Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
int main(){
int a, b;
char op;
while(1){
scanf("%d %c %d", &a, &op, &b);
if(op=='?'){
break;
}else if(op=='+'){
printf("%d\n", a+b);
}else if(op=='-'){
printf("%d\n", a-b);
}else if(op=='*'){
printf("%d\n", a*b);
}else if(op=='/'){
printf("%d\n", a/b);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267556/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267556/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%op = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %while.cond.backedge [
i8 63, label %while.end
i8 43, label %if.then5
i8 45, label %if.then11
i8 42, label %if.then17
i8 47, label %if.then23
]
if.then5: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end28.sink.split
if.then11: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end28.sink.split
if.then17: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end28.sink.split
if.then23: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end28.sink.split
if.end28.sink.split: ; preds = %if.then11, %if.then23, %if.then17, %if.then5
%add.sink = phi i32 [ %add, %if.then5 ], [ %mul, %if.then17 ], [ %div, %if.then23 ], [ %sub, %if.then11 ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.end28.sink.split, %while.cond
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
int* l;
int max =0;
int n,k,q;
int compare(const void* a, const void* b)
{
int x = *(int*)(a);
int y = *(int*)(b);
return l[x] - l[y];
}
void add(int v , int* q)
{
if(max<k)
{
int i=0;
for(;i<max;i++)
if(l[v]>l[q[i]])
break;
for(int j=max-1;j>=i;j--)
q[j+1] =q[j];
q[i] = v;
max++;
}
else
{
int i=0;
for(;i<max;i++)
if(l[v]>l[q[i]])
break;
if(i<max)
{
for(int j=max-1;j>=i;j--)
q[j] =q[j-1];
q[i] = v;
}
}
}
int main()
{
scanf("%d %d %d",&n,&k,&q);
int love[n+1];
for(int i=1;i<=n;i++)
scanf("%d",&love[i]);
l = love;
int online[k];
int top=0;
for(int i=0;i<q;i++)
{
int type, bear;
scanf("%d %d",&type,&bear);
if(type==1)
{
add(bear,online);
}
else
{
bool found = false;
for(int i=0;i<k;i++)
{
if(online[i]==bear)
{
found = true;
printf("YES\n");
break;
}
}
if(!found)
printf("NO\n");
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2676/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2676/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@max = dso_local local_unnamed_addr global i32 0, align 4
@l = dso_local local_unnamed_addr global ptr null, align 8
@k = dso_local global i32 0, align 4
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@n = dso_local global i32 0, align 4
@q = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.5 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load ptr, ptr @l, align 8, !tbaa !9
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds i32, ptr %2, i64 %idxprom
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %1 to i64
%arrayidx2 = getelementptr inbounds i32, ptr %2, i64 %idxprom1
%4 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%sub = sub nsw i32 %3, %4
ret i32 %sub
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @add(i32 noundef %v, ptr nocapture noundef %q) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @max, align 4, !tbaa !5
%1 = load i32, ptr @k, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp186 = icmp sgt i32 %0, 0
br i1 %cmp, label %for.cond.preheader, label %for.cond21.preheader
for.cond21.preheader: ; preds = %entry
br i1 %cmp186, label %for.body23.lr.ph, label %if.end55
for.body23.lr.ph: ; preds = %for.cond21.preheader
%2 = load ptr, ptr @l, align 8, !tbaa !9
%idxprom24 = sext i32 %v to i64
%arrayidx25 = getelementptr inbounds i32, ptr %2, i64 %idxprom24
%3 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%wide.trip.count = zext i32 %0 to i64
br label %for.body23
for.cond.preheader: ; preds = %entry
br i1 %cmp186, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %for.cond.preheader
%4 = load ptr, ptr @l, align 8, !tbaa !9
%idxprom = sext i32 %v to i64
%arrayidx = getelementptr inbounds i32, ptr %4, i64 %idxprom
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%wide.trip.count104 = zext i32 %0 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv101 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next102, %for.inc ]
%arrayidx3 = getelementptr inbounds i32, ptr %q, i64 %indvars.iv101
%6 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%idxprom4 = sext i32 %6 to i64
%arrayidx5 = getelementptr inbounds i32, ptr %4, i64 %idxprom4
%7 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %5, %7
br i1 %cmp6, label %for.end, label %for.inc
for.inc: ; preds = %for.body
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count104
br i1 %exitcond105.not, label %for.cond.cleanup, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body
%8 = trunc i64 %indvars.iv101 to i32
%cmp9.not.not89 = icmp sgt i32 %0, %8
br i1 %cmp9.not.not89, label %for.body10.preheader, label %for.cond.cleanup
for.body10.preheader: ; preds = %for.end
%9 = sext i32 %0 to i64
%sext116 = shl i64 %indvars.iv101, 32
%10 = ashr exact i64 %sext116, 32
br label %for.body10
for.cond.cleanup: ; preds = %for.inc, %for.body10, %for.cond.preheader, %for.end
%i.0.lcssa112 = phi i32 [ %8, %for.end ], [ 0, %for.cond.preheader ], [ %8, %for.body10 ], [ %0, %for.inc ]
%idxprom17 = zext i32 %i.0.lcssa112 to i64
%arrayidx18 = getelementptr inbounds i32, ptr %q, i64 %idxprom17
store i32 %v, ptr %arrayidx18, align 4, !tbaa !5
%11 = load i32, ptr @max, align 4, !tbaa !5
%inc19 = add nsw i32 %11, 1
store i32 %inc19, ptr @max, align 4, !tbaa !5
br label %if.end55
for.body10: ; preds = %for.body10.preheader, %for.body10
%indvars.iv107 = phi i64 [ %9, %for.body10.preheader ], [ %indvars.iv.next108, %for.body10 ]
%indvars.iv.next108 = add nsw i64 %indvars.iv107, -1
%arrayidx12 = getelementptr inbounds i32, ptr %q, i64 %indvars.iv.next108
%12 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%arrayidx14 = getelementptr inbounds i32, ptr %q, i64 %indvars.iv107
store i32 %12, ptr %arrayidx14, align 4, !tbaa !5
%cmp9.not.not = icmp sgt i64 %indvars.iv.next108, %10
br i1 %cmp9.not.not, label %for.body10, label %for.cond.cleanup, !llvm.loop !13
for.body23: ; preds = %for.body23.lr.ph, %for.inc33
%indvars.iv = phi i64 [ 0, %for.body23.lr.ph ], [ %indvars.iv.next, %for.inc33 ]
%arrayidx27 = getelementptr inbounds i32, ptr %q, i64 %indvars.iv
%13 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%idxprom28 = sext i32 %13 to i64
%arrayidx29 = getelementptr inbounds i32, ptr %2, i64 %idxprom28
%14 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %3, %14
br i1 %cmp30, label %for.cond40.preheader, label %for.inc33
for.cond40.preheader: ; preds = %for.body23
%15 = trunc i64 %indvars.iv to i32
%cmp41.not.not84 = icmp sgt i32 %0, %15
br i1 %cmp41.not.not84, label %for.body43.preheader, label %for.cond.cleanup42
for.body43.preheader: ; preds = %for.cond40.preheader
%16 = sext i32 %0 to i64
%sext = shl i64 %indvars.iv, 32
%17 = ashr exact i64 %sext, 32
%invariant.gep = getelementptr i32, ptr %q, i64 -2
br label %for.body43
for.inc33: ; preds = %for.body23
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %if.end55, label %for.body23, !llvm.loop !14
for.cond.cleanup42: ; preds = %for.body43, %for.cond40.preheader
%idxprom52 = and i64 %indvars.iv, 4294967295
%arrayidx53 = getelementptr inbounds i32, ptr %q, i64 %idxprom52
store i32 %v, ptr %arrayidx53, align 4, !tbaa !5
br label %if.end55
for.body43: ; preds = %for.body43.preheader, %for.body43
%indvars.iv97 = phi i64 [ %16, %for.body43.preheader ], [ %indvars.iv.next98, %for.body43 ]
%indvars.iv.next98 = add nsw i64 %indvars.iv97, -1
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv97
%18 = load i32, ptr %gep, align 4, !tbaa !5
%arrayidx48 = getelementptr inbounds i32, ptr %q, i64 %indvars.iv.next98
store i32 %18, ptr %arrayidx48, align 4, !tbaa !5
%cmp41.not.not = icmp sgt i64 %indvars.iv.next98, %17
br i1 %cmp41.not.not, label %for.body43, label %for.cond.cleanup42, !llvm.loop !15
if.end55: ; preds = %for.inc33, %for.cond21.preheader, %for.cond.cleanup42, %for.cond.cleanup
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%type = alloca i32, align 4
%bear = alloca i32, align 4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @k, ptr noundef nonnull @q)
%0 = load i32, ptr @n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%vla = alloca i32, i64 %1, align 16
%cmp.not40 = icmp slt i32 %0, 1
br i1 %cmp.not40, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
store ptr %vla, ptr @l, align 8, !tbaa !9
%2 = load i32, ptr @k, align 4, !tbaa !5
%3 = zext i32 %2 to i64
%vla2 = alloca i32, i64 %3, align 16
%4 = load i32, ptr @q, align 4, !tbaa !5
%cmp544 = icmp sgt i32 %4, 0
br i1 %cmp544, label %for.body7.lr.ph, label %for.cond.cleanup6
for.body7.lr.ph: ; preds = %for.cond.cleanup
%invariant.gep.i = getelementptr i32, ptr %vla2, i64 -2
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr @n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %6
br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !16
for.cond.cleanup6: ; preds = %if.end26, %for.cond.cleanup
ret i32 0
for.body7: ; preds = %for.body7.lr.ph, %if.end26
%i3.045 = phi i32 [ 0, %for.body7.lr.ph ], [ %inc28, %if.end26 ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %type) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %bear) #6
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %type, ptr noundef nonnull %bear)
%7 = load i32, ptr %type, align 4, !tbaa !5
%cmp9 = icmp eq i32 %7, 1
br i1 %cmp9, label %if.then, label %for.cond11.preheader
for.cond11.preheader: ; preds = %for.body7
%8 = load i32, ptr @k, align 4, !tbaa !5
%cmp1242 = icmp sgt i32 %8, 0
br i1 %cmp1242, label %for.body14.lr.ph, label %if.then23
for.body14.lr.ph: ; preds = %for.cond11.preheader
%9 = load i32, ptr %bear, align 4, !tbaa !5
%wide.trip.count = zext i32 %8 to i64
br label %for.body14
if.then: ; preds = %for.body7
%10 = load i32, ptr %bear, align 4, !tbaa !5
%11 = load i32, ptr @max, align 4, !tbaa !5
%12 = load i32, ptr @k, align 4, !tbaa !5
%cmp.i = icmp slt i32 %11, %12
%cmp186.i = icmp sgt i32 %11, 0
br i1 %cmp.i, label %for.cond.preheader.i, label %for.cond21.preheader.i
for.cond21.preheader.i: ; preds = %if.then
br i1 %cmp186.i, label %for.body23.lr.ph.i, label %if.end26
for.body23.lr.ph.i: ; preds = %for.cond21.preheader.i
%13 = load ptr, ptr @l, align 8, !tbaa !9
%idxprom24.i = sext i32 %10 to i64
%arrayidx25.i = getelementptr inbounds i32, ptr %13, i64 %idxprom24.i
%14 = load i32, ptr %arrayidx25.i, align 4, !tbaa !5
%wide.trip.count.i = zext i32 %11 to i64
br label %for.body23.i
for.cond.preheader.i: ; preds = %if.then
br i1 %cmp186.i, label %for.body.lr.ph.i, label %for.cond.cleanup.i
for.body.lr.ph.i: ; preds = %for.cond.preheader.i
%15 = load ptr, ptr @l, align 8, !tbaa !9
%idxprom.i = sext i32 %10 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %15, i64 %idxprom.i
%16 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%wide.trip.count104.i = zext i32 %11 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.lr.ph.i
%indvars.iv101.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next102.i, %for.inc.i ]
%arrayidx3.i = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv101.i
%17 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%idxprom4.i = sext i32 %17 to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %15, i64 %idxprom4.i
%18 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp6.i = icmp sgt i32 %16, %18
br i1 %cmp6.i, label %for.end.i, label %for.inc.i
for.inc.i: ; preds = %for.body.i
%indvars.iv.next102.i = add nuw nsw i64 %indvars.iv101.i, 1
%exitcond105.not.i = icmp eq i64 %indvars.iv.next102.i, %wide.trip.count104.i
br i1 %exitcond105.not.i, label %for.cond.cleanup.i, label %for.body.i, !llvm.loop !11
for.end.i: ; preds = %for.body.i
%19 = trunc i64 %indvars.iv101.i to i32
%cmp9.not.not89.i = icmp sgt i32 %11, %19
br i1 %cmp9.not.not89.i, label %for.body10.preheader.i, label %for.cond.cleanup.i
for.body10.preheader.i: ; preds = %for.end.i
%20 = sext i32 %11 to i64
%sext116.i = shl i64 %indvars.iv101.i, 32
%21 = ashr exact i64 %sext116.i, 32
br label %for.body10.i
for.cond.cleanup.i: ; preds = %for.inc.i, %for.body10.i, %for.end.i, %for.cond.preheader.i
%i.0.lcssa112.i = phi i32 [ %19, %for.end.i ], [ 0, %for.cond.preheader.i ], [ %19, %for.body10.i ], [ %11, %for.inc.i ]
%idxprom17.i = zext i32 %i.0.lcssa112.i to i64
%arrayidx18.i = getelementptr inbounds i32, ptr %vla2, i64 %idxprom17.i
store i32 %10, ptr %arrayidx18.i, align 4, !tbaa !5
%inc19.i = add nsw i32 %11, 1
store i32 %inc19.i, ptr @max, align 4, !tbaa !5
br label %if.end26
for.body10.i: ; preds = %for.body10.i, %for.body10.preheader.i
%indvars.iv107.i = phi i64 [ %20, %for.body10.preheader.i ], [ %indvars.iv.next108.i, %for.body10.i ]
%indvars.iv.next108.i = add nsw i64 %indvars.iv107.i, -1
%arrayidx12.i = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.next108.i
%22 = load i32, ptr %arrayidx12.i, align 4, !tbaa !5
%arrayidx14.i = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv107.i
store i32 %22, ptr %arrayidx14.i, align 4, !tbaa !5
%cmp9.not.not.i = icmp sgt i64 %indvars.iv.next108.i, %21
br i1 %cmp9.not.not.i, label %for.body10.i, label %for.cond.cleanup.i, !llvm.loop !13
for.body23.i: ; preds = %for.inc33.i, %for.body23.lr.ph.i
%indvars.iv.i = phi i64 [ 0, %for.body23.lr.ph.i ], [ %indvars.iv.next.i, %for.inc33.i ]
%arrayidx27.i = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.i
%23 = load i32, ptr %arrayidx27.i, align 4, !tbaa !5
%idxprom28.i = sext i32 %23 to i64
%arrayidx29.i = getelementptr inbounds i32, ptr %13, i64 %idxprom28.i
%24 = load i32, ptr %arrayidx29.i, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %14, %24
br i1 %cmp30.i, label %for.cond40.preheader.i, label %for.inc33.i
for.cond40.preheader.i: ; preds = %for.body23.i
%25 = trunc i64 %indvars.iv.i to i32
%cmp41.not.not84.i = icmp sgt i32 %11, %25
br i1 %cmp41.not.not84.i, label %for.body43.preheader.i, label %for.cond.cleanup42.i
for.body43.preheader.i: ; preds = %for.cond40.preheader.i
%26 = sext i32 %11 to i64
%sext.i = shl i64 %indvars.iv.i, 32
%27 = ashr exact i64 %sext.i, 32
br label %for.body43.i
for.inc33.i: ; preds = %for.body23.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %if.end26, label %for.body23.i, !llvm.loop !14
for.cond.cleanup42.i: ; preds = %for.body43.i, %for.cond40.preheader.i
%idxprom52.i = and i64 %indvars.iv.i, 4294967295
%arrayidx53.i = getelementptr inbounds i32, ptr %vla2, i64 %idxprom52.i
store i32 %10, ptr %arrayidx53.i, align 4, !tbaa !5
br label %if.end26
for.body43.i: ; preds = %for.body43.i, %for.body43.preheader.i
%indvars.iv97.i = phi i64 [ %26, %for.body43.preheader.i ], [ %indvars.iv.next98.i, %for.body43.i ]
%indvars.iv.next98.i = add nsw i64 %indvars.iv97.i, -1
%gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv97.i
%28 = load i32, ptr %gep.i, align 4, !tbaa !5
%arrayidx48.i = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.next98.i
store i32 %28, ptr %arrayidx48.i, align 4, !tbaa !5
%cmp41.not.not.i = icmp sgt i64 %indvars.iv.next98.i, %27
br i1 %cmp41.not.not.i, label %for.body43.i, label %for.cond.cleanup42.i, !llvm.loop !15
for.cond11: ; preds = %for.body14
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%exitcond.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count
br i1 %exitcond.not, label %if.then23, label %for.body14, !llvm.loop !17
for.body14: ; preds = %for.body14.lr.ph, %for.cond11
%indvars.iv50 = phi i64 [ 0, %for.body14.lr.ph ], [ %indvars.iv.next51, %for.cond11 ]
%arrayidx16 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv50
%29 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17 = icmp eq i32 %29, %9
br i1 %cmp17, label %if.then18, label %for.cond11
if.then18: ; preds = %for.body14
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end26
if.then23: ; preds = %for.cond11, %for.cond11.preheader
%puts36 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end26
if.end26: ; preds = %for.inc33.i, %if.then18, %for.cond.cleanup42.i, %for.cond.cleanup.i, %for.cond21.preheader.i, %if.then23
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %bear) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %type) #6
%inc28 = add nuw nsw i32 %i3.045, 1
%30 = load i32, ptr @q, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc28, %30
br i1 %cmp5, label %for.body7, label %for.cond.cleanup6, !llvm.loop !18
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
|
#include<stdio.h>
int main(void)
{
int a,b;
char op;
scanf("%d %c %d",&a,&op,&b);
while(1)
{
if(op == '+')
{
printf("%d\n",a+b);
}
else if(op == '-')
{
printf("%d\n",a-b);
}
else if(op == '/')
{
printf("%d\n",a/b);
}
else if(op == '*')
{
printf("%d\n",a*b);
}
else
{
break;
}
scanf("%d %c %d",&a,&op,&b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267642/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267642/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%op = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %if.end23, %entry
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %while.end [
i8 43, label %if.then
i8 45, label %if.then6
i8 47, label %if.then12
i8 42, label %if.then18
]
if.then: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end23
if.then6: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end23
if.then12: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %5, %6
br label %if.end23
if.then18: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %8, %7
br label %if.end23
if.end23: ; preds = %if.then6, %if.then18, %if.then12, %if.then
%sub.sink = phi i32 [ %sub, %if.then6 ], [ %mul, %if.then18 ], [ %div, %if.then12 ], [ %add, %if.then ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main(void){
int a,b;
char op;
while(1){
scanf("%d %c %d",&a,&op,&b);
if (op == '?') break;
if (op=='+') printf("%d\n",a+b);
else if (op=='-') printf("%d\n",a-b);
else if (op=='*') printf("%d\n",a*b);
else if (op=='/') printf("%d\n",a/b);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267693/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267693/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%op = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %while.cond.backedge [
i8 63, label %while.end
i8 43, label %if.then5
i8 45, label %if.then10
i8 42, label %if.then16
i8 47, label %if.then22
]
if.then5: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end27.sink.split
if.then10: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end27.sink.split
if.then16: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end27.sink.split
if.then22: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end27.sink.split
if.end27.sink.split: ; preds = %if.then5, %if.then16, %if.then22, %if.then10
%sub.sink = phi i32 [ %sub, %if.then10 ], [ %div, %if.then22 ], [ %mul, %if.then16 ], [ %add, %if.then5 ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.end27.sink.split, %while.cond
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main(){
int a, b;
char op;
while(1){
scanf("%d %c %d",&a, &op, &b);
if(op == '+'){printf("%d\n", a + b);
}else if(op == '-'){
printf("%d\n", a - b);
}else if (op == '*'){
printf("%d\n", a * b);
} else if (op == '/'){
printf("%d\n", a / b);
} else {
break;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267736/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267736/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%op = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %if.end23, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %while.end [
i8 43, label %if.then
i8 45, label %if.then6
i8 42, label %if.then12
i8 47, label %if.then18
]
if.then: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end23
if.then6: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end23
if.then12: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end23
if.then18: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end23
if.end23: ; preds = %if.then6, %if.then18, %if.then12, %if.then
%sub.sink = phi i32 [ %sub, %if.then6 ], [ %div, %if.then18 ], [ %mul, %if.then12 ], [ %add, %if.then ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include<stdio.h>
int main()
{
int n,m,sum=0,a[1010],b[1010],c[1010],k=1,i,j,visited[1010]={0};
scanf("%d %d",&n,&m);
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
for(i=1;i<=m;i++)
{
scanf("%d",&b[i]);
if(!visited[b[i]])
{
visited[b[i]]=1;
c[b[i]]=k++;
}
}
for(i=1;i<=n;i++)
{
if(!visited[i])
{
c[i]=k++;
}
}
for(i=1;i<=m;i++)
{
for(j=1;j<=n;j++)
{
if(c[j]<c[b[i]])
{
c[j]++;
sum=sum+a[j];
}
}
c[b[i]]=1;
}
printf("%d\n",sum);
return(0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26778/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26778/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [1010 x i32], align 16
%b = alloca [1010 x i32], align 16
%c = alloca [1010 x i32], align 16
%visited = alloca [1010 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4040, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4040, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4040, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4040, ptr nonnull %visited) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4040) %visited, i8 0, i64 4040, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not92 = icmp slt i32 %0, 1
br i1 %cmp.not92, label %for.cond2.preheader, label %for.body
for.cond2.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp3.not94 = icmp slt i32 %2, 1
br i1 %cmp3.not94, label %for.cond24.preheader, label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [1010 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %4
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond24.preheader.loopexit: ; preds = %for.inc21
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond24.preheader
for.cond24.preheader: ; preds = %for.cond24.preheader.loopexit, %for.cond2.preheader
%5 = phi i32 [ %1, %for.cond2.preheader ], [ %.pre, %for.cond24.preheader.loopexit ]
%k.0.lcssa = phi i32 [ 1, %for.cond2.preheader ], [ %k.1, %for.cond24.preheader.loopexit ]
%.lcssa91 = phi i32 [ %2, %for.cond2.preheader ], [ %12, %for.cond24.preheader.loopexit ]
%cmp25.not98 = icmp slt i32 %5, 1
br i1 %cmp25.not98, label %for.cond38.preheader.thread, label %for.body26.preheader
for.body26.preheader: ; preds = %for.cond24.preheader
%6 = add i32 %5, 1
%wide.trip.count = zext i32 %6 to i64
%7 = add nsw i64 %wide.trip.count, -1
%8 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %7, 1
%9 = icmp eq i64 %8, 0
br i1 %9, label %for.cond38.preheader.unr-lcssa, label %for.body26.preheader.new
for.body26.preheader.new: ; preds = %for.body26.preheader
%unroll_iter = and i64 %7, -2
br label %for.body26
for.body4: ; preds = %for.cond2.preheader, %for.inc21
%indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.inc21 ], [ 1, %for.cond2.preheader ]
%k.095 = phi i32 [ %k.1, %for.inc21 ], [ 1, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [1010 x i32], ptr %b, i64 0, i64 %indvars.iv112
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%10 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%idxprom10 = sext i32 %10 to i64
%arrayidx11 = getelementptr inbounds [1010 x i32], ptr %visited, i64 0, i64 %idxprom10
%11 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%tobool.not = icmp eq i32 %11, 0
br i1 %tobool.not, label %if.then, label %for.inc21
if.then: ; preds = %for.body4
store i32 1, ptr %arrayidx11, align 4, !tbaa !5
%inc16 = add nsw i32 %k.095, 1
%arrayidx20 = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %idxprom10
store i32 %k.095, ptr %arrayidx20, align 4, !tbaa !5
br label %for.inc21
for.inc21: ; preds = %for.body4, %if.then
%k.1 = phi i32 [ %k.095, %for.body4 ], [ %inc16, %if.then ]
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%12 = load i32, ptr %m, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv112, %13
br i1 %cmp3.not.not, label %for.body4, label %for.cond24.preheader.loopexit, !llvm.loop !11
for.cond38.preheader.unr-lcssa: ; preds = %for.inc35.1, %for.body26.preheader
%indvars.iv115.unr = phi i64 [ 1, %for.body26.preheader ], [ %indvars.iv.next116.1, %for.inc35.1 ]
%k.299.unr = phi i32 [ %k.0.lcssa, %for.body26.preheader ], [ %k.3.1, %for.inc35.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond38.preheader, label %for.body26.epil
for.body26.epil: ; preds = %for.cond38.preheader.unr-lcssa
%arrayidx28.epil = getelementptr inbounds [1010 x i32], ptr %visited, i64 0, i64 %indvars.iv115.unr
%14 = load i32, ptr %arrayidx28.epil, align 4, !tbaa !5
%tobool29.not.epil = icmp eq i32 %14, 0
br i1 %tobool29.not.epil, label %if.then30.epil, label %for.cond38.preheader
if.then30.epil: ; preds = %for.body26.epil
%arrayidx33.epil = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %indvars.iv115.unr
store i32 %k.299.unr, ptr %arrayidx33.epil, align 4, !tbaa !5
br label %for.cond38.preheader
for.cond38.preheader: ; preds = %for.body26.epil, %if.then30.epil, %for.cond38.preheader.unr-lcssa
%cmp39.not106 = icmp slt i32 %.lcssa91, 1
br i1 %cmp39.not106, label %for.end67, label %for.cond41.preheader.lr.ph
for.cond38.preheader.thread: ; preds = %for.cond24.preheader
%cmp39.not106133 = icmp slt i32 %.lcssa91, 1
br i1 %cmp39.not106133, label %for.end67, label %for.cond41.preheader.us.preheader
for.cond41.preheader.lr.ph: ; preds = %for.cond38.preheader
br i1 %cmp25.not98, label %for.cond41.preheader.us.preheader, label %for.cond41.preheader.preheader
for.cond41.preheader.preheader: ; preds = %for.cond41.preheader.lr.ph
%15 = add nuw i32 %.lcssa91, 1
%wide.trip.count126 = zext i32 %15 to i64
%xtraiter140 = and i64 %7, 1
%16 = icmp eq i64 %8, 0
%unroll_iter143 = and i64 %7, -2
%lcmp.mod141.not = icmp eq i64 %xtraiter140, 0
br label %for.cond41.preheader
for.cond41.preheader.us.preheader: ; preds = %for.cond38.preheader.thread, %for.cond41.preheader.lr.ph
%17 = add nuw i32 %.lcssa91, 1
%wide.trip.count131 = zext i32 %17 to i64
%18 = add nsw i64 %wide.trip.count131, -1
%19 = add nsw i64 %wide.trip.count131, -2
%xtraiter145 = and i64 %18, 3
%20 = icmp ult i64 %19, 3
br i1 %20, label %for.end67.loopexit.unr-lcssa, label %for.cond41.preheader.us.preheader.new
for.cond41.preheader.us.preheader.new: ; preds = %for.cond41.preheader.us.preheader
%unroll_iter147 = and i64 %18, -4
br label %for.cond41.preheader.us
for.cond41.preheader.us: ; preds = %for.cond41.preheader.us, %for.cond41.preheader.us.preheader.new
%indvars.iv128 = phi i64 [ 1, %for.cond41.preheader.us.preheader.new ], [ %indvars.iv.next129.3, %for.cond41.preheader.us ]
%niter148 = phi i64 [ 0, %for.cond41.preheader.us.preheader.new ], [ %niter148.next.3, %for.cond41.preheader.us ]
%arrayidx62.us = getelementptr inbounds [1010 x i32], ptr %b, i64 0, i64 %indvars.iv128
%21 = load i32, ptr %arrayidx62.us, align 4, !tbaa !5
%idxprom63.us = sext i32 %21 to i64
%arrayidx64.us = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %idxprom63.us
store i32 1, ptr %arrayidx64.us, align 4, !tbaa !5
%indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
%arrayidx62.us.1 = getelementptr inbounds [1010 x i32], ptr %b, i64 0, i64 %indvars.iv.next129
%22 = load i32, ptr %arrayidx62.us.1, align 4, !tbaa !5
%idxprom63.us.1 = sext i32 %22 to i64
%arrayidx64.us.1 = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %idxprom63.us.1
store i32 1, ptr %arrayidx64.us.1, align 4, !tbaa !5
%indvars.iv.next129.1 = add nuw nsw i64 %indvars.iv128, 2
%arrayidx62.us.2 = getelementptr inbounds [1010 x i32], ptr %b, i64 0, i64 %indvars.iv.next129.1
%23 = load i32, ptr %arrayidx62.us.2, align 4, !tbaa !5
%idxprom63.us.2 = sext i32 %23 to i64
%arrayidx64.us.2 = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %idxprom63.us.2
store i32 1, ptr %arrayidx64.us.2, align 4, !tbaa !5
%indvars.iv.next129.2 = add nuw nsw i64 %indvars.iv128, 3
%arrayidx62.us.3 = getelementptr inbounds [1010 x i32], ptr %b, i64 0, i64 %indvars.iv.next129.2
%24 = load i32, ptr %arrayidx62.us.3, align 4, !tbaa !5
%idxprom63.us.3 = sext i32 %24 to i64
%arrayidx64.us.3 = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %idxprom63.us.3
store i32 1, ptr %arrayidx64.us.3, align 4, !tbaa !5
%indvars.iv.next129.3 = add nuw nsw i64 %indvars.iv128, 4
%niter148.next.3 = add i64 %niter148, 4
%niter148.ncmp.3 = icmp eq i64 %niter148.next.3, %unroll_iter147
br i1 %niter148.ncmp.3, label %for.end67.loopexit.unr-lcssa, label %for.cond41.preheader.us, !llvm.loop !12
for.body26: ; preds = %for.inc35.1, %for.body26.preheader.new
%indvars.iv115 = phi i64 [ 1, %for.body26.preheader.new ], [ %indvars.iv.next116.1, %for.inc35.1 ]
%k.299 = phi i32 [ %k.0.lcssa, %for.body26.preheader.new ], [ %k.3.1, %for.inc35.1 ]
%niter = phi i64 [ 0, %for.body26.preheader.new ], [ %niter.next.1, %for.inc35.1 ]
%arrayidx28 = getelementptr inbounds [1010 x i32], ptr %visited, i64 0, i64 %indvars.iv115
%25 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%tobool29.not = icmp eq i32 %25, 0
br i1 %tobool29.not, label %if.then30, label %for.inc35
if.then30: ; preds = %for.body26
%inc31 = add nsw i32 %k.299, 1
%arrayidx33 = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %indvars.iv115
store i32 %k.299, ptr %arrayidx33, align 4, !tbaa !5
br label %for.inc35
for.inc35: ; preds = %for.body26, %if.then30
%k.3 = phi i32 [ %k.299, %for.body26 ], [ %inc31, %if.then30 ]
%indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
%arrayidx28.1 = getelementptr inbounds [1010 x i32], ptr %visited, i64 0, i64 %indvars.iv.next116
%26 = load i32, ptr %arrayidx28.1, align 4, !tbaa !5
%tobool29.not.1 = icmp eq i32 %26, 0
br i1 %tobool29.not.1, label %if.then30.1, label %for.inc35.1
if.then30.1: ; preds = %for.inc35
%inc31.1 = add nsw i32 %k.3, 1
%arrayidx33.1 = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %indvars.iv.next116
store i32 %k.3, ptr %arrayidx33.1, align 4, !tbaa !5
br label %for.inc35.1
for.inc35.1: ; preds = %if.then30.1, %for.inc35
%k.3.1 = phi i32 [ %k.3, %for.inc35 ], [ %inc31.1, %if.then30.1 ]
%indvars.iv.next116.1 = add nuw nsw i64 %indvars.iv115, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond38.preheader.unr-lcssa, label %for.body26, !llvm.loop !13
for.cond41.preheader: ; preds = %for.cond41.preheader.preheader, %for.cond41.for.end60_crit_edge
%indvars.iv123 = phi i64 [ 1, %for.cond41.preheader.preheader ], [ %indvars.iv.next124, %for.cond41.for.end60_crit_edge ]
%sum.0107 = phi i32 [ 0, %for.cond41.preheader.preheader ], [ %sum.2.lcssa, %for.cond41.for.end60_crit_edge ]
%arrayidx47 = getelementptr inbounds [1010 x i32], ptr %b, i64 0, i64 %indvars.iv123
%27 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%idxprom48 = sext i32 %27 to i64
%arrayidx49 = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %idxprom48
br i1 %16, label %for.cond41.for.end60_crit_edge.unr-lcssa, label %for.body43
for.body43: ; preds = %for.cond41.preheader, %for.inc58.1
%indvars.iv118 = phi i64 [ %indvars.iv.next119.1, %for.inc58.1 ], [ 1, %for.cond41.preheader ]
%sum.1103 = phi i32 [ %sum.2.1, %for.inc58.1 ], [ %sum.0107, %for.cond41.preheader ]
%niter144 = phi i64 [ %niter144.next.1, %for.inc58.1 ], [ 0, %for.cond41.preheader ]
%arrayidx45 = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %indvars.iv118
%28 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%29 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%cmp50 = icmp slt i32 %28, %29
br i1 %cmp50, label %if.then51, label %for.inc58
if.then51: ; preds = %for.body43
%inc54 = add nsw i32 %28, 1
store i32 %inc54, ptr %arrayidx45, align 4, !tbaa !5
%arrayidx56 = getelementptr inbounds [1010 x i32], ptr %a, i64 0, i64 %indvars.iv118
%30 = load i32, ptr %arrayidx56, align 4, !tbaa !5
%add = add nsw i32 %30, %sum.1103
br label %for.inc58
for.inc58: ; preds = %for.body43, %if.then51
%sum.2 = phi i32 [ %add, %if.then51 ], [ %sum.1103, %for.body43 ]
%indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
%arrayidx45.1 = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %indvars.iv.next119
%31 = load i32, ptr %arrayidx45.1, align 4, !tbaa !5
%32 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%cmp50.1 = icmp slt i32 %31, %32
br i1 %cmp50.1, label %if.then51.1, label %for.inc58.1
if.then51.1: ; preds = %for.inc58
%inc54.1 = add nsw i32 %31, 1
store i32 %inc54.1, ptr %arrayidx45.1, align 4, !tbaa !5
%arrayidx56.1 = getelementptr inbounds [1010 x i32], ptr %a, i64 0, i64 %indvars.iv.next119
%33 = load i32, ptr %arrayidx56.1, align 4, !tbaa !5
%add.1 = add nsw i32 %33, %sum.2
br label %for.inc58.1
for.inc58.1: ; preds = %if.then51.1, %for.inc58
%sum.2.1 = phi i32 [ %add.1, %if.then51.1 ], [ %sum.2, %for.inc58 ]
%indvars.iv.next119.1 = add nuw nsw i64 %indvars.iv118, 2
%niter144.next.1 = add i64 %niter144, 2
%niter144.ncmp.1 = icmp eq i64 %niter144.next.1, %unroll_iter143
br i1 %niter144.ncmp.1, label %for.cond41.for.end60_crit_edge.unr-lcssa, label %for.body43, !llvm.loop !14
for.cond41.for.end60_crit_edge.unr-lcssa: ; preds = %for.inc58.1, %for.cond41.preheader
%sum.2.lcssa.ph = phi i32 [ undef, %for.cond41.preheader ], [ %sum.2.1, %for.inc58.1 ]
%indvars.iv118.unr = phi i64 [ 1, %for.cond41.preheader ], [ %indvars.iv.next119.1, %for.inc58.1 ]
%sum.1103.unr = phi i32 [ %sum.0107, %for.cond41.preheader ], [ %sum.2.1, %for.inc58.1 ]
br i1 %lcmp.mod141.not, label %for.cond41.for.end60_crit_edge, label %for.body43.epil
for.body43.epil: ; preds = %for.cond41.for.end60_crit_edge.unr-lcssa
%arrayidx45.epil = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %indvars.iv118.unr
%34 = load i32, ptr %arrayidx45.epil, align 4, !tbaa !5
%35 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%cmp50.epil = icmp slt i32 %34, %35
br i1 %cmp50.epil, label %if.then51.epil, label %for.cond41.for.end60_crit_edge
if.then51.epil: ; preds = %for.body43.epil
%inc54.epil = add nsw i32 %34, 1
store i32 %inc54.epil, ptr %arrayidx45.epil, align 4, !tbaa !5
%arrayidx56.epil = getelementptr inbounds [1010 x i32], ptr %a, i64 0, i64 %indvars.iv118.unr
%36 = load i32, ptr %arrayidx56.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %36, %sum.1103.unr
br label %for.cond41.for.end60_crit_edge
for.cond41.for.end60_crit_edge: ; preds = %for.body43.epil, %if.then51.epil, %for.cond41.for.end60_crit_edge.unr-lcssa
%sum.2.lcssa = phi i32 [ %sum.2.lcssa.ph, %for.cond41.for.end60_crit_edge.unr-lcssa ], [ %add.epil, %if.then51.epil ], [ %sum.1103.unr, %for.body43.epil ]
store i32 1, ptr %arrayidx49, align 4, !tbaa !5
%indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
%exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126
br i1 %exitcond127.not, label %for.end67, label %for.cond41.preheader, !llvm.loop !12
for.end67.loopexit.unr-lcssa: ; preds = %for.cond41.preheader.us, %for.cond41.preheader.us.preheader
%indvars.iv128.unr = phi i64 [ 1, %for.cond41.preheader.us.preheader ], [ %indvars.iv.next129.3, %for.cond41.preheader.us ]
%lcmp.mod146.not = icmp eq i64 %xtraiter145, 0
br i1 %lcmp.mod146.not, label %for.end67, label %for.cond41.preheader.us.epil
for.cond41.preheader.us.epil: ; preds = %for.end67.loopexit.unr-lcssa, %for.cond41.preheader.us.epil
%indvars.iv128.epil = phi i64 [ %indvars.iv.next129.epil, %for.cond41.preheader.us.epil ], [ %indvars.iv128.unr, %for.end67.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond41.preheader.us.epil ], [ 0, %for.end67.loopexit.unr-lcssa ]
%arrayidx62.us.epil = getelementptr inbounds [1010 x i32], ptr %b, i64 0, i64 %indvars.iv128.epil
%37 = load i32, ptr %arrayidx62.us.epil, align 4, !tbaa !5
%idxprom63.us.epil = sext i32 %37 to i64
%arrayidx64.us.epil = getelementptr inbounds [1010 x i32], ptr %c, i64 0, i64 %idxprom63.us.epil
store i32 1, ptr %arrayidx64.us.epil, align 4, !tbaa !5
%indvars.iv.next129.epil = add nuw nsw i64 %indvars.iv128.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter145
br i1 %epil.iter.cmp.not, label %for.end67, label %for.cond41.preheader.us.epil, !llvm.loop !15
for.end67: ; preds = %for.cond41.for.end60_crit_edge, %for.end67.loopexit.unr-lcssa, %for.cond41.preheader.us.epil, %for.cond38.preheader.thread, %for.cond38.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond38.preheader ], [ 0, %for.cond38.preheader.thread ], [ 0, %for.cond41.preheader.us.epil ], [ 0, %for.end67.loopexit.unr-lcssa ], [ %sum.2.lcssa, %for.cond41.for.end60_crit_edge ]
%call68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4040, ptr nonnull %visited) #4
call void @llvm.lifetime.end.p0(i64 4040, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4040, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4040, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
int main(void){
while(1){
int a, b;
char op;
scanf("%d %c %d", &a, &op, &b);
if(op=='?') break;
if(op=='+') printf("%d\n", a+b);
if(op=='-') printf("%d\n", a-b);
if(op=='*') printf("%d\n", a*b);
if(op=='/') printf("%d\n", a/b);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267822/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267822/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%op = alloca i8, align 1
br label %while.body
while.body: ; preds = %cleanup, %entry
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %if.end7 [
i8 63, label %while.end
i8 43, label %if.then5
]
if.then5: ; preds = %while.body
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%.pr = load i8, ptr %op, align 1, !tbaa !5
br label %if.end7
if.end7: ; preds = %while.body, %if.then5
%3 = phi i8 [ %0, %while.body ], [ %.pr, %if.then5 ]
%cmp9 = icmp eq i8 %3, 45
br i1 %cmp9, label %if.then11, label %if.end13
if.then11: ; preds = %if.end7
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
%.pre = load i8, ptr %op, align 1, !tbaa !5
br label %if.end13
if.end13: ; preds = %if.then11, %if.end7
%6 = phi i8 [ %.pre, %if.then11 ], [ %3, %if.end7 ]
%cmp15 = icmp eq i8 %6, 42
br i1 %cmp15, label %if.then17, label %if.end19
if.then17: ; preds = %if.end13
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %8, %7
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
%.pr28 = load i8, ptr %op, align 1, !tbaa !5
br label %if.end19
if.end19: ; preds = %if.then17, %if.end13
%9 = phi i8 [ %.pr28, %if.then17 ], [ %6, %if.end13 ]
%cmp21 = icmp eq i8 %9, 47
br i1 %cmp21, label %if.then23, label %cleanup
if.then23: ; preds = %if.end19
%10 = load i32, ptr %a, align 4, !tbaa !8
%11 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %10, %11
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
br label %cleanup
cleanup: ; preds = %if.end19, %if.then23
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
br label %while.body
while.end: ; preds = %while.body
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include<stdio.h>
int main(){
int a,b,c;
char op;
while(scanf("%d %c %d",&a,&op,&b)!=EOF){
if(op=='?')break;
if(op=='+')c=a+b;
if(op=='-')c=a-b;
if(op=='*')c=a*b;
if(op=='/')c=a/b;
printf("%d\n",c);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267873/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267873/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%op = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%cmp25 = icmp eq i32 %call24, -1
%0 = load i8, ptr %op, align 1
%cmp126 = icmp eq i8 %0, 63
%or.cond27 = select i1 %cmp25, i1 true, i1 %cmp126
br i1 %or.cond27, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end22
%1 = phi i8 [ %4, %if.end22 ], [ %0, %entry ]
%c.028 = phi i32 [ %c.4, %if.end22 ], [ undef, %entry ]
%cmp4 = icmp eq i8 %1, 43
%2 = load i32, ptr %a, align 4
%3 = load i32, ptr %b, align 4
%add = add nsw i32 %3, %2
%c.1 = select i1 %cmp4, i32 %add, i32 %c.028
%cmp9 = icmp eq i8 %1, 45
%sub = sub nsw i32 %2, %3
%c.2 = select i1 %cmp9, i32 %sub, i32 %c.1
%cmp14 = icmp eq i8 %1, 42
%mul = mul nsw i32 %3, %2
%c.3 = select i1 %cmp14, i32 %mul, i32 %c.2
%cmp19 = icmp eq i8 %1, 47
br i1 %cmp19, label %if.then21, label %if.end22
if.then21: ; preds = %if.end
%div = sdiv i32 %2, %3
br label %if.end22
if.end22: ; preds = %if.then21, %if.end
%c.4 = phi i32 [ %div, %if.then21 ], [ %c.3, %if.end ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.4)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%cmp = icmp eq i32 %call, -1
%4 = load i8, ptr %op, align 1
%cmp1 = icmp eq i8 %4, 63
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %while.end, label %if.end, !llvm.loop !5
while.end: ; preds = %if.end22, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int a, b;
char op;
while(1)
{
scanf("%d %c %d", &a, &op, &b);
if(op == '+')
{
printf("%d\n", a + b);
}
if(op == '-')
{
printf("%d\n", a - b);
}
if(op == '*')
{
printf("%d\n", a * b);
}
if(op == '/')
{
printf("%d\n", a / b);
}
if(op == '?')
{
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267923/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267923/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%op = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %if.end20, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 43
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%.pr = load i8, ptr %op, align 1, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.cond
%3 = phi i8 [ %.pr, %if.then ], [ %0, %while.cond ]
%cmp4 = icmp eq i8 %3, 45
br i1 %cmp4, label %if.then6, label %if.end8
if.then6: ; preds = %if.end
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
%.pre = load i8, ptr %op, align 1, !tbaa !5
br label %if.end8
if.end8: ; preds = %if.then6, %if.end
%6 = phi i8 [ %.pre, %if.then6 ], [ %3, %if.end ]
%cmp10 = icmp eq i8 %6, 42
br i1 %cmp10, label %if.then12, label %if.end14
if.then12: ; preds = %if.end8
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %8, %7
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
%.pr26 = load i8, ptr %op, align 1, !tbaa !5
br label %if.end14
if.end14: ; preds = %if.then12, %if.end8
%9 = phi i8 [ %.pr26, %if.then12 ], [ %6, %if.end8 ]
%cmp16 = icmp eq i8 %9, 47
br i1 %cmp16, label %if.then18, label %if.end20
if.then18: ; preds = %if.end14
%10 = load i32, ptr %a, align 4, !tbaa !8
%11 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %10, %11
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%.pre27 = load i8, ptr %op, align 1, !tbaa !5
br label %if.end20
if.end20: ; preds = %if.then18, %if.end14
%12 = phi i8 [ %.pre27, %if.then18 ], [ %9, %if.end14 ]
%cmp22 = icmp eq i8 %12, 63
br i1 %cmp22, label %while.end, label %while.cond
while.end: ; preds = %if.end20
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include<stdio.h>
int main()
{
int a, b;
char c;
int ans;
for (;;)
{
scanf("%d %c %d", &a, &c, &b);
if (c == '?')
break;
if (c == '+')ans = a + b;
if (c == '-')ans = a - b;
if (c == '*')ans = a * b;
if (c == '/')ans = a / b;
printf("%d\n", ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267967/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267967/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3
br label %for.cond
for.cond: ; preds = %if.end21, %entry
%ans.0 = phi i32 [ undef, %entry ], [ %ans.4, %if.end21 ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %c, ptr noundef nonnull %b)
%0 = load i8, ptr %c, align 1, !tbaa !5
switch i8 %0, label %for.cond.if.end6_crit_edge [
i8 63, label %for.end
i8 43, label %if.then5
]
for.cond.if.end6_crit_edge: ; preds = %for.cond
%.pre = load i32, ptr %a, align 4
%.pre23 = load i32, ptr %b, align 4
br label %if.end6
if.then5: ; preds = %for.cond
%1 = load i32, ptr %a, align 4
%2 = load i32, ptr %b, align 4
%add = add nsw i32 %2, %1
br label %if.end6
if.end6: ; preds = %for.cond.if.end6_crit_edge, %if.then5
%3 = phi i32 [ %2, %if.then5 ], [ %.pre23, %for.cond.if.end6_crit_edge ]
%4 = phi i32 [ %1, %if.then5 ], [ %.pre, %for.cond.if.end6_crit_edge ]
%ans.1 = phi i32 [ %add, %if.then5 ], [ %ans.0, %for.cond.if.end6_crit_edge ]
%cmp8 = icmp eq i8 %0, 45
%sub = sub nsw i32 %4, %3
%ans.2 = select i1 %cmp8, i32 %sub, i32 %ans.1
%cmp13 = icmp eq i8 %0, 42
%mul = mul nsw i32 %3, %4
%ans.3 = select i1 %cmp13, i32 %mul, i32 %ans.2
%cmp18 = icmp eq i8 %0, 47
br i1 %cmp18, label %if.then20, label %if.end21
if.then20: ; preds = %if.end6
%div = sdiv i32 %4, %3
br label %if.end21
if.end21: ; preds = %if.then20, %if.end6
%ans.4 = phi i32 [ %div, %if.then20 ], [ %ans.3, %if.end6 ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.4)
br label %for.cond
for.end: ; preds = %for.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b,c;
char op;
while(1){
scanf("%d %c %d",&a,&op,&b);
if(op=='?') break;
else if(op=='+') c=a+b;
else if(op=='-') c=a-b;
else if(op=='*') c=a*b;
else if(op=='/') c=a/b;
printf("%d\n",c);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268009/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268009/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%op = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %if.end24, %entry
%c.0 = phi i32 [ undef, %entry ], [ %c.1, %if.end24 ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %if.end24 [
i8 63, label %while.end
i8 43, label %if.then5
i8 45, label %if.then10
i8 42, label %if.then15
i8 47, label %if.then20
]
if.then5: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end24
if.then10: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end24
if.then15: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end24
if.then20: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end24
if.end24: ; preds = %while.cond, %if.then5, %if.then15, %if.then20, %if.then10
%c.1 = phi i32 [ %add, %if.then5 ], [ %sub, %if.then10 ], [ %mul, %if.then15 ], [ %div, %if.then20 ], [ %c.0, %while.cond ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.1)
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include<stdio.h>
int main(){
int a,b,i;
char op;
for(i=0;;i++){
scanf("%d %c %d",&a,&op,&b);
if(op=='+'){
printf("%d\n",a+b);
}else if(op=='-'){
printf("%d\n",a-b);
}else if(op=='*'){
printf("%d\n",a*b);
}else if(op=='/'){
printf("%d\n",a/b);
}else{
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268052/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268052/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%op = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %for.end [
i8 43, label %if.then
i8 45, label %if.then6
i8 42, label %if.then12
i8 47, label %if.then18
]
if.then: ; preds = %for.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %for.inc
if.then6: ; preds = %for.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %for.inc
if.then12: ; preds = %for.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %for.inc
if.then18: ; preds = %for.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %for.inc
for.inc: ; preds = %if.then, %if.then12, %if.then18, %if.then6
%add.sink = phi i32 [ %add, %if.then ], [ %mul, %if.then12 ], [ %div, %if.then18 ], [ %sub, %if.then6 ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %for.cond
for.end: ; preds = %for.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include<stdio.h>
#include<stdlib.h>
int main()
{
long long a[10]={},ans=0,temp=0;
for(int i=1;i<=7;i++)
scanf("%lld",&a[i]);
//3 6 7号方块不可能拼出高为2的矩形 直接pass
ans+=(a[1]/2)*2; //每两个一方块可以拼成单位为2的矩形
ans+=a[2]; //一个方形方块就是一个单位
ans+=(a[4]/2)*2; //每两个J方块可以组成单位为2的矩形
ans+=(a[5]/2)*2; //每两个L方块可以组成单位为2的矩形
if(a[1]>0&&a[4]>0&&a[5]>0){ //一JL方块3个单位
a[1]--; a[4]--; a[5]--;
temp+=(a[1]/2)*2; //每两个一方块可以拼成单位为2的矩形
temp+=a[2]; //一个方形方块就是一个单位
temp+=(a[4]/2)*2; //每两个J方块可以组成单位为2的矩形
temp+=(a[5]/2)*2; //每两个L方块可以组成单位为2的矩形
temp+=3;
}
ans=ans>temp?ans:temp;
printf("%lld\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268096/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268096/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [10 x i64], align 16
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %a) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) %a, i8 0, i64 80, i1 false)
%arrayidx = getelementptr inbounds [10 x i64], ptr %a, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%arrayidx.1 = getelementptr inbounds [10 x i64], ptr %a, i64 0, i64 2
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [10 x i64], ptr %a, i64 0, i64 3
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [10 x i64], ptr %a, i64 0, i64 4
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [10 x i64], ptr %a, i64 0, i64 5
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [10 x i64], ptr %a, i64 0, i64 6
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%arrayidx.6 = getelementptr inbounds [10 x i64], ptr %a, i64 0, i64 7
%call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.6)
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%1 = load i64, ptr %arrayidx.1, align 16, !tbaa !5
%2 = load i64, ptr %arrayidx.3, align 16
%3 = load i64, ptr %arrayidx.4, align 8
%cmp13 = icmp sgt i64 %0, 0
%cmp15 = icmp sgt i64 %2, 0
%or.cond = select i1 %cmp13, i1 %cmp15, i1 false
%cmp18 = icmp sgt i64 %3, 0
%or.cond41 = select i1 %or.cond, i1 %cmp18, i1 false
br i1 %or.cond41, label %if.then, label %if.end
if.then: ; preds = %entry
%dec = add nsw i64 %0, -1
store i64 %dec, ptr %arrayidx, align 8, !tbaa !5
%dec21 = add nsw i64 %2, -1
store i64 %dec21, ptr %arrayidx.3, align 16, !tbaa !5
%dec23 = add nsw i64 %3, -1
store i64 %dec23, ptr %arrayidx.4, align 8, !tbaa !5
%div255659 = and i64 %dec, -2
%div31576063 = add nuw i64 %dec21, %div255659
%4 = and i64 %div31576063, -2
%div35586162 = add i64 %4, %dec23
%5 = and i64 %div35586162, -2
%add37 = add i64 %1, 3
%add38 = add i64 %add37, %5
br label %if.end
if.end: ; preds = %if.then, %entry
%temp.0 = phi i64 [ %add38, %if.then ], [ 0, %entry ]
%div9 = sdiv i64 %3, 2
%div = sdiv i64 %0, 2
%div5 = sdiv i64 %2, 2
%6 = add nsw i64 %div5, %div
%7 = add i64 %6, %div9
%8 = shl i64 %7, 1
%add11 = add i64 %8, %1
%cond = call i64 @llvm.smax.i64(i64 %add11, i64 %temp.0)
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cond)
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int n,s,i,min=1000,max=3,sum=0,ave;
while(1){
scanf("%d",&n);
if(n==0){
break;
}
for(i=0;i<n;i++){
scanf("%d",&s);
if(s<min){
min=s;
}
if(s>max){
max=s;
}
sum=sum+s;
}
sum=sum-max-min;
ave=sum/(n-2);
printf("%d\n",ave);
sum=0;
min=1000;
max=3;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268153/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268153/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp28 = icmp eq i32 %0, 0
br i1 %cmp28, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i32 [ %6, %for.end ], [ %0, %entry ]
%cmp119 = icmp sgt i32 %1, 0
br i1 %cmp119, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.body
%i.023 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ]
%sum.122 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ]
%max.121 = phi i32 [ %max.2, %for.body ], [ 3, %for.cond.preheader ]
%min.120 = phi i32 [ %spec.select, %for.body ], [ 1000, %for.cond.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%2 = load i32, ptr %s, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %2, i32 %min.120)
%max.2 = call i32 @llvm.smax.i32(i32 %2, i32 %max.121)
%add = add nsw i32 %2, %sum.122
%inc = add nuw nsw i32 %i.023, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %3
br i1 %cmp1, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%4 = add i32 %max.2, %spec.select
%5 = sub i32 %add, %4
br label %for.end
for.end: ; preds = %for.end.loopexit, %for.cond.preheader
%.lcssa = phi i32 [ %1, %for.cond.preheader ], [ %3, %for.end.loopexit ]
%sub9 = phi i32 [ -1003, %for.cond.preheader ], [ %5, %for.end.loopexit ]
%sub10 = add nsw i32 %.lcssa, -2
%div = sdiv i32 %sub9, %sub10
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int i, n, tmp, sum;
while (1) {
int data[100];
int max=0, min=0;
int sum = 0;
scanf("%d", &n);
if(n == 0) break;
for(i=0; i < n; i++) {
scanf("%d", &data[i]);
if (i==0) {
min = data[i];
max = 0;
}
if (data[i] > max) {
max = data[i];
}
if (data[i] < min) {
min = data[i];
}
}
for(i=0; i < n; i++) {
sum += data[i];
}
sum -= min+max;
n -= 2;
printf("%d\n", (int)sum/n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268203/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268203/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%data = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %data) #4
%call70 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp71 = icmp eq i32 %0, 0
br i1 %cmp71, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %cleanup
%1 = phi i32 [ %14, %cleanup ], [ %0, %entry ]
%cmp260 = icmp sgt i32 %1, 0
br i1 %cmp260, label %if.end8.peel, label %cleanup
if.end8.peel: ; preds = %for.cond.preheader
%call3.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %data)
%2 = load i32, ptr %data, align 16, !tbaa !5
%spec.select.peel = call i32 @llvm.smax.i32(i32 %2, i32 0)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp2.peel = icmp sgt i32 %3, 1
br i1 %cmp2.peel, label %if.end8, label %for.cond23.preheader
for.cond23.preheader: ; preds = %if.end8, %if.end8.peel
%max.0.lcssa = phi i32 [ %spec.select.peel, %if.end8.peel ], [ %spec.select, %if.end8 ]
%min.0.lcssa = phi i32 [ %2, %if.end8.peel ], [ %min.2, %if.end8 ]
%.lcssa = phi i32 [ %3, %if.end8.peel ], [ %10, %if.end8 ]
%cmp2466 = icmp sgt i32 %.lcssa, 0
br i1 %cmp2466, label %for.body25.preheader, label %cleanup
for.body25.preheader: ; preds = %for.cond23.preheader
%wide.trip.count = zext i32 %.lcssa to i64
%min.iters.check = icmp ult i32 %.lcssa, 8
br i1 %min.iters.check, label %for.body25.preheader90, label %vector.ph
vector.ph: ; preds = %for.body25.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi88 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%4 = getelementptr inbounds [100 x i32], ptr %data, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load89 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = add <4 x i32> %wide.load, %vec.phi
%7 = add <4 x i32> %wide.load89, %vec.phi88
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %7, %6
%9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %cleanup, label %for.body25.preheader90
for.body25.preheader90: ; preds = %for.body25.preheader, %middle.block
%indvars.iv75.ph = phi i64 [ 0, %for.body25.preheader ], [ %n.vec, %middle.block ]
%sum1.068.ph = phi i32 [ 0, %for.body25.preheader ], [ %9, %middle.block ]
br label %for.body25
if.end8: ; preds = %if.end8.peel, %if.end8
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end8 ], [ 1, %if.end8.peel ]
%min.063 = phi i32 [ %min.2, %if.end8 ], [ %2, %if.end8.peel ]
%max.062 = phi i32 [ %spec.select, %if.end8 ], [ %spec.select.peel, %if.end8.peel ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %data, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%.pre78 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %.pre78, i32 %max.062)
%min.2 = call i32 @llvm.smin.i32(i32 %.pre78, i32 %min.063)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp2, label %if.end8, label %for.cond23.preheader, !llvm.loop !13
for.body25: ; preds = %for.body25.preheader90, %for.body25
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body25 ], [ %indvars.iv75.ph, %for.body25.preheader90 ]
%sum1.068 = phi i32 [ %add, %for.body25 ], [ %sum1.068.ph, %for.body25.preheader90 ]
%arrayidx27 = getelementptr inbounds [100 x i32], ptr %data, i64 0, i64 %indvars.iv75
%12 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%add = add nsw i32 %12, %sum1.068
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body25, !llvm.loop !15
cleanup: ; preds = %for.body25, %middle.block, %for.cond.preheader, %for.cond23.preheader
%.lcssa85 = phi i32 [ %.lcssa, %for.cond23.preheader ], [ %1, %for.cond.preheader ], [ %.lcssa, %middle.block ], [ %.lcssa, %for.body25 ]
%min.0.lcssa84 = phi i32 [ %min.0.lcssa, %for.cond23.preheader ], [ 0, %for.cond.preheader ], [ %min.0.lcssa, %middle.block ], [ %min.0.lcssa, %for.body25 ]
%max.0.lcssa83 = phi i32 [ %max.0.lcssa, %for.cond23.preheader ], [ 0, %for.cond.preheader ], [ %max.0.lcssa, %middle.block ], [ %max.0.lcssa, %for.body25 ]
%sum1.0.lcssa = phi i32 [ 0, %for.cond23.preheader ], [ 0, %for.cond.preheader ], [ %9, %middle.block ], [ %add, %for.body25 ]
%13 = add i32 %min.0.lcssa84, %max.0.lcssa83
%sub = sub i32 %sum1.0.lcssa, %13
%sub32 = add nsw i32 %.lcssa85, -2
store i32 %sub32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %sub, %sub32
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %data) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %data) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%14 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %14, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %data) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.peeled.count", i32 1}
!15 = distinct !{!15, !10, !12, !11}
|
#include <stdio.h>
int main(void)
{
int n, i, s, sum, min, max;
scanf("%d", &n);
while(n != 0){
sum = 0;
min = 1000;
max = 0;
for(i = 0; i < n; i++){
scanf("%d", &s);
sum += s;
if(s < min)
min = s;
if(s > max)
max = s;
}
printf("%d\n", (sum - min - max) / (n - 2));
scanf("%d", &n);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268247/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268247/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not25 = icmp eq i32 %0, 0
br i1 %cmp.not25, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i32 [ %6, %for.end ], [ %0, %entry ]
%cmp117 = icmp sgt i32 %1, 0
br i1 %cmp117, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.body
%max.021 = phi i32 [ %max.1, %for.body ], [ 0, %for.cond.preheader ]
%min.020 = phi i32 [ %spec.select, %for.body ], [ 1000, %for.cond.preheader ]
%sum.019 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ]
%i.018 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%2 = load i32, ptr %s, align 4, !tbaa !5
%add = add nsw i32 %2, %sum.019
%spec.select = call i32 @llvm.smin.i32(i32 %2, i32 %min.020)
%max.1 = call i32 @llvm.smax.i32(i32 %2, i32 %max.021)
%inc = add nuw nsw i32 %i.018, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %3
br i1 %cmp1, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%4 = add i32 %spec.select, %max.1
%5 = sub i32 %add, %4
br label %for.end
for.end: ; preds = %for.end.loopexit, %for.cond.preheader
%.lcssa = phi i32 [ %1, %for.cond.preheader ], [ %3, %for.end.loopexit ]
%sub7 = phi i32 [ -1000, %for.cond.preheader ], [ %5, %for.end.loopexit ]
%sub8 = add nsw i32 %.lcssa, -2
%div = sdiv i32 %sub7, %sub8
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp eq i32 %6, 0
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main( void ) {
int i, n, sum, min, max, tmp;
for ( ; scanf( "%d", &n ), n; printf( "%d\n", ( sum - min - max ) / ( n - 2 ) ) ) {
scanf( "%d", &tmp );
sum = min = max = tmp;
for ( i = 0; i < n - 1; i++ ) {
scanf( "%d", &tmp );
sum += tmp;
if ( tmp < min )
min = tmp;
if ( max < tmp )
max = tmp;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268298/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268298/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%tmp = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #4
%call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not30 = icmp eq i32 %0, 0
br i1 %tobool.not30, label %for.end14, label %for.body
for.body: ; preds = %entry, %for.inc9
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp)
%1 = load i32, ptr %tmp, align 4, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %2, 1
br i1 %cmp21, label %for.body3, label %for.inc9
for.body3: ; preds = %for.body, %for.body3
%max.025 = phi i32 [ %max.1, %for.body3 ], [ %1, %for.body ]
%min.024 = phi i32 [ %spec.select, %for.body3 ], [ %1, %for.body ]
%sum.023 = phi i32 [ %add, %for.body3 ], [ %1, %for.body ]
%i.022 = phi i32 [ %inc, %for.body3 ], [ 0, %for.body ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp)
%3 = load i32, ptr %tmp, align 4, !tbaa !5
%add = add nsw i32 %3, %sum.023
%spec.select = call i32 @llvm.smin.i32(i32 %3, i32 %min.024)
%max.1 = call i32 @llvm.smax.i32(i32 %max.025, i32 %3)
%inc = add nuw nsw i32 %i.022, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %4, -1
%cmp = icmp slt i32 %inc, %sub
br i1 %cmp, label %for.body3, label %for.inc9, !llvm.loop !9
for.inc9: ; preds = %for.body3, %for.body
%sum.0.lcssa = phi i32 [ %1, %for.body ], [ %add, %for.body3 ]
%min.0.lcssa = phi i32 [ %1, %for.body ], [ %spec.select, %for.body3 ]
%max.0.lcssa = phi i32 [ %1, %for.body ], [ %max.1, %for.body3 ]
%.lcssa = phi i32 [ %2, %for.body ], [ %4, %for.body3 ]
%5 = add i32 %min.0.lcssa, %max.0.lcssa
%sub11 = sub i32 %sum.0.lcssa, %5
%sub12 = add nsw i32 %.lcssa, -2
%div = sdiv i32 %sub11, %sub12
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%6 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %6, 0
br i1 %tobool.not, label %for.end14, label %for.body, !llvm.loop !11
for.end14: ; preds = %for.inc9, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int MIN(int a,int b){return a<b?a:b;}
int ta[1010],to[1000010],nt[1000010],co[1000010],F[1010];
int MF(int s,int t,int e,int min){
if(s==t||min==0)return min;
int i,r;
F[s]=1;
for(i=ta[s];i+1;i=nt[i]){
if(F[to[i]])continue;
r=MF(to[i],t,e,MIN(min,co[i]));
co[i]-=r;
co[(i+e)%(2*e)]+=r;
if(r)return r;
}
return 0;
}
int Flow(int s,int t,int v,int e,int min){
while(v--)F[v]=0;
return MF(s,t,e,min);
}
int maxf(int s,int t,int v,int e){
int f,r;
for(f=0;r=Flow(s,t,v,e,1e9);f+=r);
return f;
}
int main(){
int n,m,q,l,ans,e,r=0,i,a,b,k;
scanf("%d %d %d",&n,&m,&q);
e=m+q;
for(i=0;i<=n;i++)ta[i]=-1;
for(i=0;i<m;i++){
scanf("%d %d",&a,&b);
nt[r ]=ta[to[r+e]=a];
nt[r+e]=ta[to[r ]=b];
co[ta[b]=r+e]=co[ta[a]=r]=1;
r++;
}/*printf("a\n");
for(i=0;i<=n;i++){printf("%d:",i);
for(k=ta[i];k+1;k=nt[k])printf(" %d",to[k]);
printf("\n");
}//*/
ans=maxf(1,n,n+1,e);//printf("%d\n",ans);
while(q--){
scanf("%d %d %d",&k,&a,&b);
if(k==1){
for(i=ta[a];i+1;i=nt[i]){
if(to[i]==b)break;
}
if(i==-1){
nt[r ]=ta[to[r+e]=a];
nt[r+e]=ta[to[r ]=b];
co[ta[b]=r+e]=co[ta[a]=r]=1;
r++;
}
else co[i]=co[(i+e)%(2*e)]=1;
ans+=Flow(1,n,n+1,e,1);
}
else{
for(k=ta[a];to[k]-b;k=nt[k]);
if(co[k]==2){
i=a;
a=b;
b=i;
k=(k+e)%(2*e);
}
if(co[k]==1);//co[i]=co[(i+e)%(2*e)]=0;
else if(Flow(a,b,n+1,e,1)==0){
Flow(n,b,n+1,e,1);
Flow(a,1,n+1,e,1);
ans--;
}
co[k]=co[(k+e)%(2*e)]=0;
}
printf("%d\n",ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268348/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268348/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@F = dso_local local_unnamed_addr global [1010 x i32] zeroinitializer, align 16
@ta = dso_local local_unnamed_addr global [1010 x i32] zeroinitializer, align 16
@to = dso_local local_unnamed_addr global [1000010 x i32] zeroinitializer, align 16
@co = dso_local local_unnamed_addr global [1000010 x i32] zeroinitializer, align 16
@nt = dso_local local_unnamed_addr global [1000010 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @MIN(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @MF(i32 noundef %s, i32 noundef %t, i32 noundef %e, i32 noundef %min) local_unnamed_addr #1 {
entry:
%cmp = icmp eq i32 %s, %t
%cmp1 = icmp eq i32 %min, 0
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %return, label %if.end
if.end: ; preds = %entry
%idxprom = sext i32 %s to i64
%arrayidx = getelementptr inbounds [1010 x i32], ptr @F, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [1010 x i32], ptr @ta, i64 0, i64 %idxprom
%i.044 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%tobool.not45 = icmp eq i32 %i.044, -1
br i1 %tobool.not45, label %return, label %for.body.lr.ph
for.body.lr.ph: ; preds = %if.end
%mul = shl nsw i32 %e, 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%i.046 = phi i32 [ %i.044, %for.body.lr.ph ], [ %i.0, %for.inc ]
%idxprom4 = sext i32 %i.046 to i64
%arrayidx5 = getelementptr inbounds [1000010 x i32], ptr @to, i64 0, i64 %idxprom4
%0 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%idxprom6 = sext i32 %0 to i64
%arrayidx7 = getelementptr inbounds [1010 x i32], ptr @F, i64 0, i64 %idxprom6
%1 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%tobool8.not = icmp eq i32 %1, 0
br i1 %tobool8.not, label %if.end10, label %for.inc
if.end10: ; preds = %for.body
%arrayidx14 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %idxprom4
%2 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%cond.i = tail call i32 @llvm.smin.i32(i32 %min, i32 %2)
%call15 = tail call i32 @MF(i32 noundef %0, i32 noundef %t, i32 noundef %e, i32 noundef %cond.i)
%3 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%sub = sub nsw i32 %3, %call15
store i32 %sub, ptr %arrayidx14, align 4, !tbaa !5
%add18 = add nsw i32 %i.046, %e
%rem = srem i32 %add18, %mul
%idxprom19 = sext i32 %rem to i64
%arrayidx20 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %idxprom19
%4 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%add21 = add nsw i32 %4, %call15
store i32 %add21, ptr %arrayidx20, align 4, !tbaa !5
%tobool22.not = icmp eq i32 %call15, 0
br i1 %tobool22.not, label %for.inc, label %return
for.inc: ; preds = %if.end10, %for.body
%arrayidx26 = getelementptr inbounds [1000010 x i32], ptr @nt, i64 0, i64 %idxprom4
%i.0 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%tobool.not = icmp eq i32 %i.0, -1
br i1 %tobool.not, label %return, label %for.body, !llvm.loop !9
return: ; preds = %for.inc, %if.end10, %if.end, %entry
%retval.1 = phi i32 [ %min, %entry ], [ 0, %if.end ], [ 0, %for.inc ], [ %call15, %if.end10 ]
ret i32 %retval.1
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @Flow(i32 noundef %s, i32 noundef %t, i32 noundef %v, i32 noundef %e, i32 noundef %min) local_unnamed_addr #3 {
entry:
%tobool.not2 = icmp eq i32 %v, 0
br i1 %tobool.not2, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%0 = add i32 %v, -1
%1 = sext i32 %0 to i64
%2 = zext i32 %0 to i64
%3 = sub nsw i64 %1, %2
%4 = shl nsw i64 %3, 2
%scevgep = getelementptr i8, ptr @F, i64 %4
%5 = zext i32 %v to i64
%6 = shl nuw nsw i64 %5, 2
tail call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %6, i1 false), !tbaa !5
br label %while.end
while.end: ; preds = %while.body.preheader, %entry
%call = tail call i32 @MF(i32 noundef %s, i32 noundef %t, i32 noundef %e, i32 noundef %min)
ret i32 %call
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @maxf(i32 noundef %s, i32 noundef %t, i32 noundef %v, i32 noundef %e) local_unnamed_addr #3 {
entry:
%tobool.not2.i = icmp eq i32 %v, 0
%0 = add i32 %v, -1
%1 = sext i32 %0 to i64
%2 = zext i32 %0 to i64
%3 = sub nsw i64 %1, %2
%4 = shl nsw i64 %3, 2
%scevgep.i = getelementptr i8, ptr @F, i64 %4
%5 = zext i32 %v to i64
%6 = shl nuw nsw i64 %5, 2
br i1 %tobool.not2.i, label %for.cond.us, label %for.cond
for.cond.us: ; preds = %entry, %for.cond.us
%f.0.us = phi i32 [ %add.us, %for.cond.us ], [ 0, %entry ]
%call.i.us = tail call i32 @MF(i32 noundef %s, i32 noundef %t, i32 noundef %e, i32 noundef 1000000000)
%tobool.not.us = icmp eq i32 %call.i.us, 0
%add.us = add nsw i32 %call.i.us, %f.0.us
br i1 %tobool.not.us, label %for.end, label %for.cond.us, !llvm.loop !11
for.cond: ; preds = %entry, %for.cond
%f.0 = phi i32 [ %add, %for.cond ], [ 0, %entry ]
tail call void @llvm.memset.p0.i64(ptr align 4 %scevgep.i, i8 0, i64 %6, i1 false), !tbaa !5
%call.i = tail call i32 @MF(i32 noundef %s, i32 noundef %t, i32 noundef %e, i32 noundef 1000000000)
%tobool.not = icmp eq i32 %call.i, 0
%add = add nsw i32 %call.i, %f.0
br i1 %tobool.not, label %for.end, label %for.cond, !llvm.loop !11
for.end: ; preds = %for.cond, %for.cond.us
%.us-phi = phi i32 [ %f.0.us, %for.cond.us ], [ %f.0, %for.cond ]
ret i32 %.us-phi
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%q = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %q)
%0 = load i32, ptr %m, align 4, !tbaa !5
%1 = load i32, ptr %q, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not189 = icmp slt i32 %2, 0
br i1 %cmp.not189, label %for.cond1.preheader, label %for.body.preheader
for.body.preheader: ; preds = %entry
%3 = add nuw i32 %2, 1
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @ta, i8 -1, i64 %5, i1 false), !tbaa !5
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.body.preheader, %entry
%cmp2191 = icmp sgt i32 %0, 0
br i1 %cmp2191, label %for.body3.preheader, label %for.end31
for.body3.preheader: ; preds = %for.cond1.preheader
%6 = sext i32 %add to i64
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.body3 ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%7 = load i32, ptr %a, align 4, !tbaa !5
%8 = add nsw i64 %indvars.iv, %6
%arrayidx7 = getelementptr inbounds [1000010 x i32], ptr @to, i64 0, i64 %8
store i32 %7, ptr %arrayidx7, align 4, !tbaa !5
%idxprom8 = sext i32 %7 to i64
%arrayidx9 = getelementptr inbounds [1010 x i32], ptr @ta, i64 0, i64 %idxprom8
%9 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [1000010 x i32], ptr @nt, i64 0, i64 %indvars.iv
store i32 %9, ptr %arrayidx11, align 4, !tbaa !5
%10 = load i32, ptr %b, align 4, !tbaa !5
%arrayidx13 = getelementptr inbounds [1000010 x i32], ptr @to, i64 0, i64 %indvars.iv
store i32 %10, ptr %arrayidx13, align 4, !tbaa !5
%idxprom14 = sext i32 %10 to i64
%arrayidx15 = getelementptr inbounds [1010 x i32], ptr @ta, i64 0, i64 %idxprom14
%11 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [1000010 x i32], ptr @nt, i64 0, i64 %8
store i32 %11, ptr %arrayidx18, align 4, !tbaa !5
%12 = trunc i64 %indvars.iv to i32
store i32 %12, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx22 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %indvars.iv
store i32 1, ptr %arrayidx22, align 4, !tbaa !5
%13 = trunc i64 %8 to i32
store i32 %13, ptr %arrayidx15, align 4, !tbaa !5
%arrayidx27 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %8
store i32 1, ptr %arrayidx27, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%indvars = trunc i64 %indvars.iv.next to i32
%14 = load i32, ptr %m, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %14, %indvars
br i1 %cmp2, label %for.body3, label %for.end31.loopexit, !llvm.loop !12
for.end31.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.end31
for.end31: ; preds = %for.end31.loopexit, %for.cond1.preheader
%15 = phi i32 [ %2, %for.cond1.preheader ], [ %.pre, %for.end31.loopexit ]
%r.0.lcssa = phi i32 [ 0, %for.cond1.preheader ], [ %indvars, %for.end31.loopexit ]
%add32 = add nsw i32 %15, 1
%tobool.not2.i.i = icmp eq i32 %add32, 0
%16 = sext i32 %15 to i64
%17 = zext i32 %15 to i64
%18 = sub nsw i64 %16, %17
%19 = shl nsw i64 %18, 2
%scevgep.i.i = getelementptr i8, ptr @F, i64 %19
%20 = zext i32 %add32 to i64
%21 = shl nuw nsw i64 %20, 2
br i1 %tobool.not2.i.i, label %for.cond.us.i, label %for.cond.i
for.cond.us.i: ; preds = %for.end31, %for.cond.us.i
%f.0.us.i = phi i32 [ %add.us.i, %for.cond.us.i ], [ 0, %for.end31 ]
%call.i.us.i = call i32 @MF(i32 noundef 1, i32 noundef %15, i32 noundef %add, i32 noundef 1000000000)
%tobool.not.us.i = icmp eq i32 %call.i.us.i, 0
%add.us.i = add nsw i32 %call.i.us.i, %f.0.us.i
br i1 %tobool.not.us.i, label %maxf.exit, label %for.cond.us.i, !llvm.loop !11
for.cond.i: ; preds = %for.end31, %for.cond.i
%f.0.i = phi i32 [ %add.i, %for.cond.i ], [ 0, %for.end31 ]
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.i.i, i8 0, i64 %21, i1 false), !tbaa !5
%call.i.i = call i32 @MF(i32 noundef 1, i32 noundef %15, i32 noundef %add, i32 noundef 1000000000)
%tobool.not.i = icmp eq i32 %call.i.i, 0
%add.i = add nsw i32 %call.i.i, %f.0.i
br i1 %tobool.not.i, label %maxf.exit, label %for.cond.i, !llvm.loop !11
maxf.exit: ; preds = %for.cond.i, %for.cond.us.i
%.us-phi.i = phi i32 [ %f.0.us.i, %for.cond.us.i ], [ %f.0.i, %for.cond.i ]
%22 = load i32, ptr %q, align 4, !tbaa !5
%dec207 = add nsw i32 %22, -1
store i32 %dec207, ptr %q, align 4, !tbaa !5
%tobool.not208 = icmp eq i32 %22, 0
br i1 %tobool.not208, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %maxf.exit
%mul102 = shl nsw i32 %add, 1
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end128
%r.1210 = phi i32 [ %r.0.lcssa, %while.body.lr.ph ], [ %r.3, %if.end128 ]
%ans.0209 = phi i32 [ %.us-phi.i, %while.body.lr.ph ], [ %ans.2, %if.end128 ]
%call34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %a, ptr noundef nonnull %b)
%23 = load i32, ptr %k, align 4, !tbaa !5
%cmp35 = icmp eq i32 %23, 1
%24 = load i32, ptr %a, align 4, !tbaa !5
%idxprom36 = sext i32 %24 to i64
%arrayidx37 = getelementptr inbounds [1010 x i32], ptr @ta, i64 0, i64 %idxprom36
br i1 %cmp35, label %if.then, label %if.else85
if.then: ; preds = %while.body
%i.2204 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%cond205 = icmp eq i32 %i.2204, -1
%.pre220 = load i32, ptr %b, align 4, !tbaa !5
br i1 %cond205, label %if.then51, label %for.body41
for.body41: ; preds = %if.then, %for.inc46
%i.2206 = phi i32 [ %i.2, %for.inc46 ], [ %i.2204, %if.then ]
%idxprom42 = sext i32 %i.2206 to i64
%arrayidx43 = getelementptr inbounds [1000010 x i32], ptr @to, i64 0, i64 %idxprom42
%25 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%cmp44 = icmp eq i32 %25, %.pre220
br i1 %cmp44, label %if.else, label %for.inc46
for.inc46: ; preds = %for.body41
%arrayidx48 = getelementptr inbounds [1000010 x i32], ptr @nt, i64 0, i64 %idxprom42
%i.2 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%cond = icmp eq i32 %i.2, -1
br i1 %cond, label %if.then51, label %for.body41, !llvm.loop !13
if.then51: ; preds = %for.inc46, %if.then
%add52 = add nsw i32 %r.1210, %add
%idxprom53 = sext i32 %add52 to i64
%arrayidx54 = getelementptr inbounds [1000010 x i32], ptr @to, i64 0, i64 %idxprom53
store i32 %24, ptr %arrayidx54, align 4, !tbaa !5
%idxprom57 = sext i32 %r.1210 to i64
%arrayidx58 = getelementptr inbounds [1000010 x i32], ptr @nt, i64 0, i64 %idxprom57
store i32 %i.2204, ptr %arrayidx58, align 4, !tbaa !5
%arrayidx60 = getelementptr inbounds [1000010 x i32], ptr @to, i64 0, i64 %idxprom57
store i32 %.pre220, ptr %arrayidx60, align 4, !tbaa !5
%idxprom61 = sext i32 %.pre220 to i64
%arrayidx62 = getelementptr inbounds [1010 x i32], ptr @ta, i64 0, i64 %idxprom61
%26 = load i32, ptr %arrayidx62, align 4, !tbaa !5
%arrayidx65 = getelementptr inbounds [1000010 x i32], ptr @nt, i64 0, i64 %idxprom53
store i32 %26, ptr %arrayidx65, align 4, !tbaa !5
store i32 %r.1210, ptr %arrayidx37, align 4, !tbaa !5
%arrayidx69 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %idxprom57
store i32 1, ptr %arrayidx69, align 4, !tbaa !5
store i32 %add52, ptr %arrayidx62, align 4, !tbaa !5
%arrayidx74 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %idxprom53
store i32 1, ptr %arrayidx74, align 4, !tbaa !5
%inc75 = add nsw i32 %r.1210, 1
br label %if.end81
if.else: ; preds = %for.body41
%add76 = add nsw i32 %i.2206, %add
%rem = srem i32 %add76, %mul102
%idxprom77 = sext i32 %rem to i64
%arrayidx78 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %idxprom77
store i32 1, ptr %arrayidx78, align 4, !tbaa !5
%arrayidx80 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %idxprom42
store i32 1, ptr %arrayidx80, align 4, !tbaa !5
br label %if.end81
if.end81: ; preds = %if.else, %if.then51
%r.2 = phi i32 [ %inc75, %if.then51 ], [ %r.1210, %if.else ]
%27 = load i32, ptr %n, align 4, !tbaa !5
%add82 = add nsw i32 %27, 1
%tobool.not2.i = icmp eq i32 %add82, 0
br i1 %tobool.not2.i, label %Flow.exit, label %while.body.preheader.i
while.body.preheader.i: ; preds = %if.end81
%28 = sext i32 %27 to i64
%29 = zext i32 %27 to i64
%30 = sub nsw i64 %28, %29
%31 = shl nsw i64 %30, 2
%scevgep.i = getelementptr i8, ptr @F, i64 %31
%32 = zext i32 %add82 to i64
%33 = shl nuw nsw i64 %32, 2
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.i, i8 0, i64 %33, i1 false), !tbaa !5
br label %Flow.exit
Flow.exit: ; preds = %if.end81, %while.body.preheader.i
%call.i = call i32 @MF(i32 noundef 1, i32 noundef %27, i32 noundef %add, i32 noundef 1)
%add84 = add nsw i32 %call.i, %ans.0209
br label %if.end128
if.else85: ; preds = %while.body
%34 = load i32, ptr %b, align 4, !tbaa !5
%storemerge195 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%idxprom89196 = sext i32 %storemerge195 to i64
%arrayidx90197 = getelementptr inbounds [1000010 x i32], ptr @to, i64 0, i64 %idxprom89196
%35 = load i32, ptr %arrayidx90197, align 4, !tbaa !5
%tobool91.not198 = icmp eq i32 %35, %34
br i1 %tobool91.not198, label %for.end96, label %for.inc93
for.inc93: ; preds = %if.else85, %for.inc93
%idxprom89199 = phi i64 [ %idxprom89, %for.inc93 ], [ %idxprom89196, %if.else85 ]
%arrayidx95 = getelementptr inbounds [1000010 x i32], ptr @nt, i64 0, i64 %idxprom89199
%storemerge = load i32, ptr %arrayidx95, align 4, !tbaa !5
%idxprom89 = sext i32 %storemerge to i64
%arrayidx90 = getelementptr inbounds [1000010 x i32], ptr @to, i64 0, i64 %idxprom89
%36 = load i32, ptr %arrayidx90, align 4, !tbaa !5
%tobool91.not = icmp eq i32 %36, %34
br i1 %tobool91.not, label %for.end96, label %for.inc93, !llvm.loop !14
for.end96: ; preds = %for.inc93, %if.else85
%storemerge.lcssa194 = phi i32 [ %storemerge195, %if.else85 ], [ %storemerge, %for.inc93 ]
%idxprom89.lcssa = phi i64 [ %idxprom89196, %if.else85 ], [ %idxprom89, %for.inc93 ]
store i32 %storemerge.lcssa194, ptr %k, align 4, !tbaa !5
%arrayidx98 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %idxprom89.lcssa
%37 = load i32, ptr %arrayidx98, align 4, !tbaa !5
%cmp99 = icmp eq i32 %37, 2
br i1 %cmp99, label %if.then100, label %if.end104
if.then100: ; preds = %for.end96
store i32 %34, ptr %a, align 4, !tbaa !5
store i32 %24, ptr %b, align 4, !tbaa !5
%add101 = add nsw i32 %storemerge.lcssa194, %add
%rem103 = srem i32 %add101, %mul102
store i32 %rem103, ptr %k, align 4, !tbaa !5
br label %if.end104
if.end104: ; preds = %if.then100, %for.end96
%38 = phi i32 [ %24, %if.then100 ], [ %34, %for.end96 ]
%39 = phi i32 [ %34, %if.then100 ], [ %24, %for.end96 ]
%40 = phi i32 [ %rem103, %if.then100 ], [ %storemerge.lcssa194, %for.end96 ]
%idxprom105 = sext i32 %40 to i64
%arrayidx106 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %idxprom105
%41 = load i32, ptr %arrayidx106, align 4, !tbaa !5
%cmp107 = icmp eq i32 %41, 1
br i1 %cmp107, label %if.end120, label %if.else109
if.else109: ; preds = %if.end104
%42 = load i32, ptr %n, align 4, !tbaa !5
%add110 = add nsw i32 %42, 1
%tobool.not2.i172 = icmp eq i32 %add110, 0
br i1 %tobool.not2.i172, label %Flow.exit176, label %while.body.preheader.i173
while.body.preheader.i173: ; preds = %if.else109
%43 = sext i32 %42 to i64
%44 = zext i32 %42 to i64
%45 = sub nsw i64 %43, %44
%46 = shl nsw i64 %45, 2
%scevgep.i174 = getelementptr i8, ptr @F, i64 %46
%47 = zext i32 %add110 to i64
%48 = shl nuw nsw i64 %47, 2
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.i174, i8 0, i64 %48, i1 false), !tbaa !5
br label %Flow.exit176
Flow.exit176: ; preds = %if.else109, %while.body.preheader.i173
%call.i175 = call i32 @MF(i32 noundef %39, i32 noundef %38, i32 noundef %add, i32 noundef 1)
%cmp112 = icmp eq i32 %call.i175, 0
br i1 %cmp112, label %if.then113, label %if.end120
if.then113: ; preds = %Flow.exit176
%49 = load i32, ptr %n, align 4, !tbaa !5
%50 = load i32, ptr %b, align 4, !tbaa !5
%add114 = add nsw i32 %49, 1
%tobool.not2.i177 = icmp eq i32 %add114, 0
br i1 %tobool.not2.i177, label %Flow.exit181, label %while.body.preheader.i178
while.body.preheader.i178: ; preds = %if.then113
%51 = sext i32 %49 to i64
%52 = zext i32 %49 to i64
%53 = sub nsw i64 %51, %52
%54 = shl nsw i64 %53, 2
%scevgep.i179 = getelementptr i8, ptr @F, i64 %54
%55 = zext i32 %add114 to i64
%56 = shl nuw nsw i64 %55, 2
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.i179, i8 0, i64 %56, i1 false), !tbaa !5
br label %Flow.exit181
Flow.exit181: ; preds = %if.then113, %while.body.preheader.i178
%call.i180 = call i32 @MF(i32 noundef %49, i32 noundef %50, i32 noundef %add, i32 noundef 1)
%57 = load i32, ptr %a, align 4, !tbaa !5
%58 = load i32, ptr %n, align 4, !tbaa !5
%add116 = add nsw i32 %58, 1
%tobool.not2.i182 = icmp eq i32 %add116, 0
br i1 %tobool.not2.i182, label %Flow.exit186, label %while.body.preheader.i183
while.body.preheader.i183: ; preds = %Flow.exit181
%59 = sext i32 %58 to i64
%60 = zext i32 %58 to i64
%61 = sub nsw i64 %59, %60
%62 = shl nsw i64 %61, 2
%scevgep.i184 = getelementptr i8, ptr @F, i64 %62
%63 = zext i32 %add116 to i64
%64 = shl nuw nsw i64 %63, 2
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.i184, i8 0, i64 %64, i1 false), !tbaa !5
br label %Flow.exit186
Flow.exit186: ; preds = %Flow.exit181, %while.body.preheader.i183
%call.i185 = call i32 @MF(i32 noundef %57, i32 noundef 1, i32 noundef %add, i32 noundef 1)
%dec118 = add nsw i32 %ans.0209, -1
br label %if.end120
if.end120: ; preds = %Flow.exit176, %Flow.exit186, %if.end104
%ans.1 = phi i32 [ %ans.0209, %if.end104 ], [ %dec118, %Flow.exit186 ], [ %ans.0209, %Flow.exit176 ]
%65 = load i32, ptr %k, align 4, !tbaa !5
%add121 = add nsw i32 %65, %add
%rem123 = srem i32 %add121, %mul102
%idxprom124 = sext i32 %rem123 to i64
%arrayidx125 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %idxprom124
store i32 0, ptr %arrayidx125, align 4, !tbaa !5
%idxprom126 = sext i32 %65 to i64
%arrayidx127 = getelementptr inbounds [1000010 x i32], ptr @co, i64 0, i64 %idxprom126
store i32 0, ptr %arrayidx127, align 4, !tbaa !5
br label %if.end128
if.end128: ; preds = %if.end120, %Flow.exit
%ans.2 = phi i32 [ %add84, %Flow.exit ], [ %ans.1, %if.end120 ]
%r.3 = phi i32 [ %r.2, %Flow.exit ], [ %r.1210, %if.end120 ]
%call129 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.2)
%66 = load i32, ptr %q, align 4, !tbaa !5
%dec = add nsw i32 %66, -1
store i32 %dec, ptr %q, align 4, !tbaa !5
%tobool.not = icmp eq i32 %66, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %if.end128, %maxf.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main() {
char s[101],a = '\0',b=0,i;
scanf("%s",s);
for( i=0;i<101;i++) {
if(s[i]=='C')
a=i;
if(s[i]=='C')
break;
}
if(i==101)
a=101;
for(int i=a;i<101;i++) {
if(s[i]=='F')
b++;
if(s[i]=='F')
break;
}
if(b>0)
printf("Yes\n");
else
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268405/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268405/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %for.body
for.body: ; preds = %for.inc.3, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.inc.3 ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 4, !tbaa !5
%cmp3 = icmp eq i8 %0, 67
br i1 %cmp3, label %for.end, label %for.inc
for.inc: ; preds = %for.body
%indvars.iv.next = or i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 101
br i1 %exitcond.not, label %if.end47, label %for.body.1, !llvm.loop !8
for.body.1: ; preds = %for.inc
%arrayidx.1 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp3.1 = icmp eq i8 %1, 67
br i1 %cmp3.1, label %for.end, label %for.inc.1
for.inc.1: ; preds = %for.body.1
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next.1
%2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%cmp3.2 = icmp eq i8 %2, 67
br i1 %cmp3.2, label %for.end, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next.2
%3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%cmp3.3 = icmp eq i8 %3, 67
br i1 %cmp3.3, label %for.end, label %for.inc.3
for.inc.3: ; preds = %for.inc.2
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
br label %for.body
for.end: ; preds = %for.inc.2, %for.inc.1, %for.body.1, %for.body
%indvars.iv.lcssa = phi i64 [ %indvars.iv, %for.body ], [ %indvars.iv.next, %for.body.1 ], [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.next.2, %for.inc.2 ]
%4 = trunc i64 %indvars.iv.lcssa to i8
%cmp2065 = icmp ult i8 %4, 101
br i1 %cmp2065, label %for.body22.preheader, label %if.end47
for.body22.preheader: ; preds = %for.end
%5 = and i64 %indvars.iv.lcssa, 255
br label %for.body22
for.cond19: ; preds = %for.body22
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%exitcond71.not = icmp eq i64 %indvars.iv.next69, 101
br i1 %exitcond71.not, label %if.end47, label %for.body22, !llvm.loop !10
for.body22: ; preds = %for.body22.preheader, %for.cond19
%indvars.iv68 = phi i64 [ %5, %for.body22.preheader ], [ %indvars.iv.next69, %for.cond19 ]
%arrayidx24 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv68
%6 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp26 = icmp eq i8 %6, 70
br i1 %cmp26, label %if.end47, label %for.cond19
if.end47: ; preds = %for.inc, %for.cond19, %for.body22, %for.end
%str.sink = phi ptr [ @str, %for.end ], [ @str.3, %for.body22 ], [ @str, %for.cond19 ], [ @str, %for.inc ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include <stdio.h>
#include <string.h>
int main(){
char line[120];
char str[120];
char *p;
int len;
int flag = 0, i, flag2 = 0;
fgets(line, sizeof(line), stdin);
sscanf(line, "%s", &str );
len = strlen(str);
p = str;
for(i=0; i<len; i++){
if(*p == 'C') flag = 1;
if(flag == 1 && *p == 'F' ) flag2 = 1;
p++;
}
//printf("%s\n", str);
if(flag2 == 1 ) printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268463/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268463/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%line = alloca [120 x i8], align 16
%str = alloca [120 x i8], align 16
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %line) #5
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %str) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 120, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef nonnull %str) #5
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6
%conv = trunc i64 %call4 to i32
%cmp28 = icmp sgt i32 %conv, 0
br i1 %cmp28, label %for.body.preheader, label %if.else
for.body.preheader: ; preds = %entry
%1 = add i64 %call4, 4294967295
%2 = and i64 %1, 4294967295
%3 = add nuw nsw i64 %2, 1
%xtraiter = and i64 %3, 1
%4 = icmp eq i64 %2, 0
br i1 %4, label %for.end.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %3, 8589934590
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%flag2.032 = phi i32 [ 0, %for.body.preheader.new ], [ %flag2.1.1, %for.body ]
%flag.030 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.1, %for.body ]
%p.029 = phi ptr [ %str, %for.body.preheader.new ], [ %incdec.ptr.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%5 = load i8, ptr %p.029, align 1, !tbaa !9
%cmp8 = icmp eq i8 %5, 67
%spec.select = select i1 %cmp8, i32 1, i32 %flag.030
%cmp10 = icmp eq i32 %spec.select, 1
%cmp13 = icmp eq i8 %5, 70
%6 = select i1 %cmp10, i1 %cmp13, i1 false
%incdec.ptr = getelementptr inbounds i8, ptr %p.029, i64 1
%7 = load i8, ptr %incdec.ptr, align 1, !tbaa !9
%cmp8.1 = icmp eq i8 %7, 67
%spec.select.1 = select i1 %cmp8.1, i32 1, i32 %spec.select
%cmp10.1 = icmp eq i32 %spec.select.1, 1
%cmp13.1 = icmp eq i8 %7, 70
%8 = select i1 %cmp10.1, i1 %cmp13.1, i1 false
%9 = select i1 %8, i1 true, i1 %6
%flag2.1.1 = select i1 %9, i32 1, i32 %flag2.032
%incdec.ptr.1 = getelementptr inbounds i8, ptr %p.029, i64 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.unr-lcssa.loopexit, label %for.body, !llvm.loop !10
for.end.unr-lcssa.loopexit: ; preds = %for.body
%10 = icmp eq i32 %spec.select.1, 1
br label %for.end.unr-lcssa
for.end.unr-lcssa: ; preds = %for.end.unr-lcssa.loopexit, %for.body.preheader
%flag2.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %flag2.1.1, %for.end.unr-lcssa.loopexit ]
%flag2.032.unr = phi i32 [ 0, %for.body.preheader ], [ %flag2.1.1, %for.end.unr-lcssa.loopexit ]
%flag.030.unr = phi i1 [ false, %for.body.preheader ], [ %10, %for.end.unr-lcssa.loopexit ]
%p.029.unr = phi ptr [ %str, %for.body.preheader ], [ %incdec.ptr.1, %for.end.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.unr-lcssa
%11 = load i8, ptr %p.029.unr, align 1, !tbaa !9
%cmp13.epil = icmp eq i8 %11, 70
%12 = select i1 %cmp13.epil, i1 %flag.030.unr, i1 false
%flag2.1.epil = select i1 %12, i32 1, i32 %flag2.032.unr
br label %for.end
for.end: ; preds = %for.end.unr-lcssa, %for.body.epil
%flag2.1.lcssa = phi i32 [ %flag2.1.lcssa.ph, %for.end.unr-lcssa ], [ %flag2.1.epil, %for.body.epil ]
%13 = icmp eq i32 %flag2.1.lcssa, 1
br i1 %13, label %if.end22, label %if.else
if.else: ; preds = %entry, %for.end
br label %if.end22
if.end22: ; preds = %for.end, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.end ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %str) #5
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %line) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int h,n,sum=0;
scanf("%d%d",&h,&n);
int a[n];
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
sum+=a[i];
}
if(sum>=h){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268513/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268513/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %3, 0
br i1 %cmp12, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%4 = load i32, ptr %h, align 4, !tbaa !5
%cmp4.not = icmp slt i32 %sum.0.lcssa, %4
%str.str.4 = select i1 %cmp4.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.013 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %5, %sum.013
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
int main() {
int h, n, a;
scanf("%d %d", &h, &n);
int mysum = 0;
for (int i = 0; i < n; i++) {
scanf("%d", &a);
mysum += a;
if(mysum>=h){
printf("Yes");
return 0;
}
}
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268564/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268564/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not11 = icmp sgt i32 %0, 0
br i1 %cmp.not11, label %for.body, label %cleanup5
for.cond: ; preds = %for.body
%inc = add nuw nsw i32 %i.013, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp slt i32 %inc, %1
br i1 %cmp.not, label %for.body, label %cleanup5, !llvm.loop !9
for.body: ; preds = %entry, %for.cond
%i.013 = phi i32 [ %inc, %for.cond ], [ 0, %entry ]
%mysum.012 = phi i32 [ %add, %for.cond ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%2 = load i32, ptr %a, align 4, !tbaa !5
%add = add nsw i32 %2, %mysum.012
%3 = load i32, ptr %h, align 4, !tbaa !5
%cmp2.not = icmp slt i32 %add, %3
br i1 %cmp2.not, label %for.cond, label %cleanup5
cleanup5: ; preds = %for.cond, %for.body, %entry
%.str.2.sink = phi ptr [ @.str.3, %entry ], [ @.str.2, %for.body ], [ @.str.3, %for.cond ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int h,n,i;
int a[100008];
scanf("%d %d\n",&h,&n );
for(i=0; i<n; i++){
scanf("%d",&a[i] );
h -= a[i];
}
if(h > 0){
printf("No");
}else{
printf("Yes");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268607/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268607/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [100008 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 400032, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %0, 0
br i1 %cmp10, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = load i32, ptr %h, align 4, !tbaa !5
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100008 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %h, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
store i32 %sub, ptr %h, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%5 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %sub, %for.body ]
%cmp4 = icmp sgt i32 %5, 0
%.str.2..str.3 = select i1 %cmp4, ptr @.str.2, ptr @.str.3
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3)
call void @llvm.lifetime.end.p0(i64 400032, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
long i,H,N,Ai,sum=0;
scanf("%ld",&H);
scanf("%ld",&N);
for(i=1;i<=N;i++)
{
scanf("%ld",&Ai);
sum=sum+Ai;
}
if(sum>=H)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268650/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268650/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i64, align 8
%N = alloca i64, align 8
%Ai = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Ai) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp.not9 = icmp slt i64 %0, 1
br i1 %cmp.not9, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%sum.011 = phi i64 [ %add, %for.body ], [ 0, %entry ]
%i.010 = phi i64 [ %inc, %for.body ], [ 1, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Ai)
%1 = load i64, ptr %Ai, align 8, !tbaa !5
%add = add nsw i64 %1, %sum.011
%inc = add nuw nsw i64 %i.010, 1
%2 = load i64, ptr %N, align 8, !tbaa !5
%cmp.not.not = icmp slt i64 %i.010, %2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ]
%3 = load i64, ptr %H, align 8, !tbaa !5
%cmp3.not = icmp slt i64 %sum.0.lcssa, %3
%str.str.3 = select i1 %cmp3.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Ai) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int h,n,i,sum=0;
scanf("%d%d",&h,&n);
int a[n+1];
for(i=0;i<n;i++){
scanf("%d",&a[i]);
sum+=a[i];
}
printf(sum<h?"No":"Yes");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268694/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268694/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %3, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.012 = phi i32 [ %add4, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add4 = add nsw i32 %4, %sum.012
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add4, %for.body ]
%7 = load i32, ptr %h, align 4, !tbaa !5
%cmp5 = icmp slt i32 %sum.0.lcssa, %7
%cond = select i1 %cmp5, ptr @.str.2, ptr @.str.3
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int H,N,A[100001],i,sum=0;
scanf("%d %d",&H,&N);
for(i=0;i<N;i++){
scanf("%d",&A[i]);
sum+=A[i];
}
if(sum>=H) printf("Yes");
else printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268737/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268737/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%N = alloca i32, align 4
%A = alloca [100001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.013 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.013
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp4.not = icmp slt i32 %sum.0.lcssa, %4
%.str.3..str.2 = select i1 %cmp4.not, ptr @.str.3, ptr @.str.2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
int h,n,i,atk=0;
scanf("%d%d",&h,&n);
int a[n];
for(i=0;i<n;i++){
scanf("%d",&a[i]);
atk=a[i]+atk;
}
if(atk>=h){
printf("Yes");
}
else{
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268780/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %3, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%atk.012 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %4, %atk.012
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%atk.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%7 = load i32, ptr %h, align 4, !tbaa !5
%cmp4.not = icmp slt i32 %atk.0.lcssa, %7
%.str.3..str.2 = select i1 %cmp4.not, ptr @.str.3, ptr @.str.2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int m,n,i,sum=0;
scanf("%d %d",&m,&n);
int a[100005];
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
if(sum>=m)
printf("Yes");
else
printf("No");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268823/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268823/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [100005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %a) #3
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.013 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.013
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%4 = load i32, ptr %m, align 4, !tbaa !5
%cmp4.not = icmp slt i32 %sum.0.lcssa, %4
%.str.3..str.2 = select i1 %cmp4.not, ptr @.str.3, ptr @.str.2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
long long int H,N,i,count=0;
;long long int a[100000];
scanf("%ld %ld",&H,&N);
for(i=0;i<N;i++)
{
scanf("%ld",&a[i]);
}
for(i=0;i<N;i++)
{
count=count+a[i];
}
if(count>=H) printf("Yes");
else printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268867/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268867/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i64, align 8
%N = alloca i64, align 8
%a = alloca [100000 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp18 = icmp sgt i64 %0, 0
br i1 %cmp18, label %for.body, label %for.end8
for.cond2.preheader: ; preds = %for.body
%cmp320 = icmp sgt i64 %7, 0
br i1 %cmp320, label %for.body4.preheader, label %for.end8
for.body4.preheader: ; preds = %for.cond2.preheader
%min.iters.check = icmp ult i64 %7, 4
br i1 %min.iters.check, label %for.body4.preheader29, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %7, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi27 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %index
%wide.load = load <2 x i64>, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i64, ptr %1, i64 2
%wide.load28 = load <2 x i64>, ptr %2, align 16, !tbaa !5
%3 = add <2 x i64> %wide.load, %vec.phi
%4 = add <2 x i64> %wide.load28, %vec.phi27
%index.next = add nuw i64 %index, 4
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %4, %3
%6 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %7, %n.vec
br i1 %cmp.n, label %for.end8, label %for.body4.preheader29
for.body4.preheader29: ; preds = %for.body4.preheader, %middle.block
%count.022.ph = phi i64 [ 0, %for.body4.preheader ], [ %6, %middle.block ]
%i.121.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%i.019 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %i.019
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.019, 1
%7 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %7
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader29, %for.body4
%count.022 = phi i64 [ %add, %for.body4 ], [ %count.022.ph, %for.body4.preheader29 ]
%i.121 = phi i64 [ %inc7, %for.body4 ], [ %i.121.ph, %for.body4.preheader29 ]
%arrayidx5 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %i.121
%8 = load i64, ptr %arrayidx5, align 8, !tbaa !5
%add = add nsw i64 %8, %count.022
%inc7 = add nuw nsw i64 %i.121, 1
%exitcond.not = icmp eq i64 %inc7, %7
br i1 %exitcond.not, label %for.end8, label %for.body4, !llvm.loop !14
for.end8: ; preds = %for.body4, %middle.block, %entry, %for.cond2.preheader
%count.0.lcssa = phi i64 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %6, %middle.block ], [ %add, %for.body4 ]
%9 = load i64, ptr %H, align 8, !tbaa !5
%cmp9.not = icmp slt i64 %count.0.lcssa, %9
%.str.3..str.2 = select i1 %cmp9.not, ptr @.str.3, ptr @.str.2
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
int main(void)
{
int t;
scanf("%d", &t);
while (t--)
{
int n;
scanf("%d", &n);
// Every cat has to move atleast one place
if (n % 2 == 0)
{
for (int i = 1; i < n; i = i + 2)
printf("%d %d ", i + 1, i);
}
else
{
for (int i = 1; i < n - 3; i+=2)
printf("%d %d ", i + 1, i);
printf("%d %d %d", n, n-2, n-1);
}
printf("\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26891/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26891/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d \00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec30 = add nsw i32 %0, -1
store i32 %dec30, ptr %t, align 4, !tbaa !5
%tobool.not31 = icmp eq i32 %0, 0
br i1 %tobool.not31, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = and i32 %1, 1
%cmp = icmp eq i32 %2, 0
br i1 %cmp, label %for.cond.preheader, label %for.cond6.preheader
for.cond6.preheader: ; preds = %while.body
%cmp726 = icmp sgt i32 %1, 4
br i1 %cmp726, label %for.body9, label %for.cond.cleanup8
for.cond.preheader: ; preds = %while.body
%cmp228 = icmp sgt i32 %1, 1
br i1 %cmp228, label %for.body, label %if.end
for.body: ; preds = %for.cond.preheader, %for.body
%i.029 = phi i32 [ %add4, %for.body ], [ 1, %for.cond.preheader ]
%add = add nuw nsw i32 %i.029, 1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add, i32 noundef %i.029)
%add4 = add nuw nsw i32 %i.029, 2
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp slt i32 %add4, %3
br i1 %cmp2, label %for.body, label %if.end, !llvm.loop !9
for.cond.cleanup8: ; preds = %for.body9, %for.cond6.preheader
%.lcssa = phi i32 [ %1, %for.cond6.preheader ], [ %4, %for.body9 ]
%sub15 = add nsw i32 %.lcssa, -2
%sub16 = add nsw i32 %.lcssa, -1
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.lcssa, i32 noundef %sub15, i32 noundef %sub16)
br label %if.end
for.body9: ; preds = %for.cond6.preheader, %for.body9
%i5.027 = phi i32 [ %add13, %for.body9 ], [ 1, %for.cond6.preheader ]
%add10 = add nuw nsw i32 %i5.027, 1
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add10, i32 noundef %i5.027)
%add13 = add nuw nsw i32 %i5.027, 2
%4 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %4, -3
%cmp7 = icmp slt i32 %add13, %sub
br i1 %cmp7, label %for.body9, label %for.cond.cleanup8, !llvm.loop !11
if.end: ; preds = %for.body, %for.cond.preheader, %for.cond.cleanup8
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
%5 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %5, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %5, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
//#define MOD (int)(1e5 + 7)
#define MOD (100007)
void invalid(void)
{
printf("-1\n");
exit(0);
}
static inline int *readNint(int n)
{
int *a = calloc(sizeof(int), n);
for (int i = 0; i < n; i++)
scanf("%d", &a[i]);
return a;
}
static inline int comp(const void *a, const void *b)
{
return *(int *)a < *(int *)b;
}
int main(int argc, char **argv)
{
int H, N;
scanf("%d%d", &H, &N);
int *A = readNint(N);
//qsort(A, N, sizeof(int), comp);
int t = 0;
for (int i = 0; i < N; i++)
t += A[i];
if (t >= H)
printf("Yes\n");
else
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268960/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268960/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
@str.5 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: noreturn nounwind uwtable
define dso_local void @invalid() local_unnamed_addr #0 {
entry:
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
tail call void @exit(i32 noundef 0) #8
unreachable
}
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 {
entry:
%H = alloca i32, align 4
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %H, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%conv.i = sext i32 %0 to i64
%call.i = call noalias ptr @calloc(i64 noundef 4, i64 noundef %conv.i) #10
%cmp7.i = icmp sgt i32 %0, 0
br i1 %cmp7.i, label %for.body.preheader.i, label %for.cond.cleanup
for.body.preheader.i: ; preds = %entry
%wide.trip.count.i = zext i32 %0 to i64
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.i
%call2.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef %arrayidx.i)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %readNint.exit, label %for.body.i, !llvm.loop !9
readNint.exit: ; preds = %for.body.i
%.pre = load i32, ptr %N, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %.pre, 0
br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %readNint.exit
%wide.trip.count = zext i32 %.pre to i64
%min.iters.check = icmp ult i32 %.pre, 8
br i1 %min.iters.check, label %for.body.preheader16, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi14 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds i32, ptr %call.i, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 4, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load15 = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = add <4 x i32> %wide.load, %vec.phi
%4 = add <4 x i32> %wide.load15, %vec.phi14
%index.next = add nuw i64 %index, 8
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %4, %3
%6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader16
for.body.preheader16: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%t.010.ph = phi i32 [ 0, %for.body.preheader ], [ %6, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry, %readNint.exit
%t.0.lcssa = phi i32 [ 0, %readNint.exit ], [ 0, %entry ], [ %6, %middle.block ], [ %add, %for.body ]
%7 = load i32, ptr %H, align 4, !tbaa !5
%cmp2.not = icmp slt i32 %t.0.lcssa, %7
%str.5.str.6 = select i1 %cmp2.not, ptr @str.5, ptr @str.6
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.str.6)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #9
ret i32 0
for.body: ; preds = %for.body.preheader16, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader16 ]
%t.010 = phi i32 [ %add, %for.body ], [ %t.010.ph, %for.body.preheader16 ]
%arrayidx = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv
%8 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %8, %t.010
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #7
attributes #0 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0,1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include <stdio.h>
int main(void) {
int l,m,n,i,y;
while(scanf("%d",&l),l!=0){
y=1;
for(i=1;i<=12;i++){
scanf("%d%d",&m,&n);
l-=m-n;
if(l<=0&&y==1){
printf("%d\n",i);
y=0;
}
}
if(y) printf("NA\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269002/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269002/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NA\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%l = alloca i32, align 4
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l)
%0 = load i32, ptr %l, align 4, !tbaa !5
%cmp.not16 = icmp eq i32 %0, 0
br i1 %cmp.not16, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end9
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%1 = load i32, ptr %m, align 4, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg = sub i32 %2, %1
%3 = load i32, ptr %l, align 4, !tbaa !5
%sub3 = add i32 %sub.neg, %3
store i32 %sub3, ptr %l, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %sub3, 0
br i1 %cmp4, label %for.inc, label %if.then
if.then: ; preds = %for.cond.preheader
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
br label %for.inc
for.inc: ; preds = %for.cond.preheader, %if.then
%y.1 = phi i32 [ 0, %if.then ], [ 1, %for.cond.preheader ]
%call2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%4 = load i32, ptr %m, align 4, !tbaa !5
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.1 = sub i32 %5, %4
%6 = load i32, ptr %l, align 4, !tbaa !5
%sub3.1 = add i32 %sub.neg.1, %6
store i32 %sub3.1, ptr %l, align 4, !tbaa !5
%cmp4.1 = icmp slt i32 %sub3.1, 1
%or.cond.1 = and i1 %cmp4.1, %cmp4
br i1 %or.cond.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%call6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2)
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%y.1.1 = phi i32 [ 0, %if.then.1 ], [ %y.1, %for.inc ]
%call2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%7 = load i32, ptr %m, align 4, !tbaa !5
%8 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.2 = sub i32 %8, %7
%9 = load i32, ptr %l, align 4, !tbaa !5
%sub3.2 = add i32 %sub.neg.2, %9
store i32 %sub3.2, ptr %l, align 4, !tbaa !5
%cmp4.2 = icmp slt i32 %sub3.2, 1
%cmp5.2 = icmp eq i32 %y.1.1, 1
%or.cond.2 = and i1 %cmp4.2, %cmp5.2
br i1 %or.cond.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
%call6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3)
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%y.1.2 = phi i32 [ 0, %if.then.2 ], [ %y.1.1, %for.inc.1 ]
%call2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%10 = load i32, ptr %m, align 4, !tbaa !5
%11 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.3 = sub i32 %11, %10
%12 = load i32, ptr %l, align 4, !tbaa !5
%sub3.3 = add i32 %sub.neg.3, %12
store i32 %sub3.3, ptr %l, align 4, !tbaa !5
%cmp4.3 = icmp slt i32 %sub3.3, 1
%cmp5.3 = icmp eq i32 %y.1.2, 1
%or.cond.3 = and i1 %cmp4.3, %cmp5.3
br i1 %or.cond.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
%call6.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4)
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%y.1.3 = phi i32 [ 0, %if.then.3 ], [ %y.1.2, %for.inc.2 ]
%call2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%13 = load i32, ptr %m, align 4, !tbaa !5
%14 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.4 = sub i32 %14, %13
%15 = load i32, ptr %l, align 4, !tbaa !5
%sub3.4 = add i32 %sub.neg.4, %15
store i32 %sub3.4, ptr %l, align 4, !tbaa !5
%cmp4.4 = icmp slt i32 %sub3.4, 1
%cmp5.4 = icmp eq i32 %y.1.3, 1
%or.cond.4 = and i1 %cmp4.4, %cmp5.4
br i1 %or.cond.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
%call6.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 5)
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%y.1.4 = phi i32 [ 0, %if.then.4 ], [ %y.1.3, %for.inc.3 ]
%call2.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%16 = load i32, ptr %m, align 4, !tbaa !5
%17 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.5 = sub i32 %17, %16
%18 = load i32, ptr %l, align 4, !tbaa !5
%sub3.5 = add i32 %sub.neg.5, %18
store i32 %sub3.5, ptr %l, align 4, !tbaa !5
%cmp4.5 = icmp slt i32 %sub3.5, 1
%cmp5.5 = icmp eq i32 %y.1.4, 1
%or.cond.5 = and i1 %cmp4.5, %cmp5.5
br i1 %or.cond.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
%call6.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 6)
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%y.1.5 = phi i32 [ 0, %if.then.5 ], [ %y.1.4, %for.inc.4 ]
%call2.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%19 = load i32, ptr %m, align 4, !tbaa !5
%20 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.6 = sub i32 %20, %19
%21 = load i32, ptr %l, align 4, !tbaa !5
%sub3.6 = add i32 %sub.neg.6, %21
store i32 %sub3.6, ptr %l, align 4, !tbaa !5
%cmp4.6 = icmp slt i32 %sub3.6, 1
%cmp5.6 = icmp eq i32 %y.1.5, 1
%or.cond.6 = and i1 %cmp4.6, %cmp5.6
br i1 %or.cond.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
%call6.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 7)
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %for.inc.5
%y.1.6 = phi i32 [ 0, %if.then.6 ], [ %y.1.5, %for.inc.5 ]
%call2.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%22 = load i32, ptr %m, align 4, !tbaa !5
%23 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.7 = sub i32 %23, %22
%24 = load i32, ptr %l, align 4, !tbaa !5
%sub3.7 = add i32 %sub.neg.7, %24
store i32 %sub3.7, ptr %l, align 4, !tbaa !5
%cmp4.7 = icmp slt i32 %sub3.7, 1
%cmp5.7 = icmp eq i32 %y.1.6, 1
%or.cond.7 = select i1 %cmp4.7, i1 %cmp5.7, i1 false
br i1 %or.cond.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
%call6.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 8)
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%y.1.7 = phi i32 [ 0, %if.then.7 ], [ %y.1.6, %for.inc.6 ]
%call2.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%25 = load i32, ptr %m, align 4, !tbaa !5
%26 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.8 = sub i32 %26, %25
%27 = load i32, ptr %l, align 4, !tbaa !5
%sub3.8 = add i32 %sub.neg.8, %27
store i32 %sub3.8, ptr %l, align 4, !tbaa !5
%cmp4.8 = icmp slt i32 %sub3.8, 1
%cmp5.8 = icmp eq i32 %y.1.7, 1
%or.cond.8 = select i1 %cmp4.8, i1 %cmp5.8, i1 false
br i1 %or.cond.8, label %if.then.8, label %for.inc.8
if.then.8: ; preds = %for.inc.7
%call6.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 9)
br label %for.inc.8
for.inc.8: ; preds = %if.then.8, %for.inc.7
%y.1.8 = phi i32 [ 0, %if.then.8 ], [ %y.1.7, %for.inc.7 ]
%call2.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%28 = load i32, ptr %m, align 4, !tbaa !5
%29 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.9 = sub i32 %29, %28
%30 = load i32, ptr %l, align 4, !tbaa !5
%sub3.9 = add i32 %sub.neg.9, %30
store i32 %sub3.9, ptr %l, align 4, !tbaa !5
%cmp4.9 = icmp slt i32 %sub3.9, 1
%cmp5.9 = icmp eq i32 %y.1.8, 1
%or.cond.9 = select i1 %cmp4.9, i1 %cmp5.9, i1 false
br i1 %or.cond.9, label %if.then.9, label %for.inc.9
if.then.9: ; preds = %for.inc.8
%call6.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 10)
br label %for.inc.9
for.inc.9: ; preds = %if.then.9, %for.inc.8
%y.1.9 = phi i32 [ 0, %if.then.9 ], [ %y.1.8, %for.inc.8 ]
%call2.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%31 = load i32, ptr %m, align 4, !tbaa !5
%32 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.10 = sub i32 %32, %31
%33 = load i32, ptr %l, align 4, !tbaa !5
%sub3.10 = add i32 %sub.neg.10, %33
store i32 %sub3.10, ptr %l, align 4, !tbaa !5
%cmp4.10 = icmp slt i32 %sub3.10, 1
%cmp5.10 = icmp eq i32 %y.1.9, 1
%or.cond.10 = select i1 %cmp4.10, i1 %cmp5.10, i1 false
br i1 %or.cond.10, label %if.then.10, label %for.inc.10
if.then.10: ; preds = %for.inc.9
%call6.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 11)
br label %for.inc.10
for.inc.10: ; preds = %if.then.10, %for.inc.9
%y.1.10 = phi i32 [ 0, %if.then.10 ], [ %y.1.9, %for.inc.9 ]
%call2.11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%34 = load i32, ptr %m, align 4, !tbaa !5
%35 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg.11 = sub i32 %35, %34
%36 = load i32, ptr %l, align 4, !tbaa !5
%sub3.11 = add i32 %sub.neg.11, %36
store i32 %sub3.11, ptr %l, align 4, !tbaa !5
%cmp4.11 = icmp slt i32 %sub3.11, 1
%cmp5.11 = icmp eq i32 %y.1.10, 1
%or.cond.11 = select i1 %cmp4.11, i1 %cmp5.11, i1 false
br i1 %or.cond.11, label %for.inc.11.thread, label %for.inc.11
for.inc.11.thread: ; preds = %for.inc.10
%call6.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 12)
br label %if.end9
for.inc.11: ; preds = %for.inc.10
%tobool.not = icmp eq i32 %y.1.10, 0
br i1 %tobool.not, label %if.end9, label %if.then7
if.then7: ; preds = %for.inc.11
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end9
if.end9: ; preds = %for.inc.11.thread, %if.then7, %for.inc.11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l)
%37 = load i32, ptr %l, align 4, !tbaa !5
%cmp.not = icmp eq i32 %37, 0
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !9
while.end: ; preds = %if.end9, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int cost;
int in,out;
int money;
int month;
int i, over;
while(1){
scanf("%d", &cost);
if(cost==0){
break;
}
money=0;
over=0;
for(i=0; i<12; i++){
scanf("%d %d", &in, &out);
money+=(in-out);
if(money>=cost){
over++;
}
}
month=i-(over-1);
if(month>12){
printf("NA\n");
}
else{
printf("%d\n", month);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269068/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269068/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NA\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%cost = alloca i32, align 4
%in = alloca i32, align 4
%out = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %cost) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %in) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %out) #4
%call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %cost)
%0 = load i32, ptr %cost, align 4, !tbaa !5
%cmp23 = icmp eq i32 %0, 0
br i1 %cmp23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end13
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%1 = load i32, ptr %in, align 4, !tbaa !5
%2 = load i32, ptr %out, align 4, !tbaa !5
%sub = sub nsw i32 %1, %2
%3 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not = icmp sge i32 %sub, %3
%inc.neg = sext i1 %cmp3.not to i32
%call2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%4 = load i32, ptr %in, align 4, !tbaa !5
%5 = load i32, ptr %out, align 4, !tbaa !5
%sub.1 = sub nsw i32 %4, %5
%add.1 = add nsw i32 %sub.1, %sub
%6 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.1 = icmp sge i32 %add.1, %6
%inc.1.neg = sext i1 %cmp3.not.1 to i32
%spec.select.1.neg = add nsw i32 %inc.neg, %inc.1.neg
%call2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%7 = load i32, ptr %in, align 4, !tbaa !5
%8 = load i32, ptr %out, align 4, !tbaa !5
%sub.2 = sub nsw i32 %7, %8
%add.2 = add nsw i32 %sub.2, %add.1
%9 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.2 = icmp sge i32 %add.2, %9
%inc.2.neg = sext i1 %cmp3.not.2 to i32
%spec.select.2.neg = add nsw i32 %spec.select.1.neg, %inc.2.neg
%call2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%10 = load i32, ptr %in, align 4, !tbaa !5
%11 = load i32, ptr %out, align 4, !tbaa !5
%sub.3 = sub nsw i32 %10, %11
%add.3 = add nsw i32 %sub.3, %add.2
%12 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.3 = icmp sge i32 %add.3, %12
%inc.3.neg = sext i1 %cmp3.not.3 to i32
%spec.select.3.neg = add nsw i32 %spec.select.2.neg, %inc.3.neg
%call2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%13 = load i32, ptr %in, align 4, !tbaa !5
%14 = load i32, ptr %out, align 4, !tbaa !5
%sub.4 = sub nsw i32 %13, %14
%add.4 = add nsw i32 %sub.4, %add.3
%15 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.4 = icmp sge i32 %add.4, %15
%inc.4.neg = sext i1 %cmp3.not.4 to i32
%spec.select.4.neg = add nsw i32 %spec.select.3.neg, %inc.4.neg
%call2.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%16 = load i32, ptr %in, align 4, !tbaa !5
%17 = load i32, ptr %out, align 4, !tbaa !5
%sub.5 = sub nsw i32 %16, %17
%add.5 = add nsw i32 %sub.5, %add.4
%18 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.5 = icmp sge i32 %add.5, %18
%inc.5.neg = sext i1 %cmp3.not.5 to i32
%spec.select.5.neg = add nsw i32 %spec.select.4.neg, %inc.5.neg
%call2.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%19 = load i32, ptr %in, align 4, !tbaa !5
%20 = load i32, ptr %out, align 4, !tbaa !5
%sub.6 = sub nsw i32 %19, %20
%add.6 = add nsw i32 %sub.6, %add.5
%21 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.6 = icmp sge i32 %add.6, %21
%inc.6.neg = sext i1 %cmp3.not.6 to i32
%spec.select.6.neg = add nsw i32 %spec.select.5.neg, %inc.6.neg
%call2.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%22 = load i32, ptr %in, align 4, !tbaa !5
%23 = load i32, ptr %out, align 4, !tbaa !5
%sub.7 = sub nsw i32 %22, %23
%add.7 = add nsw i32 %sub.7, %add.6
%24 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.7 = icmp sge i32 %add.7, %24
%inc.7.neg = sext i1 %cmp3.not.7 to i32
%spec.select.7.neg = add nsw i32 %spec.select.6.neg, %inc.7.neg
%call2.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%25 = load i32, ptr %in, align 4, !tbaa !5
%26 = load i32, ptr %out, align 4, !tbaa !5
%sub.8 = sub nsw i32 %25, %26
%add.8 = add nsw i32 %sub.8, %add.7
%27 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.8 = icmp sge i32 %add.8, %27
%inc.8.neg = sext i1 %cmp3.not.8 to i32
%spec.select.8.neg = add nsw i32 %spec.select.7.neg, %inc.8.neg
%call2.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%28 = load i32, ptr %in, align 4, !tbaa !5
%29 = load i32, ptr %out, align 4, !tbaa !5
%sub.9 = sub nsw i32 %28, %29
%add.9 = add nsw i32 %sub.9, %add.8
%30 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.9 = icmp sge i32 %add.9, %30
%inc.9.neg = sext i1 %cmp3.not.9 to i32
%spec.select.9.neg = add nsw i32 %spec.select.8.neg, %inc.9.neg
%call2.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%31 = load i32, ptr %in, align 4, !tbaa !5
%32 = load i32, ptr %out, align 4, !tbaa !5
%sub.10 = sub nsw i32 %31, %32
%add.10 = add nsw i32 %sub.10, %add.9
%33 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.10 = icmp sge i32 %add.10, %33
%inc.10.neg = sext i1 %cmp3.not.10 to i32
%spec.select.10.neg = add nsw i32 %spec.select.9.neg, %inc.10.neg
%call2.11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%34 = load i32, ptr %in, align 4, !tbaa !5
%35 = load i32, ptr %out, align 4, !tbaa !5
%sub.11 = sub nsw i32 %34, %35
%add.11 = add nsw i32 %sub.11, %add.10
%36 = load i32, ptr %cost, align 4, !tbaa !5
%cmp3.not.11 = icmp sge i32 %add.11, %36
%inc.11.neg = sext i1 %cmp3.not.11 to i32
%spec.select.11.neg = add nsw i32 %spec.select.10.neg, %inc.11.neg
%cmp9 = icmp ult i32 %spec.select.11.neg, 2147483635
br i1 %cmp9, label %if.then10, label %if.else
if.then10: ; preds = %for.cond.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end13
if.else: ; preds = %for.cond.preheader
%sub8 = add nsw i32 %spec.select.11.neg, 13
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub8)
br label %if.end13
if.end13: ; preds = %if.else, %if.then10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %cost)
%37 = load i32, ptr %cost, align 4, !tbaa !5
%cmp = icmp eq i32 %37, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end13, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %out) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %in) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %cost) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int d,c,sum;
scanf("%d %d",&d,&c);
sum=c*d;
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269118/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269118/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %c)
%0 = load i32, ptr %c, align 4, !tbaa !5
%1 = load i32, ptr %d, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int a,b;
scanf("%d %d",&a,&b);
printf("%d\n",a*b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269169/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269169/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int d,c;
scanf("%d%d",&d,&c);
printf("%d\n",d*c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269211/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269211/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %c)
%0 = load i32, ptr %d, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int d,c,a;
scanf("%d %d",&d,&c);
a=d*c;
printf("%d\n",a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269255/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269255/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %c)
%0 = load i32, ptr %d, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#include <time.h>
#include <ctype.h>
int cmp(const void *a, const void *b) { return *(int*)a - *(int*)b; }
int max(int a, int b) { return a >= b ? a : b; }
int min(int a, int b) { return a <= b ? a : b; }
int dsum(int x) { int r=0; while(x){ r+=(x%10); x/=10; } return r;}
void swap(int *a, int *b) { int tmp; tmp = *a; *a = *b; *b = tmp; return; }
int main(void) {
int a,b;
scanf("%d%d",&a,&b);
printf("%d\n",a*b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269299/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269299/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i32 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.05, 10
%add = add nsw i32 %r.06, %rem
%div = sdiv i32 %x.addr.05, 10
%x.addr.05.off = add i32 %x.addr.05, 9
%tobool.not = icmp ult i32 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define MODSIZE 2019
int cnt[2026];
int main(){
char s[200005];
int n,i,j;
char t;
int x = 1;
int tot = 0;
long long ans = 0;
scanf("%s", s);
n = strlen(s);
for(i = 0;i <= 2020;i++) cnt[i] = 0;
for(i = 0,j = n - 1;i < n/2;i++,j--){
t = s[i]; s[i] = s[j]; s[j] = t;
}
for(i = 0;i < n;i++){
cnt[tot]++;
tot += (s[i] - '0')*x;
tot %= MODSIZE;
ans += cnt[tot];
x = x*10 % MODSIZE;
}
printf("%lld\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269341/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269341/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@cnt = dso_local local_unnamed_addr global [2026 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [200005 x i8], align 16
call void @llvm.lifetime.start.p0(i64 200005, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8084) @cnt, i8 0, i64 8084, i1 false), !tbaa !5
%conv = trunc i64 %call2 to i32
%cmp559 = icmp sgt i32 %conv, 1
br i1 %cmp559, label %for.body7.preheader, label %for.cond19.preheader
for.body7.preheader: ; preds = %entry
%div7879 = lshr i64 %call2, 1
%sext = shl i64 %call2, 32
%0 = ashr exact i64 %sext, 32
%wide.trip.count = and i64 %div7879, 2147483647
%xtraiter = and i64 %div7879, 1
%1 = icmp eq i64 %wide.trip.count, 1
br i1 %1, label %for.cond19.preheader.loopexit.unr-lcssa, label %for.body7.preheader.new
for.body7.preheader.new: ; preds = %for.body7.preheader
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body7
for.cond19.preheader.loopexit.unr-lcssa: ; preds = %for.body7, %for.body7.preheader
%indvars.iv68.unr = phi i64 [ %0, %for.body7.preheader ], [ %indvars.iv.next69.1, %for.body7 ]
%indvars.iv.unr = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next.1, %for.body7 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond19.preheader, label %for.body7.epil
for.body7.epil: ; preds = %for.cond19.preheader.loopexit.unr-lcssa
%indvars.iv.next69.epil = add nsw i64 %indvars.iv68.unr, -1
%arrayidx9.epil = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%2 = load i8, ptr %arrayidx9.epil, align 1, !tbaa !9
%arrayidx11.epil = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv.next69.epil
%3 = load i8, ptr %arrayidx11.epil, align 1, !tbaa !9
store i8 %3, ptr %arrayidx9.epil, align 1, !tbaa !9
store i8 %2, ptr %arrayidx11.epil, align 1, !tbaa !9
br label %for.cond19.preheader
for.cond19.preheader: ; preds = %for.body7.epil, %for.cond19.preheader.loopexit.unr-lcssa, %entry
%cmp2062 = icmp sgt i32 %conv, 0
br i1 %cmp2062, label %for.body22.preheader, label %for.end38
for.body22.preheader: ; preds = %for.cond19.preheader
%wide.trip.count76 = and i64 %call2, 4294967295
br label %for.body22
for.body7: ; preds = %for.body7, %for.body7.preheader.new
%indvars.iv68 = phi i64 [ %0, %for.body7.preheader.new ], [ %indvars.iv.next69.1, %for.body7 ]
%indvars.iv = phi i64 [ 0, %for.body7.preheader.new ], [ %indvars.iv.next.1, %for.body7 ]
%niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.1, %for.body7 ]
%indvars.iv.next69 = add nsw i64 %indvars.iv68, -1
%arrayidx9 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv
%4 = load i8, ptr %arrayidx9, align 2, !tbaa !9
%arrayidx11 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv.next69
%5 = load i8, ptr %arrayidx11, align 1, !tbaa !9
store i8 %5, ptr %arrayidx9, align 2, !tbaa !9
store i8 %4, ptr %arrayidx11, align 1, !tbaa !9
%indvars.iv.next = or i64 %indvars.iv, 1
%indvars.iv.next69.1 = add nsw i64 %indvars.iv68, -2
%arrayidx9.1 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%6 = load i8, ptr %arrayidx9.1, align 1, !tbaa !9
%arrayidx11.1 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv.next69.1
%7 = load i8, ptr %arrayidx11.1, align 1, !tbaa !9
store i8 %7, ptr %arrayidx9.1, align 1, !tbaa !9
store i8 %6, ptr %arrayidx11.1, align 1, !tbaa !9
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond19.preheader.loopexit.unr-lcssa, label %for.body7, !llvm.loop !10
for.body22: ; preds = %for.body22.preheader, %for.body22
%8 = phi i32 [ 0, %for.body22.preheader ], [ %10, %for.body22 ]
%indvars.iv73 = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next74, %for.body22 ]
%ans.066 = phi i64 [ 0, %for.body22.preheader ], [ %add33, %for.body22 ]
%tot.065 = phi i32 [ 0, %for.body22.preheader ], [ %rem, %for.body22 ]
%x.064 = phi i32 [ 1, %for.body22.preheader ], [ %rem35, %for.body22 ]
%idxprom23 = sext i32 %tot.065 to i64
%arrayidx24 = getelementptr inbounds [2026 x i32], ptr @cnt, i64 0, i64 %idxprom23
%inc25 = add nsw i32 %8, 1
store i32 %inc25, ptr %arrayidx24, align 4, !tbaa !5
%arrayidx27 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv73
%9 = load i8, ptr %arrayidx27, align 1, !tbaa !9
%conv28 = sext i8 %9 to i32
%sub29 = add nsw i32 %conv28, -48
%mul = mul nsw i32 %sub29, %x.064
%add = add nsw i32 %mul, %tot.065
%rem = srem i32 %add, 2019
%idxprom30 = sext i32 %rem to i64
%arrayidx31 = getelementptr inbounds [2026 x i32], ptr @cnt, i64 0, i64 %idxprom30
%10 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%conv32 = sext i32 %10 to i64
%add33 = add nsw i64 %ans.066, %conv32
%mul34 = mul nsw i32 %x.064, 10
%rem35 = srem i32 %mul34, 2019
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%exitcond77.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count76
br i1 %exitcond77.not, label %for.end38, label %for.body22, !llvm.loop !12
for.end38: ; preds = %for.body22, %for.cond19.preheader
%ans.0.lcssa = phi i64 [ 0, %for.cond19.preheader ], [ %add33, %for.body22 ]
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 200005, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
#define MAX 100000
#define SENTINEL 2000000000
struct Card {
char suit;
int value;
};
struct Card L[MAX / 2 + 2], R[MAX / 2 + 2];
void merge(struct Card A[], int n, int left, int mid, int right) {
int i, j, k;
int n1 = mid - left;
int n2 = right - mid;
for ( i = 0; i < n1; i++ ) L[i] = A[left + i];
for ( i = 0; i < n2; i++ ) R[i] = A[mid + i];
L[n1].value = R[n2].value = SENTINEL;
i = j = 0;
for ( k = left; k < right; k++ ) {
if ( L[i].value <= R[j].value ) {
A[k] = L[i++];
} else {
A[k]=R[j++];
}
}
}
void mergeSort(struct Card A[], int n, int left, int right) {
int mid;
if( left+ 1<right){
mid = (left + right) /2;
mergeSort(A, n, left, mid);
mergeSort(A, n, mid, right);
merge(A, n, left, mid, right);
}
}
int partition(struct Card A[], int n, int p, int r){
int i, j;
struct Card t, x;
x = A[r];
i = p - 1;
for ( j = p; j < r; j++ ) {
if ( A[j].value <= x.value ) {
i++;
t = A[i];
A[i] = A[j];
A[j] = t;
}
}
t = A[i + 1];
A[i + 1] = A[r];
A[r] = t;
return i + 1;
}
void quickSort(struct Card A[], int n, int p, int r) {
int q;
if ( p < r ) {
q = partition(A, n, p, r);
quickSort(A, n, p, q - 1);
quickSort(A, n, q + 1, r);
}
}
int main(){
int n, i, v;
struct Card A[MAX],B[MAX];
char S[10];
int stable=1;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf("%s%d", S, &v);
A[i].suit = B[i].suit= S[0];
A[i].value = B[i].value =v;
}
mergeSort(A, n, 0, n);
quickSort(B, n, 0, n-1);
for(i=0; i<n; i++){
// マージソートとクイックソートの結果を比べる
if(A[i].suit != B[i].suit) stable=0;
}
if(stable ==1) printf("Stable\n");
else printf("Not stable\n");
for(i=0; i<n; i++){
printf("%c %d\n", B[i].suit, B[i].value);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269392/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269392/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Card = type { i8, i32 }
@L = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%A89 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp66 = icmp sgt i32 %sub, 0
br i1 %cmp66, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader107, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A89
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader107, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load90 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load90, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !5
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader107
for.body.preheader107: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader107, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader107 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader107 ]
%arrayidx.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !9
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader107
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader107 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp568 = icmp sgt i32 %sub1, 0
br i1 %cmp568, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count80 = zext i32 %sub1 to i64
%invariant.gep87 = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check95 = icmp ult i32 %sub1, 10
br i1 %min.iters.check95, label %for.body6.preheader106, label %vector.memcheck91
vector.memcheck91: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A89
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check92 = icmp ult i64 %16, 32
br i1 %diff.check92, label %for.body6.preheader106, label %vector.ph96
vector.ph96: ; preds = %vector.memcheck91
%n.vec98 = and i64 %wide.trip.count80, 4294967292
br label %vector.body101
vector.body101: ; preds = %vector.body101, %vector.ph96
%index102 = phi i64 [ 0, %vector.ph96 ], [ %index.next105, %vector.body101 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index102
%18 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %index102
%wide.load103 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load104 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load103, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load104, ptr %20, align 16
%index.next105 = add nuw i64 %index102, 4
%21 = icmp eq i64 %index.next105, %n.vec98
br i1 %21, label %middle.block93, label %vector.body101, !llvm.loop !11
middle.block93: ; preds = %vector.body101
%cmp.n100 = icmp eq i64 %n.vec98, %wide.trip.count80
br i1 %cmp.n100, label %for.end14, label %for.body6.preheader106
for.body6.preheader106: ; preds = %vector.memcheck91, %for.body6.preheader, %middle.block93
%indvars.iv76.ph = phi i64 [ 0, %vector.memcheck91 ], [ 0, %for.body6.preheader ], [ %n.vec98, %middle.block93 ]
%22 = xor i64 %indvars.iv76.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80
%xtraiter108 = and i64 %wide.trip.count80, 3
%lcmp.mod109.not = icmp eq i64 %xtraiter108, 0
br i1 %lcmp.mod109.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader106, %for.body6.prol
%indvars.iv76.prol = phi i64 [ %indvars.iv.next77.prol, %for.body6.prol ], [ %indvars.iv76.ph, %for.body6.preheader106 ]
%prol.iter110 = phi i64 [ %prol.iter110.next, %for.body6.prol ], [ 0, %for.body6.preheader106 ]
%arrayidx8.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.prol
%gep88.prol = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv76.prol
%24 = load i64, ptr %gep88.prol, align 4
store i64 %24, ptr %arrayidx8.prol, align 8
%indvars.iv.next77.prol = add nuw nsw i64 %indvars.iv76.prol, 1
%prol.iter110.next = add i64 %prol.iter110, 1
%prol.iter110.cmp.not = icmp eq i64 %prol.iter110.next, %xtraiter108
br i1 %prol.iter110.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !12
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader106
%indvars.iv76.unr = phi i64 [ %indvars.iv76.ph, %for.body6.preheader106 ], [ %indvars.iv.next77.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !13
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv76 = phi i64 [ %indvars.iv.next77.3, %for.body6 ], [ %indvars.iv76.unr, %for.body6.prol.loopexit ]
%arrayidx8 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76
%gep88 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv76
%30 = load i64, ptr %gep88, align 4
store i64 %30, ptr %arrayidx8, align 8
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%arrayidx8.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77
%gep88.1 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77
%31 = load i64, ptr %gep88.1, align 4
store i64 %31, ptr %arrayidx8.1, align 8
%indvars.iv.next77.1 = add nuw nsw i64 %indvars.iv76, 2
%arrayidx8.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.1
%gep88.2 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77.1
%32 = load i64, ptr %gep88.2, align 4
store i64 %32, ptr %arrayidx8.2, align 8
%indvars.iv.next77.2 = add nuw nsw i64 %indvars.iv76, 3
%arrayidx8.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.2
%gep88.3 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77.2
%33 = load i64, ptr %gep88.3, align 4
store i64 %33, ptr %arrayidx8.3, align 8
%indvars.iv.next77.3 = add nuw nsw i64 %indvars.iv76, 4
%exitcond81.not.3 = icmp eq i64 %indvars.iv.next77.3, %wide.trip.count80
br i1 %exitcond81.not.3, label %for.end14, label %for.body6, !llvm.loop !14
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block93, %for.cond4.preheader
%idxprom15 = sext i32 %sub1 to i64
%value = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom15, i32 1
store i32 2000000000, ptr %value, align 4, !tbaa !15
%idxprom17 = sext i32 %sub to i64
%value19 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17, i32 1
store i32 2000000000, ptr %value19, align 4, !tbaa !15
%cmp2170 = icmp slt i32 %left, %right
br i1 %cmp2170, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count85 = sext i32 %right to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv82 = phi i64 [ %34, %for.body22.preheader ], [ %indvars.iv.next83, %for.body22 ]
%i.273 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%j.072 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%idxprom23 = zext i32 %i.273 to i64
%value25 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23, i32 1
%35 = load i32, ptr %value25, align 4, !tbaa !15
%idxprom26 = zext i32 %j.072 to i64
%value28 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26, i32 1
%36 = load i32, ptr %value28, align 4, !tbaa !15
%cmp29.not = icmp sgt i32 %35, %36
%arrayidx27 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx27, ptr %arrayidx24
%inc37 = zext i1 %cmp29.not to i32
%j.1 = add nuw nsw i32 %j.072, %inc37
%not.cmp29.not = xor i1 %cmp29.not, true
%inc32 = zext i1 %not.cmp29.not to i32
%i.3 = add nuw nsw i32 %i.273, %inc32
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv82
store i64 %.sink, ptr %37, align 4
%indvars.iv.next83 = add nsw i64 %indvars.iv82, 1
%exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
br i1 %exitcond86.not, label %for.end42, label %for.body22, !llvm.loop !20
for.end42: ; preds = %for.body22, %for.end14
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 {
entry:
%A14 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp66.i = icmp sgt i32 %sub.i, 0
br i1 %cmp66.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A14
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load15 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load15, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp568.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp568.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count80.i = zext i32 %sub1.i to i64
%invariant.gep87.i = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check20 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check20, label %for.body6.i.preheader, label %vector.memcheck16
vector.memcheck16: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A14
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check17 = icmp ult i64 %16, 32
br i1 %diff.check17, label %for.body6.i.preheader, label %vector.ph21
vector.ph21: ; preds = %vector.memcheck16
%n.vec23 = and i64 %wide.trip.count80.i, 4294967292
br label %vector.body26
vector.body26: ; preds = %vector.body26, %vector.ph21
%index27 = phi i64 [ 0, %vector.ph21 ], [ %index.next30, %vector.body26 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index27
%18 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %index27
%wide.load28 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load29 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load28, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load29, ptr %20, align 16
%index.next30 = add nuw i64 %index27, 4
%21 = icmp eq i64 %index.next30, %n.vec23
br i1 %21, label %middle.block18, label %vector.body26, !llvm.loop !23
middle.block18: ; preds = %vector.body26
%cmp.n25 = icmp eq i64 %n.vec23, %wide.trip.count80.i
br i1 %cmp.n25, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck16, %for.body6.preheader.i, %middle.block18
%indvars.iv76.i.ph = phi i64 [ 0, %vector.memcheck16 ], [ 0, %for.body6.preheader.i ], [ %n.vec23, %middle.block18 ]
%22 = xor i64 %indvars.iv76.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80.i
%xtraiter31 = and i64 %wide.trip.count80.i, 3
%lcmp.mod32.not = icmp eq i64 %xtraiter31, 0
br i1 %lcmp.mod32.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv76.i.prol = phi i64 [ %indvars.iv.next77.i.prol, %for.body6.i.prol ], [ %indvars.iv76.i.ph, %for.body6.i.preheader ]
%prol.iter33 = phi i64 [ %prol.iter33.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%arrayidx8.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.i.prol
%gep88.i.prol = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv76.i.prol
%24 = load i64, ptr %gep88.i.prol, align 4
store i64 %24, ptr %arrayidx8.i.prol, align 8
%indvars.iv.next77.i.prol = add nuw nsw i64 %indvars.iv76.i.prol, 1
%prol.iter33.next = add i64 %prol.iter33, 1
%prol.iter33.cmp.not = icmp eq i64 %prol.iter33.next, %xtraiter31
br i1 %prol.iter33.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !24
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv76.i.unr = phi i64 [ %indvars.iv76.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next77.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !25
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv76.i = phi i64 [ %indvars.iv.next77.i.3, %for.body6.i ], [ %indvars.iv76.i.unr, %for.body6.i.prol.loopexit ]
%arrayidx8.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.i
%gep88.i = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv76.i
%30 = load i64, ptr %gep88.i, align 4
store i64 %30, ptr %arrayidx8.i, align 8
%indvars.iv.next77.i = add nuw nsw i64 %indvars.iv76.i, 1
%arrayidx8.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i
%gep88.i.1 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i
%31 = load i64, ptr %gep88.i.1, align 4
store i64 %31, ptr %arrayidx8.i.1, align 8
%indvars.iv.next77.i.1 = add nuw nsw i64 %indvars.iv76.i, 2
%arrayidx8.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i.1
%gep88.i.2 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.1
%32 = load i64, ptr %gep88.i.2, align 4
store i64 %32, ptr %arrayidx8.i.2, align 8
%indvars.iv.next77.i.2 = add nuw nsw i64 %indvars.iv76.i, 3
%arrayidx8.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i.2
%gep88.i.3 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.2
%33 = load i64, ptr %gep88.i.3, align 4
store i64 %33, ptr %arrayidx8.i.3, align 8
%indvars.iv.next77.i.3 = add nuw nsw i64 %indvars.iv76.i, 4
%exitcond81.not.i.3 = icmp eq i64 %indvars.iv.next77.i.3, %wide.trip.count80.i
br i1 %exitcond81.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !26
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block18, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub1.i to i64
%value.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom15.i, i32 1
store i32 2000000000, ptr %value.i, align 4, !tbaa !15
%idxprom17.i = sext i32 %sub.i to i64
%value19.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17.i, i32 1
store i32 2000000000, ptr %value19.i, align 4, !tbaa !15
%34 = sext i32 %left to i64
%wide.trip.count85.i = sext i32 %right to i64
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i, %for.end14.i
%indvars.iv82.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next83.i, %for.body22.i ]
%i.273.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ]
%j.072.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ]
%idxprom23.i = zext i32 %i.273.i to i64
%value25.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i, i32 1
%35 = load i32, ptr %value25.i, align 4, !tbaa !15
%idxprom26.i = zext i32 %j.072.i to i64
%value28.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i, i32 1
%36 = load i32, ptr %value28.i, align 4, !tbaa !15
%cmp29.not.i = icmp sgt i32 %35, %36
%arrayidx27.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i
%arrayidx24.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i
%.sink.in.i = select i1 %cmp29.not.i, ptr %arrayidx27.i, ptr %arrayidx24.i
%inc37.i = zext i1 %cmp29.not.i to i32
%j.1.i = add nuw nsw i32 %j.072.i, %inc37.i
%not.cmp29.not.i = xor i1 %cmp29.not.i, true
%inc32.i = zext i1 %not.cmp29.not.i to i32
%i.3.i = add nuw nsw i32 %i.273.i, %inc32.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv82.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next83.i = add nsw i64 %indvars.iv82.i, 1
%exitcond86.not.i = icmp eq i64 %indvars.iv.next83.i, %wide.trip.count85.i
br i1 %exitcond86.not.i, label %if.end, label %for.body22.i, !llvm.loop !20
if.end: ; preds = %for.body22.i, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !27
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%value.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %value.prol, align 4, !tbaa !15
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%value = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %value, align 4, !tbaa !15
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%value.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %value.1, align 4, !tbaa !15
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !29
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp10 = icmp slt i32 %p, %r
br i1 %cmp10, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr11 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !27
%sub.i = add nsw i32 %p.tr11, -1
%1 = sext i32 %p.tr11 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%value.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %value.i.prol, align 4, !tbaa !15
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr11 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr11, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%value.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %value.i, align 4, !tbaa !15
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%value.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %value.i.1, align 4, !tbaa !15
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %n, i32 noundef %p.tr11, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%v = alloca i32, align 4
%A = alloca [100000 x %struct.Card], align 16
%B = alloca [100000 x %struct.Card], align 16
%S = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !28
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S, ptr noundef nonnull %v)
%1 = load i8, ptr %S, align 1, !tbaa !30
%arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !31
%arrayidx4 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx4, align 8, !tbaa !31
%2 = load i32, ptr %v, align 4, !tbaa !28
%value = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value, align 4, !tbaa !15
%value10 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value10, align 4, !tbaa !15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !28
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !32
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr %n, align 4, !tbaa !28
%sub = add nsw i32 %5, -1
call void @quickSort(ptr noundef nonnull %B, i32 noundef %5, i32 noundef 0, i32 noundef %sub)
%cmp1465 = icmp sgt i32 %5, 0
br i1 %cmp1465, label %for.body15.preheader, label %if.end33
for.body15.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end27.unr-lcssa, label %for.body15.preheader.new
for.body15.preheader.new: ; preds = %for.body15.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body15
for.body15: ; preds = %for.body15, %for.body15.preheader.new
%indvars.iv73 = phi i64 [ 0, %for.body15.preheader.new ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067 = phi i32 [ 1, %for.body15.preheader.new ], [ %spec.select.3, %for.body15 ]
%niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.3, %for.body15 ]
%arrayidx17 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73
%7 = load i8, ptr %arrayidx17, align 16, !tbaa !31
%arrayidx20 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv73
%8 = load i8, ptr %arrayidx20, align 16, !tbaa !31
%cmp23.not = icmp eq i8 %7, %8
%indvars.iv.next74 = or i64 %indvars.iv73, 1
%arrayidx17.1 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74
%9 = load i8, ptr %arrayidx17.1, align 8, !tbaa !31
%arrayidx20.1 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74
%10 = load i8, ptr %arrayidx20.1, align 8, !tbaa !31
%cmp23.not.1 = icmp eq i8 %9, %10
%indvars.iv.next74.1 = or i64 %indvars.iv73, 2
%arrayidx17.2 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74.1
%11 = load i8, ptr %arrayidx17.2, align 16, !tbaa !31
%arrayidx20.2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74.1
%12 = load i8, ptr %arrayidx20.2, align 16, !tbaa !31
%cmp23.not.2 = icmp eq i8 %11, %12
%indvars.iv.next74.2 = or i64 %indvars.iv73, 3
%arrayidx17.3 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74.2
%13 = load i8, ptr %arrayidx17.3, align 8, !tbaa !31
%arrayidx20.3 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74.2
%14 = load i8, ptr %arrayidx20.3, align 8, !tbaa !31
%cmp23.not.3 = icmp eq i8 %13, %14
%15 = select i1 %cmp23.not.3, i1 %cmp23.not.2, i1 false
%16 = select i1 %15, i1 %cmp23.not.1, i1 false
%17 = select i1 %16, i1 %cmp23.not, i1 false
%spec.select.3 = select i1 %17, i32 %stable.067, i32 0
%indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end27.unr-lcssa, label %for.body15, !llvm.loop !33
for.end27.unr-lcssa: ; preds = %for.body15, %for.body15.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%indvars.iv73.unr = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067.unr = phi i32 [ 1, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end27, label %for.body15.epil
for.body15.epil: ; preds = %for.end27.unr-lcssa, %for.body15.epil
%indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %for.body15.epil ], [ %indvars.iv73.unr, %for.end27.unr-lcssa ]
%stable.067.epil = phi i32 [ %spec.select.epil, %for.body15.epil ], [ %stable.067.unr, %for.end27.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body15.epil ], [ 0, %for.end27.unr-lcssa ]
%arrayidx17.epil = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73.epil
%18 = load i8, ptr %arrayidx17.epil, align 8, !tbaa !31
%arrayidx20.epil = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv73.epil
%19 = load i8, ptr %arrayidx20.epil, align 8, !tbaa !31
%cmp23.not.epil = icmp eq i8 %18, %19
%spec.select.epil = select i1 %cmp23.not.epil, i32 %stable.067.epil, i32 0
%indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end27, label %for.body15.epil, !llvm.loop !34
for.end27: ; preds = %for.body15.epil, %for.end27.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end27.unr-lcssa ], [ %spec.select.epil, %for.body15.epil ]
%20 = icmp eq i32 %spec.select.lcssa, 1
%spec.select81 = select i1 %20, ptr @str.5, ptr @str
br label %if.end33
if.end33: ; preds = %for.end27, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select81, %for.end27 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%21 = load i32, ptr %n, align 4, !tbaa !28
%cmp3569 = icmp sgt i32 %21, 0
br i1 %cmp3569, label %for.body37, label %for.end48
for.body37: ; preds = %if.end33, %for.body37
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body37 ], [ 0, %if.end33 ]
%arrayidx39 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv76
%22 = load i8, ptr %arrayidx39, align 8, !tbaa !31
%conv41 = sext i8 %22 to i32
%value44 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv76, i32 1
%23 = load i32, ptr %value44, align 4, !tbaa !15
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv41, i32 noundef %23)
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%24 = load i32, ptr %n, align 4, !tbaa !28
%25 = sext i32 %24 to i64
%cmp35 = icmp slt i64 %indvars.iv.next77, %25
br i1 %cmp35, label %for.body37, label %for.end48, !llvm.loop !35
for.end48: ; preds = %for.body37, %if.end33
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !6, !7, !8}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !6, !7}
!14 = distinct !{!14, !6, !7}
!15 = !{!16, !19, i64 4}
!16 = !{!"Card", !17, i64 0, !19, i64 4}
!17 = !{!"omnipotent char", !18, i64 0}
!18 = !{!"Simple C/C++ TBAA"}
!19 = !{!"int", !17, i64 0}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6, !7, !8}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !6, !7, !8}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !6, !7}
!26 = distinct !{!26, !6, !7}
!27 = !{i64 0, i64 4, !28}
!28 = !{!19, !19, i64 0}
!29 = distinct !{!29, !6}
!30 = !{!17, !17, i64 0}
!31 = !{!16, !17, i64 0}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !6}
|
#include<stdio.h>
#include<stdlib.h>
typedef struct{
int num;
int mmm;
char mark;
}Card;
int n,x;
int pertition(Card *A,int p,int r){
int i,j;
Card tmp;
x=A[r].num;
i=p-1;
for(j=p;j<r;j++){
if(A[j].num<=x){
i++;
tmp=A[i];
A[i]=A[j];
A[j]=tmp;
}
}
tmp=A[i+1];
A[i+1]=A[r];
A[r]=tmp;
return i+1;
}
void quickSort(Card *A,int p,int r){
int q;
if(p<r){
q = pertition(A,p,r);
quickSort(A,p,q-1);
quickSort(A,q+1,r);
}
}
int main(void){
int i,q,flag=0;
Card *A;
char spe;
scanf("%d%c",&n,&spe);
A=malloc(n*sizeof(Card));
for(i=0;i<n;i++){
scanf("%c%d%c",&A[i].mark,&A[i].num,&spe);
A[i].mmm=i;
}
quickSort(A,0,n-1);
for(i=0;i<n-1;i++){
if(A[i].num==A[i+1].num && A[i].mmm>A[i+1].mmm){
flag++;
break;
}
}
if(flag==0) printf("Stable\n");
else printf("Not stable\n");
for(i=0;i<n;i++){
printf("%c %d\n",A[i].mark,A[i].num);
}
free(A);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269435/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269435/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Card = type { i32, i32, i8 }
@x = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [7 x i8] c"%c%d%c\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @pertition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%tmp = alloca %struct.Card, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp)
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
store i32 %0, ptr @x, align 4, !tbaa !10
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.047 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %2, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.047, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, i64 12, i1 false), !tbaa.struct !11
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, i64 12, i1 false), !tbaa.struct !11
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, ptr noundef nonnull align 4 dereferenceable(12) %tmp, i64 12, i1 false), !tbaa.struct !11
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !13
for.end.loopexit: ; preds = %for.inc
%3 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %3, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15, i64 12, i1 false), !tbaa.struct !11
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false), !tbaa.struct !11
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, ptr noundef nonnull align 4 dereferenceable(12) %tmp, i64 12, i1 false), !tbaa.struct !11
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp)
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%tmp.i = alloca %struct.Card, align 4
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %pertition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %pertition.exit ]
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp.i)
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %0, ptr @x, align 4, !tbaa !10
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%i.047.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ]
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%2 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp4.not.i = icmp sgt i32 %2, %0
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, i64 12, i1 false), !tbaa.struct !11
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, i64 12, i1 false), !tbaa.struct !11
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, i64 12, i1 false), !tbaa.struct !11
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %pertition.exit, label %for.body.i, !llvm.loop !13
pertition.exit: ; preds = %for.inc.i
%3 = add nsw i32 %i.1.i, 1
%idxprom14.i = sext i32 %3 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15.i, i64 12, i1 false), !tbaa.struct !11
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, i64 12, i1 false), !tbaa.struct !11
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, i64 12, i1 false), !tbaa.struct !11
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp.i)
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i)
%add = add nsw i32 %i.1.i, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %pertition.exit, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%spe = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %spe) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %spe)
%0 = load i32, ptr @n, align 4, !tbaa !10
%conv = sext i32 %0 to i64
%mul = mul nsw i64 %conv, 12
%call1 = call noalias ptr @malloc(i64 noundef %mul) #9
%cmp82 = icmp sgt i32 %0, 0
br i1 %cmp82, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct.Card, ptr %call1, i64 %indvars.iv
%mark = getelementptr inbounds %struct.Card, ptr %call1, i64 %indvars.iv, i32 2
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %mark, ptr noundef %arrayidx, ptr noundef nonnull %spe)
%mmm = getelementptr inbounds %struct.Card, ptr %call1, i64 %indvars.iv, i32 1
%1 = trunc i64 %indvars.iv to i32
store i32 %1, ptr %mmm, align 4, !tbaa !15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr @n, align 4, !tbaa !10
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !16
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ]
%sub = add nsw i32 %.lcssa, -1
call void @quickSort(ptr noundef %call1, i32 noundef 0, i32 noundef %sub)
%4 = load i32, ptr @n, align 4, !tbaa !10
%cmp10.not84 = icmp sgt i32 %4, 1
br i1 %cmp10.not84, label %for.body12.preheader, label %if.end39
for.body12.preheader: ; preds = %for.end
%sub9 = add nsw i32 %4, -1
%wide.trip.count = zext i32 %sub9 to i64
%.pre = load i32, ptr %call1, align 4, !tbaa !5
br label %for.body12
for.body12: ; preds = %for.body12.preheader, %for.inc31
%5 = phi i32 [ %.pre, %for.body12.preheader ], [ %6, %for.inc31 ]
%indvars.iv90 = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next91, %for.inc31 ]
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%arrayidx17 = getelementptr inbounds %struct.Card, ptr %call1, i64 %indvars.iv.next91
%6 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp19 = icmp eq i32 %5, %6
br i1 %cmp19, label %land.lhs.true, label %for.inc31
land.lhs.true: ; preds = %for.body12
%mmm23 = getelementptr inbounds %struct.Card, ptr %call1, i64 %indvars.iv90, i32 1
%7 = load i32, ptr %mmm23, align 4, !tbaa !15
%mmm27 = getelementptr inbounds %struct.Card, ptr %call1, i64 %indvars.iv.next91, i32 1
%8 = load i32, ptr %mmm27, align 4, !tbaa !15
%cmp28 = icmp sgt i32 %7, %8
br i1 %cmp28, label %if.end39, label %for.inc31
for.inc31: ; preds = %for.body12, %land.lhs.true
%exitcond.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count
br i1 %exitcond.not, label %if.end39, label %for.body12, !llvm.loop !17
if.end39: ; preds = %land.lhs.true, %for.inc31, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ @str.5, %for.inc31 ], [ @str, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%9 = load i32, ptr @n, align 4, !tbaa !10
%cmp4186 = icmp sgt i32 %9, 0
br i1 %cmp4186, label %for.body43, label %for.end54
for.body43: ; preds = %if.end39, %for.body43
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body43 ], [ 0, %if.end39 ]
%arrayidx45 = getelementptr inbounds %struct.Card, ptr %call1, i64 %indvars.iv93
%mark46 = getelementptr inbounds %struct.Card, ptr %call1, i64 %indvars.iv93, i32 2
%10 = load i8, ptr %mark46, align 4, !tbaa !18
%conv47 = sext i8 %10 to i32
%11 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv47, i32 noundef %11)
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%12 = load i32, ptr @n, align 4, !tbaa !10
%13 = sext i32 %12 to i64
%cmp41 = icmp slt i64 %indvars.iv.next94, %13
br i1 %cmp41, label %for.body43, label %for.end54, !llvm.loop !19
for.end54: ; preds = %for.body43, %if.end39
call void @free(ptr noundef %call1) #8
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %spe) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !8, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 1, !12}
!12 = !{!8, !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!6, !7, i64 4}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = !{!6, !8, i64 8}
!19 = distinct !{!19, !14}
|
#include <stdio.h>
#include <stdlib.h>
struct card
{
int n;
int p;
char c;
} typedef card;
card A[100000];
int stableFlag = 0;
int Partition(int p, int r)
{
int i, j;
card tmp;
i = p - 1;
for(j = p; j < r; j++)
{
if(A[j].n <= A[r].n)
{
i = i + 1;
tmp = A[i];
A[i] = A[j];
A[j] = tmp;
}
}
tmp = A[i + 1];
A[i + 1] = A[r];
A[r] = tmp;
return i + 1;
}
void QuickSort(int p, int r)
{
int q;
if(p < r)
{
q = Partition(p, r);
QuickSort(p, q - 1);
QuickSort(q + 1, r);
}
}
int StableOrNot(int n)
{
int i;
for(i = 0; i < n; i++)
{
if(A[i].n == A[i + 1].n &&
A[i].p >= A[i + 1].p) return 0;
}
return 1;
}
int main()
{
int i;
int n;
scanf("%d", &n);
for(i = 0; i < n; i++)
{
while(1)
{
A[i].c = getchar();
if(A[i].c != ' ' && A[i].c != '\n') break;
}
A[i].p = i + 1;
scanf("%d", &A[i].n);
}
QuickSort(0, n - 1);
if(StableOrNot(n) == 1) printf("Stable\n");
else printf("Not stable\n");
for(i = 0; i < n; i++)
{
printf("%c %d\n", A[i].c, A[i].n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269493/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269493/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.card = type { i32, i32, i8 }
@stableFlag = dso_local local_unnamed_addr global i32 0, align 4
@A = dso_local global [100000 x %struct.card] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.4 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @Partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%tmp = alloca %struct.card, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp)
%cmp37 = icmp slt i32 %p, %r
br i1 %cmp37, label %for.body.lr.ph, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %r to i64
br label %for.end
for.body.lr.ph: ; preds = %entry
%sub = add nsw i32 %p, -1
%idxprom1 = sext i32 %r to i64
%arrayidx2 = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %idxprom1
%0 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ %0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%i.038 = phi i32 [ %sub, %for.body.lr.ph ], [ %i.1, %for.inc ]
%arrayidx = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %1, %2
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%add = add nsw i32 %i.038, 1
%idxprom5 = sext i32 %add to i64
%arrayidx6 = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %idxprom5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, i64 12, i1 false), !tbaa.struct !10
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false), !tbaa.struct !10
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, ptr noundef nonnull align 4 dereferenceable(12) %tmp, i64 12, i1 false), !tbaa.struct !10
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.038, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom1
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !13
for.end.loopexit: ; preds = %for.inc
%3 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %entry.for.end_crit_edge, %for.end.loopexit
%idxprom19.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %idxprom1, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry.for.end_crit_edge ], [ %3, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %idxprom14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15, i64 12, i1 false), !tbaa.struct !10
%arrayidx20 = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %idxprom19.pre-phi
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx20, i64 12, i1 false), !tbaa.struct !10
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx20, ptr noundef nonnull align 4 dereferenceable(12) %tmp, i64 12, i1 false), !tbaa.struct !10
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp)
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @QuickSort(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%tmp.i = alloca %struct.card, align 4
%cmp6 = icmp slt i32 %p, %r
br i1 %cmp6, label %for.body.lr.ph.i.lr.ph, label %if.end
for.body.lr.ph.i.lr.ph: ; preds = %entry
%idxprom1.i = sext i32 %r to i64
%arrayidx2.i = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %idxprom1.i
br label %for.body.lr.ph.i
for.body.lr.ph.i: ; preds = %for.body.lr.ph.i.lr.ph, %Partition.exit
%p.tr7 = phi i32 [ %p, %for.body.lr.ph.i.lr.ph ], [ %add, %Partition.exit ]
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp.i)
%sub.i = add nsw i32 %p.tr7, -1
%0 = sext i32 %p.tr7 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.lr.ph.i
%indvars.iv.i = phi i64 [ %0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.inc.i ]
%i.038.i = phi i32 [ %sub.i, %for.body.lr.ph.i ], [ %i.1.i, %for.inc.i ]
%arrayidx.i = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv.i
%1 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp4.not.i = icmp sgt i32 %1, %2
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%add.i = add nsw i32 %i.038.i, 1
%idxprom5.i = sext i32 %add.i to i64
%arrayidx6.i = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %idxprom5.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, i64 12, i1 false), !tbaa.struct !10
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, i64 12, i1 false), !tbaa.struct !10
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, i64 12, i1 false), !tbaa.struct !10
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.038.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom1.i
br i1 %exitcond.not.i, label %Partition.exit, label %for.body.i, !llvm.loop !13
Partition.exit: ; preds = %for.inc.i
%3 = add nsw i32 %i.1.i, 1
%idxprom14.i = sext i32 %3 to i64
%arrayidx15.i = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %idxprom14.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15.i, i64 12, i1 false), !tbaa.struct !10
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, i64 12, i1 false), !tbaa.struct !10
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, i64 12, i1 false), !tbaa.struct !10
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp.i)
tail call void @QuickSort(i32 noundef %p.tr7, i32 noundef %i.1.i)
%add = add nsw i32 %i.1.i, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.lr.ph.i, label %if.end
if.end: ; preds = %Partition.exit, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @StableOrNot(i32 noundef %n) local_unnamed_addr #3 {
entry:
%cmp18 = icmp sgt i32 %n, 0
br i1 %cmp18, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%.pre = load i32, ptr @A, align 16, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%0 = phi i32 [ %.pre, %for.body.preheader ], [ %1, %for.inc ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx3 = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv.next
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp5 = icmp eq i32 %0, %1
br i1 %cmp5, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%p = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv, i32 1
%2 = load i32, ptr %p, align 4, !tbaa !15
%p11 = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv.next, i32 1
%3 = load i32, ptr %p11, align 4, !tbaa !15
%cmp12.not = icmp slt i32 %2, %3
br i1 %cmp12.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.body, %land.lhs.true
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !16
cleanup: ; preds = %land.lhs.true, %for.inc, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %for.inc ], [ 0, %land.lhs.true ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !11
%cmp56 = icmp sgt i32 %0, 0
br i1 %cmp56, label %while.cond.preheader, label %for.end
while.cond.preheader: ; preds = %entry, %while.end
%indvars.iv = phi i64 [ %indvars.iv.next, %while.end ], [ 0, %entry ]
%c = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv, i32 2
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %while.cond.preheader
%1 = load ptr, ptr @stdin, align 8, !tbaa !17
%call.i = call i32 @getc(ptr noundef %1)
%conv = trunc i32 %call.i to i8
store i8 %conv, ptr %c, align 4, !tbaa !19
%sext = shl i32 %call.i, 24
switch i32 %sext, label %while.end [
i32 536870912, label %while.cond.backedge
i32 167772160, label %while.cond.backedge
]
while.cond.backedge: ; preds = %while.cond, %while.cond
br label %while.cond
while.end: ; preds = %while.cond
%arrayidx = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%p = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv, i32 1
%2 = trunc i64 %indvars.iv.next to i32
store i32 %2, ptr %p, align 4, !tbaa !15
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%3 = load i32, ptr %n, align 4, !tbaa !11
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %while.cond.preheader, label %for.end, !llvm.loop !20
for.end: ; preds = %while.end, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %while.end ]
%sub = add nsw i32 %.lcssa, -1
call void @QuickSort(i32 noundef 0, i32 noundef %sub)
%5 = load i32, ptr %n, align 4, !tbaa !11
%cmp18.i = icmp sgt i32 %5, 0
br i1 %cmp18.i, label %for.body.preheader.i, label %if.end26
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %5 to i64
%.pre.i = load i32, ptr @A, align 16, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%6 = phi i32 [ %.pre.i, %for.body.preheader.i ], [ %7, %for.inc.i ]
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx3.i = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv.next.i
%7 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp5.i = icmp eq i32 %6, %7
br i1 %cmp5.i, label %land.lhs.true.i, label %for.inc.i
land.lhs.true.i: ; preds = %for.body.i
%p.i = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %p.i, align 4, !tbaa !15
%p11.i = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv.next.i, i32 1
%9 = load i32, ptr %p11.i, align 4, !tbaa !15
%cmp12.not.i = icmp slt i32 %8, %9
br i1 %cmp12.not.i, label %for.inc.i, label %if.end26
for.inc.i: ; preds = %land.lhs.true.i, %for.body.i
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %if.end26, label %for.body.i, !llvm.loop !16
if.end26: ; preds = %land.lhs.true.i, %for.inc.i, %for.end
%str.sink = phi ptr [ @str.4, %for.end ], [ @str.4, %for.inc.i ], [ @str, %land.lhs.true.i ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%10 = load i32, ptr %n, align 4, !tbaa !11
%cmp2858 = icmp sgt i32 %10, 0
br i1 %cmp2858, label %for.body30, label %for.end41
for.body30: ; preds = %if.end26, %for.body30
%indvars.iv62 = phi i64 [ %indvars.iv.next63, %for.body30 ], [ 0, %if.end26 ]
%arrayidx32 = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv62
%c33 = getelementptr inbounds [100000 x %struct.card], ptr @A, i64 0, i64 %indvars.iv62, i32 2
%11 = load i8, ptr %c33, align 4, !tbaa !19
%conv34 = sext i8 %11 to i32
%12 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %conv34, i32 noundef %12)
%indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
%13 = load i32, ptr %n, align 4, !tbaa !11
%14 = sext i32 %13 to i64
%cmp28 = icmp slt i64 %indvars.iv.next63, %14
br i1 %cmp28, label %for.body30, label %for.end41, !llvm.loop !21
for.end41: ; preds = %for.body30, %if.end26
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"card", !7, i64 0, !7, i64 4, !8, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 1, !12}
!11 = !{!7, !7, i64 0}
!12 = !{!8, !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!6, !7, i64 4}
!16 = distinct !{!16, !14}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !8, i64 0}
!19 = !{!6, !8, i64 8}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
|
#include<stdio.h>
#define N 100000
#define INFTY 1000000000
struct Card{
char suit;
int value;
};
struct Card L[N], R[N];
void merge(struct Card *, int, int, int);
void mergeSort(struct Card *, int , int);
int partition(struct Card *, int, int);
void quickSort(struct Card *, int, int);
int main(){
int n;
int i;
int v;
struct Card A[N], B[N];
char S[10];
int stable;
stable = 1;
scanf("%d", &n);
for ( i = 0; i < n; i++ ) {
scanf("%s %d", S, &v);
A[i].suit = S[0];
B[i].suit = S[0];
A[i].value = v;
B[i].value = v;
}
mergeSort(A, 0, n);
quickSort(B, 0, n-1);
for ( i = 0; i < n; i++ ){
if ( A[i].suit != B[i].suit ) stable = 0;
}
if ( stable == 1 ) printf("Stable\n");
else printf("Not stable\n");
for ( i = 0; i < n; i++ ) {
printf("%c %d\n", B[i].suit, B[i].value);
}
return 0;
}
void merge(struct Card A[], int left, int mid, int right){
int i, j, k;
int n1;
int n2;
n1 = mid - left;
n2 = right - mid;
for ( i = 0; i < n1; i++ ) {
L[i] = A[left + i];
}
for ( i = 0; i < n2; i++ ) {
R[i] = A[mid + i];
}
L[n1].value = INFTY;
R[n2].value = INFTY;
i = 0;
j = 0;
for ( k = left; k < right; k++ ){
if ( L[i].value <= R[j].value ){
A[k] = L[i];
i++;
}
else {
A[k] = R[j];
j++;
}
}
}
void mergeSort(struct Card A[], int left, int right ){
int mid;
if ( left + 1 < right ){
mid = (left + right)/2;
mergeSort(A, left, mid);
mergeSort(A, mid, right);
merge(A, left, mid, right);
}
}
int partition(struct Card A[], int p, int r){
int i, j;
struct Card t, x;
x = A[r];
i = p - 1;
for ( j = p; j < r; j++ ){
if ( A[j].value <= x.value ){
i++;
t = A[i];
A[i] = A[j];
A[j] = t;
}
}
t = A[i+1];
A[i+1] = A[r];
A[r] = t;
return i+1;
}
void quickSort(struct Card A[], int p, int r){
int q;
if ( p < r ){
q = partition(A, p, r);
quickSort(A, p, q - 1);
quickSort(A, q + 1, r);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269543/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269543/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Card = type { i8, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@L = dso_local local_unnamed_addr global [100000 x %struct.Card] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [100000 x %struct.Card] zeroinitializer, align 16
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%v = alloca i32, align 4
%A = alloca [100000 x %struct.Card], align 16
%B = alloca [100000 x %struct.Card], align 16
%S = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp64 = icmp sgt i32 %0, 0
br i1 %cmp64, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S, ptr noundef nonnull %v)
%1 = load i8, ptr %S, align 1, !tbaa !9
%arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !10
%arrayidx5 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx5, align 8, !tbaa !10
%2 = load i32, ptr %v, align 4, !tbaa !5
%value = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value, align 4, !tbaa !12
%value11 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value11, align 4, !tbaa !12
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !13
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
call void @quickSort(ptr noundef nonnull %B, i32 noundef 0, i32 noundef %sub)
%cmp1566 = icmp sgt i32 %5, 0
br i1 %cmp1566, label %for.body16.preheader, label %if.end34
for.body16.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end28.unr-lcssa, label %for.body16.preheader.new
for.body16.preheader.new: ; preds = %for.body16.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body16
for.body16: ; preds = %for.body16, %for.body16.preheader.new
%indvars.iv74 = phi i64 [ 0, %for.body16.preheader.new ], [ %indvars.iv.next75.3, %for.body16 ]
%stable.068 = phi i32 [ 1, %for.body16.preheader.new ], [ %spec.select.3, %for.body16 ]
%niter = phi i64 [ 0, %for.body16.preheader.new ], [ %niter.next.3, %for.body16 ]
%arrayidx18 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv74
%7 = load i8, ptr %arrayidx18, align 16, !tbaa !10
%arrayidx21 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv74
%8 = load i8, ptr %arrayidx21, align 16, !tbaa !10
%cmp24.not = icmp eq i8 %7, %8
%indvars.iv.next75 = or i64 %indvars.iv74, 1
%arrayidx18.1 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next75
%9 = load i8, ptr %arrayidx18.1, align 8, !tbaa !10
%arrayidx21.1 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next75
%10 = load i8, ptr %arrayidx21.1, align 8, !tbaa !10
%cmp24.not.1 = icmp eq i8 %9, %10
%indvars.iv.next75.1 = or i64 %indvars.iv74, 2
%arrayidx18.2 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next75.1
%11 = load i8, ptr %arrayidx18.2, align 16, !tbaa !10
%arrayidx21.2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next75.1
%12 = load i8, ptr %arrayidx21.2, align 16, !tbaa !10
%cmp24.not.2 = icmp eq i8 %11, %12
%indvars.iv.next75.2 = or i64 %indvars.iv74, 3
%arrayidx18.3 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next75.2
%13 = load i8, ptr %arrayidx18.3, align 8, !tbaa !10
%arrayidx21.3 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next75.2
%14 = load i8, ptr %arrayidx21.3, align 8, !tbaa !10
%cmp24.not.3 = icmp eq i8 %13, %14
%15 = select i1 %cmp24.not.3, i1 %cmp24.not.2, i1 false
%16 = select i1 %15, i1 %cmp24.not.1, i1 false
%17 = select i1 %16, i1 %cmp24.not, i1 false
%spec.select.3 = select i1 %17, i32 %stable.068, i32 0
%indvars.iv.next75.3 = add nuw nsw i64 %indvars.iv74, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end28.unr-lcssa, label %for.body16, !llvm.loop !15
for.end28.unr-lcssa: ; preds = %for.body16, %for.body16.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body16.preheader ], [ %spec.select.3, %for.body16 ]
%indvars.iv74.unr = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next75.3, %for.body16 ]
%stable.068.unr = phi i32 [ 1, %for.body16.preheader ], [ %spec.select.3, %for.body16 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end28, label %for.body16.epil
for.body16.epil: ; preds = %for.end28.unr-lcssa, %for.body16.epil
%indvars.iv74.epil = phi i64 [ %indvars.iv.next75.epil, %for.body16.epil ], [ %indvars.iv74.unr, %for.end28.unr-lcssa ]
%stable.068.epil = phi i32 [ %spec.select.epil, %for.body16.epil ], [ %stable.068.unr, %for.end28.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body16.epil ], [ 0, %for.end28.unr-lcssa ]
%arrayidx18.epil = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv74.epil
%18 = load i8, ptr %arrayidx18.epil, align 8, !tbaa !10
%arrayidx21.epil = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv74.epil
%19 = load i8, ptr %arrayidx21.epil, align 8, !tbaa !10
%cmp24.not.epil = icmp eq i8 %18, %19
%spec.select.epil = select i1 %cmp24.not.epil, i32 %stable.068.epil, i32 0
%indvars.iv.next75.epil = add nuw nsw i64 %indvars.iv74.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end28, label %for.body16.epil, !llvm.loop !16
for.end28: ; preds = %for.body16.epil, %for.end28.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end28.unr-lcssa ], [ %spec.select.epil, %for.body16.epil ]
%20 = icmp eq i32 %spec.select.lcssa, 1
%spec.select82 = select i1 %20, ptr @str.5, ptr @str
br label %if.end34
if.end34: ; preds = %for.end28, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select82, %for.end28 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%21 = load i32, ptr %n, align 4, !tbaa !5
%cmp3670 = icmp sgt i32 %21, 0
br i1 %cmp3670, label %for.body38, label %for.end49
for.body38: ; preds = %if.end34, %for.body38
%indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body38 ], [ 0, %if.end34 ]
%arrayidx40 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv77
%22 = load i8, ptr %arrayidx40, align 8, !tbaa !10
%conv42 = sext i8 %22 to i32
%value45 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv77, i32 1
%23 = load i32, ptr %value45, align 4, !tbaa !12
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv42, i32 noundef %23)
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%24 = load i32, ptr %n, align 4, !tbaa !5
%25 = sext i32 %24 to i64
%cmp36 = icmp slt i64 %indvars.iv.next78, %25
br i1 %cmp36, label %for.body38, label %for.end49, !llvm.loop !18
for.end49: ; preds = %for.body38, %if.end34
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #3 {
entry:
%A12 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp68.i = icmp sgt i32 %sub.i, 0
br i1 %cmp68.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A12
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load13 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load13, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !19
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp570.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp570.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count82.i = zext i32 %sub1.i to i64
%invariant.gep89.i = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check18 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check18, label %for.body6.i.preheader, label %vector.memcheck14
vector.memcheck14: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A12
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check15 = icmp ult i64 %16, 32
br i1 %diff.check15, label %for.body6.i.preheader, label %vector.ph19
vector.ph19: ; preds = %vector.memcheck14
%n.vec21 = and i64 %wide.trip.count82.i, 4294967292
br label %vector.body24
vector.body24: ; preds = %vector.body24, %vector.ph19
%index25 = phi i64 [ 0, %vector.ph19 ], [ %index.next28, %vector.body24 ]
%17 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %index25
%18 = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %index25
%wide.load26 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load27 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load26, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load27, ptr %20, align 16
%index.next28 = add nuw i64 %index25, 4
%21 = icmp eq i64 %index.next28, %n.vec21
br i1 %21, label %middle.block16, label %vector.body24, !llvm.loop !23
middle.block16: ; preds = %vector.body24
%cmp.n23 = icmp eq i64 %n.vec21, %wide.trip.count82.i
br i1 %cmp.n23, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck14, %for.body6.preheader.i, %middle.block16
%indvars.iv78.i.ph = phi i64 [ 0, %vector.memcheck14 ], [ 0, %for.body6.preheader.i ], [ %n.vec21, %middle.block16 ]
%22 = xor i64 %indvars.iv78.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82.i
%xtraiter29 = and i64 %wide.trip.count82.i, 3
%lcmp.mod30.not = icmp eq i64 %xtraiter29, 0
br i1 %lcmp.mod30.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv78.i.prol = phi i64 [ %indvars.iv.next79.i.prol, %for.body6.i.prol ], [ %indvars.iv78.i.ph, %for.body6.i.preheader ]
%prol.iter31 = phi i64 [ %prol.iter31.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%arrayidx8.i.prol = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv78.i.prol
%gep90.i.prol = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %indvars.iv78.i.prol
%24 = load i64, ptr %gep90.i.prol, align 4
store i64 %24, ptr %arrayidx8.i.prol, align 8
%indvars.iv.next79.i.prol = add nuw nsw i64 %indvars.iv78.i.prol, 1
%prol.iter31.next = add i64 %prol.iter31, 1
%prol.iter31.cmp.not = icmp eq i64 %prol.iter31.next, %xtraiter29
br i1 %prol.iter31.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !24
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv78.i.unr = phi i64 [ %indvars.iv78.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next79.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !25
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv78.i = phi i64 [ %indvars.iv.next79.i.3, %for.body6.i ], [ %indvars.iv78.i.unr, %for.body6.i.prol.loopexit ]
%arrayidx8.i = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv78.i
%gep90.i = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %indvars.iv78.i
%30 = load i64, ptr %gep90.i, align 4
store i64 %30, ptr %arrayidx8.i, align 8
%indvars.iv.next79.i = add nuw nsw i64 %indvars.iv78.i, 1
%arrayidx8.i.1 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79.i
%gep90.i.1 = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i
%31 = load i64, ptr %gep90.i.1, align 4
store i64 %31, ptr %arrayidx8.i.1, align 8
%indvars.iv.next79.i.1 = add nuw nsw i64 %indvars.iv78.i, 2
%arrayidx8.i.2 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79.i.1
%gep90.i.2 = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.1
%32 = load i64, ptr %gep90.i.2, align 4
store i64 %32, ptr %arrayidx8.i.2, align 8
%indvars.iv.next79.i.2 = add nuw nsw i64 %indvars.iv78.i, 3
%arrayidx8.i.3 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79.i.2
%gep90.i.3 = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.2
%33 = load i64, ptr %gep90.i.3, align 4
store i64 %33, ptr %arrayidx8.i.3, align 8
%indvars.iv.next79.i.3 = add nuw nsw i64 %indvars.iv78.i, 4
%exitcond83.not.i.3 = icmp eq i64 %indvars.iv.next79.i.3, %wide.trip.count82.i
br i1 %exitcond83.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !26
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block16, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub.i to i64
%value.i = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %idxprom15.i, i32 1
store i32 1000000000, ptr %value.i, align 4, !tbaa !12
%idxprom17.i = sext i32 %sub1.i to i64
%value19.i = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %idxprom17.i, i32 1
store i32 1000000000, ptr %value19.i, align 4, !tbaa !12
%34 = sext i32 %left to i64
%wide.trip.count87.i = sext i32 %right to i64
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i, %for.end14.i
%indvars.iv84.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next85.i, %for.body22.i ]
%i.275.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ]
%j.074.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ]
%idxprom23.i = zext i32 %i.275.i to i64
%value25.i = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i, i32 1
%35 = load i32, ptr %value25.i, align 4, !tbaa !12
%idxprom26.i = zext i32 %j.074.i to i64
%value28.i = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i, i32 1
%36 = load i32, ptr %value28.i, align 4, !tbaa !12
%cmp29.not.i = icmp sgt i32 %35, %36
%arrayidx27.i = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i
%arrayidx24.i = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i
%.sink.in.i = select i1 %cmp29.not.i, ptr %arrayidx27.i, ptr %arrayidx24.i
%inc39.i = zext i1 %cmp29.not.i to i32
%j.1.i = add nuw nsw i32 %j.074.i, %inc39.i
%not.cmp29.not.i = xor i1 %cmp29.not.i, true
%inc34.i = zext i1 %not.cmp29.not.i to i32
%i.3.i = add nuw nsw i32 %i.275.i, %inc34.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv84.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next85.i = add nsw i64 %indvars.iv84.i, 1
%exitcond88.not.i = icmp eq i64 %indvars.iv.next85.i, %wide.trip.count87.i
br i1 %exitcond88.not.i, label %if.end, label %for.body22.i, !llvm.loop !27
if.end: ; preds = %for.body22.i, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !28
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%value.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %value.i.prol, align 4, !tbaa !12
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr9 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr9, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%value.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %value.i, align 4, !tbaa !12
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%value.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %value.i.1, align 4, !tbaa !12
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #5 {
entry:
%A91 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp68 = icmp sgt i32 %sub, 0
br i1 %cmp68, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader109, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A91
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader109, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load92 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load92, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !30
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader109
for.body.preheader109: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader109, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader109 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader109 ]
%arrayidx.prol = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !31
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader109
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader109 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp570 = icmp sgt i32 %sub1, 0
br i1 %cmp570, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count82 = zext i32 %sub1 to i64
%invariant.gep89 = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check97 = icmp ult i32 %sub1, 10
br i1 %min.iters.check97, label %for.body6.preheader108, label %vector.memcheck93
vector.memcheck93: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A91
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check94 = icmp ult i64 %16, 32
br i1 %diff.check94, label %for.body6.preheader108, label %vector.ph98
vector.ph98: ; preds = %vector.memcheck93
%n.vec100 = and i64 %wide.trip.count82, 4294967292
br label %vector.body103
vector.body103: ; preds = %vector.body103, %vector.ph98
%index104 = phi i64 [ 0, %vector.ph98 ], [ %index.next107, %vector.body103 ]
%17 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %index104
%18 = getelementptr %struct.Card, ptr %invariant.gep89, i64 %index104
%wide.load105 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load106 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load105, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load106, ptr %20, align 16
%index.next107 = add nuw i64 %index104, 4
%21 = icmp eq i64 %index.next107, %n.vec100
br i1 %21, label %middle.block95, label %vector.body103, !llvm.loop !32
middle.block95: ; preds = %vector.body103
%cmp.n102 = icmp eq i64 %n.vec100, %wide.trip.count82
br i1 %cmp.n102, label %for.end14, label %for.body6.preheader108
for.body6.preheader108: ; preds = %vector.memcheck93, %for.body6.preheader, %middle.block95
%indvars.iv78.ph = phi i64 [ 0, %vector.memcheck93 ], [ 0, %for.body6.preheader ], [ %n.vec100, %middle.block95 ]
%22 = xor i64 %indvars.iv78.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82
%xtraiter110 = and i64 %wide.trip.count82, 3
%lcmp.mod111.not = icmp eq i64 %xtraiter110, 0
br i1 %lcmp.mod111.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader108, %for.body6.prol
%indvars.iv78.prol = phi i64 [ %indvars.iv.next79.prol, %for.body6.prol ], [ %indvars.iv78.ph, %for.body6.preheader108 ]
%prol.iter112 = phi i64 [ %prol.iter112.next, %for.body6.prol ], [ 0, %for.body6.preheader108 ]
%arrayidx8.prol = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv78.prol
%gep90.prol = getelementptr %struct.Card, ptr %invariant.gep89, i64 %indvars.iv78.prol
%24 = load i64, ptr %gep90.prol, align 4
store i64 %24, ptr %arrayidx8.prol, align 8
%indvars.iv.next79.prol = add nuw nsw i64 %indvars.iv78.prol, 1
%prol.iter112.next = add i64 %prol.iter112, 1
%prol.iter112.cmp.not = icmp eq i64 %prol.iter112.next, %xtraiter110
br i1 %prol.iter112.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !33
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader108
%indvars.iv78.unr = phi i64 [ %indvars.iv78.ph, %for.body6.preheader108 ], [ %indvars.iv.next79.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !34
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv78 = phi i64 [ %indvars.iv.next79.3, %for.body6 ], [ %indvars.iv78.unr, %for.body6.prol.loopexit ]
%arrayidx8 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv78
%gep90 = getelementptr %struct.Card, ptr %invariant.gep89, i64 %indvars.iv78
%30 = load i64, ptr %gep90, align 4
store i64 %30, ptr %arrayidx8, align 8
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%arrayidx8.1 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79
%gep90.1 = getelementptr %struct.Card, ptr %invariant.gep89, i64 %indvars.iv.next79
%31 = load i64, ptr %gep90.1, align 4
store i64 %31, ptr %arrayidx8.1, align 8
%indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 2
%arrayidx8.2 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79.1
%gep90.2 = getelementptr %struct.Card, ptr %invariant.gep89, i64 %indvars.iv.next79.1
%32 = load i64, ptr %gep90.2, align 4
store i64 %32, ptr %arrayidx8.2, align 8
%indvars.iv.next79.2 = add nuw nsw i64 %indvars.iv78, 3
%arrayidx8.3 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79.2
%gep90.3 = getelementptr %struct.Card, ptr %invariant.gep89, i64 %indvars.iv.next79.2
%33 = load i64, ptr %gep90.3, align 4
store i64 %33, ptr %arrayidx8.3, align 8
%indvars.iv.next79.3 = add nuw nsw i64 %indvars.iv78, 4
%exitcond83.not.3 = icmp eq i64 %indvars.iv.next79.3, %wide.trip.count82
br i1 %exitcond83.not.3, label %for.end14, label %for.body6, !llvm.loop !35
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block95, %for.cond4.preheader
%idxprom15 = sext i32 %sub to i64
%value = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %idxprom15, i32 1
store i32 1000000000, ptr %value, align 4, !tbaa !12
%idxprom17 = sext i32 %sub1 to i64
%value19 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %idxprom17, i32 1
store i32 1000000000, ptr %value19, align 4, !tbaa !12
%cmp2172 = icmp slt i32 %left, %right
br i1 %cmp2172, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count87 = sext i32 %right to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv84 = phi i64 [ %34, %for.body22.preheader ], [ %indvars.iv.next85, %for.body22 ]
%i.275 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%j.074 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%idxprom23 = zext i32 %i.275 to i64
%value25 = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %idxprom23, i32 1
%35 = load i32, ptr %value25, align 4, !tbaa !12
%idxprom26 = zext i32 %j.074 to i64
%value28 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %idxprom26, i32 1
%36 = load i32, ptr %value28, align 4, !tbaa !12
%cmp29.not = icmp sgt i32 %35, %36
%arrayidx27 = getelementptr inbounds [100000 x %struct.Card], ptr @R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [100000 x %struct.Card], ptr @L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx27, ptr %arrayidx24
%inc39 = zext i1 %cmp29.not to i32
%j.1 = add nuw nsw i32 %j.074, %inc39
%not.cmp29.not = xor i1 %cmp29.not, true
%inc34 = zext i1 %not.cmp29.not to i32
%i.3 = add nuw nsw i32 %i.275, %inc34
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv84
store i64 %.sink, ptr %37, align 4
%indvars.iv.next85 = add nsw i64 %indvars.iv84, 1
%exitcond88.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count87
br i1 %exitcond88.not, label %for.end42, label %for.body22, !llvm.loop !27
for.end42: ; preds = %for.body22, %for.end14
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #6 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !28
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%value.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %value.prol, align 4, !tbaa !12
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%value = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %value, align 4, !tbaa !12
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%value.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %value.1, align 4, !tbaa !12
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !29
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !7, i64 0}
!11 = !{!"Card", !7, i64 0, !6, i64 4}
!12 = !{!11, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !14, !20, !21}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !14, !20}
!26 = distinct !{!26, !14, !20}
!27 = distinct !{!27, !14}
!28 = !{i64 0, i64 4, !5}
!29 = distinct !{!29, !14}
!30 = distinct !{!30, !14, !20, !21}
!31 = distinct !{!31, !17}
!32 = distinct !{!32, !14, !20, !21}
!33 = distinct !{!33, !17}
!34 = distinct !{!34, !14, !20}
!35 = distinct !{!35, !14, !20}
|
#include <stdio.h>
typedef struct{
char mark[2];
int value;
int moji;
} Card;
int partition(Card*, int, int);
void quickSort(Card*,int ,int);
int main(){
Card A[100001];
int n,i,stb = 0;
scanf("%d",&n);
for(i = 0; i < n; i++){
scanf("%s %d",A[i].mark, &A[i].value);
A[i].moji = i + 1;
}
quickSort(A, 0, n - 1);
for(i = 0; i < n; i++){
if(A[i].moji > A[i + 1].moji && A[i].value == A[i + 1].value){
stb++;
break;
}
}
if(stb == 0) {
printf("Stable\n");
}
else {
printf("Not stable\n");
}
for(i = 0; i < n; i++) {
printf("%s %d\n",A[i].mark, A[i].value);
}
return 0;
}
void quickSort(Card *A,int p,int r){
int q;
if (p < r){
q = partition(A, p, r);
quickSort(A, p, q-1);
quickSort(A, q+1, r);
}
}
int partition(Card *A,int p,int r){
int i, j, a;
Card x;
a = A[r].value;
i = p - 1;
for(j = p; j < r; j++){
if(A[j].value <= a){
i++;
x = A[i];
A[i] = A[j];
A[j] = x;
}
}
x = A[i + 1];
A[i + 1] = A[r];
A[r] = x;
return i + 1;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269587/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269587/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Card = type { [2 x i8], i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [100001 x %struct.Card], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1200012, ptr nonnull %A) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub81 = add nsw i32 %0, -1
call void @quickSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub81)
br label %if.end34
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100001 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
%value = getelementptr inbounds [100001 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %value)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%moji = getelementptr inbounds [100001 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 2
%1 = trunc i64 %indvars.iv.next to i32
store i32 %1, ptr %moji, align 4, !tbaa !9
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %2, -1
call void @quickSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub)
%cmp8.not68 = icmp sgt i32 %2, 0
br i1 %cmp8.not68, label %for.body9.preheader, label %if.end34
for.body9.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %2 to i64
%moji12.phi.trans.insert = getelementptr inbounds [100001 x %struct.Card], ptr %A, i64 0, i64 0, i32 2
%.pre = load i32, ptr %moji12.phi.trans.insert, align 8, !tbaa !9
br label %for.body9
for.body9: ; preds = %for.body9.preheader, %for.inc27
%4 = phi i32 [ %.pre, %for.body9.preheader ], [ %5, %for.inc27 ]
%indvars.iv74 = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next75, %for.inc27 ]
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%moji16 = getelementptr inbounds [100001 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next75, i32 2
%5 = load i32, ptr %moji16, align 4, !tbaa !9
%cmp17 = icmp sgt i32 %4, %5
br i1 %cmp17, label %land.lhs.true, label %for.inc27
land.lhs.true: ; preds = %for.body9
%value20 = getelementptr inbounds [100001 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv74, i32 1
%6 = load i32, ptr %value20, align 4, !tbaa !13
%value24 = getelementptr inbounds [100001 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next75, i32 1
%7 = load i32, ptr %value24, align 4, !tbaa !13
%cmp25 = icmp eq i32 %6, %7
br i1 %cmp25, label %if.end34, label %for.inc27
for.inc27: ; preds = %for.body9, %land.lhs.true
%exitcond.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count
br i1 %exitcond.not, label %if.end34, label %for.body9, !llvm.loop !14
if.end34: ; preds = %land.lhs.true, %for.inc27, %for.end, %for.end.thread
%str.sink = phi ptr [ @str.5, %for.end.thread ], [ @str.5, %for.end ], [ @str.5, %for.inc27 ], [ @str, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp3670 = icmp sgt i32 %8, 0
br i1 %cmp3670, label %for.body37, label %for.end48
for.body37: ; preds = %if.end34, %for.body37
%indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body37 ], [ 0, %if.end34 ]
%arrayidx39 = getelementptr inbounds [100001 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv77
%value44 = getelementptr inbounds [100001 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv77, i32 1
%9 = load i32, ptr %value44, align 4, !tbaa !13
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %arrayidx39, i32 noundef %9)
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp36 = icmp slt i64 %indvars.iv.next78, %11
br i1 %cmp36, label %for.body37, label %for.end48, !llvm.loop !15
for.end48: ; preds = %for.body37, %if.end34
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 1200012, ptr nonnull %A) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%x.i = alloca %struct.Card, align 4
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%value.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i, i32 1
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %x.i)
%0 = load i32, ptr %value.i, align 4, !tbaa !13
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%i.048.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ]
%value3.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%2 = load i32, ptr %value3.i, align 4, !tbaa !13
%cmp4.not.i = icmp sgt i32 %2, %0
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %x.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, i64 12, i1 false), !tbaa.struct !16
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, i64 12, i1 false), !tbaa.struct !16
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, ptr noundef nonnull align 4 dereferenceable(12) %x.i, i64 12, i1 false), !tbaa.struct !16
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %partition.exit, label %for.body.i, !llvm.loop !18
partition.exit: ; preds = %for.inc.i
%3 = add nsw i32 %i.1.i, 1
%idxprom14.i = sext i32 %3 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %x.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15.i, i64 12, i1 false), !tbaa.struct !16
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, i64 12, i1 false), !tbaa.struct !16
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, ptr noundef nonnull align 4 dereferenceable(12) %x.i, i64 12, i1 false), !tbaa.struct !16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %x.i)
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i)
%add = add nsw i32 %i.1.i, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%x = alloca %struct.Card, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %x)
%idxprom = sext i32 %r to i64
%value = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom, i32 1
%0 = load i32, ptr %value, align 4, !tbaa !13
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.048 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%value3 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%2 = load i32, ptr %value3, align 4, !tbaa !13
%cmp4.not = icmp sgt i32 %2, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %x, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, i64 12, i1 false), !tbaa.struct !16
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, i64 12, i1 false), !tbaa.struct !16
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, ptr noundef nonnull align 4 dereferenceable(12) %x, i64 12, i1 false), !tbaa.struct !16
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !18
for.end.loopexit: ; preds = %for.inc
%3 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %3, %for.end.loopexit ]
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %x, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15, i64 12, i1 false), !tbaa.struct !16
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false), !tbaa.struct !16
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, ptr noundef nonnull align 4 dereferenceable(12) %x, i64 12, i1 false), !tbaa.struct !16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %x)
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"", !7, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 4}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{i64 0, i64 2, !17, i64 4, i64 4, !5, i64 8, i64 4, !5}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !12}
|
#include <stdio.h>
#define MAX 100000
#define SENTINEL 2000000000
struct Card {
char suit;
int value;
};
struct Card L[MAX/2+2], R[MAX/2+2];
void merge(struct Card A[], int n, int left, int mid, int right) {
int i, j, k;
int n1 = mid - left;
int n2 = right - mid;
for(int i=0;i<n1;i++) L[i] = A[left + i];
for(int i=0;i<n2;i++) R[i] = A[mid + i];
L[n1].value = R[n2].value = SENTINEL;
i = j = 0;
for(k=left; k<right; k++) {
if(L[i].value <= R[j].value) {
A[k] = L[i++];
} else {
A[k] = R[j++];
}
}
}
void mergeSort(struct Card A[], int n, int left, int right) {
if(left+1 < right) {
int mid = (left+right) / 2;
mergeSort(A,n,left,mid);
mergeSort(A,n,mid, right);
merge(A,n,left,mid,right);
}
}
int partition(struct Card A[], int n, int p, int r) {
int i, j;
struct Card t, x;
x = A[r];
i = p-1;
for(j=p; j<r; j++) {
if(A[j].value <= x.value) {
i++;
t=A[i]; A[i]=A[j]; A[j]=t;
}
}
t=A[i+1]; A[i+1]=A[r]; A[r]=t;
return i+1;
}
void quickSort(struct Card A[], int n, int p, int r) {
int q;
if(p<r) {
q = partition(A,n,p,r);
quickSort(A,n,p,q-1);
quickSort(A,n,q+1,r);
}
}
int main() {
int n, i, v;
struct Card A[MAX], B[MAX];
char S[10];
int stable = 1;
scanf("%d", &n);
for(i=0;i<n;i++) {
scanf("%s %d",S,&v);
A[i].suit = B[i].suit = S[0];
A[i].value = B[i].value = v;
}
mergeSort(A,n,0,n);
quickSort(B,n,0,n-1);
for(i=0;i<n;i++) {
// マージソートとクイックソートの結果を比べる
if(A[i].suit != B[i].suit) stable = 0;
}
if(stable==1) printf("Stable\n");
else printf("Not stable\n");
for(i=0;i<n;i++) {
printf("%c %d\n",B[i].suit,B[i].value);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269637/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269637/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Card = type { i8, i32 }
@L = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%A90 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp67 = icmp sgt i32 %sub, 0
br i1 %cmp67, label %for.body.preheader, label %for.cond6.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader108, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A90
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader108, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load91 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load91, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !5
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond6.preheader, label %for.body.preheader108
for.body.preheader108: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader108, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader108 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader108 ]
%arrayidx.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !9
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader108
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader108 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond6.preheader, label %for.body
for.cond6.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp769 = icmp sgt i32 %sub1, 0
br i1 %cmp769, label %for.body9.preheader, label %for.cond.cleanup8
for.body9.preheader: ; preds = %for.cond6.preheader
%13 = sext i32 %mid to i64
%wide.trip.count81 = zext i32 %sub1 to i64
%invariant.gep88 = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check96 = icmp ult i32 %sub1, 10
br i1 %min.iters.check96, label %for.body9.preheader107, label %vector.memcheck92
vector.memcheck92: ; preds = %for.body9.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A90
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check93 = icmp ult i64 %16, 32
br i1 %diff.check93, label %for.body9.preheader107, label %vector.ph97
vector.ph97: ; preds = %vector.memcheck92
%n.vec99 = and i64 %wide.trip.count81, 4294967292
br label %vector.body102
vector.body102: ; preds = %vector.body102, %vector.ph97
%index103 = phi i64 [ 0, %vector.ph97 ], [ %index.next106, %vector.body102 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index103
%18 = getelementptr %struct.Card, ptr %invariant.gep88, i64 %index103
%wide.load104 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load105 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load104, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load105, ptr %20, align 16
%index.next106 = add nuw i64 %index103, 4
%21 = icmp eq i64 %index.next106, %n.vec99
br i1 %21, label %middle.block94, label %vector.body102, !llvm.loop !11
middle.block94: ; preds = %vector.body102
%cmp.n101 = icmp eq i64 %n.vec99, %wide.trip.count81
br i1 %cmp.n101, label %for.cond.cleanup8, label %for.body9.preheader107
for.body9.preheader107: ; preds = %vector.memcheck92, %for.body9.preheader, %middle.block94
%indvars.iv77.ph = phi i64 [ 0, %vector.memcheck92 ], [ 0, %for.body9.preheader ], [ %n.vec99, %middle.block94 ]
%22 = xor i64 %indvars.iv77.ph, -1
%23 = add nsw i64 %22, %wide.trip.count81
%xtraiter109 = and i64 %wide.trip.count81, 3
%lcmp.mod110.not = icmp eq i64 %xtraiter109, 0
br i1 %lcmp.mod110.not, label %for.body9.prol.loopexit, label %for.body9.prol
for.body9.prol: ; preds = %for.body9.preheader107, %for.body9.prol
%indvars.iv77.prol = phi i64 [ %indvars.iv.next78.prol, %for.body9.prol ], [ %indvars.iv77.ph, %for.body9.preheader107 ]
%prol.iter111 = phi i64 [ %prol.iter111.next, %for.body9.prol ], [ 0, %for.body9.preheader107 ]
%arrayidx11.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv77.prol
%gep89.prol = getelementptr %struct.Card, ptr %invariant.gep88, i64 %indvars.iv77.prol
%24 = load i64, ptr %gep89.prol, align 4
store i64 %24, ptr %arrayidx11.prol, align 8
%indvars.iv.next78.prol = add nuw nsw i64 %indvars.iv77.prol, 1
%prol.iter111.next = add i64 %prol.iter111, 1
%prol.iter111.cmp.not = icmp eq i64 %prol.iter111.next, %xtraiter109
br i1 %prol.iter111.cmp.not, label %for.body9.prol.loopexit, label %for.body9.prol, !llvm.loop !12
for.body9.prol.loopexit: ; preds = %for.body9.prol, %for.body9.preheader107
%indvars.iv77.unr = phi i64 [ %indvars.iv77.ph, %for.body9.preheader107 ], [ %indvars.iv.next78.prol, %for.body9.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.cond.cleanup8, label %for.body9
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond6.preheader, label %for.body, !llvm.loop !13
for.cond.cleanup8: ; preds = %for.body9.prol.loopexit, %for.body9, %middle.block94, %for.cond6.preheader
%idxprom18 = sext i32 %sub1 to i64
%value = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom18, i32 1
store i32 2000000000, ptr %value, align 4, !tbaa !14
%idxprom20 = sext i32 %sub to i64
%value22 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom20, i32 1
store i32 2000000000, ptr %value22, align 4, !tbaa !14
%cmp2471 = icmp slt i32 %left, %right
br i1 %cmp2471, label %for.body25.preheader, label %for.end45
for.body25.preheader: ; preds = %for.cond.cleanup8
%30 = sext i32 %left to i64
%wide.trip.count86 = sext i32 %right to i64
br label %for.body25
for.body9: ; preds = %for.body9.prol.loopexit, %for.body9
%indvars.iv77 = phi i64 [ %indvars.iv.next78.3, %for.body9 ], [ %indvars.iv77.unr, %for.body9.prol.loopexit ]
%arrayidx11 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv77
%gep89 = getelementptr %struct.Card, ptr %invariant.gep88, i64 %indvars.iv77
%31 = load i64, ptr %gep89, align 4
store i64 %31, ptr %arrayidx11, align 8
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%arrayidx11.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next78
%gep89.1 = getelementptr %struct.Card, ptr %invariant.gep88, i64 %indvars.iv.next78
%32 = load i64, ptr %gep89.1, align 4
store i64 %32, ptr %arrayidx11.1, align 8
%indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 2
%arrayidx11.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next78.1
%gep89.2 = getelementptr %struct.Card, ptr %invariant.gep88, i64 %indvars.iv.next78.1
%33 = load i64, ptr %gep89.2, align 4
store i64 %33, ptr %arrayidx11.2, align 8
%indvars.iv.next78.2 = add nuw nsw i64 %indvars.iv77, 3
%arrayidx11.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next78.2
%gep89.3 = getelementptr %struct.Card, ptr %invariant.gep88, i64 %indvars.iv.next78.2
%34 = load i64, ptr %gep89.3, align 4
store i64 %34, ptr %arrayidx11.3, align 8
%indvars.iv.next78.3 = add nuw nsw i64 %indvars.iv77, 4
%exitcond82.not.3 = icmp eq i64 %indvars.iv.next78.3, %wide.trip.count81
br i1 %exitcond82.not.3, label %for.cond.cleanup8, label %for.body9, !llvm.loop !19
for.body25: ; preds = %for.body25.preheader, %for.body25
%indvars.iv83 = phi i64 [ %30, %for.body25.preheader ], [ %indvars.iv.next84, %for.body25 ]
%i.074 = phi i32 [ 0, %for.body25.preheader ], [ %i.1, %for.body25 ]
%j.073 = phi i32 [ 0, %for.body25.preheader ], [ %j.1, %for.body25 ]
%idxprom26 = zext i32 %i.074 to i64
%value28 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom26, i32 1
%35 = load i32, ptr %value28, align 4, !tbaa !14
%idxprom29 = zext i32 %j.073 to i64
%value31 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom29, i32 1
%36 = load i32, ptr %value31, align 4, !tbaa !14
%cmp32.not = icmp sgt i32 %35, %36
%arrayidx30 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom29
%arrayidx27 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom26
%.sink.in = select i1 %cmp32.not, ptr %arrayidx30, ptr %arrayidx27
%inc40 = zext i1 %cmp32.not to i32
%j.1 = add nuw nsw i32 %j.073, %inc40
%not.cmp32.not = xor i1 %cmp32.not, true
%inc35 = zext i1 %not.cmp32.not to i32
%i.1 = add nuw nsw i32 %i.074, %inc35
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv83
store i64 %.sink, ptr %37, align 4
%indvars.iv.next84 = add nsw i64 %indvars.iv83, 1
%exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
br i1 %exitcond87.not, label %for.end45, label %for.body25, !llvm.loop !20
for.end45: ; preds = %for.body25, %for.cond.cleanup8
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 {
entry:
%A14 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp67.i = icmp sgt i32 %sub.i, 0
br i1 %cmp67.i, label %for.body.preheader.i, label %for.cond6.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A14
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load15 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load15, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond6.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond6.preheader.i, label %for.body.i
for.cond6.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp769.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp769.i, label %for.body9.preheader.i, label %for.cond.cleanup8.i
for.body9.preheader.i: ; preds = %for.cond6.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count81.i = zext i32 %sub1.i to i64
%invariant.gep88.i = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check20 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check20, label %for.body9.i.preheader, label %vector.memcheck16
vector.memcheck16: ; preds = %for.body9.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A14
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check17 = icmp ult i64 %16, 32
br i1 %diff.check17, label %for.body9.i.preheader, label %vector.ph21
vector.ph21: ; preds = %vector.memcheck16
%n.vec23 = and i64 %wide.trip.count81.i, 4294967292
br label %vector.body26
vector.body26: ; preds = %vector.body26, %vector.ph21
%index27 = phi i64 [ 0, %vector.ph21 ], [ %index.next30, %vector.body26 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index27
%18 = getelementptr %struct.Card, ptr %invariant.gep88.i, i64 %index27
%wide.load28 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load29 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load28, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load29, ptr %20, align 16
%index.next30 = add nuw i64 %index27, 4
%21 = icmp eq i64 %index.next30, %n.vec23
br i1 %21, label %middle.block18, label %vector.body26, !llvm.loop !23
middle.block18: ; preds = %vector.body26
%cmp.n25 = icmp eq i64 %n.vec23, %wide.trip.count81.i
br i1 %cmp.n25, label %for.cond.cleanup8.i, label %for.body9.i.preheader
for.body9.i.preheader: ; preds = %vector.memcheck16, %for.body9.preheader.i, %middle.block18
%indvars.iv77.i.ph = phi i64 [ 0, %vector.memcheck16 ], [ 0, %for.body9.preheader.i ], [ %n.vec23, %middle.block18 ]
%22 = xor i64 %indvars.iv77.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count81.i
%xtraiter31 = and i64 %wide.trip.count81.i, 3
%lcmp.mod32.not = icmp eq i64 %xtraiter31, 0
br i1 %lcmp.mod32.not, label %for.body9.i.prol.loopexit, label %for.body9.i.prol
for.body9.i.prol: ; preds = %for.body9.i.preheader, %for.body9.i.prol
%indvars.iv77.i.prol = phi i64 [ %indvars.iv.next78.i.prol, %for.body9.i.prol ], [ %indvars.iv77.i.ph, %for.body9.i.preheader ]
%prol.iter33 = phi i64 [ %prol.iter33.next, %for.body9.i.prol ], [ 0, %for.body9.i.preheader ]
%arrayidx11.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv77.i.prol
%gep89.i.prol = getelementptr %struct.Card, ptr %invariant.gep88.i, i64 %indvars.iv77.i.prol
%24 = load i64, ptr %gep89.i.prol, align 4
store i64 %24, ptr %arrayidx11.i.prol, align 8
%indvars.iv.next78.i.prol = add nuw nsw i64 %indvars.iv77.i.prol, 1
%prol.iter33.next = add i64 %prol.iter33, 1
%prol.iter33.cmp.not = icmp eq i64 %prol.iter33.next, %xtraiter31
br i1 %prol.iter33.cmp.not, label %for.body9.i.prol.loopexit, label %for.body9.i.prol, !llvm.loop !24
for.body9.i.prol.loopexit: ; preds = %for.body9.i.prol, %for.body9.i.preheader
%indvars.iv77.i.unr = phi i64 [ %indvars.iv77.i.ph, %for.body9.i.preheader ], [ %indvars.iv.next78.i.prol, %for.body9.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.cond.cleanup8.i, label %for.body9.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond6.preheader.i, label %for.body.i, !llvm.loop !25
for.cond.cleanup8.i: ; preds = %for.body9.i.prol.loopexit, %for.body9.i, %middle.block18, %for.cond6.preheader.i
%idxprom18.i = sext i32 %sub1.i to i64
%value.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom18.i, i32 1
store i32 2000000000, ptr %value.i, align 4, !tbaa !14
%idxprom20.i = sext i32 %sub.i to i64
%value22.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom20.i, i32 1
store i32 2000000000, ptr %value22.i, align 4, !tbaa !14
%30 = sext i32 %left to i64
%wide.trip.count86.i = sext i32 %right to i64
br label %for.body25.i
for.body9.i: ; preds = %for.body9.i.prol.loopexit, %for.body9.i
%indvars.iv77.i = phi i64 [ %indvars.iv.next78.i.3, %for.body9.i ], [ %indvars.iv77.i.unr, %for.body9.i.prol.loopexit ]
%arrayidx11.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv77.i
%gep89.i = getelementptr %struct.Card, ptr %invariant.gep88.i, i64 %indvars.iv77.i
%31 = load i64, ptr %gep89.i, align 4
store i64 %31, ptr %arrayidx11.i, align 8
%indvars.iv.next78.i = add nuw nsw i64 %indvars.iv77.i, 1
%arrayidx11.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next78.i
%gep89.i.1 = getelementptr %struct.Card, ptr %invariant.gep88.i, i64 %indvars.iv.next78.i
%32 = load i64, ptr %gep89.i.1, align 4
store i64 %32, ptr %arrayidx11.i.1, align 8
%indvars.iv.next78.i.1 = add nuw nsw i64 %indvars.iv77.i, 2
%arrayidx11.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next78.i.1
%gep89.i.2 = getelementptr %struct.Card, ptr %invariant.gep88.i, i64 %indvars.iv.next78.i.1
%33 = load i64, ptr %gep89.i.2, align 4
store i64 %33, ptr %arrayidx11.i.2, align 8
%indvars.iv.next78.i.2 = add nuw nsw i64 %indvars.iv77.i, 3
%arrayidx11.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next78.i.2
%gep89.i.3 = getelementptr %struct.Card, ptr %invariant.gep88.i, i64 %indvars.iv.next78.i.2
%34 = load i64, ptr %gep89.i.3, align 4
store i64 %34, ptr %arrayidx11.i.3, align 8
%indvars.iv.next78.i.3 = add nuw nsw i64 %indvars.iv77.i, 4
%exitcond82.not.i.3 = icmp eq i64 %indvars.iv.next78.i.3, %wide.trip.count81.i
br i1 %exitcond82.not.i.3, label %for.cond.cleanup8.i, label %for.body9.i, !llvm.loop !26
for.body25.i: ; preds = %for.body25.i, %for.cond.cleanup8.i
%indvars.iv83.i = phi i64 [ %30, %for.cond.cleanup8.i ], [ %indvars.iv.next84.i, %for.body25.i ]
%i.074.i = phi i32 [ 0, %for.cond.cleanup8.i ], [ %i.1.i, %for.body25.i ]
%j.073.i = phi i32 [ 0, %for.cond.cleanup8.i ], [ %j.1.i, %for.body25.i ]
%idxprom26.i = zext i32 %i.074.i to i64
%value28.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom26.i, i32 1
%35 = load i32, ptr %value28.i, align 4, !tbaa !14
%idxprom29.i = zext i32 %j.073.i to i64
%value31.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom29.i, i32 1
%36 = load i32, ptr %value31.i, align 4, !tbaa !14
%cmp32.not.i = icmp sgt i32 %35, %36
%arrayidx30.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom29.i
%arrayidx27.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom26.i
%.sink.in.i = select i1 %cmp32.not.i, ptr %arrayidx30.i, ptr %arrayidx27.i
%inc40.i = zext i1 %cmp32.not.i to i32
%j.1.i = add nuw nsw i32 %j.073.i, %inc40.i
%not.cmp32.not.i = xor i1 %cmp32.not.i, true
%inc35.i = zext i1 %not.cmp32.not.i to i32
%i.1.i = add nuw nsw i32 %i.074.i, %inc35.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv83.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next84.i = add nsw i64 %indvars.iv83.i, 1
%exitcond87.not.i = icmp eq i64 %indvars.iv.next84.i, %wide.trip.count86.i
br i1 %exitcond87.not.i, label %if.end, label %for.body25.i, !llvm.loop !20
if.end: ; preds = %for.body25.i, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !27
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%value.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %value.prol, align 4, !tbaa !14
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%value = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %value, align 4, !tbaa !14
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%value.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %value.1, align 4, !tbaa !14
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !29
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp10 = icmp slt i32 %p, %r
br i1 %cmp10, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr11 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !27
%sub.i = add nsw i32 %p.tr11, -1
%1 = sext i32 %p.tr11 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%value.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %value.i.prol, align 4, !tbaa !14
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr11 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr11, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%value.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %value.i, align 4, !tbaa !14
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%value.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %value.i.1, align 4, !tbaa !14
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %n, i32 noundef %p.tr11, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%v = alloca i32, align 4
%A = alloca [100000 x %struct.Card], align 16
%B = alloca [100000 x %struct.Card], align 16
%S = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !28
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S, ptr noundef nonnull %v)
%1 = load i8, ptr %S, align 1, !tbaa !30
%arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !31
%arrayidx4 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx4, align 8, !tbaa !31
%2 = load i32, ptr %v, align 4, !tbaa !28
%value = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value, align 4, !tbaa !14
%value10 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value10, align 4, !tbaa !14
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !28
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !32
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr %n, align 4, !tbaa !28
%sub = add nsw i32 %5, -1
call void @quickSort(ptr noundef nonnull %B, i32 noundef %5, i32 noundef 0, i32 noundef %sub)
%cmp1465 = icmp sgt i32 %5, 0
br i1 %cmp1465, label %for.body15.preheader, label %if.end33
for.body15.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end27.unr-lcssa, label %for.body15.preheader.new
for.body15.preheader.new: ; preds = %for.body15.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body15
for.body15: ; preds = %for.body15, %for.body15.preheader.new
%indvars.iv73 = phi i64 [ 0, %for.body15.preheader.new ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067 = phi i32 [ 1, %for.body15.preheader.new ], [ %spec.select.3, %for.body15 ]
%niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.3, %for.body15 ]
%arrayidx17 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73
%7 = load i8, ptr %arrayidx17, align 16, !tbaa !31
%arrayidx20 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv73
%8 = load i8, ptr %arrayidx20, align 16, !tbaa !31
%cmp23.not = icmp eq i8 %7, %8
%indvars.iv.next74 = or i64 %indvars.iv73, 1
%arrayidx17.1 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74
%9 = load i8, ptr %arrayidx17.1, align 8, !tbaa !31
%arrayidx20.1 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74
%10 = load i8, ptr %arrayidx20.1, align 8, !tbaa !31
%cmp23.not.1 = icmp eq i8 %9, %10
%indvars.iv.next74.1 = or i64 %indvars.iv73, 2
%arrayidx17.2 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74.1
%11 = load i8, ptr %arrayidx17.2, align 16, !tbaa !31
%arrayidx20.2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74.1
%12 = load i8, ptr %arrayidx20.2, align 16, !tbaa !31
%cmp23.not.2 = icmp eq i8 %11, %12
%indvars.iv.next74.2 = or i64 %indvars.iv73, 3
%arrayidx17.3 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74.2
%13 = load i8, ptr %arrayidx17.3, align 8, !tbaa !31
%arrayidx20.3 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74.2
%14 = load i8, ptr %arrayidx20.3, align 8, !tbaa !31
%cmp23.not.3 = icmp eq i8 %13, %14
%15 = select i1 %cmp23.not.3, i1 %cmp23.not.2, i1 false
%16 = select i1 %15, i1 %cmp23.not.1, i1 false
%17 = select i1 %16, i1 %cmp23.not, i1 false
%spec.select.3 = select i1 %17, i32 %stable.067, i32 0
%indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end27.unr-lcssa, label %for.body15, !llvm.loop !33
for.end27.unr-lcssa: ; preds = %for.body15, %for.body15.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%indvars.iv73.unr = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067.unr = phi i32 [ 1, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end27, label %for.body15.epil
for.body15.epil: ; preds = %for.end27.unr-lcssa, %for.body15.epil
%indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %for.body15.epil ], [ %indvars.iv73.unr, %for.end27.unr-lcssa ]
%stable.067.epil = phi i32 [ %spec.select.epil, %for.body15.epil ], [ %stable.067.unr, %for.end27.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body15.epil ], [ 0, %for.end27.unr-lcssa ]
%arrayidx17.epil = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73.epil
%18 = load i8, ptr %arrayidx17.epil, align 8, !tbaa !31
%arrayidx20.epil = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv73.epil
%19 = load i8, ptr %arrayidx20.epil, align 8, !tbaa !31
%cmp23.not.epil = icmp eq i8 %18, %19
%spec.select.epil = select i1 %cmp23.not.epil, i32 %stable.067.epil, i32 0
%indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end27, label %for.body15.epil, !llvm.loop !34
for.end27: ; preds = %for.body15.epil, %for.end27.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end27.unr-lcssa ], [ %spec.select.epil, %for.body15.epil ]
%20 = icmp eq i32 %spec.select.lcssa, 1
%spec.select81 = select i1 %20, ptr @str.5, ptr @str
br label %if.end33
if.end33: ; preds = %for.end27, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select81, %for.end27 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%21 = load i32, ptr %n, align 4, !tbaa !28
%cmp3569 = icmp sgt i32 %21, 0
br i1 %cmp3569, label %for.body37, label %for.end48
for.body37: ; preds = %if.end33, %for.body37
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body37 ], [ 0, %if.end33 ]
%arrayidx39 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv76
%22 = load i8, ptr %arrayidx39, align 8, !tbaa !31
%conv41 = sext i8 %22 to i32
%value44 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv76, i32 1
%23 = load i32, ptr %value44, align 4, !tbaa !14
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv41, i32 noundef %23)
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%24 = load i32, ptr %n, align 4, !tbaa !28
%25 = sext i32 %24 to i64
%cmp35 = icmp slt i64 %indvars.iv.next77, %25
br i1 %cmp35, label %for.body37, label %for.end48, !llvm.loop !35
for.end48: ; preds = %for.body37, %if.end33
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !6, !7, !8}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !6, !7}
!14 = !{!15, !18, i64 4}
!15 = !{!"Card", !16, i64 0, !18, i64 4}
!16 = !{!"omnipotent char", !17, i64 0}
!17 = !{!"Simple C/C++ TBAA"}
!18 = !{!"int", !16, i64 0}
!19 = distinct !{!19, !6, !7}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6, !7, !8}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !6, !7, !8}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !6, !7}
!26 = distinct !{!26, !6, !7}
!27 = !{i64 0, i64 4, !28}
!28 = !{!18, !18, i64 0}
!29 = distinct !{!29, !6}
!30 = !{!16, !16, i64 0}
!31 = !{!15, !16, i64 0}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !6}
|
#include<stdio.h>
#define MAX 100000
#define SE 2000000000
typedef struct C {
char suit;
int value;
} Card;
Card L[MAX/2+2], R[MAX/2+2];
void merge(Card A[], int left, int mid, int right){
int i, j, k, n1, n2;
n1 = mid - left;
n2 = right - mid;
for( i = 0 ; i < n1 ; i++ ){
L[i] = A[left+i];
}
for( i = 0 ; i < n2 ; i++ ){
R[i] = A[mid+i];
}
L[n1].value = R[n2].value = SE;
i = j = 0;
for( k = left ; k < right ; k++ ){
if( L[i].value <= R[j].value ){
A[k] = L[i];
i = i +1;
}
else {
A[k] = R[j];
j = j + 1;
}
}
}
void mergeSort(Card A[], int left, int right){
int mid;
if( left + 1 < right ){
mid = ( left + right ) / 2;
mergeSort(A, left, mid);
mergeSort(A, mid, right);
merge(A, left, mid, right);
}
}
int partition(Card A[], int p, int r){
int i, j;
Card x, t;
x = A[r];
i = p-1;
for( j = p ; j < r ; j++ ){
if( A[j].value <= x.value ){
i++;
t = A[i];
A[i] = A[j];
A[j] = t;
}
}
t = A[i+1];
A[i+1] = A[r];
A[r] = t;
return i + 1;
}
void quickSort(Card A[], int p, int r){
int q;
if( p < r ){
q = partition(A, p, r);
quickSort(A, p, q-1);
quickSort(A, q+1, r);
}
}
int main(){
int n, i, v;
Card A[MAX], B[MAX];
char S[10];
int stable = 1;
scanf("%d", &n);
for( i = 0 ; i < n ; i++ ){
scanf("%s %d", S, &v);
A[i].suit = B[i].suit = S[0];
A[i].value = B[i].value = v;
}
mergeSort(A, 0, n);
quickSort(B, 0, n-1);
for( i = 0 ; i < n ; i++ ){
if( A[i].suit != B[i].suit ) stable = 0;
}
if( stable == 1 ) printf("Stable\n");
else printf("Not stable\n");
for( i = 0 ; i < n ; i++ ){
printf("%c %d\n", B[i].suit, B[i].value);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269680/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269680/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.C = type { i8, i32 }
@L = dso_local local_unnamed_addr global [50002 x %struct.C] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50002 x %struct.C] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%A91 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp68 = icmp sgt i32 %sub, 0
br i1 %cmp68, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.C, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader109, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A91
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader109, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.C, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load92 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load92, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !5
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader109
for.body.preheader109: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader109, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader109 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader109 ]
%arrayidx.prol = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.C, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !9
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader109
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader109 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp570 = icmp sgt i32 %sub1, 0
br i1 %cmp570, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count82 = zext i32 %sub1 to i64
%invariant.gep89 = getelementptr %struct.C, ptr %A, i64 %13
%min.iters.check97 = icmp ult i32 %sub1, 10
br i1 %min.iters.check97, label %for.body6.preheader108, label %vector.memcheck93
vector.memcheck93: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A91
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check94 = icmp ult i64 %16, 32
br i1 %diff.check94, label %for.body6.preheader108, label %vector.ph98
vector.ph98: ; preds = %vector.memcheck93
%n.vec100 = and i64 %wide.trip.count82, 4294967292
br label %vector.body103
vector.body103: ; preds = %vector.body103, %vector.ph98
%index104 = phi i64 [ 0, %vector.ph98 ], [ %index.next107, %vector.body103 ]
%17 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %index104
%18 = getelementptr %struct.C, ptr %invariant.gep89, i64 %index104
%wide.load105 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load106 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load105, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load106, ptr %20, align 16
%index.next107 = add nuw i64 %index104, 4
%21 = icmp eq i64 %index.next107, %n.vec100
br i1 %21, label %middle.block95, label %vector.body103, !llvm.loop !11
middle.block95: ; preds = %vector.body103
%cmp.n102 = icmp eq i64 %n.vec100, %wide.trip.count82
br i1 %cmp.n102, label %for.end14, label %for.body6.preheader108
for.body6.preheader108: ; preds = %vector.memcheck93, %for.body6.preheader, %middle.block95
%indvars.iv78.ph = phi i64 [ 0, %vector.memcheck93 ], [ 0, %for.body6.preheader ], [ %n.vec100, %middle.block95 ]
%22 = xor i64 %indvars.iv78.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82
%xtraiter110 = and i64 %wide.trip.count82, 3
%lcmp.mod111.not = icmp eq i64 %xtraiter110, 0
br i1 %lcmp.mod111.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader108, %for.body6.prol
%indvars.iv78.prol = phi i64 [ %indvars.iv.next79.prol, %for.body6.prol ], [ %indvars.iv78.ph, %for.body6.preheader108 ]
%prol.iter112 = phi i64 [ %prol.iter112.next, %for.body6.prol ], [ 0, %for.body6.preheader108 ]
%arrayidx8.prol = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %indvars.iv78.prol
%gep90.prol = getelementptr %struct.C, ptr %invariant.gep89, i64 %indvars.iv78.prol
%24 = load i64, ptr %gep90.prol, align 4
store i64 %24, ptr %arrayidx8.prol, align 8
%indvars.iv.next79.prol = add nuw nsw i64 %indvars.iv78.prol, 1
%prol.iter112.next = add i64 %prol.iter112, 1
%prol.iter112.cmp.not = icmp eq i64 %prol.iter112.next, %xtraiter110
br i1 %prol.iter112.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !12
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader108
%indvars.iv78.unr = phi i64 [ %indvars.iv78.ph, %for.body6.preheader108 ], [ %indvars.iv.next79.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.C, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.C, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.C, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.C, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !13
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv78 = phi i64 [ %indvars.iv.next79.3, %for.body6 ], [ %indvars.iv78.unr, %for.body6.prol.loopexit ]
%arrayidx8 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %indvars.iv78
%gep90 = getelementptr %struct.C, ptr %invariant.gep89, i64 %indvars.iv78
%30 = load i64, ptr %gep90, align 4
store i64 %30, ptr %arrayidx8, align 8
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%arrayidx8.1 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next79
%gep90.1 = getelementptr %struct.C, ptr %invariant.gep89, i64 %indvars.iv.next79
%31 = load i64, ptr %gep90.1, align 4
store i64 %31, ptr %arrayidx8.1, align 8
%indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 2
%arrayidx8.2 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next79.1
%gep90.2 = getelementptr %struct.C, ptr %invariant.gep89, i64 %indvars.iv.next79.1
%32 = load i64, ptr %gep90.2, align 4
store i64 %32, ptr %arrayidx8.2, align 8
%indvars.iv.next79.2 = add nuw nsw i64 %indvars.iv78, 3
%arrayidx8.3 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next79.2
%gep90.3 = getelementptr %struct.C, ptr %invariant.gep89, i64 %indvars.iv.next79.2
%33 = load i64, ptr %gep90.3, align 4
store i64 %33, ptr %arrayidx8.3, align 8
%indvars.iv.next79.3 = add nuw nsw i64 %indvars.iv78, 4
%exitcond83.not.3 = icmp eq i64 %indvars.iv.next79.3, %wide.trip.count82
br i1 %exitcond83.not.3, label %for.end14, label %for.body6, !llvm.loop !14
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block95, %for.cond4.preheader
%idxprom15 = sext i32 %sub1 to i64
%value = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %idxprom15, i32 1
store i32 2000000000, ptr %value, align 4, !tbaa !15
%idxprom17 = sext i32 %sub to i64
%value19 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %idxprom17, i32 1
store i32 2000000000, ptr %value19, align 4, !tbaa !15
%cmp2172 = icmp slt i32 %left, %right
br i1 %cmp2172, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count87 = sext i32 %right to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv84 = phi i64 [ %34, %for.body22.preheader ], [ %indvars.iv.next85, %for.body22 ]
%i.275 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%j.074 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%idxprom23 = zext i32 %i.275 to i64
%value25 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %idxprom23, i32 1
%35 = load i32, ptr %value25, align 4, !tbaa !15
%idxprom26 = zext i32 %j.074 to i64
%value28 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %idxprom26, i32 1
%36 = load i32, ptr %value28, align 4, !tbaa !15
%cmp29.not = icmp sgt i32 %35, %36
%arrayidx27 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx27, ptr %arrayidx24
%add39 = zext i1 %cmp29.not to i32
%j.1 = add nuw nsw i32 %j.074, %add39
%not.cmp29.not = xor i1 %cmp29.not, true
%add34 = zext i1 %not.cmp29.not to i32
%i.3 = add nuw nsw i32 %i.275, %add34
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv84
store i64 %.sink, ptr %37, align 4
%indvars.iv.next85 = add nsw i64 %indvars.iv84, 1
%exitcond88.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count87
br i1 %exitcond88.not, label %for.end42, label %for.body22, !llvm.loop !20
for.end42: ; preds = %for.body22, %for.end14
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 {
entry:
%A12 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp68.i = icmp sgt i32 %sub.i, 0
br i1 %cmp68.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.C, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A12
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.C, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load13 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load13, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.C, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp570.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp570.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count82.i = zext i32 %sub1.i to i64
%invariant.gep89.i = getelementptr %struct.C, ptr %A, i64 %13
%min.iters.check18 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check18, label %for.body6.i.preheader, label %vector.memcheck14
vector.memcheck14: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A12
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check15 = icmp ult i64 %16, 32
br i1 %diff.check15, label %for.body6.i.preheader, label %vector.ph19
vector.ph19: ; preds = %vector.memcheck14
%n.vec21 = and i64 %wide.trip.count82.i, 4294967292
br label %vector.body24
vector.body24: ; preds = %vector.body24, %vector.ph19
%index25 = phi i64 [ 0, %vector.ph19 ], [ %index.next28, %vector.body24 ]
%17 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %index25
%18 = getelementptr %struct.C, ptr %invariant.gep89.i, i64 %index25
%wide.load26 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load27 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load26, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load27, ptr %20, align 16
%index.next28 = add nuw i64 %index25, 4
%21 = icmp eq i64 %index.next28, %n.vec21
br i1 %21, label %middle.block16, label %vector.body24, !llvm.loop !23
middle.block16: ; preds = %vector.body24
%cmp.n23 = icmp eq i64 %n.vec21, %wide.trip.count82.i
br i1 %cmp.n23, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck14, %for.body6.preheader.i, %middle.block16
%indvars.iv78.i.ph = phi i64 [ 0, %vector.memcheck14 ], [ 0, %for.body6.preheader.i ], [ %n.vec21, %middle.block16 ]
%22 = xor i64 %indvars.iv78.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82.i
%xtraiter29 = and i64 %wide.trip.count82.i, 3
%lcmp.mod30.not = icmp eq i64 %xtraiter29, 0
br i1 %lcmp.mod30.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv78.i.prol = phi i64 [ %indvars.iv.next79.i.prol, %for.body6.i.prol ], [ %indvars.iv78.i.ph, %for.body6.i.preheader ]
%prol.iter31 = phi i64 [ %prol.iter31.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%arrayidx8.i.prol = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %indvars.iv78.i.prol
%gep90.i.prol = getelementptr %struct.C, ptr %invariant.gep89.i, i64 %indvars.iv78.i.prol
%24 = load i64, ptr %gep90.i.prol, align 4
store i64 %24, ptr %arrayidx8.i.prol, align 8
%indvars.iv.next79.i.prol = add nuw nsw i64 %indvars.iv78.i.prol, 1
%prol.iter31.next = add i64 %prol.iter31, 1
%prol.iter31.cmp.not = icmp eq i64 %prol.iter31.next, %xtraiter29
br i1 %prol.iter31.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !24
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv78.i.unr = phi i64 [ %indvars.iv78.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next79.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.C, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.C, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.C, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.C, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !25
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv78.i = phi i64 [ %indvars.iv.next79.i.3, %for.body6.i ], [ %indvars.iv78.i.unr, %for.body6.i.prol.loopexit ]
%arrayidx8.i = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %indvars.iv78.i
%gep90.i = getelementptr %struct.C, ptr %invariant.gep89.i, i64 %indvars.iv78.i
%30 = load i64, ptr %gep90.i, align 4
store i64 %30, ptr %arrayidx8.i, align 8
%indvars.iv.next79.i = add nuw nsw i64 %indvars.iv78.i, 1
%arrayidx8.i.1 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next79.i
%gep90.i.1 = getelementptr %struct.C, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i
%31 = load i64, ptr %gep90.i.1, align 4
store i64 %31, ptr %arrayidx8.i.1, align 8
%indvars.iv.next79.i.1 = add nuw nsw i64 %indvars.iv78.i, 2
%arrayidx8.i.2 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next79.i.1
%gep90.i.2 = getelementptr %struct.C, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.1
%32 = load i64, ptr %gep90.i.2, align 4
store i64 %32, ptr %arrayidx8.i.2, align 8
%indvars.iv.next79.i.2 = add nuw nsw i64 %indvars.iv78.i, 3
%arrayidx8.i.3 = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next79.i.2
%gep90.i.3 = getelementptr %struct.C, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.2
%33 = load i64, ptr %gep90.i.3, align 4
store i64 %33, ptr %arrayidx8.i.3, align 8
%indvars.iv.next79.i.3 = add nuw nsw i64 %indvars.iv78.i, 4
%exitcond83.not.i.3 = icmp eq i64 %indvars.iv.next79.i.3, %wide.trip.count82.i
br i1 %exitcond83.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !26
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block16, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub1.i to i64
%value.i = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %idxprom15.i, i32 1
store i32 2000000000, ptr %value.i, align 4, !tbaa !15
%idxprom17.i = sext i32 %sub.i to i64
%value19.i = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %idxprom17.i, i32 1
store i32 2000000000, ptr %value19.i, align 4, !tbaa !15
%34 = sext i32 %left to i64
%wide.trip.count87.i = sext i32 %right to i64
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i, %for.end14.i
%indvars.iv84.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next85.i, %for.body22.i ]
%i.275.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ]
%j.074.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ]
%idxprom23.i = zext i32 %i.275.i to i64
%value25.i = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %idxprom23.i, i32 1
%35 = load i32, ptr %value25.i, align 4, !tbaa !15
%idxprom26.i = zext i32 %j.074.i to i64
%value28.i = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %idxprom26.i, i32 1
%36 = load i32, ptr %value28.i, align 4, !tbaa !15
%cmp29.not.i = icmp sgt i32 %35, %36
%arrayidx27.i = getelementptr inbounds [50002 x %struct.C], ptr @R, i64 0, i64 %idxprom26.i
%arrayidx24.i = getelementptr inbounds [50002 x %struct.C], ptr @L, i64 0, i64 %idxprom23.i
%.sink.in.i = select i1 %cmp29.not.i, ptr %arrayidx27.i, ptr %arrayidx24.i
%add39.i = zext i1 %cmp29.not.i to i32
%j.1.i = add nuw nsw i32 %j.074.i, %add39.i
%not.cmp29.not.i = xor i1 %cmp29.not.i, true
%add34.i = zext i1 %not.cmp29.not.i to i32
%i.3.i = add nuw nsw i32 %i.275.i, %add34.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv84.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next85.i = add nsw i64 %indvars.iv84.i, 1
%exitcond88.not.i = icmp eq i64 %indvars.iv.next85.i, %wide.trip.count87.i
br i1 %exitcond88.not.i, label %if.end, label %for.body22.i, !llvm.loop !20
if.end: ; preds = %for.body22.i, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !27
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%value.prol = getelementptr inbounds %struct.C, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %value.prol, align 4, !tbaa !15
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.C, ptr %A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%value = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %value, align 4, !tbaa !15
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%value.1 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %value.1, align 4, !tbaa !15
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !29
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !27
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%value.i.prol = getelementptr inbounds %struct.C, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %value.i.prol, align 4, !tbaa !15
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.C, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr9 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr9, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%value.i = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %value.i, align 4, !tbaa !15
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%value.i.1 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %value.i.1, align 4, !tbaa !15
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%v = alloca i32, align 4
%A = alloca [100000 x %struct.C], align 16
%B = alloca [100000 x %struct.C], align 16
%S = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !28
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S, ptr noundef nonnull %v)
%1 = load i8, ptr %S, align 1, !tbaa !30
%arrayidx2 = getelementptr inbounds [100000 x %struct.C], ptr %B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !31
%arrayidx4 = getelementptr inbounds [100000 x %struct.C], ptr %A, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx4, align 8, !tbaa !31
%2 = load i32, ptr %v, align 4, !tbaa !28
%value = getelementptr inbounds [100000 x %struct.C], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value, align 4, !tbaa !15
%value10 = getelementptr inbounds [100000 x %struct.C], ptr %A, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value10, align 4, !tbaa !15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !28
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !32
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr %n, align 4, !tbaa !28
%sub = add nsw i32 %5, -1
call void @quickSort(ptr noundef nonnull %B, i32 noundef 0, i32 noundef %sub)
%cmp1465 = icmp sgt i32 %5, 0
br i1 %cmp1465, label %for.body15.preheader, label %if.end33
for.body15.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end27.unr-lcssa, label %for.body15.preheader.new
for.body15.preheader.new: ; preds = %for.body15.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body15
for.body15: ; preds = %for.body15, %for.body15.preheader.new
%indvars.iv73 = phi i64 [ 0, %for.body15.preheader.new ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067 = phi i32 [ 1, %for.body15.preheader.new ], [ %spec.select.3, %for.body15 ]
%niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.3, %for.body15 ]
%arrayidx17 = getelementptr inbounds [100000 x %struct.C], ptr %A, i64 0, i64 %indvars.iv73
%7 = load i8, ptr %arrayidx17, align 16, !tbaa !31
%arrayidx20 = getelementptr inbounds [100000 x %struct.C], ptr %B, i64 0, i64 %indvars.iv73
%8 = load i8, ptr %arrayidx20, align 16, !tbaa !31
%cmp23.not = icmp eq i8 %7, %8
%indvars.iv.next74 = or i64 %indvars.iv73, 1
%arrayidx17.1 = getelementptr inbounds [100000 x %struct.C], ptr %A, i64 0, i64 %indvars.iv.next74
%9 = load i8, ptr %arrayidx17.1, align 8, !tbaa !31
%arrayidx20.1 = getelementptr inbounds [100000 x %struct.C], ptr %B, i64 0, i64 %indvars.iv.next74
%10 = load i8, ptr %arrayidx20.1, align 8, !tbaa !31
%cmp23.not.1 = icmp eq i8 %9, %10
%indvars.iv.next74.1 = or i64 %indvars.iv73, 2
%arrayidx17.2 = getelementptr inbounds [100000 x %struct.C], ptr %A, i64 0, i64 %indvars.iv.next74.1
%11 = load i8, ptr %arrayidx17.2, align 16, !tbaa !31
%arrayidx20.2 = getelementptr inbounds [100000 x %struct.C], ptr %B, i64 0, i64 %indvars.iv.next74.1
%12 = load i8, ptr %arrayidx20.2, align 16, !tbaa !31
%cmp23.not.2 = icmp eq i8 %11, %12
%indvars.iv.next74.2 = or i64 %indvars.iv73, 3
%arrayidx17.3 = getelementptr inbounds [100000 x %struct.C], ptr %A, i64 0, i64 %indvars.iv.next74.2
%13 = load i8, ptr %arrayidx17.3, align 8, !tbaa !31
%arrayidx20.3 = getelementptr inbounds [100000 x %struct.C], ptr %B, i64 0, i64 %indvars.iv.next74.2
%14 = load i8, ptr %arrayidx20.3, align 8, !tbaa !31
%cmp23.not.3 = icmp eq i8 %13, %14
%15 = select i1 %cmp23.not.3, i1 %cmp23.not.2, i1 false
%16 = select i1 %15, i1 %cmp23.not.1, i1 false
%17 = select i1 %16, i1 %cmp23.not, i1 false
%spec.select.3 = select i1 %17, i32 %stable.067, i32 0
%indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end27.unr-lcssa, label %for.body15, !llvm.loop !33
for.end27.unr-lcssa: ; preds = %for.body15, %for.body15.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%indvars.iv73.unr = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067.unr = phi i32 [ 1, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end27, label %for.body15.epil
for.body15.epil: ; preds = %for.end27.unr-lcssa, %for.body15.epil
%indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %for.body15.epil ], [ %indvars.iv73.unr, %for.end27.unr-lcssa ]
%stable.067.epil = phi i32 [ %spec.select.epil, %for.body15.epil ], [ %stable.067.unr, %for.end27.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body15.epil ], [ 0, %for.end27.unr-lcssa ]
%arrayidx17.epil = getelementptr inbounds [100000 x %struct.C], ptr %A, i64 0, i64 %indvars.iv73.epil
%18 = load i8, ptr %arrayidx17.epil, align 8, !tbaa !31
%arrayidx20.epil = getelementptr inbounds [100000 x %struct.C], ptr %B, i64 0, i64 %indvars.iv73.epil
%19 = load i8, ptr %arrayidx20.epil, align 8, !tbaa !31
%cmp23.not.epil = icmp eq i8 %18, %19
%spec.select.epil = select i1 %cmp23.not.epil, i32 %stable.067.epil, i32 0
%indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end27, label %for.body15.epil, !llvm.loop !34
for.end27: ; preds = %for.body15.epil, %for.end27.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end27.unr-lcssa ], [ %spec.select.epil, %for.body15.epil ]
%20 = icmp eq i32 %spec.select.lcssa, 1
%spec.select81 = select i1 %20, ptr @str.5, ptr @str
br label %if.end33
if.end33: ; preds = %for.end27, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select81, %for.end27 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%21 = load i32, ptr %n, align 4, !tbaa !28
%cmp3569 = icmp sgt i32 %21, 0
br i1 %cmp3569, label %for.body37, label %for.end48
for.body37: ; preds = %if.end33, %for.body37
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body37 ], [ 0, %if.end33 ]
%arrayidx39 = getelementptr inbounds [100000 x %struct.C], ptr %B, i64 0, i64 %indvars.iv76
%22 = load i8, ptr %arrayidx39, align 8, !tbaa !31
%conv41 = sext i8 %22 to i32
%value44 = getelementptr inbounds [100000 x %struct.C], ptr %B, i64 0, i64 %indvars.iv76, i32 1
%23 = load i32, ptr %value44, align 4, !tbaa !15
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv41, i32 noundef %23)
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%24 = load i32, ptr %n, align 4, !tbaa !28
%25 = sext i32 %24 to i64
%cmp35 = icmp slt i64 %indvars.iv.next77, %25
br i1 %cmp35, label %for.body37, label %for.end48, !llvm.loop !35
for.end48: ; preds = %for.body37, %if.end33
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !6, !7, !8}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !6, !7}
!14 = distinct !{!14, !6, !7}
!15 = !{!16, !19, i64 4}
!16 = !{!"C", !17, i64 0, !19, i64 4}
!17 = !{!"omnipotent char", !18, i64 0}
!18 = !{!"Simple C/C++ TBAA"}
!19 = !{!"int", !17, i64 0}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6, !7, !8}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !6, !7, !8}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !6, !7}
!26 = distinct !{!26, !6, !7}
!27 = !{i64 0, i64 4, !28}
!28 = !{!19, !19, i64 0}
!29 = distinct !{!29, !6}
!30 = !{!17, !17, i64 0}
!31 = !{!16, !17, i64 0}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !6}
|
#include <stdio.h>
#define MAX 100000
struct T{
char mark;
int num;
};
int p(struct T A[],int a,int b);
void q(struct T A[],int a,int b);
void merge(struct T A[],int l,int m,int r);
void mergesort(struct T A[],int l,int r);
int n;
struct T L[MAX/2+2],R[MAX/2+2];
int main(){
int i,m,st=1;
struct T X[MAX],Y[MAX];
scanf("%d",&n);
for(i=0;i<n;i++){
getchar();
scanf("%c %d",&X[i].mark,&X[i].num);
Y[i]=X[i];
}
mergesort(X,0,n);
q(Y,0,n-1);
for(i=0;i<n;i++){
if(X[i].mark!=Y[i].mark) st=0;
}
if(st==1) printf("Stable\n");
else printf("Not stable\n");
for(i=0;i<n;i++)printf("%c %d\n",Y[i].mark,Y[i].num);
return 0;
}
int p(struct T A[],int a,int b){
int i,j;
struct T x,t;
x=A[b];
i=a-1;
for(j=a;j<b;j++){
if(A[j].num<=x.num){
i=i+1;
t=A[i];
A[i]=A[j];
A[j]=t;
}
}
t=A[i+1];
A[i+1]=A[b];
A[b]=t;
return i+1;
}
void q(struct T A[],int a,int b){
int m;
if(a<b){
m=p(A,a,b);
q(A,a,m-1);
q(A,m+1,b);
}
}
void merge(struct T A[],int l,int m,int r){
int n1,n2,i,j,k;
n1=m-l;
n2=r-m;
for(i=0;i<n1;i++) L[i]=A[l+i];
for(i=0;i<n2;i++) R[i]=A[m+i];
L[n1].num=R[n2].num=2000000000;
i=0,j=0;
for(k=l;k<r;k++){
if(L[i].num<=R[j].num){
A[k]=L[i];
i++;
}else{
A[k]=R[j];
j++;
}
}
}
void mergesort(struct T A[],int l,int r){
if(l+1<r){
int m;
m=(l+r)/2;
mergesort(A,l,m);
mergesort(A,m,r);
merge(A,l,m,r);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269738/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269738/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.T = type { i8, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [6 x i8] c"%c %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@L = dso_local local_unnamed_addr global [50002 x %struct.T] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50002 x %struct.T] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%X = alloca [100000 x %struct.T], align 16
%Y = alloca [100000 x %struct.T], align 16
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %X) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %Y) #8
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp60 = icmp sgt i32 %0, 0
br i1 %cmp60, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%1 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i = call i32 @getc(ptr noundef %1)
%arrayidx = getelementptr inbounds [100000 x %struct.T], ptr %X, i64 0, i64 %indvars.iv
%num = getelementptr inbounds [100000 x %struct.T], ptr %X, i64 0, i64 %indvars.iv, i32 1
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %num)
%arrayidx6 = getelementptr inbounds [100000 x %struct.T], ptr %Y, i64 0, i64 %indvars.iv
%2 = load i64, ptr %arrayidx, align 8
store i64 %2, ptr %arrayidx6, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergesort(ptr noundef nonnull %X, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr @n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
call void @q(ptr noundef nonnull %Y, i32 noundef 0, i32 noundef %sub)
%cmp1162 = icmp sgt i32 %5, 0
br i1 %cmp1162, label %for.body12.preheader, label %if.end30
for.body12.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end24.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body12
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%indvars.iv70 = phi i64 [ 0, %for.body12.preheader.new ], [ %indvars.iv.next71.3, %for.body12 ]
%st.064 = phi i32 [ 1, %for.body12.preheader.new ], [ %spec.select.3, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.3, %for.body12 ]
%arrayidx14 = getelementptr inbounds [100000 x %struct.T], ptr %X, i64 0, i64 %indvars.iv70
%7 = load i8, ptr %arrayidx14, align 16, !tbaa !13
%arrayidx17 = getelementptr inbounds [100000 x %struct.T], ptr %Y, i64 0, i64 %indvars.iv70
%8 = load i8, ptr %arrayidx17, align 16, !tbaa !13
%cmp20.not = icmp eq i8 %7, %8
%indvars.iv.next71 = or i64 %indvars.iv70, 1
%arrayidx14.1 = getelementptr inbounds [100000 x %struct.T], ptr %X, i64 0, i64 %indvars.iv.next71
%9 = load i8, ptr %arrayidx14.1, align 8, !tbaa !13
%arrayidx17.1 = getelementptr inbounds [100000 x %struct.T], ptr %Y, i64 0, i64 %indvars.iv.next71
%10 = load i8, ptr %arrayidx17.1, align 8, !tbaa !13
%cmp20.not.1 = icmp eq i8 %9, %10
%indvars.iv.next71.1 = or i64 %indvars.iv70, 2
%arrayidx14.2 = getelementptr inbounds [100000 x %struct.T], ptr %X, i64 0, i64 %indvars.iv.next71.1
%11 = load i8, ptr %arrayidx14.2, align 16, !tbaa !13
%arrayidx17.2 = getelementptr inbounds [100000 x %struct.T], ptr %Y, i64 0, i64 %indvars.iv.next71.1
%12 = load i8, ptr %arrayidx17.2, align 16, !tbaa !13
%cmp20.not.2 = icmp eq i8 %11, %12
%indvars.iv.next71.2 = or i64 %indvars.iv70, 3
%arrayidx14.3 = getelementptr inbounds [100000 x %struct.T], ptr %X, i64 0, i64 %indvars.iv.next71.2
%13 = load i8, ptr %arrayidx14.3, align 8, !tbaa !13
%arrayidx17.3 = getelementptr inbounds [100000 x %struct.T], ptr %Y, i64 0, i64 %indvars.iv.next71.2
%14 = load i8, ptr %arrayidx17.3, align 8, !tbaa !13
%cmp20.not.3 = icmp eq i8 %13, %14
%15 = select i1 %cmp20.not.3, i1 %cmp20.not.2, i1 false
%16 = select i1 %15, i1 %cmp20.not.1, i1 false
%17 = select i1 %16, i1 %cmp20.not, i1 false
%spec.select.3 = select i1 %17, i32 %st.064, i32 0
%indvars.iv.next71.3 = add nuw nsw i64 %indvars.iv70, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end24.unr-lcssa, label %for.body12, !llvm.loop !15
for.end24.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body12.preheader ], [ %spec.select.3, %for.body12 ]
%indvars.iv70.unr = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next71.3, %for.body12 ]
%st.064.unr = phi i32 [ 1, %for.body12.preheader ], [ %spec.select.3, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end24, label %for.body12.epil
for.body12.epil: ; preds = %for.end24.unr-lcssa, %for.body12.epil
%indvars.iv70.epil = phi i64 [ %indvars.iv.next71.epil, %for.body12.epil ], [ %indvars.iv70.unr, %for.end24.unr-lcssa ]
%st.064.epil = phi i32 [ %spec.select.epil, %for.body12.epil ], [ %st.064.unr, %for.end24.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body12.epil ], [ 0, %for.end24.unr-lcssa ]
%arrayidx14.epil = getelementptr inbounds [100000 x %struct.T], ptr %X, i64 0, i64 %indvars.iv70.epil
%18 = load i8, ptr %arrayidx14.epil, align 8, !tbaa !13
%arrayidx17.epil = getelementptr inbounds [100000 x %struct.T], ptr %Y, i64 0, i64 %indvars.iv70.epil
%19 = load i8, ptr %arrayidx17.epil, align 8, !tbaa !13
%cmp20.not.epil = icmp eq i8 %18, %19
%spec.select.epil = select i1 %cmp20.not.epil, i32 %st.064.epil, i32 0
%indvars.iv.next71.epil = add nuw nsw i64 %indvars.iv70.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end24, label %for.body12.epil, !llvm.loop !16
for.end24: ; preds = %for.body12.epil, %for.end24.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end24.unr-lcssa ], [ %spec.select.epil, %for.body12.epil ]
%20 = icmp eq i32 %spec.select.lcssa, 1
%spec.select78 = select i1 %20, ptr @str.5, ptr @str
br label %if.end30
if.end30: ; preds = %for.end24, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select78, %for.end24 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%21 = load i32, ptr @n, align 4, !tbaa !5
%cmp3266 = icmp sgt i32 %21, 0
br i1 %cmp3266, label %for.body34, label %for.end45
for.body34: ; preds = %if.end30, %for.body34
%indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.body34 ], [ 0, %if.end30 ]
%arrayidx36 = getelementptr inbounds [100000 x %struct.T], ptr %Y, i64 0, i64 %indvars.iv73
%22 = load i8, ptr %arrayidx36, align 8, !tbaa !13
%conv38 = sext i8 %22 to i32
%num41 = getelementptr inbounds [100000 x %struct.T], ptr %Y, i64 0, i64 %indvars.iv73, i32 1
%23 = load i32, ptr %num41, align 4, !tbaa !18
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv38, i32 noundef %23)
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%24 = load i32, ptr @n, align 4, !tbaa !5
%25 = sext i32 %24 to i64
%cmp32 = icmp slt i64 %indvars.iv.next74, %25
br i1 %cmp32, label %for.body34, label %for.end45, !llvm.loop !19
for.end45: ; preds = %for.body34, %if.end30
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %Y) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %X) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergesort(ptr noundef %A, i32 noundef %l, i32 noundef %r) local_unnamed_addr #3 {
entry:
%A12 = ptrtoint ptr %A to i64
%add = add nsw i32 %l, 1
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %r, %l
%div = sdiv i32 %add1, 2
tail call void @mergesort(ptr noundef %A, i32 noundef %l, i32 noundef %div)
tail call void @mergesort(ptr noundef %A, i32 noundef %div, i32 noundef %r)
%sub.i = sub nsw i32 %div, %l
%sub1.i = sub i32 %r, %div
%cmp68.i = icmp sgt i32 %sub.i, 0
br i1 %cmp68.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %l to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.T, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A12
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.T, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load13 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load13, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !20
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.T, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !23
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp570.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp570.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count82.i = zext i32 %sub1.i to i64
%invariant.gep89.i = getelementptr %struct.T, ptr %A, i64 %13
%min.iters.check18 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check18, label %for.body6.i.preheader, label %vector.memcheck14
vector.memcheck14: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A12
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check15 = icmp ult i64 %16, 32
br i1 %diff.check15, label %for.body6.i.preheader, label %vector.ph19
vector.ph19: ; preds = %vector.memcheck14
%n.vec21 = and i64 %wide.trip.count82.i, 4294967292
br label %vector.body24
vector.body24: ; preds = %vector.body24, %vector.ph19
%index25 = phi i64 [ 0, %vector.ph19 ], [ %index.next28, %vector.body24 ]
%17 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %index25
%18 = getelementptr %struct.T, ptr %invariant.gep89.i, i64 %index25
%wide.load26 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load27 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load26, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load27, ptr %20, align 16
%index.next28 = add nuw i64 %index25, 4
%21 = icmp eq i64 %index.next28, %n.vec21
br i1 %21, label %middle.block16, label %vector.body24, !llvm.loop !24
middle.block16: ; preds = %vector.body24
%cmp.n23 = icmp eq i64 %n.vec21, %wide.trip.count82.i
br i1 %cmp.n23, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck14, %for.body6.preheader.i, %middle.block16
%indvars.iv78.i.ph = phi i64 [ 0, %vector.memcheck14 ], [ 0, %for.body6.preheader.i ], [ %n.vec21, %middle.block16 ]
%22 = xor i64 %indvars.iv78.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82.i
%xtraiter29 = and i64 %wide.trip.count82.i, 3
%lcmp.mod30.not = icmp eq i64 %xtraiter29, 0
br i1 %lcmp.mod30.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv78.i.prol = phi i64 [ %indvars.iv.next79.i.prol, %for.body6.i.prol ], [ %indvars.iv78.i.ph, %for.body6.i.preheader ]
%prol.iter31 = phi i64 [ %prol.iter31.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%arrayidx8.i.prol = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %indvars.iv78.i.prol
%gep90.i.prol = getelementptr %struct.T, ptr %invariant.gep89.i, i64 %indvars.iv78.i.prol
%24 = load i64, ptr %gep90.i.prol, align 4
store i64 %24, ptr %arrayidx8.i.prol, align 8
%indvars.iv.next79.i.prol = add nuw nsw i64 %indvars.iv78.i.prol, 1
%prol.iter31.next = add i64 %prol.iter31, 1
%prol.iter31.cmp.not = icmp eq i64 %prol.iter31.next, %xtraiter29
br i1 %prol.iter31.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !25
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv78.i.unr = phi i64 [ %indvars.iv78.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next79.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.T, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.T, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.T, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.T, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !26
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv78.i = phi i64 [ %indvars.iv.next79.i.3, %for.body6.i ], [ %indvars.iv78.i.unr, %for.body6.i.prol.loopexit ]
%arrayidx8.i = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %indvars.iv78.i
%gep90.i = getelementptr %struct.T, ptr %invariant.gep89.i, i64 %indvars.iv78.i
%30 = load i64, ptr %gep90.i, align 4
store i64 %30, ptr %arrayidx8.i, align 8
%indvars.iv.next79.i = add nuw nsw i64 %indvars.iv78.i, 1
%arrayidx8.i.1 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %indvars.iv.next79.i
%gep90.i.1 = getelementptr %struct.T, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i
%31 = load i64, ptr %gep90.i.1, align 4
store i64 %31, ptr %arrayidx8.i.1, align 8
%indvars.iv.next79.i.1 = add nuw nsw i64 %indvars.iv78.i, 2
%arrayidx8.i.2 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %indvars.iv.next79.i.1
%gep90.i.2 = getelementptr %struct.T, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.1
%32 = load i64, ptr %gep90.i.2, align 4
store i64 %32, ptr %arrayidx8.i.2, align 8
%indvars.iv.next79.i.2 = add nuw nsw i64 %indvars.iv78.i, 3
%arrayidx8.i.3 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %indvars.iv.next79.i.2
%gep90.i.3 = getelementptr %struct.T, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.2
%33 = load i64, ptr %gep90.i.3, align 4
store i64 %33, ptr %arrayidx8.i.3, align 8
%indvars.iv.next79.i.3 = add nuw nsw i64 %indvars.iv78.i, 4
%exitcond83.not.i.3 = icmp eq i64 %indvars.iv.next79.i.3, %wide.trip.count82.i
br i1 %exitcond83.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !27
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block16, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub1.i to i64
%num.i = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %idxprom15.i, i32 1
store i32 2000000000, ptr %num.i, align 4, !tbaa !18
%idxprom17.i = sext i32 %sub.i to i64
%num19.i = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %idxprom17.i, i32 1
store i32 2000000000, ptr %num19.i, align 4, !tbaa !18
%34 = sext i32 %l to i64
%wide.trip.count87.i = sext i32 %r to i64
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i, %for.end14.i
%indvars.iv84.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next85.i, %for.body22.i ]
%j.074.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ]
%i.273.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ]
%idxprom23.i = zext i32 %i.273.i to i64
%num25.i = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %idxprom23.i, i32 1
%35 = load i32, ptr %num25.i, align 4, !tbaa !18
%idxprom26.i = zext i32 %j.074.i to i64
%num28.i = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %idxprom26.i, i32 1
%36 = load i32, ptr %num28.i, align 4, !tbaa !18
%cmp29.not.i = icmp sle i32 %35, %36
%arrayidx27.i = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %idxprom26.i
%arrayidx24.i = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %idxprom23.i
%.sink.in.i = select i1 %cmp29.not.i, ptr %arrayidx24.i, ptr %arrayidx27.i
%inc34.i = zext i1 %cmp29.not.i to i32
%i.3.i = add nuw nsw i32 %i.273.i, %inc34.i
%not.cmp29.not.i = xor i1 %cmp29.not.i, true
%inc39.i = zext i1 %not.cmp29.not.i to i32
%j.1.i = add nuw nsw i32 %j.074.i, %inc39.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.T, ptr %A, i64 %indvars.iv84.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next85.i = add nsw i64 %indvars.iv84.i, 1
%exitcond88.not.i = icmp eq i64 %indvars.iv.next85.i, %wide.trip.count87.i
br i1 %exitcond88.not.i, label %if.end, label %for.body22.i, !llvm.loop !28
if.end: ; preds = %for.body22.i, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @q(ptr nocapture noundef %A, i32 noundef %a, i32 noundef %b) local_unnamed_addr #4 {
entry:
%cmp8 = icmp slt i32 %a, %b
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %b to i64
%arrayidx.i = getelementptr inbounds %struct.T, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %p.exit
%a.tr9 = phi i32 [ %a, %for.body.preheader.i.lr.ph ], [ %add, %p.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !29
%sub.i = add nsw i32 %a.tr9, -1
%1 = sext i32 %a.tr9 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%num.i.prol = getelementptr inbounds %struct.T, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %num.i.prol, align 4, !tbaa !18
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.T, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %a.tr9 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.T, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %a.tr9, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %p.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%num.i = getelementptr inbounds %struct.T, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %num.i, align 4, !tbaa !18
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.T, ptr %A, i64 %indvars.iv.i
%add.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %add.i to i64
%arrayidx6.i = getelementptr inbounds %struct.T, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%num.i.1 = getelementptr inbounds %struct.T, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %num.i.1, align 4, !tbaa !18
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.T, ptr %A, i64 %indvars.iv.next.i
%add.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %add.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.T, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %add.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %p.exit, label %for.body.i, !llvm.loop !30
p.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.T, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @q(ptr noundef nonnull %A, i32 noundef %a.tr9, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %b
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %p.exit, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @p(ptr nocapture noundef %A, i32 noundef %a, i32 noundef %b) local_unnamed_addr #5 {
entry:
%idxprom = sext i32 %b to i64
%arrayidx = getelementptr inbounds %struct.T, ptr %A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !29
%cmp46 = icmp slt i32 %a, %b
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %a, -1
%0 = sext i32 %a to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%num.prol = getelementptr inbounds %struct.T, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %num.prol, align 4, !tbaa !18
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.T, ptr %A, i64 %0
%idxprom5.prol = sext i32 %a to i64
%arrayidx6.prol = getelementptr inbounds %struct.T, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %a, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%num = getelementptr inbounds %struct.T, ptr %A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %num, align 4, !tbaa !18
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.T, ptr %A, i64 %indvars.iv
%add = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %add to i64
%arrayidx6 = getelementptr inbounds %struct.T, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%num.1 = getelementptr inbounds %struct.T, ptr %A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %num.1, align 4, !tbaa !18
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.T, ptr %A, i64 %indvars.iv.next
%add.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %add.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.T, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !30
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %a, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.T, ptr %A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %l, i32 noundef %m, i32 noundef %r) local_unnamed_addr #6 {
entry:
%A91 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %m, %l
%sub1 = sub i32 %r, %m
%cmp68 = icmp sgt i32 %sub, 0
br i1 %cmp68, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %l to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.T, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader109, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A91
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader109, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.T, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load92 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load92, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !31
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader109
for.body.preheader109: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader109, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader109 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader109 ]
%arrayidx.prol = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.T, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !32
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader109
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader109 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp570 = icmp sgt i32 %sub1, 0
br i1 %cmp570, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %m to i64
%wide.trip.count82 = zext i32 %sub1 to i64
%invariant.gep89 = getelementptr %struct.T, ptr %A, i64 %13
%min.iters.check97 = icmp ult i32 %sub1, 10
br i1 %min.iters.check97, label %for.body6.preheader108, label %vector.memcheck93
vector.memcheck93: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A91
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check94 = icmp ult i64 %16, 32
br i1 %diff.check94, label %for.body6.preheader108, label %vector.ph98
vector.ph98: ; preds = %vector.memcheck93
%n.vec100 = and i64 %wide.trip.count82, 4294967292
br label %vector.body103
vector.body103: ; preds = %vector.body103, %vector.ph98
%index104 = phi i64 [ 0, %vector.ph98 ], [ %index.next107, %vector.body103 ]
%17 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %index104
%18 = getelementptr %struct.T, ptr %invariant.gep89, i64 %index104
%wide.load105 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load106 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load105, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load106, ptr %20, align 16
%index.next107 = add nuw i64 %index104, 4
%21 = icmp eq i64 %index.next107, %n.vec100
br i1 %21, label %middle.block95, label %vector.body103, !llvm.loop !33
middle.block95: ; preds = %vector.body103
%cmp.n102 = icmp eq i64 %n.vec100, %wide.trip.count82
br i1 %cmp.n102, label %for.end14, label %for.body6.preheader108
for.body6.preheader108: ; preds = %vector.memcheck93, %for.body6.preheader, %middle.block95
%indvars.iv78.ph = phi i64 [ 0, %vector.memcheck93 ], [ 0, %for.body6.preheader ], [ %n.vec100, %middle.block95 ]
%22 = xor i64 %indvars.iv78.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82
%xtraiter110 = and i64 %wide.trip.count82, 3
%lcmp.mod111.not = icmp eq i64 %xtraiter110, 0
br i1 %lcmp.mod111.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader108, %for.body6.prol
%indvars.iv78.prol = phi i64 [ %indvars.iv.next79.prol, %for.body6.prol ], [ %indvars.iv78.ph, %for.body6.preheader108 ]
%prol.iter112 = phi i64 [ %prol.iter112.next, %for.body6.prol ], [ 0, %for.body6.preheader108 ]
%arrayidx8.prol = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %indvars.iv78.prol
%gep90.prol = getelementptr %struct.T, ptr %invariant.gep89, i64 %indvars.iv78.prol
%24 = load i64, ptr %gep90.prol, align 4
store i64 %24, ptr %arrayidx8.prol, align 8
%indvars.iv.next79.prol = add nuw nsw i64 %indvars.iv78.prol, 1
%prol.iter112.next = add i64 %prol.iter112, 1
%prol.iter112.cmp.not = icmp eq i64 %prol.iter112.next, %xtraiter110
br i1 %prol.iter112.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !34
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader108
%indvars.iv78.unr = phi i64 [ %indvars.iv78.ph, %for.body6.preheader108 ], [ %indvars.iv.next79.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.T, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.T, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.T, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.T, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !35
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv78 = phi i64 [ %indvars.iv.next79.3, %for.body6 ], [ %indvars.iv78.unr, %for.body6.prol.loopexit ]
%arrayidx8 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %indvars.iv78
%gep90 = getelementptr %struct.T, ptr %invariant.gep89, i64 %indvars.iv78
%30 = load i64, ptr %gep90, align 4
store i64 %30, ptr %arrayidx8, align 8
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%arrayidx8.1 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %indvars.iv.next79
%gep90.1 = getelementptr %struct.T, ptr %invariant.gep89, i64 %indvars.iv.next79
%31 = load i64, ptr %gep90.1, align 4
store i64 %31, ptr %arrayidx8.1, align 8
%indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 2
%arrayidx8.2 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %indvars.iv.next79.1
%gep90.2 = getelementptr %struct.T, ptr %invariant.gep89, i64 %indvars.iv.next79.1
%32 = load i64, ptr %gep90.2, align 4
store i64 %32, ptr %arrayidx8.2, align 8
%indvars.iv.next79.2 = add nuw nsw i64 %indvars.iv78, 3
%arrayidx8.3 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %indvars.iv.next79.2
%gep90.3 = getelementptr %struct.T, ptr %invariant.gep89, i64 %indvars.iv.next79.2
%33 = load i64, ptr %gep90.3, align 4
store i64 %33, ptr %arrayidx8.3, align 8
%indvars.iv.next79.3 = add nuw nsw i64 %indvars.iv78, 4
%exitcond83.not.3 = icmp eq i64 %indvars.iv.next79.3, %wide.trip.count82
br i1 %exitcond83.not.3, label %for.end14, label %for.body6, !llvm.loop !36
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block95, %for.cond4.preheader
%idxprom15 = sext i32 %sub1 to i64
%num = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %idxprom15, i32 1
store i32 2000000000, ptr %num, align 4, !tbaa !18
%idxprom17 = sext i32 %sub to i64
%num19 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %idxprom17, i32 1
store i32 2000000000, ptr %num19, align 4, !tbaa !18
%cmp2172 = icmp slt i32 %l, %r
br i1 %cmp2172, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%34 = sext i32 %l to i64
%wide.trip.count87 = sext i32 %r to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv84 = phi i64 [ %34, %for.body22.preheader ], [ %indvars.iv.next85, %for.body22 ]
%j.074 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%i.273 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%idxprom23 = zext i32 %i.273 to i64
%num25 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %idxprom23, i32 1
%35 = load i32, ptr %num25, align 4, !tbaa !18
%idxprom26 = zext i32 %j.074 to i64
%num28 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %idxprom26, i32 1
%36 = load i32, ptr %num28, align 4, !tbaa !18
%cmp29.not = icmp sle i32 %35, %36
%arrayidx27 = getelementptr inbounds [50002 x %struct.T], ptr @R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [50002 x %struct.T], ptr @L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx24, ptr %arrayidx27
%inc34 = zext i1 %cmp29.not to i32
%i.3 = add nuw nsw i32 %i.273, %inc34
%not.cmp29.not = xor i1 %cmp29.not, true
%inc39 = zext i1 %not.cmp29.not to i32
%j.1 = add nuw nsw i32 %j.074, %inc39
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.T, ptr %A, i64 %indvars.iv84
store i64 %.sink, ptr %37, align 4
%indvars.iv.next85 = add nsw i64 %indvars.iv84, 1
%exitcond88.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count87
br i1 %exitcond88.not, label %for.end42, label %for.body22, !llvm.loop !28
for.end42: ; preds = %for.body22, %for.end14
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !7, i64 0}
!14 = !{!"T", !7, i64 0, !6, i64 4}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = !{!14, !6, i64 4}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !17}
!24 = distinct !{!24, !12, !21, !22}
!25 = distinct !{!25, !17}
!26 = distinct !{!26, !12, !21}
!27 = distinct !{!27, !12, !21}
!28 = distinct !{!28, !12}
!29 = !{i64 0, i64 4, !5}
!30 = distinct !{!30, !12}
!31 = distinct !{!31, !12, !21, !22}
!32 = distinct !{!32, !17}
!33 = distinct !{!33, !12, !21, !22}
!34 = distinct !{!34, !17}
!35 = distinct !{!35, !12, !21}
!36 = distinct !{!36, !12, !21}
|
#include <stdio.h>
#define m 100000
struct Card{
char c;int v;
};
struct Card L[m/2+2],R[m/2+2];
void swap(struct Card A,struct Card B){
struct Card t = A;
A = B;
B = t;
}
void merge(struct Card a[],int left,int mid,int right){
int i,j,k;
int n1 = mid - left;
int n2 = right - mid;
for(i=0;i<n1;i++) L[i] = a[left+i];
for(i=0;i<n2;i++) R[i] = a[mid+i];
i = j = 0;
L[n1].v = R[n2].v = 2000000000;
for(k=left;k<right;k++){
if(L[i].v<=R[j].v) a[k] = L[i++];
else a[k] = R[j++];
}
}
void mergeSort(struct Card a[],int left,int right){
if(left+1<right){
int mid = (left+right)/2;
mergeSort(a,left,mid);
mergeSort(a,mid,right);
merge(a,left,mid,right);
}
}
int partition(struct Card a[],int left,int right){
struct Card x,t;
x = a[right];
int i = left - 1;
for(int j=left;j<right;j++){
if(a[j].v<=x.v){
i++;
t = a[i];a[i] = a[j];a[j]=t;
}
}
t = a[i+1];a[i+1] = a[right];a[right]=t;
return i+1;
}
void quickSort(struct Card a[],int left,int right){
if(left<right){
int p = partition(a,left,right);
quickSort(a,left,p-1);
quickSort(a,p+1,right);
}
}
int main(){
struct Card A[m],B[m];
int n,i,num;
char s[10];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s %d",s,&num);
A[i].c=B[i].c=s[0];
A[i].v=B[i].v=num;
}
mergeSort(A,0,n);
quickSort(B,0,n-1);
int flag = 1;
for(i=0;i<n;i++){
if(A[i].c != B[i].c){
flag = 0;
break;
}
}
if(flag) printf("Stable\n");
else printf("Not stable\n");
for(i=0;i<n;i++){
printf("%c %d\n",B[i].c,B[i].v);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269781/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269781/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Card = type { i8, i32 }
@L = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local void @swap(i64 %A.coerce, i64 %B.coerce) local_unnamed_addr #0 {
entry:
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %a, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #2 {
entry:
%a89 = ptrtoint ptr %a to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp66 = icmp sgt i32 %sub, 0
br i1 %cmp66, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.Card, ptr %a, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader107, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %a89
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader107, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load90 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load90, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !5
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader107
for.body.preheader107: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader107, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader107 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader107 ]
%arrayidx.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !9
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader107
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader107 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp568 = icmp sgt i32 %sub1, 0
br i1 %cmp568, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count80 = zext i32 %sub1 to i64
%invariant.gep87 = getelementptr %struct.Card, ptr %a, i64 %13
%min.iters.check95 = icmp ult i32 %sub1, 10
br i1 %min.iters.check95, label %for.body6.preheader106, label %vector.memcheck91
vector.memcheck91: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %a89
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check92 = icmp ult i64 %16, 32
br i1 %diff.check92, label %for.body6.preheader106, label %vector.ph96
vector.ph96: ; preds = %vector.memcheck91
%n.vec98 = and i64 %wide.trip.count80, 4294967292
br label %vector.body101
vector.body101: ; preds = %vector.body101, %vector.ph96
%index102 = phi i64 [ 0, %vector.ph96 ], [ %index.next105, %vector.body101 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index102
%18 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %index102
%wide.load103 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load104 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load103, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load104, ptr %20, align 16
%index.next105 = add nuw i64 %index102, 4
%21 = icmp eq i64 %index.next105, %n.vec98
br i1 %21, label %middle.block93, label %vector.body101, !llvm.loop !11
middle.block93: ; preds = %vector.body101
%cmp.n100 = icmp eq i64 %n.vec98, %wide.trip.count80
br i1 %cmp.n100, label %for.end14, label %for.body6.preheader106
for.body6.preheader106: ; preds = %vector.memcheck91, %for.body6.preheader, %middle.block93
%indvars.iv76.ph = phi i64 [ 0, %vector.memcheck91 ], [ 0, %for.body6.preheader ], [ %n.vec98, %middle.block93 ]
%22 = xor i64 %indvars.iv76.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80
%xtraiter108 = and i64 %wide.trip.count80, 3
%lcmp.mod109.not = icmp eq i64 %xtraiter108, 0
br i1 %lcmp.mod109.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader106, %for.body6.prol
%indvars.iv76.prol = phi i64 [ %indvars.iv.next77.prol, %for.body6.prol ], [ %indvars.iv76.ph, %for.body6.preheader106 ]
%prol.iter110 = phi i64 [ %prol.iter110.next, %for.body6.prol ], [ 0, %for.body6.preheader106 ]
%arrayidx8.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.prol
%gep88.prol = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv76.prol
%24 = load i64, ptr %gep88.prol, align 4
store i64 %24, ptr %arrayidx8.prol, align 8
%indvars.iv.next77.prol = add nuw nsw i64 %indvars.iv76.prol, 1
%prol.iter110.next = add i64 %prol.iter110, 1
%prol.iter110.cmp.not = icmp eq i64 %prol.iter110.next, %xtraiter108
br i1 %prol.iter110.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !12
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader106
%indvars.iv76.unr = phi i64 [ %indvars.iv76.ph, %for.body6.preheader106 ], [ %indvars.iv.next77.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !13
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv76 = phi i64 [ %indvars.iv.next77.3, %for.body6 ], [ %indvars.iv76.unr, %for.body6.prol.loopexit ]
%arrayidx8 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76
%gep88 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv76
%30 = load i64, ptr %gep88, align 4
store i64 %30, ptr %arrayidx8, align 8
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%arrayidx8.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77
%gep88.1 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77
%31 = load i64, ptr %gep88.1, align 4
store i64 %31, ptr %arrayidx8.1, align 8
%indvars.iv.next77.1 = add nuw nsw i64 %indvars.iv76, 2
%arrayidx8.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.1
%gep88.2 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77.1
%32 = load i64, ptr %gep88.2, align 4
store i64 %32, ptr %arrayidx8.2, align 8
%indvars.iv.next77.2 = add nuw nsw i64 %indvars.iv76, 3
%arrayidx8.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.2
%gep88.3 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77.2
%33 = load i64, ptr %gep88.3, align 4
store i64 %33, ptr %arrayidx8.3, align 8
%indvars.iv.next77.3 = add nuw nsw i64 %indvars.iv76, 4
%exitcond81.not.3 = icmp eq i64 %indvars.iv.next77.3, %wide.trip.count80
br i1 %exitcond81.not.3, label %for.end14, label %for.body6, !llvm.loop !14
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block93, %for.cond4.preheader
%idxprom15 = sext i32 %sub1 to i64
%v = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom15, i32 1
store i32 2000000000, ptr %v, align 4, !tbaa !15
%idxprom17 = sext i32 %sub to i64
%v19 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17, i32 1
store i32 2000000000, ptr %v19, align 4, !tbaa !15
%cmp2170 = icmp slt i32 %left, %right
br i1 %cmp2170, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count85 = sext i32 %right to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv82 = phi i64 [ %34, %for.body22.preheader ], [ %indvars.iv.next83, %for.body22 ]
%i.273 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%j.072 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%idxprom23 = zext i32 %i.273 to i64
%v25 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23, i32 1
%35 = load i32, ptr %v25, align 4, !tbaa !15
%idxprom26 = zext i32 %j.072 to i64
%v28 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26, i32 1
%36 = load i32, ptr %v28, align 4, !tbaa !15
%cmp29.not = icmp sgt i32 %35, %36
%arrayidx27 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx27, ptr %arrayidx24
%inc37 = zext i1 %cmp29.not to i32
%j.1 = add nuw nsw i32 %j.072, %inc37
%not.cmp29.not = xor i1 %cmp29.not, true
%inc32 = zext i1 %not.cmp29.not to i32
%i.3 = add nuw nsw i32 %i.273, %inc32
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv82
store i64 %.sink, ptr %37, align 4
%indvars.iv.next83 = add nsw i64 %indvars.iv82, 1
%exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
br i1 %exitcond86.not, label %for.end42, label %for.body22, !llvm.loop !20
for.end42: ; preds = %for.body22, %for.end14
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %a, i32 noundef %left, i32 noundef %right) local_unnamed_addr #3 {
entry:
%a12 = ptrtoint ptr %a to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %a, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %a, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp66.i = icmp sgt i32 %sub.i, 0
br i1 %cmp66.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.Card, ptr %a, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %a12
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load13 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load13, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp568.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp568.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count80.i = zext i32 %sub1.i to i64
%invariant.gep87.i = getelementptr %struct.Card, ptr %a, i64 %13
%min.iters.check18 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check18, label %for.body6.i.preheader, label %vector.memcheck14
vector.memcheck14: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %a12
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check15 = icmp ult i64 %16, 32
br i1 %diff.check15, label %for.body6.i.preheader, label %vector.ph19
vector.ph19: ; preds = %vector.memcheck14
%n.vec21 = and i64 %wide.trip.count80.i, 4294967292
br label %vector.body24
vector.body24: ; preds = %vector.body24, %vector.ph19
%index25 = phi i64 [ 0, %vector.ph19 ], [ %index.next28, %vector.body24 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index25
%18 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %index25
%wide.load26 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load27 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load26, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load27, ptr %20, align 16
%index.next28 = add nuw i64 %index25, 4
%21 = icmp eq i64 %index.next28, %n.vec21
br i1 %21, label %middle.block16, label %vector.body24, !llvm.loop !23
middle.block16: ; preds = %vector.body24
%cmp.n23 = icmp eq i64 %n.vec21, %wide.trip.count80.i
br i1 %cmp.n23, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck14, %for.body6.preheader.i, %middle.block16
%indvars.iv76.i.ph = phi i64 [ 0, %vector.memcheck14 ], [ 0, %for.body6.preheader.i ], [ %n.vec21, %middle.block16 ]
%22 = xor i64 %indvars.iv76.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80.i
%xtraiter29 = and i64 %wide.trip.count80.i, 3
%lcmp.mod30.not = icmp eq i64 %xtraiter29, 0
br i1 %lcmp.mod30.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv76.i.prol = phi i64 [ %indvars.iv.next77.i.prol, %for.body6.i.prol ], [ %indvars.iv76.i.ph, %for.body6.i.preheader ]
%prol.iter31 = phi i64 [ %prol.iter31.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%arrayidx8.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.i.prol
%gep88.i.prol = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv76.i.prol
%24 = load i64, ptr %gep88.i.prol, align 4
store i64 %24, ptr %arrayidx8.i.prol, align 8
%indvars.iv.next77.i.prol = add nuw nsw i64 %indvars.iv76.i.prol, 1
%prol.iter31.next = add i64 %prol.iter31, 1
%prol.iter31.cmp.not = icmp eq i64 %prol.iter31.next, %xtraiter29
br i1 %prol.iter31.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !24
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv76.i.unr = phi i64 [ %indvars.iv76.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next77.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !25
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv76.i = phi i64 [ %indvars.iv.next77.i.3, %for.body6.i ], [ %indvars.iv76.i.unr, %for.body6.i.prol.loopexit ]
%arrayidx8.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.i
%gep88.i = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv76.i
%30 = load i64, ptr %gep88.i, align 4
store i64 %30, ptr %arrayidx8.i, align 8
%indvars.iv.next77.i = add nuw nsw i64 %indvars.iv76.i, 1
%arrayidx8.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i
%gep88.i.1 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i
%31 = load i64, ptr %gep88.i.1, align 4
store i64 %31, ptr %arrayidx8.i.1, align 8
%indvars.iv.next77.i.1 = add nuw nsw i64 %indvars.iv76.i, 2
%arrayidx8.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i.1
%gep88.i.2 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.1
%32 = load i64, ptr %gep88.i.2, align 4
store i64 %32, ptr %arrayidx8.i.2, align 8
%indvars.iv.next77.i.2 = add nuw nsw i64 %indvars.iv76.i, 3
%arrayidx8.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i.2
%gep88.i.3 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.2
%33 = load i64, ptr %gep88.i.3, align 4
store i64 %33, ptr %arrayidx8.i.3, align 8
%indvars.iv.next77.i.3 = add nuw nsw i64 %indvars.iv76.i, 4
%exitcond81.not.i.3 = icmp eq i64 %indvars.iv.next77.i.3, %wide.trip.count80.i
br i1 %exitcond81.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !26
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block16, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub1.i to i64
%v.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom15.i, i32 1
store i32 2000000000, ptr %v.i, align 4, !tbaa !15
%idxprom17.i = sext i32 %sub.i to i64
%v19.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17.i, i32 1
store i32 2000000000, ptr %v19.i, align 4, !tbaa !15
%34 = sext i32 %left to i64
%wide.trip.count85.i = sext i32 %right to i64
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i, %for.end14.i
%indvars.iv82.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next83.i, %for.body22.i ]
%i.273.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ]
%j.072.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ]
%idxprom23.i = zext i32 %i.273.i to i64
%v25.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i, i32 1
%35 = load i32, ptr %v25.i, align 4, !tbaa !15
%idxprom26.i = zext i32 %j.072.i to i64
%v28.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i, i32 1
%36 = load i32, ptr %v28.i, align 4, !tbaa !15
%cmp29.not.i = icmp sgt i32 %35, %36
%arrayidx27.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i
%arrayidx24.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i
%.sink.in.i = select i1 %cmp29.not.i, ptr %arrayidx27.i, ptr %arrayidx24.i
%inc37.i = zext i1 %cmp29.not.i to i32
%j.1.i = add nuw nsw i32 %j.072.i, %inc37.i
%not.cmp29.not.i = xor i1 %cmp29.not.i, true
%inc32.i = zext i1 %not.cmp29.not.i to i32
%i.3.i = add nuw nsw i32 %i.273.i, %inc32.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv82.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next83.i = add nsw i64 %indvars.iv82.i, 1
%exitcond86.not.i = icmp eq i64 %indvars.iv.next83.i, %wide.trip.count85.i
br i1 %exitcond86.not.i, label %if.end, label %for.body22.i, !llvm.loop !20
if.end: ; preds = %for.body22.i, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %a, i32 noundef %left, i32 noundef %right) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %right to i64
%arrayidx = getelementptr inbounds %struct.Card, ptr %a, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !27
%cmp46 = icmp slt i32 %left, %right
br i1 %cmp46, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %left, -1
%0 = sext i32 %left to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%v.prol = getelementptr inbounds %struct.Card, ptr %a, i64 %0, i32 1
%2 = load i32, ptr %v.prol, align 4, !tbaa !15
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %a, i64 %0
%idxprom5.prol = sext i32 %left to i64
%arrayidx6.prol = getelementptr inbounds %struct.Card, ptr %a, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %left, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.cond.cleanup.loopexit, label %for.body
for.cond.cleanup.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%8 = add nsw i32 %i.1.lcssa, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%i.0.lcssa = phi i32 [ %left, %entry ], [ %8, %for.cond.cleanup.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %a, i64 %idxprom14
%9 = load i64, ptr %arrayidx15, align 4
%10 = load i64, ptr %arrayidx, align 4
store i64 %10, ptr %arrayidx15, align 4
store i64 %9, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.047 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.047.unr, %for.body.prol.loopexit ]
%v = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv, i32 1
%11 = load i32, ptr %v, align 4, !tbaa !15
%cmp4.not = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv
%inc = add nsw i32 %i.047, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %a, i64 %idxprom5
%12 = load i64, ptr %arrayidx6, align 4
%13 = load i64, ptr %arrayidx2, align 4
store i64 %13, ptr %arrayidx6, align 4
store i64 %12, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%v.1 = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.next, i32 1
%14 = load i32, ptr %v.1, align 4, !tbaa !15
%cmp4.not.1 = icmp sgt i32 %14, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.Card, ptr %a, i64 %idxprom5.1
%15 = load i64, ptr %arrayidx6.1, align 4
%16 = load i64, ptr %arrayidx2.1, align 4
store i64 %16, ptr %arrayidx6.1, align 4
store i64 %15, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !29
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %a, i32 noundef %left, i32 noundef %right) local_unnamed_addr #5 {
entry:
%cmp8 = icmp slt i32 %left, %right
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %right to i64
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %a, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%left.tr9 = phi i32 [ %left, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !27
%sub.i = add nsw i32 %left.tr9, -1
%1 = sext i32 %left.tr9 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%v.i.prol = getelementptr inbounds %struct.Card, ptr %a, i64 %1, i32 1
%3 = load i32, ptr %v.i.prol, align 4, !tbaa !15
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card, ptr %a, i64 %1
%idxprom5.i.prol = sext i32 %left.tr9 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card, ptr %a, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %left.tr9, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.047.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.047.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.047.i.unr, %for.body.i.prol.loopexit ]
%v.i = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %v.i, align 4, !tbaa !15
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %a, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%v.i.1 = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %v.i.1, align 4, !tbaa !15
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card, ptr %a, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %a, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %a, i32 noundef %left.tr9, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #6 {
entry:
%A = alloca [100000 x %struct.Card], align 16
%B = alloca [100000 x %struct.Card], align 16
%n = alloca i32, align 4
%num = alloca i32, align 4
%s = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #9
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #9
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !28
%cmp61 = icmp sgt i32 %0, 0
br i1 %cmp61, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %num)
%1 = load i8, ptr %s, align 1, !tbaa !30
%arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !31
%arrayidx4 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx4, align 8, !tbaa !31
%2 = load i32, ptr %num, align 4, !tbaa !28
%v = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %v, align 4, !tbaa !15
%v10 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %v10, align 4, !tbaa !15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !28
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !32
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr %n, align 4, !tbaa !28
%sub = add nsw i32 %5, -1
call void @quickSort(ptr noundef nonnull %B, i32 noundef 0, i32 noundef %sub)
%cmp1463 = icmp sgt i32 %5, 0
br i1 %cmp1463, label %for.body15.preheader, label %if.end31
for.body15.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
br label %for.body15
for.cond13: ; preds = %for.body15
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%exitcond.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count
br i1 %exitcond.not, label %if.end31, label %for.body15, !llvm.loop !33
for.body15: ; preds = %for.body15.preheader, %for.cond13
%indvars.iv69 = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next70, %for.cond13 ]
%arrayidx17 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv69
%6 = load i8, ptr %arrayidx17, align 8, !tbaa !31
%arrayidx20 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv69
%7 = load i8, ptr %arrayidx20, align 8, !tbaa !31
%cmp23.not = icmp eq i8 %6, %7
br i1 %cmp23.not, label %for.cond13, label %if.end31
if.end31: ; preds = %for.body15, %for.cond13, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ @str.5, %for.cond13 ], [ @str, %for.body15 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%8 = load i32, ptr %n, align 4, !tbaa !28
%cmp3365 = icmp sgt i32 %8, 0
br i1 %cmp3365, label %for.body35, label %for.end46
for.body35: ; preds = %if.end31, %for.body35
%indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body35 ], [ 0, %if.end31 ]
%arrayidx37 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv72
%9 = load i8, ptr %arrayidx37, align 8, !tbaa !31
%conv39 = sext i8 %9 to i32
%v42 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv72, i32 1
%10 = load i32, ptr %v42, align 4, !tbaa !15
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv39, i32 noundef %10)
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%11 = load i32, ptr %n, align 4, !tbaa !28
%12 = sext i32 %11 to i64
%cmp33 = icmp slt i64 %indvars.iv.next73, %12
br i1 %cmp33, label %for.body35, label %for.end46, !llvm.loop !34
for.end46: ; preds = %for.body35, %if.end31
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #9
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !6, !7, !8}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !6, !7}
!14 = distinct !{!14, !6, !7}
!15 = !{!16, !19, i64 4}
!16 = !{!"Card", !17, i64 0, !19, i64 4}
!17 = !{!"omnipotent char", !18, i64 0}
!18 = !{!"Simple C/C++ TBAA"}
!19 = !{!"int", !17, i64 0}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6, !7, !8}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !6, !7, !8}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !6, !7}
!26 = distinct !{!26, !6, !7}
!27 = !{i64 0, i64 4, !28}
!28 = !{!19, !19, i64 0}
!29 = distinct !{!29, !6}
!30 = !{!17, !17, i64 0}
!31 = !{!16, !17, i64 0}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !6}
|
#include<stdio.h>
#define N 1000000
typedef struct{
int num,id;
char mark;
} card;
void swap(card *a,card* b){
card t=*a;*a=*b,*b=t;
}
int partition(card *A,int p,int r){
int x=A[r].num,i=p-1,j;
for(j=p;j<r;j++){
if(A[j].num<=x){
i=i+1;
swap(&A[i],&A[j]);
}
}
swap(&A[i+1],&A[r]);
return i+1;
}
void quickSort(card *A,int p,int r){
if(p<r){
int q=partition(A,p,r);
quickSort(A,p,q-1);
quickSort(A,q+1,r);
}
}
int isStable(card *a,int n){
int i;
for(i=0;i<n-1;i++){
if(a[i].num==a[i+1].num && a[i].id>a[i+1].id)return 0;
}
return 1;
}
int main(void){
int n,i;
card A[N];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf(" %c %d",&A[i].mark,&A[i].num);
A[i].id=i;
}
quickSort(A,0,n-1);
printf("%s\n",isStable(A,n)?"Stable":"Not stable");
for(i=0;i<n;i++)
printf("%c %d\n",A[i].mark,A[i].num);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269831/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269831/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.card = type { i32, i32, i8 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c" %c %d\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
@.str.4 = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@.str.5 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%t = alloca %struct.card, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %t, ptr noundef nonnull align 4 dereferenceable(12) %a, i64 12, i1 false), !tbaa.struct !5
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %a, ptr noundef nonnull align 4 dereferenceable(12) %b, i64 12, i1 false), !tbaa.struct !5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %b, ptr noundef nonnull align 4 dereferenceable(12) %t, i64 12, i1 false), !tbaa.struct !5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%t.i29 = alloca %struct.card, align 4
%t.i = alloca %struct.card, align 4
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !11
%cmp30 = icmp slt i32 %p, %r
br i1 %cmp30, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.031 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !11
%cmp4.not = icmp sgt i32 %2, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%add = add nsw i32 %i.031, 1
%idxprom5 = sext i32 %add to i64
%arrayidx6 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom5
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t.i)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %t.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, i64 12, i1 false), !tbaa.struct !5
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, i64 12, i1 false), !tbaa.struct !5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, ptr noundef nonnull align 4 dereferenceable(12) %t.i, i64 12, i1 false), !tbaa.struct !5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t.i)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.031, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !13
for.end.loopexit: ; preds = %for.inc
%3 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %3, %for.end.loopexit ]
%idxprom10 = sext i32 %i.0.lcssa to i64
%arrayidx11 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom10
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t.i29)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %t.i29, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, i64 12, i1 false), !tbaa.struct !5
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false), !tbaa.struct !5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, ptr noundef nonnull align 4 dereferenceable(12) %t.i29, i64 12, i1 false), !tbaa.struct !5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t.i29)
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%t.i29.i = alloca %struct.card, align 4
%t.i.i = alloca %struct.card, align 4
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !11
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%i.031.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ]
%arrayidx2.i = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.i
%2 = load i32, ptr %arrayidx2.i, align 4, !tbaa !11
%cmp4.not.i = icmp sgt i32 %2, %0
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%add.i = add nsw i32 %i.031.i, 1
%idxprom5.i = sext i32 %add.i to i64
%arrayidx6.i = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom5.i
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t.i.i)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %t.i.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, i64 12, i1 false), !tbaa.struct !5
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, i64 12, i1 false), !tbaa.struct !5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, ptr noundef nonnull align 4 dereferenceable(12) %t.i.i, i64 12, i1 false), !tbaa.struct !5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t.i.i)
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.031.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %partition.exit, label %for.body.i, !llvm.loop !13
partition.exit: ; preds = %for.inc.i
%3 = add nsw i32 %i.1.i, 1
%idxprom10.i = sext i32 %3 to i64
%arrayidx11.i = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom10.i
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t.i29.i)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %t.i29.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i, i64 12, i1 false), !tbaa.struct !5
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, i64 12, i1 false), !tbaa.struct !5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, ptr noundef nonnull align 4 dereferenceable(12) %t.i29.i, i64 12, i1 false), !tbaa.struct !5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t.i29.i)
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i)
%add = add nsw i32 %i.1.i, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @isStable(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #4 {
entry:
%cmp20 = icmp sgt i32 %n, 1
br i1 %cmp20, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %a, align 4, !tbaa !11
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%0 = phi i32 [ %.pre, %for.body.preheader ], [ %1, %for.inc ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds %struct.card, ptr %a, i64 %indvars.iv.next
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !11
%cmp4 = icmp eq i32 %0, %1
br i1 %cmp4, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%id = getelementptr inbounds %struct.card, ptr %a, i64 %indvars.iv, i32 1
%2 = load i32, ptr %id, align 4, !tbaa !15
%id10 = getelementptr inbounds %struct.card, ptr %a, i64 %indvars.iv.next, i32 1
%3 = load i32, ptr %id10, align 4, !tbaa !15
%cmp11 = icmp sgt i32 %2, %3
br i1 %cmp11, label %cleanup, label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !16
cleanup: ; preds = %land.lhs.true, %for.inc, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %for.inc ], [ 0, %land.lhs.true ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%A = alloca [1000000 x %struct.card], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 12000000, ptr nonnull %A) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !6
%cmp33 = icmp sgt i32 %0, 0
br i1 %cmp33, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub43 = add nsw i32 %0, -1
call void @quickSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub43)
br label %isStable.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x %struct.card], ptr %A, i64 0, i64 %indvars.iv
%mark = getelementptr inbounds [1000000 x %struct.card], ptr %A, i64 0, i64 %indvars.iv, i32 2
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %mark, ptr noundef nonnull %arrayidx)
%id = getelementptr inbounds [1000000 x %struct.card], ptr %A, i64 0, i64 %indvars.iv, i32 1
%1 = trunc i64 %indvars.iv to i32
store i32 %1, ptr %id, align 4, !tbaa !15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !6
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !17
for.end: ; preds = %for.body
%sub = add nsw i32 %2, -1
call void @quickSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub)
%cmp20.i = icmp sgt i32 %2, 1
br i1 %cmp20.i, label %for.body.preheader.i, label %isStable.exit
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %sub to i64
%.pre.i = load i32, ptr %A, align 16, !tbaa !11
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%4 = phi i32 [ %.pre.i, %for.body.preheader.i ], [ %5, %for.inc.i ]
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx2.i = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.next.i
%5 = load i32, ptr %arrayidx2.i, align 4, !tbaa !11
%cmp4.i = icmp eq i32 %4, %5
br i1 %cmp4.i, label %land.lhs.true.i, label %for.inc.i
land.lhs.true.i: ; preds = %for.body.i
%id.i = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.i, i32 1
%6 = load i32, ptr %id.i, align 4, !tbaa !15
%id10.i = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.next.i, i32 1
%7 = load i32, ptr %id10.i, align 4, !tbaa !15
%cmp11.i = icmp sgt i32 %6, %7
br i1 %cmp11.i, label %isStable.exit, label %for.inc.i
for.inc.i: ; preds = %land.lhs.true.i, %for.body.i
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %isStable.exit, label %for.body.i, !llvm.loop !16
isStable.exit: ; preds = %for.inc.i, %land.lhs.true.i, %for.end.thread, %for.end
%8 = phi ptr [ @.str.3, %for.end ], [ @.str.3, %for.end.thread ], [ @.str.3, %for.inc.i ], [ @.str.4, %land.lhs.true.i ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %8)
%9 = load i32, ptr %n, align 4, !tbaa !6
%cmp1035 = icmp sgt i32 %9, 0
br i1 %cmp1035, label %for.body11, label %for.end21
for.body11: ; preds = %isStable.exit, %for.body11
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body11 ], [ 0, %isStable.exit ]
%arrayidx13 = getelementptr inbounds [1000000 x %struct.card], ptr %A, i64 0, i64 %indvars.iv39
%mark14 = getelementptr inbounds [1000000 x %struct.card], ptr %A, i64 0, i64 %indvars.iv39, i32 2
%10 = load i8, ptr %mark14, align 4, !tbaa !18
%conv = sext i8 %10 to i32
%11 = load i32, ptr %arrayidx13, align 4, !tbaa !11
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %conv, i32 noundef %11)
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%12 = load i32, ptr %n, align 4, !tbaa !6
%13 = sext i32 %12 to i64
%cmp10 = icmp slt i64 %indvars.iv.next40, %13
br i1 %cmp10, label %for.body11, label %for.end21, !llvm.loop !19
for.end21: ; preds = %for.body11, %isStable.exit
call void @llvm.lifetime.end.p0(i64 12000000, ptr nonnull %A) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 1, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!8, !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"", !7, i64 0, !7, i64 4, !8, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!12, !7, i64 4}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = !{!12, !8, i64 8}
!19 = distinct !{!19, !14}
|
#include<stdio.h>
#include<stdlib.h>
#define MAX 100000
#define SENTINEL 200000000
typedef struct{
char moji;
int fig;
}Card;
Card L[MAX/2 + 2], R[MAX/2 + 2];
void quickSort(Card *, int, int);
void merge(Card *, int, int, int);
void mergeSort(Card *, int, int);
int partition(Card *, int, int);
int n;
int main()
{
int i;
int stable = 1;
int fig;
char s[10];
Card A[MAX],B[MAX];
scanf("%d",&n);
for(i = 0; i < n; i++){
scanf("%s %d",s,&fig);
A[i].moji = B[i].moji = s[0];
A[i].fig = B[i].fig = fig;
}
mergeSort(A,0,n);
quickSort(B,0,n-1);
for(i = 0; i < n; i++){
if(A[i].moji != B[i].moji)stable = 0;
}
if(stable == 1)printf("Stable\n");
else printf("Not stable\n");
for(i = 0; i < n; i++){
printf("%c %d\n",B[i].moji, B[i].fig);
}
return 0;
}
void merge(Card A[], int left, int mid, int right)
{
int i,j,k;
int n1 = mid - left;
int n2 = right - mid;
for(i = 0; i < n1; i++)L[i] = A[left + i];
for(i = 0; i < n2; i++)R[i] = A[mid + i];
L[n1].fig = R[n2].fig = SENTINEL;
i = j = 0;
for(k = left; k < right; k++){
if(L[i].fig <= R[j].fig){
A[k] = L[i++];
}else{
A[k] = R[j++];
}
}
}
void mergeSort(Card A[], int left, int right)
{
int mid;
if(left + 1 < right){
mid = (left + right)/2;
mergeSort(A,left,mid);
mergeSort(A,mid,right);
merge(A,left,mid,right);
}
}
int partition(Card A[], int p, int r)
{
int i,j;
Card t,x;
x = A[r];
i = p - 1;
for(j = p; j < r; j++){
if(A[j].fig <= x.fig){
i++;
t = A[i];
A[i] = A[j];
A[j] = t;
}
}
t = A[i + 1];
A[i + 1] = A[r];
A[r] = t;
return i + 1;
}
void quickSort(Card A[], int p, int r)
{
int q;
if(p < r){
q = partition(A,p,r);
quickSort(A,p,q-1);
quickSort(A,q+1,r);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269875/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269875/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Card = type { i8, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@L = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%fig = alloca i32, align 4
%s = alloca [10 x i8], align 1
%A = alloca [100000 x %struct.Card], align 16
%B = alloca [100000 x %struct.Card], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %fig) #8
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #8
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp64 = icmp sgt i32 %0, 0
br i1 %cmp64, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %fig)
%1 = load i8, ptr %s, align 1, !tbaa !9
%arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !10
%arrayidx4 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx4, align 8, !tbaa !10
%2 = load i32, ptr %fig, align 4, !tbaa !5
%fig8 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %fig8, align 4, !tbaa !12
%fig11 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %fig11, align 4, !tbaa !12
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !13
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr @n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
call void @quickSort(ptr noundef nonnull %B, i32 noundef 0, i32 noundef %sub)
%cmp1566 = icmp sgt i32 %5, 0
br i1 %cmp1566, label %for.body16.preheader, label %if.end34
for.body16.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end28.unr-lcssa, label %for.body16.preheader.new
for.body16.preheader.new: ; preds = %for.body16.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body16
for.body16: ; preds = %for.body16, %for.body16.preheader.new
%indvars.iv74 = phi i64 [ 0, %for.body16.preheader.new ], [ %indvars.iv.next75.3, %for.body16 ]
%stable.068 = phi i32 [ 1, %for.body16.preheader.new ], [ %spec.select.3, %for.body16 ]
%niter = phi i64 [ 0, %for.body16.preheader.new ], [ %niter.next.3, %for.body16 ]
%arrayidx18 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv74
%7 = load i8, ptr %arrayidx18, align 16, !tbaa !10
%arrayidx21 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv74
%8 = load i8, ptr %arrayidx21, align 16, !tbaa !10
%cmp24.not = icmp eq i8 %7, %8
%indvars.iv.next75 = or i64 %indvars.iv74, 1
%arrayidx18.1 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next75
%9 = load i8, ptr %arrayidx18.1, align 8, !tbaa !10
%arrayidx21.1 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next75
%10 = load i8, ptr %arrayidx21.1, align 8, !tbaa !10
%cmp24.not.1 = icmp eq i8 %9, %10
%indvars.iv.next75.1 = or i64 %indvars.iv74, 2
%arrayidx18.2 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next75.1
%11 = load i8, ptr %arrayidx18.2, align 16, !tbaa !10
%arrayidx21.2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next75.1
%12 = load i8, ptr %arrayidx21.2, align 16, !tbaa !10
%cmp24.not.2 = icmp eq i8 %11, %12
%indvars.iv.next75.2 = or i64 %indvars.iv74, 3
%arrayidx18.3 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next75.2
%13 = load i8, ptr %arrayidx18.3, align 8, !tbaa !10
%arrayidx21.3 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next75.2
%14 = load i8, ptr %arrayidx21.3, align 8, !tbaa !10
%cmp24.not.3 = icmp eq i8 %13, %14
%15 = select i1 %cmp24.not.3, i1 %cmp24.not.2, i1 false
%16 = select i1 %15, i1 %cmp24.not.1, i1 false
%17 = select i1 %16, i1 %cmp24.not, i1 false
%spec.select.3 = select i1 %17, i32 %stable.068, i32 0
%indvars.iv.next75.3 = add nuw nsw i64 %indvars.iv74, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end28.unr-lcssa, label %for.body16, !llvm.loop !15
for.end28.unr-lcssa: ; preds = %for.body16, %for.body16.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body16.preheader ], [ %spec.select.3, %for.body16 ]
%indvars.iv74.unr = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next75.3, %for.body16 ]
%stable.068.unr = phi i32 [ 1, %for.body16.preheader ], [ %spec.select.3, %for.body16 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end28, label %for.body16.epil
for.body16.epil: ; preds = %for.end28.unr-lcssa, %for.body16.epil
%indvars.iv74.epil = phi i64 [ %indvars.iv.next75.epil, %for.body16.epil ], [ %indvars.iv74.unr, %for.end28.unr-lcssa ]
%stable.068.epil = phi i32 [ %spec.select.epil, %for.body16.epil ], [ %stable.068.unr, %for.end28.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body16.epil ], [ 0, %for.end28.unr-lcssa ]
%arrayidx18.epil = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv74.epil
%18 = load i8, ptr %arrayidx18.epil, align 8, !tbaa !10
%arrayidx21.epil = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv74.epil
%19 = load i8, ptr %arrayidx21.epil, align 8, !tbaa !10
%cmp24.not.epil = icmp eq i8 %18, %19
%spec.select.epil = select i1 %cmp24.not.epil, i32 %stable.068.epil, i32 0
%indvars.iv.next75.epil = add nuw nsw i64 %indvars.iv74.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end28, label %for.body16.epil, !llvm.loop !16
for.end28: ; preds = %for.body16.epil, %for.end28.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end28.unr-lcssa ], [ %spec.select.epil, %for.body16.epil ]
%20 = icmp eq i32 %spec.select.lcssa, 1
%spec.select82 = select i1 %20, ptr @str.5, ptr @str
br label %if.end34
if.end34: ; preds = %for.end28, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select82, %for.end28 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%21 = load i32, ptr @n, align 4, !tbaa !5
%cmp3670 = icmp sgt i32 %21, 0
br i1 %cmp3670, label %for.body38, label %for.end49
for.body38: ; preds = %if.end34, %for.body38
%indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body38 ], [ 0, %if.end34 ]
%arrayidx40 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv77
%22 = load i8, ptr %arrayidx40, align 8, !tbaa !10
%conv42 = sext i8 %22 to i32
%fig45 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv77, i32 1
%23 = load i32, ptr %fig45, align 4, !tbaa !12
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv42, i32 noundef %23)
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%24 = load i32, ptr @n, align 4, !tbaa !5
%25 = sext i32 %24 to i64
%cmp36 = icmp slt i64 %indvars.iv.next78, %25
br i1 %cmp36, label %for.body38, label %for.end49, !llvm.loop !18
for.end49: ; preds = %for.body38, %if.end34
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %fig) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #3 {
entry:
%A12 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp66.i = icmp sgt i32 %sub.i, 0
br i1 %cmp66.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A12
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load13 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load13, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !19
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp568.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp568.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count80.i = zext i32 %sub1.i to i64
%invariant.gep87.i = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check18 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check18, label %for.body6.i.preheader, label %vector.memcheck14
vector.memcheck14: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A12
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check15 = icmp ult i64 %16, 32
br i1 %diff.check15, label %for.body6.i.preheader, label %vector.ph19
vector.ph19: ; preds = %vector.memcheck14
%n.vec21 = and i64 %wide.trip.count80.i, 4294967292
br label %vector.body24
vector.body24: ; preds = %vector.body24, %vector.ph19
%index25 = phi i64 [ 0, %vector.ph19 ], [ %index.next28, %vector.body24 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index25
%18 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %index25
%wide.load26 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load27 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load26, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load27, ptr %20, align 16
%index.next28 = add nuw i64 %index25, 4
%21 = icmp eq i64 %index.next28, %n.vec21
br i1 %21, label %middle.block16, label %vector.body24, !llvm.loop !23
middle.block16: ; preds = %vector.body24
%cmp.n23 = icmp eq i64 %n.vec21, %wide.trip.count80.i
br i1 %cmp.n23, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck14, %for.body6.preheader.i, %middle.block16
%indvars.iv76.i.ph = phi i64 [ 0, %vector.memcheck14 ], [ 0, %for.body6.preheader.i ], [ %n.vec21, %middle.block16 ]
%22 = xor i64 %indvars.iv76.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80.i
%xtraiter29 = and i64 %wide.trip.count80.i, 3
%lcmp.mod30.not = icmp eq i64 %xtraiter29, 0
br i1 %lcmp.mod30.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv76.i.prol = phi i64 [ %indvars.iv.next77.i.prol, %for.body6.i.prol ], [ %indvars.iv76.i.ph, %for.body6.i.preheader ]
%prol.iter31 = phi i64 [ %prol.iter31.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%arrayidx8.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.i.prol
%gep88.i.prol = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv76.i.prol
%24 = load i64, ptr %gep88.i.prol, align 4
store i64 %24, ptr %arrayidx8.i.prol, align 8
%indvars.iv.next77.i.prol = add nuw nsw i64 %indvars.iv76.i.prol, 1
%prol.iter31.next = add i64 %prol.iter31, 1
%prol.iter31.cmp.not = icmp eq i64 %prol.iter31.next, %xtraiter29
br i1 %prol.iter31.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !24
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv76.i.unr = phi i64 [ %indvars.iv76.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next77.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !25
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv76.i = phi i64 [ %indvars.iv.next77.i.3, %for.body6.i ], [ %indvars.iv76.i.unr, %for.body6.i.prol.loopexit ]
%arrayidx8.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.i
%gep88.i = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv76.i
%30 = load i64, ptr %gep88.i, align 4
store i64 %30, ptr %arrayidx8.i, align 8
%indvars.iv.next77.i = add nuw nsw i64 %indvars.iv76.i, 1
%arrayidx8.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i
%gep88.i.1 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i
%31 = load i64, ptr %gep88.i.1, align 4
store i64 %31, ptr %arrayidx8.i.1, align 8
%indvars.iv.next77.i.1 = add nuw nsw i64 %indvars.iv76.i, 2
%arrayidx8.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i.1
%gep88.i.2 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.1
%32 = load i64, ptr %gep88.i.2, align 4
store i64 %32, ptr %arrayidx8.i.2, align 8
%indvars.iv.next77.i.2 = add nuw nsw i64 %indvars.iv76.i, 3
%arrayidx8.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i.2
%gep88.i.3 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.2
%33 = load i64, ptr %gep88.i.3, align 4
store i64 %33, ptr %arrayidx8.i.3, align 8
%indvars.iv.next77.i.3 = add nuw nsw i64 %indvars.iv76.i, 4
%exitcond81.not.i.3 = icmp eq i64 %indvars.iv.next77.i.3, %wide.trip.count80.i
br i1 %exitcond81.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !26
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block16, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub1.i to i64
%fig.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom15.i, i32 1
store i32 200000000, ptr %fig.i, align 4, !tbaa !12
%idxprom17.i = sext i32 %sub.i to i64
%fig19.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17.i, i32 1
store i32 200000000, ptr %fig19.i, align 4, !tbaa !12
%34 = sext i32 %left to i64
%wide.trip.count85.i = sext i32 %right to i64
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i, %for.end14.i
%indvars.iv82.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next83.i, %for.body22.i ]
%i.273.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ]
%j.072.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ]
%idxprom23.i = zext i32 %i.273.i to i64
%fig25.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i, i32 1
%35 = load i32, ptr %fig25.i, align 4, !tbaa !12
%idxprom26.i = zext i32 %j.072.i to i64
%fig28.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i, i32 1
%36 = load i32, ptr %fig28.i, align 4, !tbaa !12
%cmp29.not.i = icmp sgt i32 %35, %36
%arrayidx27.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i
%arrayidx24.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i
%.sink.in.i = select i1 %cmp29.not.i, ptr %arrayidx27.i, ptr %arrayidx24.i
%inc37.i = zext i1 %cmp29.not.i to i32
%j.1.i = add nuw nsw i32 %j.072.i, %inc37.i
%not.cmp29.not.i = xor i1 %cmp29.not.i, true
%inc32.i = zext i1 %not.cmp29.not.i to i32
%i.3.i = add nuw nsw i32 %i.273.i, %inc32.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv82.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next83.i = add nsw i64 %indvars.iv82.i, 1
%exitcond86.not.i = icmp eq i64 %indvars.iv.next83.i, %wide.trip.count85.i
br i1 %exitcond86.not.i, label %if.end, label %for.body22.i, !llvm.loop !27
if.end: ; preds = %for.body22.i, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !28
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%fig.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %fig.i.prol, align 4, !tbaa !12
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr9 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr9, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%fig.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %fig.i, align 4, !tbaa !12
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%fig.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %fig.i.1, align 4, !tbaa !12
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #5 {
entry:
%A89 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp66 = icmp sgt i32 %sub, 0
br i1 %cmp66, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader107, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A89
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader107, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load90 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load90, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !30
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader107
for.body.preheader107: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader107, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader107 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader107 ]
%arrayidx.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !31
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader107
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader107 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp568 = icmp sgt i32 %sub1, 0
br i1 %cmp568, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count80 = zext i32 %sub1 to i64
%invariant.gep87 = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check95 = icmp ult i32 %sub1, 10
br i1 %min.iters.check95, label %for.body6.preheader106, label %vector.memcheck91
vector.memcheck91: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A89
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check92 = icmp ult i64 %16, 32
br i1 %diff.check92, label %for.body6.preheader106, label %vector.ph96
vector.ph96: ; preds = %vector.memcheck91
%n.vec98 = and i64 %wide.trip.count80, 4294967292
br label %vector.body101
vector.body101: ; preds = %vector.body101, %vector.ph96
%index102 = phi i64 [ 0, %vector.ph96 ], [ %index.next105, %vector.body101 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index102
%18 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %index102
%wide.load103 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load104 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load103, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load104, ptr %20, align 16
%index.next105 = add nuw i64 %index102, 4
%21 = icmp eq i64 %index.next105, %n.vec98
br i1 %21, label %middle.block93, label %vector.body101, !llvm.loop !32
middle.block93: ; preds = %vector.body101
%cmp.n100 = icmp eq i64 %n.vec98, %wide.trip.count80
br i1 %cmp.n100, label %for.end14, label %for.body6.preheader106
for.body6.preheader106: ; preds = %vector.memcheck91, %for.body6.preheader, %middle.block93
%indvars.iv76.ph = phi i64 [ 0, %vector.memcheck91 ], [ 0, %for.body6.preheader ], [ %n.vec98, %middle.block93 ]
%22 = xor i64 %indvars.iv76.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80
%xtraiter108 = and i64 %wide.trip.count80, 3
%lcmp.mod109.not = icmp eq i64 %xtraiter108, 0
br i1 %lcmp.mod109.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader106, %for.body6.prol
%indvars.iv76.prol = phi i64 [ %indvars.iv.next77.prol, %for.body6.prol ], [ %indvars.iv76.ph, %for.body6.preheader106 ]
%prol.iter110 = phi i64 [ %prol.iter110.next, %for.body6.prol ], [ 0, %for.body6.preheader106 ]
%arrayidx8.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.prol
%gep88.prol = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv76.prol
%24 = load i64, ptr %gep88.prol, align 4
store i64 %24, ptr %arrayidx8.prol, align 8
%indvars.iv.next77.prol = add nuw nsw i64 %indvars.iv76.prol, 1
%prol.iter110.next = add i64 %prol.iter110, 1
%prol.iter110.cmp.not = icmp eq i64 %prol.iter110.next, %xtraiter108
br i1 %prol.iter110.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !33
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader106
%indvars.iv76.unr = phi i64 [ %indvars.iv76.ph, %for.body6.preheader106 ], [ %indvars.iv.next77.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !34
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv76 = phi i64 [ %indvars.iv.next77.3, %for.body6 ], [ %indvars.iv76.unr, %for.body6.prol.loopexit ]
%arrayidx8 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76
%gep88 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv76
%30 = load i64, ptr %gep88, align 4
store i64 %30, ptr %arrayidx8, align 8
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%arrayidx8.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77
%gep88.1 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77
%31 = load i64, ptr %gep88.1, align 4
store i64 %31, ptr %arrayidx8.1, align 8
%indvars.iv.next77.1 = add nuw nsw i64 %indvars.iv76, 2
%arrayidx8.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.1
%gep88.2 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77.1
%32 = load i64, ptr %gep88.2, align 4
store i64 %32, ptr %arrayidx8.2, align 8
%indvars.iv.next77.2 = add nuw nsw i64 %indvars.iv76, 3
%arrayidx8.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.2
%gep88.3 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77.2
%33 = load i64, ptr %gep88.3, align 4
store i64 %33, ptr %arrayidx8.3, align 8
%indvars.iv.next77.3 = add nuw nsw i64 %indvars.iv76, 4
%exitcond81.not.3 = icmp eq i64 %indvars.iv.next77.3, %wide.trip.count80
br i1 %exitcond81.not.3, label %for.end14, label %for.body6, !llvm.loop !35
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block93, %for.cond4.preheader
%idxprom15 = sext i32 %sub1 to i64
%fig = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom15, i32 1
store i32 200000000, ptr %fig, align 4, !tbaa !12
%idxprom17 = sext i32 %sub to i64
%fig19 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17, i32 1
store i32 200000000, ptr %fig19, align 4, !tbaa !12
%cmp2170 = icmp slt i32 %left, %right
br i1 %cmp2170, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count85 = sext i32 %right to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv82 = phi i64 [ %34, %for.body22.preheader ], [ %indvars.iv.next83, %for.body22 ]
%i.273 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%j.072 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%idxprom23 = zext i32 %i.273 to i64
%fig25 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23, i32 1
%35 = load i32, ptr %fig25, align 4, !tbaa !12
%idxprom26 = zext i32 %j.072 to i64
%fig28 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26, i32 1
%36 = load i32, ptr %fig28, align 4, !tbaa !12
%cmp29.not = icmp sgt i32 %35, %36
%arrayidx27 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx27, ptr %arrayidx24
%inc37 = zext i1 %cmp29.not to i32
%j.1 = add nuw nsw i32 %j.072, %inc37
%not.cmp29.not = xor i1 %cmp29.not, true
%inc32 = zext i1 %not.cmp29.not to i32
%i.3 = add nuw nsw i32 %i.273, %inc32
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv82
store i64 %.sink, ptr %37, align 4
%indvars.iv.next83 = add nsw i64 %indvars.iv82, 1
%exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
br i1 %exitcond86.not, label %for.end42, label %for.body22, !llvm.loop !27
for.end42: ; preds = %for.body22, %for.end14
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #6 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !28
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%fig.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %fig.prol, align 4, !tbaa !12
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%fig = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %fig, align 4, !tbaa !12
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%fig.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %fig.1, align 4, !tbaa !12
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !29
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !7, i64 0}
!11 = !{!"", !7, i64 0, !6, i64 4}
!12 = !{!11, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !14, !20, !21}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !14, !20}
!26 = distinct !{!26, !14, !20}
!27 = distinct !{!27, !14}
!28 = !{i64 0, i64 4, !5}
!29 = distinct !{!29, !14}
!30 = distinct !{!30, !14, !20, !21}
!31 = distinct !{!31, !17}
!32 = distinct !{!32, !14, !20, !21}
!33 = distinct !{!33, !17}
!34 = distinct !{!34, !14, !20}
!35 = distinct !{!35, !14, !20}
|
#include <stdio.h>
#include <string.h>
typedef struct{
char name;
int num, id;
}card;
void swap(card* A, card* B){
card tmp = *A;
*A = *B;
*B = tmp;
}
int partition(card* A, int p, int r){
int x = A[r].num, i = p-1;
for(int j=p ; j<r ; j++){
if(A[j].num <= x){
i++;
swap(&A[i], &A[j]);
}
}
swap(&A[i+1], &A[r]);
return i+1;
}
void quicksort(card* A, int p, int r){
if(p<r){
int q = partition(A, p, r);
quicksort(A, p, q-1);
quicksort(A, q+1, r);
}
}
int checkstable(card* A, int n){
for(int i=0 ; i<n-1 ; i++)
if(A[i].num == A[i+1].num && A[i].id > A[i+1].id)
return 1;
return 0;
}
int main(void){
int n;
scanf("%d", &n);
card A[n];
for(int i=0 ; i<n ; i++){
scanf("%s %d", &A[i].name, &A[i].num);
A[i].id = i;
}
quicksort(A, 0, n-1);
checkstable(A, n) == 1 ? printf("Not stable\n") : printf("Stable\n");
for(int i=0 ; i<n ; i++)
printf("%c %d\n", A[i].name, A[i].num);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269925/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269925/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.card = type { i8, i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
@str.5 = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %A, ptr nocapture noundef %B) local_unnamed_addr #0 {
entry:
%tmp = alloca %struct.card, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp, ptr noundef nonnull align 4 dereferenceable(12) %A, i64 12, i1 false), !tbaa.struct !5
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %A, ptr noundef nonnull align 4 dereferenceable(12) %B, i64 12, i1 false), !tbaa.struct !5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %B, ptr noundef nonnull align 4 dereferenceable(12) %tmp, i64 12, i1 false), !tbaa.struct !5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%tmp.i29 = alloca %struct.card, align 4
%tmp.i = alloca %struct.card, align 4
%idxprom = sext i32 %r to i64
%num = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom, i32 1
%0 = load i32, ptr %num, align 4, !tbaa !11
%cmp30 = icmp slt i32 %p, %r
br i1 %cmp30, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.cond.cleanup.loopexit: ; preds = %for.inc
%2 = add nsw i32 %i.1, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %2, %for.cond.cleanup.loopexit ]
%arrayidx = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom
%idxprom10 = sext i32 %i.0.lcssa to i64
%arrayidx11 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom10
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp.i)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, i64 12, i1 false), !tbaa.struct !5
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false), !tbaa.struct !5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, i64 12, i1 false), !tbaa.struct !5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp.i)
ret i32 %i.0.lcssa
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.031 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%num3 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv, i32 1
%3 = load i32, ptr %num3, align 4, !tbaa !11
%cmp4.not = icmp sgt i32 %3, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.031, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom5
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp.i29)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i29, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, i64 12, i1 false), !tbaa.struct !5
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, i64 12, i1 false), !tbaa.struct !5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i29, i64 12, i1 false), !tbaa.struct !5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp.i29)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.031, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !13
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quicksort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%tmp.i29.i = alloca %struct.card, align 4
%tmp.i.i = alloca %struct.card, align 4
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%num.i = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom.i, i32 1
%arrayidx.i = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%0 = load i32, ptr %num.i, align 4, !tbaa !11
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%i.031.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ]
%num3.i = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.i, i32 1
%2 = load i32, ptr %num3.i, align 4, !tbaa !11
%cmp4.not.i = icmp sgt i32 %2, %0
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.031.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom5.i
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp.i29.i)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i29.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, i64 12, i1 false), !tbaa.struct !5
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, i64 12, i1 false), !tbaa.struct !5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i29.i, i64 12, i1 false), !tbaa.struct !5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp.i29.i)
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.031.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %partition.exit, label %for.body.i, !llvm.loop !13
partition.exit: ; preds = %for.inc.i
%3 = add nsw i32 %i.1.i, 1
%idxprom10.i = sext i32 %3 to i64
%arrayidx11.i = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom10.i
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp.i.i)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i, i64 12, i1 false), !tbaa.struct !5
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, i64 12, i1 false), !tbaa.struct !5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i.i, i64 12, i1 false), !tbaa.struct !5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp.i.i)
tail call void @quicksort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i)
%add = add nsw i32 %i.1.i, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @checkstable(ptr nocapture noundef readonly %A, i32 noundef %n) local_unnamed_addr #4 {
entry:
%cmp.not20 = icmp sgt i32 %n, 1
br i1 %cmp.not20, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
%0 = zext i32 %sub to i64
%wide.trip.count = zext i32 %sub to i64
%num.phi.trans.insert = getelementptr inbounds %struct.card, ptr %A, i64 0, i32 1
%.pre = load i32, ptr %num.phi.trans.insert, align 4, !tbaa !11
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%1 = phi i32 [ %.pre, %for.body.preheader ], [ %2, %for.inc ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%cmp.not22 = phi i1 [ true, %for.body.preheader ], [ %cmp.not, %for.inc ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%num3 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.next, i32 1
%2 = load i32, ptr %num3, align 4, !tbaa !11
%cmp4 = icmp eq i32 %1, %2
br i1 %cmp4, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%id = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv, i32 2
%3 = load i32, ptr %id, align 4, !tbaa !15
%id10 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.next, i32 2
%4 = load i32, ptr %id10, align 4, !tbaa !15
%cmp11 = icmp sgt i32 %3, %4
br i1 %cmp11, label %cleanup.loopexit, label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true
%cmp.not = icmp ult i64 %indvars.iv.next, %0
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup.loopexit, label %for.body, !llvm.loop !16
cleanup.loopexit: ; preds = %land.lhs.true, %for.inc
%cmp.not.lcssa.ph = phi i1 [ %cmp.not, %for.inc ], [ %cmp.not22, %land.lhs.true ]
%5 = zext i1 %cmp.not.lcssa.ph to i32
br label %cleanup
cleanup: ; preds = %cleanup.loopexit, %entry
%cmp.not.lcssa = phi i32 [ 0, %entry ], [ %5, %cleanup.loopexit ]
ret i32 %cmp.not.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !9
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca %struct.card, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !9
%cmp36 = icmp sgt i32 %3, 0
br i1 %cmp36, label %for.body, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %entry
%sub46 = add nsw i32 %3, -1
call void @quicksort(ptr noundef nonnull %vla, i32 noundef 0, i32 noundef %sub46)
br label %cond.false
for.cond.cleanup: ; preds = %for.body
%sub = add nsw i32 %10, -1
call void @quicksort(ptr noundef nonnull %vla, i32 noundef 0, i32 noundef %sub)
%cmp.not20.i = icmp sgt i32 %10, 1
br i1 %cmp.not20.i, label %for.body.preheader.i, label %cond.false
for.body.preheader.i: ; preds = %for.cond.cleanup
%4 = zext i32 %sub to i64
%num.phi.trans.insert.i = getelementptr inbounds %struct.card, ptr %vla, i64 0, i32 1
%.pre.i = load i32, ptr %num.phi.trans.insert.i, align 4, !tbaa !11
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%5 = phi i32 [ %.pre.i, %for.body.preheader.i ], [ %6, %for.inc.i ]
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%cmp.not22.i = phi i1 [ true, %for.body.preheader.i ], [ %cmp.not.i, %for.inc.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%num3.i = getelementptr inbounds %struct.card, ptr %vla, i64 %indvars.iv.next.i, i32 1
%6 = load i32, ptr %num3.i, align 4, !tbaa !11
%cmp4.i = icmp eq i32 %5, %6
br i1 %cmp4.i, label %land.lhs.true.i, label %for.inc.i
land.lhs.true.i: ; preds = %for.body.i
%id.i = getelementptr inbounds %struct.card, ptr %vla, i64 %indvars.iv.i, i32 2
%7 = load i32, ptr %id.i, align 4, !tbaa !15
%id10.i = getelementptr inbounds %struct.card, ptr %vla, i64 %indvars.iv.next.i, i32 2
%8 = load i32, ptr %id10.i, align 4, !tbaa !15
%cmp11.i = icmp sgt i32 %7, %8
br i1 %cmp11.i, label %checkstable.exit, label %for.inc.i
for.inc.i: ; preds = %land.lhs.true.i, %for.body.i
%cmp.not.i = icmp ult i64 %indvars.iv.next.i, %4
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %4
br i1 %exitcond.not.i, label %checkstable.exit, label %for.body.i, !llvm.loop !16
checkstable.exit: ; preds = %land.lhs.true.i, %for.inc.i
%cmp.not.lcssa.ph.i = phi i1 [ %cmp.not.i, %for.inc.i ], [ %cmp.not22.i, %land.lhs.true.i ]
br i1 %cmp.not.lcssa.ph.i, label %cond.end, label %cond.false
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct.card, ptr %vla, i64 %indvars.iv
%num = getelementptr inbounds %struct.card, ptr %vla, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %num)
%id = getelementptr inbounds %struct.card, ptr %vla, i64 %indvars.iv, i32 2
%9 = trunc i64 %indvars.iv to i32
store i32 %9, ptr %id, align 4, !tbaa !15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %n, align 4, !tbaa !9
%11 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !17
cond.false: ; preds = %for.cond.cleanup.thread, %for.cond.cleanup, %checkstable.exit
br label %cond.end
cond.end: ; preds = %checkstable.exit, %cond.false
%str.sink = phi ptr [ @str, %cond.false ], [ @str.5, %checkstable.exit ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%12 = load i32, ptr %n, align 4, !tbaa !9
%cmp1238 = icmp sgt i32 %12, 0
br i1 %cmp1238, label %for.body14, label %for.cond.cleanup13
for.cond.cleanup13: ; preds = %for.body14, %cond.end
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
for.body14: ; preds = %cond.end, %for.body14
%indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body14 ], [ 0, %cond.end ]
%arrayidx16 = getelementptr inbounds %struct.card, ptr %vla, i64 %indvars.iv42
%13 = load i8, ptr %arrayidx16, align 4, !tbaa !18
%conv = sext i8 %13 to i32
%num20 = getelementptr inbounds %struct.card, ptr %vla, i64 %indvars.iv42, i32 1
%14 = load i32, ptr %num20, align 4, !tbaa !11
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv, i32 noundef %14)
%indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
%15 = load i32, ptr %n, align 4, !tbaa !9
%16 = sext i32 %15 to i64
%cmp12 = icmp slt i64 %indvars.iv.next43, %16
br i1 %cmp12, label %for.body14, label %for.cond.cleanup13, !llvm.loop !19
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #8 = { nofree nounwind }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{i64 0, i64 1, !6, i64 4, i64 4, !9, i64 8, i64 4, !9}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 4}
!12 = !{!"", !7, i64 0, !10, i64 4, !10, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!12, !10, i64 8}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = !{!12, !7, i64 0}
!19 = distinct !{!19, !14}
|
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct Card{
char name[1];
int val;
} Card;
void swap(Card* A, Card* B){
Card C = *A;
*A = *B;
*B = C;
}
int Divide(Card A[], int low, int high){
int i = low-1;
for(int j=low; j<high; j++){
if(A[j].val <= A[high].val){
i++;
swap(&A[i],&A[j]);
}
}
swap(&A[i+1],&A[high]);
return i+1;
}
void QuickSort(Card A[], int low, int high){
if(low < high){
int mid = Divide(A,low,high);
QuickSort(A,low,mid-1);
QuickSort(A,mid+1,high);
}
}
bool Stability(Card A[], Card B[], int n){
// Card Deck with no overlapping-value cards
int tmp[n];
int tmp_size = 0;
for(int i=0; i<n; i++){
if(A[i].val != A[i+1].val){
tmp[tmp_size] = A[i].val;
tmp_size++;
}
}
// Check for stability
for(int i=0; i<tmp_size; i++){
Card a[n], b[n];
int count_a = 0, count_b = 0;
for(int j=0; j<n; j++){
if(tmp[i] == A[j].val){
a[count_a] = A[j];
count_a++;
}
if(tmp[i] == B[j].val){
b[count_b] = B[j];
count_b++;
}
}
for(int i=0; i<count_a; i++){
if(a[i].name[0] != b[i].name[0])
return 0;
}
}
return 1;
}
void copyCard(Card A[], Card B[], int n){
for(int i=0; i<n; i++)
B[i] = A[i];
}
void printCard(Card A[], int n){
for(int i=0; i<n; i++)
printf("%s %d\n",A[i].name,A[i].val);
}
int main(){
int n;
scanf("%d",&n);
Card A[n], B[n];
for(int i=0; i<n; i++)
scanf("%s %d",A[i].name,&A[i].val);
copyCard(A,B,n);
QuickSort(A,0,n-1);
if(Stability(A,B,n) == 1)
printf("Stable\n");
else
printf("Not stable\n");
printCard(A,n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269976/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269976/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Card = type { [1 x i8], i32 }
@.str = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %A, ptr nocapture noundef %B) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %A, align 4
%1 = load i64, ptr %B, align 4
store i64 %1, ptr %A, align 4
store i64 %0, ptr %B, align 4
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @Divide(ptr nocapture noundef %A, i32 noundef %low, i32 noundef %high) local_unnamed_addr #3 {
entry:
%cmp29 = icmp slt i32 %low, %high
br i1 %cmp29, label %for.body.lr.ph, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = sext i32 %high to i64
br label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%sub = add nsw i32 %low, -1
%idxprom1 = sext i32 %high to i64
%val3 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom1, i32 1
%0 = sext i32 %low to i64
br label %for.body
for.cond.cleanup.loopexit: ; preds = %for.inc
%1 = add nsw i32 %i.1, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %entry.for.cond.cleanup_crit_edge, %for.cond.cleanup.loopexit
%idxprom12.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %idxprom1, %for.cond.cleanup.loopexit ]
%i.0.lcssa = phi i32 [ %low, %entry.for.cond.cleanup_crit_edge ], [ %1, %for.cond.cleanup.loopexit ]
%idxprom10 = sext i32 %i.0.lcssa to i64
%arrayidx11 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom10
%arrayidx13 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom12.pre-phi
%2 = load i64, ptr %arrayidx11, align 4
%3 = load i64, ptr %arrayidx13, align 4
store i64 %3, ptr %arrayidx11, align 4
store i64 %2, ptr %arrayidx13, align 4
ret i32 %i.0.lcssa
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ %0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%i.030 = phi i32 [ %sub, %for.body.lr.ph ], [ %i.1, %for.inc ]
%val = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%4 = load i32, ptr %val, align 4, !tbaa !5
%5 = load i32, ptr %val3, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %4, %5
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.030, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
%6 = load i64, ptr %arrayidx6, align 4
%7 = load i64, ptr %arrayidx, align 4
store i64 %7, ptr %arrayidx6, align 4
store i64 %6, ptr %arrayidx, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.030, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom1
br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !10
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @QuickSort(ptr nocapture noundef %A, i32 noundef %low, i32 noundef %high) local_unnamed_addr #4 {
entry:
%cmp8 = icmp slt i32 %low, %high
br i1 %cmp8, label %for.body.lr.ph.i.lr.ph, label %if.end
for.body.lr.ph.i.lr.ph: ; preds = %entry
%idxprom1.i = sext i32 %high to i64
%val3.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom1.i, i32 1
%arrayidx13.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom1.i
br label %for.body.lr.ph.i
for.body.lr.ph.i: ; preds = %for.body.lr.ph.i.lr.ph, %Divide.exit
%low.tr9 = phi i32 [ %low, %for.body.lr.ph.i.lr.ph ], [ %add, %Divide.exit ]
%sub.i = add nsw i32 %low.tr9, -1
%0 = sext i32 %low.tr9 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.lr.ph.i
%indvars.iv.i = phi i64 [ %0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.inc.i ]
%i.030.i = phi i32 [ %sub.i, %for.body.lr.ph.i ], [ %i.1.i, %for.inc.i ]
%val.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%1 = load i32, ptr %val.i, align 4, !tbaa !5
%2 = load i32, ptr %val3.i, align 4, !tbaa !5
%cmp4.not.i = icmp sgt i32 %1, %2
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.030.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
%3 = load i64, ptr %arrayidx6.i, align 4
%4 = load i64, ptr %arrayidx.i, align 4
store i64 %4, ptr %arrayidx6.i, align 4
store i64 %3, ptr %arrayidx.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.030.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom1.i
br i1 %exitcond.not.i, label %Divide.exit, label %for.body.i, !llvm.loop !10
Divide.exit: ; preds = %for.inc.i
%5 = add nsw i32 %i.1.i, 1
%idxprom10.i = sext i32 %5 to i64
%arrayidx11.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom10.i
%6 = load i64, ptr %arrayidx11.i, align 4
%7 = load i64, ptr %arrayidx13.i, align 4
store i64 %7, ptr %arrayidx11.i, align 4
store i64 %6, ptr %arrayidx13.i, align 4
tail call void @QuickSort(ptr noundef nonnull %A, i32 noundef %low.tr9, i32 noundef %i.1.i)
%add = add nsw i32 %i.1.i, 2
%cmp = icmp slt i32 %add, %high
br i1 %cmp, label %for.body.lr.ph.i, label %if.end
if.end: ; preds = %Divide.exit, %entry
ret void
}
; Function Attrs: nofree nosync nounwind uwtable
define dso_local zeroext i1 @Stability(ptr nocapture noundef readonly %A, ptr nocapture noundef readonly %B, i32 noundef %n) local_unnamed_addr #5 {
entry:
%0 = zext i32 %n to i64
%vla = alloca i32, i64 %0, align 16
%cmp118 = icmp slt i32 %n, 1
br i1 %cmp118, label %cleanup81, label %for.body.preheader
for.body.preheader: ; preds = %entry
%val.phi.trans.insert = getelementptr inbounds %struct.Card, ptr %A, i64 0, i32 1
%.pre = load i32, ptr %val.phi.trans.insert, align 4, !tbaa !5
%xtraiter = and i64 %0, 1
%1 = icmp eq i32 %n, 1
br i1 %1, label %for.cond12.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %0, 4294967294
br label %for.body
for.cond12.preheader.unr-lcssa.loopexit: ; preds = %for.inc.1
%2 = add nuw nsw i64 %indvars.iv, 3
br label %for.cond12.preheader.unr-lcssa
for.cond12.preheader.unr-lcssa: ; preds = %for.cond12.preheader.unr-lcssa.loopexit, %for.body.preheader
%tmp_size.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %tmp_size.1.1, %for.cond12.preheader.unr-lcssa.loopexit ]
%.unr = phi i32 [ %.pre, %for.body.preheader ], [ %15, %for.cond12.preheader.unr-lcssa.loopexit ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %2, %for.cond12.preheader.unr-lcssa.loopexit ]
%tmp_size.0120.unr = phi i32 [ 0, %for.body.preheader ], [ %tmp_size.1.1, %for.cond12.preheader.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond12.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond12.preheader.unr-lcssa
%val3.epil = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.unr, i32 1
%3 = load i32, ptr %val3.epil, align 4, !tbaa !5
%cmp4.not.epil = icmp eq i32 %.unr, %3
br i1 %cmp4.not.epil, label %for.cond12.preheader, label %if.then.epil
if.then.epil: ; preds = %for.body.epil
%idxprom8.epil = sext i32 %tmp_size.0120.unr to i64
%arrayidx9.epil = getelementptr inbounds i32, ptr %vla, i64 %idxprom8.epil
store i32 %.unr, ptr %arrayidx9.epil, align 4, !tbaa !12
%inc.epil = add nsw i32 %tmp_size.0120.unr, 1
br label %for.cond12.preheader
for.cond12.preheader: ; preds = %for.body.epil, %if.then.epil, %for.cond12.preheader.unr-lcssa
%tmp_size.1.lcssa = phi i32 [ %tmp_size.1.lcssa.ph, %for.cond12.preheader.unr-lcssa ], [ %inc.epil, %if.then.epil ], [ %tmp_size.0120.unr, %for.body.epil ]
%cmp13.not128 = icmp slt i32 %tmp_size.1.lcssa, 1
%brmerge = or i1 %cmp13.not128, %cmp118
br i1 %brmerge, label %cleanup81, label %for.body15.us.preheader
for.body15.us.preheader: ; preds = %for.cond12.preheader
%4 = zext i32 %tmp_size.1.lcssa to i64
%wide.trip.count151 = zext i32 %tmp_size.1.lcssa to i64
br label %for.body15.us
for.body15.us: ; preds = %for.body15.us.preheader, %for.inc76.us
%indvars.iv149 = phi i64 [ 0, %for.body15.us.preheader ], [ %indvars.iv.next150, %for.inc76.us ]
%cmp13.not130.us = phi i1 [ false, %for.body15.us.preheader ], [ %cmp13.not.us, %for.inc76.us ]
%5 = tail call ptr @llvm.stacksave.p0()
%vla17.us = alloca %struct.Card, i64 %0, align 16
%vla18.us = alloca %struct.Card, i64 %0, align 16
%arrayidx24.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv149
%6 = load i32, ptr %arrayidx24.us, align 4, !tbaa !12
br label %for.body22.us
for.cond53.us: ; preds = %for.body56.us
%indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
%exitcond148.not = icmp eq i64 %indvars.iv.next145, %wide.trip.count147
br i1 %exitcond148.not, label %for.inc76.us, label %for.body56.us, !llvm.loop !13
for.inc76.us: ; preds = %for.cond53.us, %for.cond19.for.cond53.preheader_crit_edge.us
tail call void @llvm.stackrestore.p0(ptr %5)
%indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
%cmp13.not.us = icmp uge i64 %indvars.iv.next150, %4
%exitcond152 = icmp eq i64 %indvars.iv.next150, %wide.trip.count151
br i1 %exitcond152, label %cleanup81, label %for.body15.us, !llvm.loop !14
for.body56.us: ; preds = %for.body56.us.preheader, %for.cond53.us
%indvars.iv144 = phi i64 [ 0, %for.body56.us.preheader ], [ %indvars.iv.next145, %for.cond53.us ]
%arrayidx58.us = getelementptr inbounds %struct.Card, ptr %vla17.us, i64 %indvars.iv144
%7 = load i8, ptr %arrayidx58.us, align 8, !tbaa !15
%arrayidx61.us = getelementptr inbounds %struct.Card, ptr %vla18.us, i64 %indvars.iv144
%8 = load i8, ptr %arrayidx61.us, align 8, !tbaa !15
%cmp65.not.us = icmp eq i8 %7, %8
br i1 %cmp65.not.us, label %for.cond53.us, label %cleanup
for.body22.us: ; preds = %for.body15.us, %for.inc49.us
%indvars.iv139 = phi i64 [ 0, %for.body15.us ], [ %indvars.iv.next140, %for.inc49.us ]
%count_b.0123.us = phi i32 [ 0, %for.body15.us ], [ %count_b.1.us, %for.inc49.us ]
%count_a.0122.us = phi i32 [ 0, %for.body15.us ], [ %count_a.1.us, %for.inc49.us ]
%val27.us = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv139, i32 1
%9 = load i32, ptr %val27.us, align 4, !tbaa !5
%cmp28.us = icmp eq i32 %6, %9
br i1 %cmp28.us, label %if.then29.us, label %if.end35.us
if.then29.us: ; preds = %for.body22.us
%arrayidx26.us = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv139
%idxprom30.us = sext i32 %count_a.0122.us to i64
%arrayidx31.us = getelementptr inbounds %struct.Card, ptr %vla17.us, i64 %idxprom30.us
%10 = load i64, ptr %arrayidx26.us, align 4
store i64 %10, ptr %arrayidx31.us, align 8
%inc34.us = add nsw i32 %count_a.0122.us, 1
br label %if.end35.us
if.end35.us: ; preds = %if.then29.us, %for.body22.us
%count_a.1.us = phi i32 [ %inc34.us, %if.then29.us ], [ %count_a.0122.us, %for.body22.us ]
%val40.us = getelementptr inbounds %struct.Card, ptr %B, i64 %indvars.iv139, i32 1
%11 = load i32, ptr %val40.us, align 4, !tbaa !5
%cmp41.us = icmp eq i32 %6, %11
br i1 %cmp41.us, label %if.then42.us, label %for.inc49.us
if.then42.us: ; preds = %if.end35.us
%arrayidx39.us = getelementptr inbounds %struct.Card, ptr %B, i64 %indvars.iv139
%idxprom43.us = sext i32 %count_b.0123.us to i64
%arrayidx44.us = getelementptr inbounds %struct.Card, ptr %vla18.us, i64 %idxprom43.us
%12 = load i64, ptr %arrayidx39.us, align 4
store i64 %12, ptr %arrayidx44.us, align 8
%inc47.us = add nsw i32 %count_b.0123.us, 1
br label %for.inc49.us
for.inc49.us: ; preds = %if.then42.us, %if.end35.us
%count_b.1.us = phi i32 [ %inc47.us, %if.then42.us ], [ %count_b.0123.us, %if.end35.us ]
%indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
%exitcond143.not = icmp eq i64 %indvars.iv.next140, %0
br i1 %exitcond143.not, label %for.cond19.for.cond53.preheader_crit_edge.us, label %for.body22.us, !llvm.loop !16
for.cond19.for.cond53.preheader_crit_edge.us: ; preds = %for.inc49.us
%cmp54.not126.us = icmp sgt i32 %count_a.1.us, 0
br i1 %cmp54.not126.us, label %for.body56.us.preheader, label %for.inc76.us
for.body56.us.preheader: ; preds = %for.cond19.for.cond53.preheader_crit_edge.us
%wide.trip.count147 = zext i32 %count_a.1.us to i64
br label %for.body56.us
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%13 = phi i32 [ %.pre, %for.body.preheader.new ], [ %15, %for.inc.1 ]
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%tmp_size.0120 = phi i32 [ 0, %for.body.preheader.new ], [ %tmp_size.1.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%indvars.iv.next = or i64 %indvars.iv, 1
%val3 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%14 = load i32, ptr %val3, align 4, !tbaa !5
%cmp4.not = icmp eq i32 %13, %14
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%idxprom8 = sext i32 %tmp_size.0120 to i64
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %idxprom8
store i32 %13, ptr %arrayidx9, align 4, !tbaa !12
%inc = add nsw i32 %tmp_size.0120, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%tmp_size.1 = phi i32 [ %inc, %if.then ], [ %tmp_size.0120, %for.body ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%val3.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.1, i32 1
%15 = load i32, ptr %val3.1, align 4, !tbaa !5
%cmp4.not.1 = icmp eq i32 %14, %15
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%idxprom8.1 = sext i32 %tmp_size.1 to i64
%arrayidx9.1 = getelementptr inbounds i32, ptr %vla, i64 %idxprom8.1
store i32 %14, ptr %arrayidx9.1, align 4, !tbaa !12
%inc.1 = add nsw i32 %tmp_size.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%tmp_size.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %tmp_size.1, %for.inc ]
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond12.preheader.unr-lcssa.loopexit, label %for.body, !llvm.loop !17
cleanup: ; preds = %for.body56.us
tail call void @llvm.stackrestore.p0(ptr %5)
br label %cleanup81
cleanup81: ; preds = %for.inc76.us, %for.cond12.preheader, %entry, %cleanup
%cmp13.not117 = phi i1 [ %cmp13.not130.us, %cleanup ], [ true, %for.cond12.preheader ], [ true, %entry ], [ %cmp13.not.us, %for.inc76.us ]
ret i1 %cmp13.not117
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @copyCard(ptr nocapture noundef readonly %A, ptr nocapture noundef writeonly %B, i32 noundef %n) local_unnamed_addr #3 {
entry:
%cmp6 = icmp sgt i32 %n, 0
br i1 %cmp6, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%B9 = ptrtoint ptr %B to i64
%A10 = ptrtoint ptr %A to i64
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 6
%0 = sub i64 %B9, %A10
%diff.check = icmp ult i64 %0, 32
%or.cond = or i1 %min.iters.check, %diff.check
br i1 %or.cond, label %for.body.preheader12, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%1 = getelementptr inbounds %struct.Card, ptr %B, i64 %index
%2 = getelementptr inbounds %struct.Card, ptr %A, i64 %index
%wide.load = load <2 x i64>, ptr %2, align 4
%3 = getelementptr inbounds i64, ptr %2, i64 2
%wide.load11 = load <2 x i64>, ptr %3, align 4
store <2 x i64> %wide.load, ptr %1, align 4
%4 = getelementptr inbounds i64, ptr %1, i64 2
store <2 x i64> %wide.load11, ptr %4, align 4
%index.next = add nuw i64 %index, 4
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader12
for.body.preheader12: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%6 = xor i64 %indvars.iv.ph, -1
%7 = add nsw i64 %6, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader12, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader12 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader12 ]
%arrayidx.prol = getelementptr inbounds %struct.Card, ptr %B, i64 %indvars.iv.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.prol
%8 = load i64, ptr %arrayidx2.prol, align 4
store i64 %8, ptr %arrayidx.prol, align 4
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !21
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader12
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader12 ], [ %indvars.iv.next.prol, %for.body.prol ]
%9 = icmp ult i64 %7, 3
br i1 %9, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
ret void
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds %struct.Card, ptr %B, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds %struct.Card, ptr %B, i64 %indvars.iv.next
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next
%11 = load i64, ptr %arrayidx2.1, align 4
store i64 %11, ptr %arrayidx.1, align 4
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds %struct.Card, ptr %B, i64 %indvars.iv.next.1
%arrayidx2.2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.1
%12 = load i64, ptr %arrayidx2.2, align 4
store i64 %12, ptr %arrayidx.2, align 4
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds %struct.Card, ptr %B, i64 %indvars.iv.next.2
%arrayidx2.3 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.2
%13 = load i64, ptr %arrayidx2.3, align 4
store i64 %13, ptr %arrayidx.3, align 4
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond.cleanup, label %for.body, !llvm.loop !23
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printCard(ptr noundef %A, i32 noundef %n) local_unnamed_addr #7 {
entry:
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
ret void
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%val = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%0 = load i32, ptr %val, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %arrayidx, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !24
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !12
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca %struct.Card, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !12
%4 = zext i32 %3 to i64
%vla1 = alloca %struct.Card, i64 %4, align 16
%cmp21 = icmp sgt i32 %3, 0
br i1 %cmp21, label %for.body, label %copyCard.exit
for.cond.cleanup: ; preds = %for.body
%cmp6.i = icmp sgt i32 %.pr, 0
br i1 %cmp6.i, label %for.body.preheader.i, label %copyCard.exit
for.body.preheader.i: ; preds = %for.cond.cleanup
%wide.trip.count.i = zext i32 %.pr to i64
%5 = shl nuw nsw i64 %wide.trip.count.i, 3
call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %vla1, ptr nonnull align 16 %vla, i64 %5, i1 false)
br label %copyCard.exit
copyCard.exit: ; preds = %entry, %for.body.preheader.i, %for.cond.cleanup
%.lcssa26 = phi i32 [ %.pr, %for.body.preheader.i ], [ %.pr, %for.cond.cleanup ], [ %3, %entry ]
%sub = add nsw i32 %.lcssa26, -1
call void @QuickSort(ptr noundef nonnull %vla, i32 noundef 0, i32 noundef %sub)
%call5 = call zeroext i1 @Stability(ptr noundef nonnull %vla, ptr noundef nonnull %vla1, i32 noundef %.lcssa26)
%str.5.str = select i1 %call5, ptr @str.5, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.str)
%6 = load i32, ptr %n, align 4, !tbaa !12
%cmp7.i = icmp sgt i32 %6, 0
br i1 %cmp7.i, label %for.body.preheader.i14, label %printCard.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct.Card, ptr %vla, i64 %indvars.iv
%val = getelementptr inbounds %struct.Card, ptr %vla, i64 %indvars.iv, i32 1
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx, ptr noundef nonnull %val)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%.pr = load i32, ptr %n, align 4, !tbaa !12
%7 = sext i32 %.pr to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !25
for.body.preheader.i14: ; preds = %copyCard.exit
%wide.trip.count.i15 = zext i32 %6 to i64
br label %for.body.i16
for.body.i16: ; preds = %for.body.i16, %for.body.preheader.i14
%indvars.iv.i17 = phi i64 [ 0, %for.body.preheader.i14 ], [ %indvars.iv.next.i19, %for.body.i16 ]
%arrayidx.i18 = getelementptr inbounds %struct.Card, ptr %vla, i64 %indvars.iv.i17
%val.i = getelementptr inbounds %struct.Card, ptr %vla, i64 %indvars.iv.i17, i32 1
%8 = load i32, ptr %val.i, align 4, !tbaa !5
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %arrayidx.i18, i32 noundef %8)
%indvars.iv.next.i19 = add nuw nsw i64 %indvars.iv.i17, 1
%exitcond.not.i20 = icmp eq i64 %indvars.iv.next.i19, %wide.trip.count.i15
br i1 %exitcond.not.i20, label %printCard.exit, label %for.body.i16, !llvm.loop !24
printCard.exit: ; preds = %for.body.i16, %copyCard.exit
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nosync nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind }
attributes #10 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !9, i64 4}
!6 = !{!"Card", !7, i64 0, !9, i64 4}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!9, !9, i64 0}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !11, !19}
!24 = distinct !{!24, !11}
!25 = distinct !{!25, !11}
|
#include<stdio.h>
#define MAX 100005
#define INFTY 1000000000
typedef struct{
char c;
int n;
} Card;
void Merge(Card *A,int left,int mid,int right){
int n1,n2,i,j,k;
Card l[MAX/2],r[MAX/2];
n1 = mid-left;
n2 = right-mid;
for(i=0;i<n1;i++) l[i] = A[left+i];
for(i=0;i<n2;i++) r[i] = A[mid+i];
l[n1].n = INFTY;
r[n2].n = INFTY;
i=0;
j=0;
for(k=left;k<right;k++){
if(l[i].n<=r[j].n){
A[k] = l[i];
i++;
}
else{
A[k] = r[j];
j++;
}
}
}
void MergeSort(Card *A, int left, int right){
int mid;
if(left+1<right){
mid = (left+right)/2;
MergeSort(A, left, mid);
MergeSort(A, mid, right);
Merge(A, left, mid, right);
}
}
int Partition(Card *A,int p,int r){
int x,i,j;
Card tmp;
x = A[r].n;
i = p-1;
for(j=p;j<r;j++){
if(A[j].n<=x){
i++;
tmp = A[i];
A[i] = A[j];
A[j] = tmp;
}
}
tmp = A[i+1];
A[i+1] = A[r];
A[r] = tmp;
return i+1;
}
void QuickSort(Card *A, int p, int r){
int q;
if(p<r){
q = Partition(A,p,r);
QuickSort(A,p,q-1);
QuickSort(A,q+1,r);
}
}
int main(){
Card A[MAX],B[MAX];
int n,i,left,right,flag=0;
scanf("%d",&n);
left = 0;
right = n;
for(i=0;i<n;i++){
scanf("%s %d",&A[i].c,&A[i].n);
B[i] = A[i];
};
QuickSort(A,0,n-1);
MergeSort(B,left,right);
for(i=0;i<n;i++){
if(A[i].c != B[i].c){
flag++;
printf("Not stable\n");
break;
}
}
if(flag == 0) printf("Stable\n");
for(i=0;i<n;i++) printf("%c %d\n",A[i].c,A[i].n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270017/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270017/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Card = type { i8, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @Merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%l = alloca [50002 x %struct.Card], align 16
%r = alloca [50002 x %struct.Card], align 16
call void @llvm.lifetime.start.p0(i64 400016, ptr nonnull %l) #7
call void @llvm.lifetime.start.p0(i64 400016, ptr nonnull %r) #7
%sub = sub nsw i32 %mid, %left
%sub1 = sub nsw i32 %right, %mid
%cmp68 = icmp sgt i32 %sub, 0
br i1 %cmp68, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%1 = shl nsw i64 %0, 3
%scevgep = getelementptr i8, ptr %A, i64 %1
%2 = xor i32 %left, -1
%3 = add i32 %2, %mid
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 3
%6 = add nuw nsw i64 %5, 8
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %l, ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i64 %6, i1 false)
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body.preheader, %entry
%cmp570 = icmp sgt i32 %sub1, 0
br i1 %cmp570, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%7 = sext i32 %mid to i64
%8 = shl nsw i64 %7, 3
%scevgep78 = getelementptr i8, ptr %A, i64 %8
%9 = xor i32 %mid, -1
%10 = add i32 %9, %right
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 3
%13 = add nuw nsw i64 %12, 8
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %r, ptr noundef nonnull align 4 dereferenceable(1) %scevgep78, i64 %13, i1 false)
br label %for.end14
for.end14: ; preds = %for.body6.preheader, %for.cond4.preheader
%idxprom15 = sext i32 %sub to i64
%n = getelementptr inbounds [50002 x %struct.Card], ptr %l, i64 0, i64 %idxprom15, i32 1
store i32 1000000000, ptr %n, align 4, !tbaa !5
%idxprom17 = sext i32 %sub1 to i64
%n19 = getelementptr inbounds [50002 x %struct.Card], ptr %r, i64 0, i64 %idxprom17, i32 1
store i32 1000000000, ptr %n19, align 4, !tbaa !5
%cmp2172 = icmp slt i32 %left, %right
br i1 %cmp2172, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%14 = sext i32 %left to i64
%wide.trip.count = sext i32 %right to i64
%15 = sub nsw i64 %wide.trip.count, %14
%xtraiter = and i64 %15, 1
%16 = sub nsw i64 0, %wide.trip.count
%17 = xor i64 %14, %16
%18 = icmp eq i64 %17, -1
br i1 %18, label %for.end42.loopexit.unr-lcssa, label %for.body22.preheader.new
for.body22.preheader.new: ; preds = %for.body22.preheader
%unroll_iter = and i64 %15, -2
%invariant.gep = getelementptr %struct.Card, ptr %A, i64 1
br label %for.body22
for.body22: ; preds = %for.body22, %for.body22.preheader.new
%indvars.iv = phi i64 [ %14, %for.body22.preheader.new ], [ %indvars.iv.next.1, %for.body22 ]
%j.074 = phi i32 [ 0, %for.body22.preheader.new ], [ %j.1.1, %for.body22 ]
%i.273 = phi i32 [ 0, %for.body22.preheader.new ], [ %i.3.1, %for.body22 ]
%niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.1, %for.body22 ]
%idxprom23 = zext i32 %i.273 to i64
%n25 = getelementptr inbounds [50002 x %struct.Card], ptr %l, i64 0, i64 %idxprom23, i32 1
%19 = load i32, ptr %n25, align 4, !tbaa !5
%idxprom26 = zext i32 %j.074 to i64
%n28 = getelementptr inbounds [50002 x %struct.Card], ptr %r, i64 0, i64 %idxprom26, i32 1
%20 = load i32, ptr %n28, align 4, !tbaa !5
%cmp29.not = icmp sle i32 %19, %20
%arrayidx27 = getelementptr inbounds [50002 x %struct.Card], ptr %r, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [50002 x %struct.Card], ptr %l, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx24, ptr %arrayidx27
%inc34 = zext i1 %cmp29.not to i32
%i.3 = add nuw nsw i32 %i.273, %inc34
%not.cmp29.not = xor i1 %cmp29.not, true
%inc39 = zext i1 %not.cmp29.not to i32
%j.1 = add nuw nsw i32 %j.074, %inc39
%.sink = load i64, ptr %.sink.in, align 8
%21 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
store i64 %.sink, ptr %21, align 4
%idxprom23.1 = zext i32 %i.3 to i64
%n25.1 = getelementptr inbounds [50002 x %struct.Card], ptr %l, i64 0, i64 %idxprom23.1, i32 1
%22 = load i32, ptr %n25.1, align 4, !tbaa !5
%idxprom26.1 = zext i32 %j.1 to i64
%n28.1 = getelementptr inbounds [50002 x %struct.Card], ptr %r, i64 0, i64 %idxprom26.1, i32 1
%23 = load i32, ptr %n28.1, align 4, !tbaa !5
%cmp29.not.1 = icmp sle i32 %22, %23
%arrayidx27.1 = getelementptr inbounds [50002 x %struct.Card], ptr %r, i64 0, i64 %idxprom26.1
%arrayidx24.1 = getelementptr inbounds [50002 x %struct.Card], ptr %l, i64 0, i64 %idxprom23.1
%.sink.in.1 = select i1 %cmp29.not.1, ptr %arrayidx24.1, ptr %arrayidx27.1
%inc34.1 = zext i1 %cmp29.not.1 to i32
%i.3.1 = add nuw nsw i32 %i.3, %inc34.1
%not.cmp29.not.1 = xor i1 %cmp29.not.1, true
%inc39.1 = zext i1 %not.cmp29.not.1 to i32
%j.1.1 = add nuw nsw i32 %j.1, %inc39.1
%.sink.1 = load i64, ptr %.sink.in.1, align 8
%gep = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv
store i64 %.sink.1, ptr %gep, align 4
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end42.loopexit.unr-lcssa.loopexit, label %for.body22, !llvm.loop !10
for.end42.loopexit.unr-lcssa.loopexit: ; preds = %for.body22
%24 = zext i32 %i.3.1 to i64
%25 = zext i32 %j.1.1 to i64
br label %for.end42.loopexit.unr-lcssa
for.end42.loopexit.unr-lcssa: ; preds = %for.end42.loopexit.unr-lcssa.loopexit, %for.body22.preheader
%indvars.iv.unr = phi i64 [ %14, %for.body22.preheader ], [ %indvars.iv.next.1, %for.end42.loopexit.unr-lcssa.loopexit ]
%j.074.unr = phi i64 [ 0, %for.body22.preheader ], [ %25, %for.end42.loopexit.unr-lcssa.loopexit ]
%i.273.unr = phi i64 [ 0, %for.body22.preheader ], [ %24, %for.end42.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end42, label %for.body22.epil
for.body22.epil: ; preds = %for.end42.loopexit.unr-lcssa
%n25.epil = getelementptr inbounds [50002 x %struct.Card], ptr %l, i64 0, i64 %i.273.unr, i32 1
%26 = load i32, ptr %n25.epil, align 4, !tbaa !5
%n28.epil = getelementptr inbounds [50002 x %struct.Card], ptr %r, i64 0, i64 %j.074.unr, i32 1
%27 = load i32, ptr %n28.epil, align 4, !tbaa !5
%cmp29.not.epil.not = icmp sgt i32 %26, %27
%arrayidx27.epil = getelementptr inbounds [50002 x %struct.Card], ptr %r, i64 0, i64 %j.074.unr
%arrayidx24.epil = getelementptr inbounds [50002 x %struct.Card], ptr %l, i64 0, i64 %i.273.unr
%.sink.in.epil = select i1 %cmp29.not.epil.not, ptr %arrayidx27.epil, ptr %arrayidx24.epil
%.sink.epil = load i64, ptr %.sink.in.epil, align 8
%28 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.unr
store i64 %.sink.epil, ptr %28, align 4
br label %for.end42
for.end42: ; preds = %for.body22.epil, %for.end42.loopexit.unr-lcssa, %for.end14
call void @llvm.lifetime.end.p0(i64 400016, ptr nonnull %r) #7
call void @llvm.lifetime.end.p0(i64 400016, ptr nonnull %l) #7
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @MergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 {
entry:
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %common.ret12
common.ret12: ; preds = %entry, %if.then
ret void
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @MergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @MergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
tail call void @Merge(ptr noundef %A, i32 noundef %left, i32 noundef %div, i32 noundef %right)
br label %common.ret12
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @Partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%n = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom, i32 1
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%n3.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %n3.prol, align 4, !tbaa !5
%cmp4.not.prol = icmp sgt i32 %3, %0
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.prol
%4 = load i64, ptr %arrayidx6.prol, align 4
%5 = load i64, ptr %arrayidx2.prol, align 4
store i64 %5, ptr %arrayidx6.prol, align 4
store i64 %4, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%6 = sub nsw i64 0, %idxprom
%7 = xor i64 %1, %6
%8 = icmp eq i64 %7, -1
br i1 %8, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.047 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.047.unr, %for.body.prol.loopexit ]
%n3 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%9 = load i32, ptr %n3, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %9, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.047, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
%10 = load i64, ptr %arrayidx6, align 4
%11 = load i64, ptr %arrayidx2, align 4
store i64 %11, ptr %arrayidx6, align 4
store i64 %10, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%n3.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%12 = load i32, ptr %n3.1, align 4, !tbaa !5
%cmp4.not.1 = icmp sgt i32 %12, %0
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.1
%13 = load i64, ptr %arrayidx6.1, align 4
%14 = load i64, ptr %arrayidx2.1, align 4
store i64 %14, ptr %arrayidx6.1, align 4
store i64 %13, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !12
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%15 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %15, %for.end.loopexit ]
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
%16 = load i64, ptr %arrayidx15, align 4
%17 = load i64, ptr %arrayidx, align 4
store i64 %17, ptr %arrayidx15, align 4
store i64 %16, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @QuickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%n.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i, i32 1
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %Partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %Partition.exit ]
%1 = load i32, ptr %n.i, align 4, !tbaa !5
%sub.i = add nsw i32 %p.tr9, -1
%2 = sext i32 %p.tr9 to i64
%3 = sub nsw i64 %idxprom.i, %2
%xtraiter = and i64 %3, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%n3.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %2, i32 1
%4 = load i32, ptr %n3.i.prol, align 4, !tbaa !5
%cmp4.not.i.prol = icmp sgt i32 %4, %1
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %2
%idxprom5.i.prol = sext i32 %p.tr9 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.prol
%5 = load i64, ptr %arrayidx6.i.prol, align 4
%6 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %6, ptr %arrayidx6.i.prol, align 4
store i64 %5, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr9, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %2, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %2, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.047.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%7 = xor i64 %2, %0
%8 = icmp eq i64 %7, -1
br i1 %8, label %Partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.047.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.047.i.unr, %for.body.i.prol.loopexit ]
%n3.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%9 = load i32, ptr %n3.i, align 4, !tbaa !5
%cmp4.not.i = icmp sgt i32 %9, %1
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
%10 = load i64, ptr %arrayidx6.i, align 4
%11 = load i64, ptr %arrayidx2.i, align 4
store i64 %11, ptr %arrayidx6.i, align 4
store i64 %10, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%n3.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1
%12 = load i32, ptr %n3.i.1, align 4, !tbaa !5
%cmp4.not.i.1 = icmp sgt i32 %12, %1
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.1
%13 = load i64, ptr %arrayidx6.i.1, align 4
%14 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %14, ptr %arrayidx6.i.1, align 4
store i64 %13, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %Partition.exit, label %for.body.i, !llvm.loop !12
Partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%15 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %15 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
%16 = load i64, ptr %arrayidx15.i, align 4
%17 = load i64, ptr %arrayidx.i, align 4
store i64 %17, ptr %arrayidx15.i, align 4
store i64 %16, ptr %arrayidx.i, align 4
tail call void @QuickSort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %Partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%A = alloca [100005 x %struct.Card], align 16
%B = alloca [100005 x %struct.Card], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %A) #7
call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %B) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !13
%cmp62 = icmp sgt i32 %0, 0
br i1 %cmp62, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100005 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
%n3 = getelementptr inbounds [100005 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %n3)
%arrayidx6 = getelementptr inbounds [100005 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv
%1 = load i64, ptr %arrayidx, align 8
store i64 %1, ptr %arrayidx6, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !13
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ]
%sub = add nsw i32 %.lcssa, -1
call void @QuickSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub)
call void @MergeSort(ptr noundef nonnull %B, i32 noundef 0, i32 noundef %0)
%cmp11.not64 = icmp sgt i32 %.lcssa, 0
br i1 %cmp11.not64, label %for.body12.preheader, label %if.end31
for.body12.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %.lcssa to i64
br label %for.body12
for.cond10: ; preds = %for.body12
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%exitcond.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count
br i1 %exitcond.not, label %if.end31, label %for.body12, !llvm.loop !15
for.body12: ; preds = %for.body12.preheader, %for.cond10
%indvars.iv70 = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next71, %for.cond10 ]
%arrayidx14 = getelementptr inbounds [100005 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv70
%4 = load i8, ptr %arrayidx14, align 8, !tbaa !16
%arrayidx17 = getelementptr inbounds [100005 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv70
%5 = load i8, ptr %arrayidx17, align 8, !tbaa !16
%cmp20.not = icmp eq i8 %4, %5
br i1 %cmp20.not, label %for.cond10, label %if.end31
if.end31: ; preds = %for.cond10, %for.body12, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ @str, %for.body12 ], [ @str.5, %for.cond10 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%6 = load i32, ptr %n, align 4, !tbaa !13
%cmp3366 = icmp sgt i32 %6, 0
br i1 %cmp3366, label %for.body35, label %for.end46
for.body35: ; preds = %if.end31, %for.body35
%indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.body35 ], [ 0, %if.end31 ]
%arrayidx37 = getelementptr inbounds [100005 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73
%7 = load i8, ptr %arrayidx37, align 8, !tbaa !16
%conv39 = sext i8 %7 to i32
%n42 = getelementptr inbounds [100005 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73, i32 1
%8 = load i32, ptr %n42, align 4, !tbaa !5
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv39, i32 noundef %8)
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%9 = load i32, ptr %n, align 4, !tbaa !13
%10 = sext i32 %9 to i64
%cmp33 = icmp slt i64 %indvars.iv.next74, %10
br i1 %cmp33, label %for.body35, label %for.end46, !llvm.loop !17
for.end46: ; preds = %for.body35, %if.end31
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %B) #7
call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %A) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !9, i64 4}
!6 = !{!"", !7, i64 0, !9, i64 4}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!9, !9, i64 0}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = !{!6, !7, i64 0}
!17 = distinct !{!17, !11}
|
#include <stdio.h>
#define EXTREME 1000000000
#define MAX_ELEM 500000
typedef struct card{
char mark;
int x;
} Card;
Card L[MAX_ELEM / 2];
Card R[MAX_ELEM / 2];
Card c1[1000000];
Card c2[1000000];
void merge(Card A[], int left, int mid, int right){
int n1 = mid - left;
int n2 = right - mid;
for(int i = 0; i < n1; i++) L[i] = A[left+i];
for(int i = 0; i < n2; i++) R[i] = A[mid+i];
L[n1].x = EXTREME;
R[n2].x = EXTREME;
/* compare with L and R */
int i = 0, j = 0;
for(int k = left; k < right; k++){
if(L[i].x <= R[j].x){
A[k] = L[i];
i++;
} else{
A[k] = R[j];
j++;
}
}
}
void merge_sort(Card A[], int left, int right){
if(right - left > 1){
int mid = (right+left)/2;
merge_sort(A, left, mid);
merge_sort(A, mid, right);
merge(A, left, mid, right);
}
}
int partition(Card A[], int p, int r){
int i = p - 1;
Card last = A[r];
Card tmp;
for(int j = p; j < r; j++){
if(A[j].x <= last.x){
i += 1;
tmp = A[i];
A[i] = A[j];
A[j] = tmp;
}
}
tmp = A[i + 1];
A[i + 1]= A[r];
A[r] = tmp;
return i + 1;
}
int quicksort(Card A[], int p, int r){
if(p < r){
int q = partition(A, p, r);
quicksort(A, p, q-1);
quicksort(A, q+1, r);
}
return 0;
}
int main(){
int i, n, v;
/* 安定ならば0、不安定なら1を表す変数 */
int judge = 0;
char S[10];
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%s %d", S, &v);
c1[i].mark = c2[i].mark = S[0];
c1[i].x = c2[i].x = v;
}
quicksort(c1, 0, n - 1);
merge_sort(c2, 0, n);
for(i = 0; i < n; i++){
if(c1[i].mark != c2[i].mark){
judge = 1;
}
}
if(judge == 1){
printf("Not stable\n");
} else{
printf("Stable\n");
}
for(i = 0; i < n; i++){
printf("%c %d\n", c1[i].mark, c1[i].x);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270060/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270060/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.card = type { i8, i32 }
@L = dso_local local_unnamed_addr global [250000 x %struct.card] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [250000 x %struct.card] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@c2 = dso_local global [1000000 x %struct.card] zeroinitializer, align 16
@c1 = dso_local global [1000000 x %struct.card] zeroinitializer, align 16
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
@str.5 = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%A93 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp70 = icmp sgt i32 %sub, 0
br i1 %cmp70, label %for.body.preheader, label %for.cond5.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader111, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A93
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader111, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.card, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load94 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load94, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !5
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond5.preheader, label %for.body.preheader111
for.body.preheader111: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader111, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader111 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader111 ]
%arrayidx.prol = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.card, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !9
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader111
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader111 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond5.preheader, label %for.body
for.cond5.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp672 = icmp sgt i32 %sub1, 0
br i1 %cmp672, label %for.body8.preheader, label %for.cond.cleanup7
for.body8.preheader: ; preds = %for.cond5.preheader
%13 = sext i32 %mid to i64
%wide.trip.count84 = zext i32 %sub1 to i64
%invariant.gep91 = getelementptr %struct.card, ptr %A, i64 %13
%min.iters.check99 = icmp ult i32 %sub1, 10
br i1 %min.iters.check99, label %for.body8.preheader110, label %vector.memcheck95
vector.memcheck95: ; preds = %for.body8.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A93
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check96 = icmp ult i64 %16, 32
br i1 %diff.check96, label %for.body8.preheader110, label %vector.ph100
vector.ph100: ; preds = %vector.memcheck95
%n.vec102 = and i64 %wide.trip.count84, 4294967292
br label %vector.body105
vector.body105: ; preds = %vector.body105, %vector.ph100
%index106 = phi i64 [ 0, %vector.ph100 ], [ %index.next109, %vector.body105 ]
%17 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %index106
%18 = getelementptr %struct.card, ptr %invariant.gep91, i64 %index106
%wide.load107 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load108 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load107, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load108, ptr %20, align 16
%index.next109 = add nuw i64 %index106, 4
%21 = icmp eq i64 %index.next109, %n.vec102
br i1 %21, label %middle.block97, label %vector.body105, !llvm.loop !11
middle.block97: ; preds = %vector.body105
%cmp.n104 = icmp eq i64 %n.vec102, %wide.trip.count84
br i1 %cmp.n104, label %for.cond.cleanup7, label %for.body8.preheader110
for.body8.preheader110: ; preds = %vector.memcheck95, %for.body8.preheader, %middle.block97
%indvars.iv80.ph = phi i64 [ 0, %vector.memcheck95 ], [ 0, %for.body8.preheader ], [ %n.vec102, %middle.block97 ]
%22 = xor i64 %indvars.iv80.ph, -1
%23 = add nsw i64 %22, %wide.trip.count84
%xtraiter112 = and i64 %wide.trip.count84, 3
%lcmp.mod113.not = icmp eq i64 %xtraiter112, 0
br i1 %lcmp.mod113.not, label %for.body8.prol.loopexit, label %for.body8.prol
for.body8.prol: ; preds = %for.body8.preheader110, %for.body8.prol
%indvars.iv80.prol = phi i64 [ %indvars.iv.next81.prol, %for.body8.prol ], [ %indvars.iv80.ph, %for.body8.preheader110 ]
%prol.iter114 = phi i64 [ %prol.iter114.next, %for.body8.prol ], [ 0, %for.body8.preheader110 ]
%arrayidx10.prol = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %indvars.iv80.prol
%gep92.prol = getelementptr %struct.card, ptr %invariant.gep91, i64 %indvars.iv80.prol
%24 = load i64, ptr %gep92.prol, align 4
store i64 %24, ptr %arrayidx10.prol, align 8
%indvars.iv.next81.prol = add nuw nsw i64 %indvars.iv80.prol, 1
%prol.iter114.next = add i64 %prol.iter114, 1
%prol.iter114.cmp.not = icmp eq i64 %prol.iter114.next, %xtraiter112
br i1 %prol.iter114.cmp.not, label %for.body8.prol.loopexit, label %for.body8.prol, !llvm.loop !12
for.body8.prol.loopexit: ; preds = %for.body8.prol, %for.body8.preheader110
%indvars.iv80.unr = phi i64 [ %indvars.iv80.ph, %for.body8.preheader110 ], [ %indvars.iv.next81.prol, %for.body8.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.cond.cleanup7, label %for.body8
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.card, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.card, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.card, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.card, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond5.preheader, label %for.body, !llvm.loop !13
for.cond.cleanup7: ; preds = %for.body8.prol.loopexit, %for.body8, %middle.block97, %for.cond5.preheader
%idxprom17 = sext i32 %sub to i64
%x = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %idxprom17, i32 1
store i32 1000000000, ptr %x, align 4, !tbaa !14
%idxprom19 = sext i32 %sub1 to i64
%x21 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %idxprom19, i32 1
store i32 1000000000, ptr %x21, align 4, !tbaa !14
%cmp2474 = icmp slt i32 %left, %right
br i1 %cmp2474, label %for.body26.preheader, label %for.cond.cleanup25
for.body26.preheader: ; preds = %for.cond.cleanup7
%30 = sext i32 %left to i64
%wide.trip.count89 = sext i32 %right to i64
br label %for.body26
for.body8: ; preds = %for.body8.prol.loopexit, %for.body8
%indvars.iv80 = phi i64 [ %indvars.iv.next81.3, %for.body8 ], [ %indvars.iv80.unr, %for.body8.prol.loopexit ]
%arrayidx10 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %indvars.iv80
%gep92 = getelementptr %struct.card, ptr %invariant.gep91, i64 %indvars.iv80
%31 = load i64, ptr %gep92, align 4
store i64 %31, ptr %arrayidx10, align 8
%indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
%arrayidx10.1 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %indvars.iv.next81
%gep92.1 = getelementptr %struct.card, ptr %invariant.gep91, i64 %indvars.iv.next81
%32 = load i64, ptr %gep92.1, align 4
store i64 %32, ptr %arrayidx10.1, align 8
%indvars.iv.next81.1 = add nuw nsw i64 %indvars.iv80, 2
%arrayidx10.2 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %indvars.iv.next81.1
%gep92.2 = getelementptr %struct.card, ptr %invariant.gep91, i64 %indvars.iv.next81.1
%33 = load i64, ptr %gep92.2, align 4
store i64 %33, ptr %arrayidx10.2, align 8
%indvars.iv.next81.2 = add nuw nsw i64 %indvars.iv80, 3
%arrayidx10.3 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %indvars.iv.next81.2
%gep92.3 = getelementptr %struct.card, ptr %invariant.gep91, i64 %indvars.iv.next81.2
%34 = load i64, ptr %gep92.3, align 4
store i64 %34, ptr %arrayidx10.3, align 8
%indvars.iv.next81.3 = add nuw nsw i64 %indvars.iv80, 4
%exitcond85.not.3 = icmp eq i64 %indvars.iv.next81.3, %wide.trip.count84
br i1 %exitcond85.not.3, label %for.cond.cleanup7, label %for.body8, !llvm.loop !19
for.cond.cleanup25: ; preds = %for.body26, %for.cond.cleanup7
ret void
for.body26: ; preds = %for.body26.preheader, %for.body26
%indvars.iv86 = phi i64 [ %30, %for.body26.preheader ], [ %indvars.iv.next87, %for.body26 ]
%j.076 = phi i32 [ 0, %for.body26.preheader ], [ %j.1, %for.body26 ]
%i22.075 = phi i32 [ 0, %for.body26.preheader ], [ %i22.1, %for.body26 ]
%idxprom27 = zext i32 %i22.075 to i64
%x29 = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %idxprom27, i32 1
%35 = load i32, ptr %x29, align 4, !tbaa !14
%idxprom30 = zext i32 %j.076 to i64
%x32 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %idxprom30, i32 1
%36 = load i32, ptr %x32, align 4, !tbaa !14
%cmp33.not = icmp sle i32 %35, %36
%arrayidx31 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %idxprom30
%arrayidx28 = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %idxprom27
%.sink.in = select i1 %cmp33.not, ptr %arrayidx28, ptr %arrayidx31
%inc38 = zext i1 %cmp33.not to i32
%i22.1 = add nuw nsw i32 %i22.075, %inc38
%not.cmp33.not = xor i1 %cmp33.not, true
%inc43 = zext i1 %not.cmp33.not to i32
%j.1 = add nuw nsw i32 %j.076, %inc43
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv86
store i64 %.sink, ptr %37, align 4
%indvars.iv.next87 = add nsw i64 %indvars.iv86, 1
%exitcond90.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count89
br i1 %exitcond90.not, label %for.cond.cleanup25, label %for.body26, !llvm.loop !20
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge_sort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 {
entry:
%A11 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %right, %left
%cmp = icmp sgt i32 %sub, 1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add = add nsw i32 %right, %left
%div = sdiv i32 %add, 2
tail call void @merge_sort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @merge_sort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp70.i = icmp sgt i32 %sub.i, 0
br i1 %cmp70.i, label %for.body.preheader.i, label %for.cond5.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A11
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.card, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load12 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load12, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond5.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.card, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond5.preheader.i, label %for.body.i
for.cond5.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp672.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp672.i, label %for.body8.preheader.i, label %for.cond.cleanup7.i
for.body8.preheader.i: ; preds = %for.cond5.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count84.i = zext i32 %sub1.i to i64
%invariant.gep91.i = getelementptr %struct.card, ptr %A, i64 %13
%min.iters.check17 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check17, label %for.body8.i.preheader, label %vector.memcheck13
vector.memcheck13: ; preds = %for.body8.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A11
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check14 = icmp ult i64 %16, 32
br i1 %diff.check14, label %for.body8.i.preheader, label %vector.ph18
vector.ph18: ; preds = %vector.memcheck13
%n.vec20 = and i64 %wide.trip.count84.i, 4294967292
br label %vector.body23
vector.body23: ; preds = %vector.body23, %vector.ph18
%index24 = phi i64 [ 0, %vector.ph18 ], [ %index.next27, %vector.body23 ]
%17 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %index24
%18 = getelementptr %struct.card, ptr %invariant.gep91.i, i64 %index24
%wide.load25 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load26 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load25, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load26, ptr %20, align 16
%index.next27 = add nuw i64 %index24, 4
%21 = icmp eq i64 %index.next27, %n.vec20
br i1 %21, label %middle.block15, label %vector.body23, !llvm.loop !23
middle.block15: ; preds = %vector.body23
%cmp.n22 = icmp eq i64 %n.vec20, %wide.trip.count84.i
br i1 %cmp.n22, label %for.cond.cleanup7.i, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %vector.memcheck13, %for.body8.preheader.i, %middle.block15
%indvars.iv80.i.ph = phi i64 [ 0, %vector.memcheck13 ], [ 0, %for.body8.preheader.i ], [ %n.vec20, %middle.block15 ]
%22 = xor i64 %indvars.iv80.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count84.i
%xtraiter28 = and i64 %wide.trip.count84.i, 3
%lcmp.mod29.not = icmp eq i64 %xtraiter28, 0
br i1 %lcmp.mod29.not, label %for.body8.i.prol.loopexit, label %for.body8.i.prol
for.body8.i.prol: ; preds = %for.body8.i.preheader, %for.body8.i.prol
%indvars.iv80.i.prol = phi i64 [ %indvars.iv.next81.i.prol, %for.body8.i.prol ], [ %indvars.iv80.i.ph, %for.body8.i.preheader ]
%prol.iter30 = phi i64 [ %prol.iter30.next, %for.body8.i.prol ], [ 0, %for.body8.i.preheader ]
%arrayidx10.i.prol = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %indvars.iv80.i.prol
%gep92.i.prol = getelementptr %struct.card, ptr %invariant.gep91.i, i64 %indvars.iv80.i.prol
%24 = load i64, ptr %gep92.i.prol, align 4
store i64 %24, ptr %arrayidx10.i.prol, align 8
%indvars.iv.next81.i.prol = add nuw nsw i64 %indvars.iv80.i.prol, 1
%prol.iter30.next = add i64 %prol.iter30, 1
%prol.iter30.cmp.not = icmp eq i64 %prol.iter30.next, %xtraiter28
br i1 %prol.iter30.cmp.not, label %for.body8.i.prol.loopexit, label %for.body8.i.prol, !llvm.loop !24
for.body8.i.prol.loopexit: ; preds = %for.body8.i.prol, %for.body8.i.preheader
%indvars.iv80.i.unr = phi i64 [ %indvars.iv80.i.ph, %for.body8.i.preheader ], [ %indvars.iv.next81.i.prol, %for.body8.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.cond.cleanup7.i, label %for.body8.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.card, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.card, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond5.preheader.i, label %for.body.i, !llvm.loop !25
for.cond.cleanup7.i: ; preds = %for.body8.i.prol.loopexit, %for.body8.i, %middle.block15, %for.cond5.preheader.i
%idxprom17.i = sext i32 %sub.i to i64
%x.i = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %idxprom17.i, i32 1
store i32 1000000000, ptr %x.i, align 4, !tbaa !14
%idxprom19.i = sext i32 %sub1.i to i64
%x21.i = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %idxprom19.i, i32 1
store i32 1000000000, ptr %x21.i, align 4, !tbaa !14
%cmp2474.i = icmp slt i32 %left, %right
br i1 %cmp2474.i, label %for.body26.preheader.i, label %if.end
for.body26.preheader.i: ; preds = %for.cond.cleanup7.i
%30 = sext i32 %left to i64
%wide.trip.count89.i = sext i32 %right to i64
br label %for.body26.i
for.body8.i: ; preds = %for.body8.i.prol.loopexit, %for.body8.i
%indvars.iv80.i = phi i64 [ %indvars.iv.next81.i.3, %for.body8.i ], [ %indvars.iv80.i.unr, %for.body8.i.prol.loopexit ]
%arrayidx10.i = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %indvars.iv80.i
%gep92.i = getelementptr %struct.card, ptr %invariant.gep91.i, i64 %indvars.iv80.i
%31 = load i64, ptr %gep92.i, align 4
store i64 %31, ptr %arrayidx10.i, align 8
%indvars.iv.next81.i = add nuw nsw i64 %indvars.iv80.i, 1
%arrayidx10.i.1 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %indvars.iv.next81.i
%gep92.i.1 = getelementptr %struct.card, ptr %invariant.gep91.i, i64 %indvars.iv.next81.i
%32 = load i64, ptr %gep92.i.1, align 4
store i64 %32, ptr %arrayidx10.i.1, align 8
%indvars.iv.next81.i.1 = add nuw nsw i64 %indvars.iv80.i, 2
%arrayidx10.i.2 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %indvars.iv.next81.i.1
%gep92.i.2 = getelementptr %struct.card, ptr %invariant.gep91.i, i64 %indvars.iv.next81.i.1
%33 = load i64, ptr %gep92.i.2, align 4
store i64 %33, ptr %arrayidx10.i.2, align 8
%indvars.iv.next81.i.2 = add nuw nsw i64 %indvars.iv80.i, 3
%arrayidx10.i.3 = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %indvars.iv.next81.i.2
%gep92.i.3 = getelementptr %struct.card, ptr %invariant.gep91.i, i64 %indvars.iv.next81.i.2
%34 = load i64, ptr %gep92.i.3, align 4
store i64 %34, ptr %arrayidx10.i.3, align 8
%indvars.iv.next81.i.3 = add nuw nsw i64 %indvars.iv80.i, 4
%exitcond85.not.i.3 = icmp eq i64 %indvars.iv.next81.i.3, %wide.trip.count84.i
br i1 %exitcond85.not.i.3, label %for.cond.cleanup7.i, label %for.body8.i, !llvm.loop !26
for.body26.i: ; preds = %for.body26.i, %for.body26.preheader.i
%indvars.iv86.i = phi i64 [ %30, %for.body26.preheader.i ], [ %indvars.iv.next87.i, %for.body26.i ]
%j.076.i = phi i32 [ 0, %for.body26.preheader.i ], [ %j.1.i, %for.body26.i ]
%i22.075.i = phi i32 [ 0, %for.body26.preheader.i ], [ %i22.1.i, %for.body26.i ]
%idxprom27.i = zext i32 %i22.075.i to i64
%x29.i = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %idxprom27.i, i32 1
%35 = load i32, ptr %x29.i, align 4, !tbaa !14
%idxprom30.i = zext i32 %j.076.i to i64
%x32.i = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %idxprom30.i, i32 1
%36 = load i32, ptr %x32.i, align 4, !tbaa !14
%cmp33.not.i = icmp sle i32 %35, %36
%arrayidx31.i = getelementptr inbounds [250000 x %struct.card], ptr @R, i64 0, i64 %idxprom30.i
%arrayidx28.i = getelementptr inbounds [250000 x %struct.card], ptr @L, i64 0, i64 %idxprom27.i
%.sink.in.i = select i1 %cmp33.not.i, ptr %arrayidx28.i, ptr %arrayidx31.i
%inc38.i = zext i1 %cmp33.not.i to i32
%i22.1.i = add nuw nsw i32 %i22.075.i, %inc38.i
%not.cmp33.not.i = xor i1 %cmp33.not.i, true
%inc43.i = zext i1 %not.cmp33.not.i to i32
%j.1.i = add nuw nsw i32 %j.076.i, %inc43.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv86.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next87.i = add nsw i64 %indvars.iv86.i, 1
%exitcond90.not.i = icmp eq i64 %indvars.iv.next87.i, %wide.trip.count89.i
br i1 %exitcond90.not.i, label %if.end, label %for.body26.i, !llvm.loop !20
if.end: ; preds = %for.body26.i, %for.cond.cleanup7.i, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom
%last.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%last.sroa.3.0.copyload = load i32, ptr %last.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !27
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%x.prol = getelementptr inbounds %struct.card, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %x.prol, align 4, !tbaa !14
%cmp4.not.prol = icmp sgt i32 %2, %last.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.card, ptr %A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.cond.cleanup.loopexit, label %for.body
for.cond.cleanup.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%8 = add nsw i32 %i.1.lcssa, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %8, %for.cond.cleanup.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom14
%9 = load i64, ptr %arrayidx15, align 4
%10 = load i64, ptr %arrayidx, align 4
store i64 %10, ptr %arrayidx15, align 4
store i64 %9, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.047 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.047.unr, %for.body.prol.loopexit ]
%x = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv, i32 1
%11 = load i32, ptr %x, align 4, !tbaa !14
%cmp4.not = icmp sgt i32 %11, %last.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv
%add = add nsw i32 %i.047, 1
%idxprom5 = sext i32 %add to i64
%arrayidx6 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom5
%12 = load i64, ptr %arrayidx6, align 4
%13 = load i64, ptr %arrayidx2, align 4
store i64 %13, ptr %arrayidx6, align 4
store i64 %12, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.047, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%x.1 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.next, i32 1
%14 = load i32, ptr %x.1, align 4, !tbaa !14
%cmp4.not.1 = icmp sgt i32 %14, %last.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.next
%add.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %add.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom5.1
%15 = load i64, ptr %arrayidx6.1, align 4
%16 = load i64, ptr %arrayidx2.1, align 4
store i64 %16, ptr %arrayidx6.1, align 4
store i64 %15, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !29
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @quicksort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp11 = icmp slt i32 %p, %r
br i1 %cmp11, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom.i
%last.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr12 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%last.sroa.3.0.copyload.i = load i32, ptr %last.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !27
%sub.i = add nsw i32 %p.tr12, -1
%1 = sext i32 %p.tr12 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%x.i.prol = getelementptr inbounds %struct.card, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %x.i.prol, align 4, !tbaa !14
%cmp4.not.i.prol = icmp sgt i32 %3, %last.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.card, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr12 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr12, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.047.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.047.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.047.i.unr, %for.body.i.prol.loopexit ]
%x.i = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %x.i, align 4, !tbaa !14
%cmp4.not.i = icmp sgt i32 %8, %last.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.i
%add.i = add nsw i32 %i.047.i, 1
%idxprom5.i = sext i32 %add.i to i64
%arrayidx6.i = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%x.i.1 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %x.i.1, align 4, !tbaa !14
%cmp4.not.i.1 = icmp sgt i32 %11, %last.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.next.i
%add.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %add.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %add.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
%call1 = tail call i32 @quicksort(ptr noundef nonnull %A, i32 noundef %p.tr12, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret i32 0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%v = alloca i32, align 4
%S = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !28
%cmp62 = icmp sgt i32 %0, 0
br i1 %cmp62, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S, ptr noundef nonnull %v)
%1 = load i8, ptr %S, align 1, !tbaa !30
%arrayidx2 = getelementptr inbounds [1000000 x %struct.card], ptr @c2, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !31
%arrayidx4 = getelementptr inbounds [1000000 x %struct.card], ptr @c1, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx4, align 8, !tbaa !31
%2 = load i32, ptr %v, align 4, !tbaa !28
%x = getelementptr inbounds [1000000 x %struct.card], ptr @c2, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %x, align 4, !tbaa !14
%x10 = getelementptr inbounds [1000000 x %struct.card], ptr @c1, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %x10, align 4, !tbaa !14
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !28
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !32
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
%sub = add nsw i32 %.lcssa, -1
%call11 = call i32 @quicksort(ptr noundef nonnull @c1, i32 noundef 0, i32 noundef %sub)
call void @merge_sort(ptr noundef nonnull @c2, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr %n, align 4, !tbaa !28
%cmp1364 = icmp sgt i32 %5, 0
br i1 %cmp1364, label %for.body14.preheader, label %if.else
for.body14.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 1
%6 = icmp eq i32 %5, 1
br i1 %6, label %for.end26.unr-lcssa, label %for.body14.preheader.new
for.body14.preheader.new: ; preds = %for.body14.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body14
for.body14: ; preds = %for.body14, %for.body14.preheader.new
%indvars.iv72 = phi i64 [ 0, %for.body14.preheader.new ], [ %indvars.iv.next73.1, %for.body14 ]
%judge.066 = phi i32 [ 0, %for.body14.preheader.new ], [ %spec.select.1, %for.body14 ]
%niter = phi i64 [ 0, %for.body14.preheader.new ], [ %niter.next.1, %for.body14 ]
%arrayidx16 = getelementptr inbounds [1000000 x %struct.card], ptr @c1, i64 0, i64 %indvars.iv72
%7 = load i8, ptr %arrayidx16, align 16, !tbaa !31
%arrayidx19 = getelementptr inbounds [1000000 x %struct.card], ptr @c2, i64 0, i64 %indvars.iv72
%8 = load i8, ptr %arrayidx19, align 16, !tbaa !31
%cmp22.not = icmp eq i8 %7, %8
%indvars.iv.next73 = or i64 %indvars.iv72, 1
%arrayidx16.1 = getelementptr inbounds [1000000 x %struct.card], ptr @c1, i64 0, i64 %indvars.iv.next73
%9 = load i8, ptr %arrayidx16.1, align 8, !tbaa !31
%arrayidx19.1 = getelementptr inbounds [1000000 x %struct.card], ptr @c2, i64 0, i64 %indvars.iv.next73
%10 = load i8, ptr %arrayidx19.1, align 8, !tbaa !31
%cmp22.not.1 = icmp eq i8 %9, %10
%11 = select i1 %cmp22.not.1, i1 %cmp22.not, i1 false
%spec.select.1 = select i1 %11, i32 %judge.066, i32 1
%indvars.iv.next73.1 = add nuw nsw i64 %indvars.iv72, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end26.unr-lcssa, label %for.body14, !llvm.loop !33
for.end26.unr-lcssa: ; preds = %for.body14, %for.body14.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body14.preheader ], [ %spec.select.1, %for.body14 ]
%indvars.iv72.unr = phi i64 [ 0, %for.body14.preheader ], [ %indvars.iv.next73.1, %for.body14 ]
%judge.066.unr = phi i32 [ 0, %for.body14.preheader ], [ %spec.select.1, %for.body14 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end26, label %for.body14.epil
for.body14.epil: ; preds = %for.end26.unr-lcssa
%arrayidx16.epil = getelementptr inbounds [1000000 x %struct.card], ptr @c1, i64 0, i64 %indvars.iv72.unr
%12 = load i8, ptr %arrayidx16.epil, align 8, !tbaa !31
%arrayidx19.epil = getelementptr inbounds [1000000 x %struct.card], ptr @c2, i64 0, i64 %indvars.iv72.unr
%13 = load i8, ptr %arrayidx19.epil, align 8, !tbaa !31
%cmp22.not.epil = icmp eq i8 %12, %13
%spec.select.epil = select i1 %cmp22.not.epil, i32 %judge.066.unr, i32 1
br label %for.end26
for.end26: ; preds = %for.end26.unr-lcssa, %for.body14.epil
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end26.unr-lcssa ], [ %spec.select.epil, %for.body14.epil ]
%14 = icmp eq i32 %spec.select.lcssa, 1
br i1 %14, label %if.end32, label %if.else
if.else: ; preds = %for.end, %for.end26
br label %if.end32
if.end32: ; preds = %for.end26, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.5, %for.end26 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%15 = load i32, ptr %n, align 4, !tbaa !28
%cmp3468 = icmp sgt i32 %15, 0
br i1 %cmp3468, label %for.body36, label %for.end47
for.body36: ; preds = %if.end32, %for.body36
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body36 ], [ 0, %if.end32 ]
%arrayidx38 = getelementptr inbounds [1000000 x %struct.card], ptr @c1, i64 0, i64 %indvars.iv75
%16 = load i8, ptr %arrayidx38, align 8, !tbaa !31
%conv40 = sext i8 %16 to i32
%x43 = getelementptr inbounds [1000000 x %struct.card], ptr @c1, i64 0, i64 %indvars.iv75, i32 1
%17 = load i32, ptr %x43, align 4, !tbaa !14
%call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv40, i32 noundef %17)
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%18 = load i32, ptr %n, align 4, !tbaa !28
%19 = sext i32 %18 to i64
%cmp34 = icmp slt i64 %indvars.iv.next76, %19
br i1 %cmp34, label %for.body36, label %for.end47, !llvm.loop !34
for.end47: ; preds = %for.body36, %if.end32
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !6, !7, !8}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !6, !7}
!14 = !{!15, !18, i64 4}
!15 = !{!"card", !16, i64 0, !18, i64 4}
!16 = !{!"omnipotent char", !17, i64 0}
!17 = !{!"Simple C/C++ TBAA"}
!18 = !{!"int", !16, i64 0}
!19 = distinct !{!19, !6, !7}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6, !7, !8}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !6, !7, !8}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !6, !7}
!26 = distinct !{!26, !6, !7}
!27 = !{i64 0, i64 4, !28}
!28 = !{!18, !18, i64 0}
!29 = distinct !{!29, !6}
!30 = !{!16, !16, i64 0}
!31 = !{!15, !16, i64 0}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !6}
|
typedef struct CC{
int i;
int y;
char z;
} CC;
#include <stdio.h>
int gu(){
int n = 0;
int x = getchar_unlocked();
if(x<=47||58<=x){
return x;
}
while(48<=x&&x<58){
n=10*n+(x & 0xf);
x = getchar_unlocked();
}
return n;
}
void pn(int n){
int i=0;
char c[11];
if(!n){
putchar_unlocked('0');
return;
}
while(n){
c[i++]=(char)(n%10+'0'),n/=10;
}
while(i--){
putchar_unlocked(c[i]);
}
}
void *qp(CC *lon, CC *pan){
CC pores = *(pan-1);
CC *p = lon-1;
for(CC *w = lon; w!=pan-1;++w){
if(w->y<=pores.y){
p++;
CC bum = *p;
*p = *w;
*w = bum;
}
}
CC bum = *++p;
*p=pores;
*(pan-1)=bum;
return p;
}
void clock(void *lon, void *pan, size_t C){
if(pan-lon<=C){
return;
}
void *mi = qp(lon,pan);
clock(lon,mi,C);
clock(mi,pan,C);
}
int main(int argc, char **argv){
int n = gu();
CC X[n];
for(int i=0;i<=n-1;++i){
X[i].z=getchar_unlocked();
getchar_unlocked();
X[i].y=gu();
X[i].i=i;
}
clock(X,X+n,sizeof(CC));
int f=0;
for(int i=1;i<=n-1;++i){
if(X[i].y==X[i-1].y&&X[i].i<X[i-1].i){
f=1;
break;
}
}
puts(f ? "Not stable" : "Stable");
for(int i=0;i<=n-1;++i){
putchar_unlocked(X[i].z), putchar_unlocked(' ');
pn(X[i].y), putchar_unlocked('\n');
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270103/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270103/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
%struct.CC = type { i32, i32, i8 }
@.str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @gu() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #6
br label %getchar_unlocked.exit
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%4 = add i32 %cond.i, -58
%or.cond = icmp ult i32 %4, -10
br i1 %or.cond, label %cleanup, label %while.body.preheader
while.body.preheader: ; preds = %getchar_unlocked.exit
%.pre24 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.preheader, %getchar_unlocked.exit21
%5 = phi ptr [ %9, %getchar_unlocked.exit21 ], [ %.pre24, %while.body.preheader ]
%x.023 = phi i32 [ %cond.i17, %getchar_unlocked.exit21 ], [ %cond.i, %while.body.preheader ]
%n.022 = phi i32 [ %add, %getchar_unlocked.exit21 ], [ 0, %while.body.preheader ]
%mul = mul nsw i32 %n.022, 10
%and = and i32 %x.023, 15
%add = add nsw i32 %and, %mul
%_IO_read_ptr.i12 = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %_IO_read_ptr.i12, align 8, !tbaa !9
%_IO_read_end.i13 = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 2
%7 = load ptr, ptr %_IO_read_end.i13, align 8, !tbaa !14
%cmp.not.i14 = icmp ult ptr %6, %7
br i1 %cmp.not.i14, label %cond.false.i18, label %cond.true.i15, !prof !15
cond.true.i15: ; preds = %while.body
%call.i16 = tail call i32 @__uflow(ptr noundef nonnull %5) #6
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit21
cond.false.i18: ; preds = %while.body
%incdec.ptr.i19 = getelementptr inbounds i8, ptr %6, i64 1
store ptr %incdec.ptr.i19, ptr %_IO_read_ptr.i12, align 8, !tbaa !9
%8 = load i8, ptr %6, align 1, !tbaa !16
%conv3.i20 = zext i8 %8 to i32
br label %getchar_unlocked.exit21
getchar_unlocked.exit21: ; preds = %cond.true.i15, %cond.false.i18
%9 = phi ptr [ %.pre, %cond.true.i15 ], [ %5, %cond.false.i18 ]
%cond.i17 = phi i32 [ %call.i16, %cond.true.i15 ], [ %conv3.i20, %cond.false.i18 ]
%10 = add i32 %cond.i17, -48
%11 = icmp ult i32 %10, 10
br i1 %11, label %while.body, label %cleanup, !llvm.loop !17
cleanup: ; preds = %getchar_unlocked.exit21, %getchar_unlocked.exit
%retval.0 = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %add, %getchar_unlocked.exit21 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local void @pn(i32 noundef %n) local_unnamed_addr #0 {
entry:
%c = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %c) #6
%tobool.not = icmp eq i32 %n, 0
br i1 %tobool.not, label %if.then, label %while.body
if.then: ; preds = %entry
%0 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 5
%1 = load ptr, ptr %_IO_write_ptr.i, align 8, !tbaa !19
%_IO_write_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 6
%2 = load ptr, ptr %_IO_write_end.i, align 8, !tbaa !20
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %if.then
%call.i = tail call i32 @__overflow(ptr noundef nonnull %0, i32 noundef 48) #6
br label %cleanup
cond.false.i: ; preds = %if.then
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_write_ptr.i, align 8, !tbaa !19
store i8 48, ptr %1, align 1, !tbaa !16
br label %cleanup
while.body: ; preds = %entry, %while.body
%indvars.iv29 = phi i32 [ %indvars.iv.next30, %while.body ], [ 1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%n.addr.025 = phi i32 [ %div, %while.body ], [ %n, %entry ]
%rem = srem i32 %n.addr.025, 10
%3 = trunc i32 %rem to i8
%conv = add nsw i8 %3, 48
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [11 x i8], ptr %c, i64 0, i64 %indvars.iv
store i8 %conv, ptr %arrayidx, align 1, !tbaa !16
%div = sdiv i32 %n.addr.025, 10
%n.addr.025.off = add i32 %n.addr.025, 9
%tobool1.not = icmp ult i32 %n.addr.025.off, 19
%indvars.iv.next30 = add nuw i32 %indvars.iv29, 1
br i1 %tobool1.not, label %while.body4.preheader, label %while.body, !llvm.loop !21
while.body4.preheader: ; preds = %while.body
%4 = sext i32 %indvars.iv29 to i64
br label %while.body4
while.body4: ; preds = %while.body4.preheader, %putchar_unlocked.exit24
%indvars.iv31 = phi i64 [ %4, %while.body4.preheader ], [ %indvars.iv.next32, %putchar_unlocked.exit24 ]
%indvars.iv.next32 = add nsw i64 %indvars.iv31, -1
%arrayidx6 = getelementptr inbounds [11 x i8], ptr %c, i64 0, i64 %indvars.iv.next32
%5 = load i8, ptr %arrayidx6, align 1, !tbaa !16
%6 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i16 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 5
%7 = load ptr, ptr %_IO_write_ptr.i16, align 8, !tbaa !19
%_IO_write_end.i17 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 6
%8 = load ptr, ptr %_IO_write_end.i17, align 8, !tbaa !20
%cmp.not.i18 = icmp ult ptr %7, %8
br i1 %cmp.not.i18, label %cond.false.i22, label %cond.true.i19, !prof !15
cond.true.i19: ; preds = %while.body4
%conv7 = zext i8 %5 to i32
%call.i20 = tail call i32 @__overflow(ptr noundef nonnull %6, i32 noundef %conv7) #6
br label %putchar_unlocked.exit24
cond.false.i22: ; preds = %while.body4
%incdec.ptr.i23 = getelementptr inbounds i8, ptr %7, i64 1
store ptr %incdec.ptr.i23, ptr %_IO_write_ptr.i16, align 8, !tbaa !19
store i8 %5, ptr %7, align 1, !tbaa !16
br label %putchar_unlocked.exit24
putchar_unlocked.exit24: ; preds = %cond.true.i19, %cond.false.i22
%9 = and i64 %indvars.iv.next32, 4294967295
%tobool3.not = icmp eq i64 %9, 0
br i1 %tobool3.not, label %cleanup, label %while.body4, !llvm.loop !22
cleanup: ; preds = %putchar_unlocked.exit24, %cond.false.i, %cond.true.i
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %c) #6
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local nonnull ptr @qp(ptr noundef %lon, ptr noundef %pan) local_unnamed_addr #2 {
entry:
%bum = alloca %struct.CC, align 4
%bum6 = alloca %struct.CC, align 4
%add.ptr = getelementptr inbounds %struct.CC, ptr %pan, i64 -1
%pores.sroa.0.0.copyload = load i32, ptr %add.ptr, align 4, !tbaa.struct !23
%pores.sroa.4.0.add.ptr.sroa_idx = getelementptr %struct.CC, ptr %pan, i64 -1, i32 1
%0 = load <2 x i32>, ptr %pores.sroa.4.0.add.ptr.sroa_idx, align 4
%add.ptr1 = getelementptr inbounds %struct.CC, ptr %lon, i64 -1
%cmp.not24 = icmp eq ptr %add.ptr, %lon
br i1 %cmp.not24, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = extractelement <2 x i32> %0, i64 0
br label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
%p.0.lcssa = phi ptr [ %add.ptr1, %entry ], [ %p.1, %for.inc ]
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %bum6)
%incdec.ptr7 = getelementptr inbounds %struct.CC, ptr %p.0.lcssa, i64 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %bum6, ptr noundef nonnull align 4 dereferenceable(12) %incdec.ptr7, i64 12, i1 false), !tbaa.struct !23
store i32 %pores.sroa.0.0.copyload, ptr %incdec.ptr7, align 4, !tbaa.struct !23
%pores.sroa.4.0.p.0.16.sroa_idx = getelementptr inbounds %struct.CC, ptr %p.0.lcssa, i64 1, i32 1
store <2 x i32> %0, ptr %pores.sroa.4.0.p.0.16.sroa_idx, align 4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %add.ptr, ptr noundef nonnull align 4 dereferenceable(12) %bum6, i64 12, i1 false), !tbaa.struct !23
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %bum6)
ret ptr %incdec.ptr7
for.body: ; preds = %for.body.preheader, %for.inc
%w.026 = phi ptr [ %incdec.ptr5, %for.inc ], [ %lon, %for.body.preheader ]
%p.025 = phi ptr [ %p.1, %for.inc ], [ %add.ptr1, %for.body.preheader ]
%y = getelementptr inbounds %struct.CC, ptr %w.026, i64 0, i32 1
%2 = load i32, ptr %y, align 4, !tbaa !25
%cmp4.not = icmp sgt i32 %2, %1
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%incdec.ptr = getelementptr inbounds %struct.CC, ptr %p.025, i64 1
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %bum)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %bum, ptr noundef nonnull align 4 dereferenceable(12) %incdec.ptr, i64 12, i1 false), !tbaa.struct !23
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %incdec.ptr, ptr noundef nonnull align 4 dereferenceable(12) %w.026, i64 12, i1 false), !tbaa.struct !23
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %w.026, ptr noundef nonnull align 4 dereferenceable(12) %bum, i64 12, i1 false), !tbaa.struct !23
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %bum)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%p.1 = phi ptr [ %incdec.ptr, %if.then ], [ %p.025, %for.body ]
%incdec.ptr5 = getelementptr inbounds %struct.CC, ptr %w.026, i64 1
%cmp.not = icmp eq ptr %incdec.ptr5, %add.ptr
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !27
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @clock(ptr noundef %lon, ptr noundef %pan, i64 noundef %C) local_unnamed_addr #2 {
entry:
%bum.i = alloca %struct.CC, align 4
%bum6.i = alloca %struct.CC, align 4
%sub.ptr.lhs.cast = ptrtoint ptr %pan to i64
%sub.ptr.rhs.cast8 = ptrtoint ptr %lon to i64
%sub.ptr.sub9 = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast8
%cmp.not10 = icmp ugt i64 %sub.ptr.sub9, %C
br i1 %cmp.not10, label %if.end.lr.ph, label %return
if.end.lr.ph: ; preds = %entry
%add.ptr.i = getelementptr inbounds %struct.CC, ptr %pan, i64 -1
%pores.sroa.4.0.add.ptr.sroa_idx.i = getelementptr %struct.CC, ptr %pan, i64 -1, i32 1
br label %if.end
if.end: ; preds = %if.end.lr.ph, %qp.exit
%lon.tr11 = phi ptr [ %lon, %if.end.lr.ph ], [ %incdec.ptr7.i, %qp.exit ]
%pores.sroa.0.0.copyload.i = load i32, ptr %add.ptr.i, align 4, !tbaa.struct !23
%0 = load <2 x i32>, ptr %pores.sroa.4.0.add.ptr.sroa_idx.i, align 4
%add.ptr1.i = getelementptr inbounds %struct.CC, ptr %lon.tr11, i64 -1
%cmp.not24.i = icmp eq ptr %add.ptr.i, %lon.tr11
br i1 %cmp.not24.i, label %qp.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %if.end
%1 = extractelement <2 x i32> %0, i64 0
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.inc.i
%w.026.i = phi ptr [ %incdec.ptr5.i, %for.inc.i ], [ %lon.tr11, %for.body.i.preheader ]
%p.025.i = phi ptr [ %p.1.i, %for.inc.i ], [ %add.ptr1.i, %for.body.i.preheader ]
%y.i = getelementptr inbounds %struct.CC, ptr %w.026.i, i64 0, i32 1
%2 = load i32, ptr %y.i, align 4, !tbaa !25
%cmp4.not.i = icmp sgt i32 %2, %1
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%incdec.ptr.i = getelementptr inbounds %struct.CC, ptr %p.025.i, i64 1
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %bum.i)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %bum.i, ptr noundef nonnull align 4 dereferenceable(12) %incdec.ptr.i, i64 12, i1 false), !tbaa.struct !23
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %incdec.ptr.i, ptr noundef nonnull align 4 dereferenceable(12) %w.026.i, i64 12, i1 false), !tbaa.struct !23
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %w.026.i, ptr noundef nonnull align 4 dereferenceable(12) %bum.i, i64 12, i1 false), !tbaa.struct !23
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %bum.i)
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%p.1.i = phi ptr [ %incdec.ptr.i, %if.then.i ], [ %p.025.i, %for.body.i ]
%incdec.ptr5.i = getelementptr inbounds %struct.CC, ptr %w.026.i, i64 1
%cmp.not.i = icmp eq ptr %incdec.ptr5.i, %add.ptr.i
br i1 %cmp.not.i, label %qp.exit, label %for.body.i, !llvm.loop !27
qp.exit: ; preds = %for.inc.i, %if.end
%p.0.lcssa.i = phi ptr [ %add.ptr1.i, %if.end ], [ %p.1.i, %for.inc.i ]
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %bum6.i)
%incdec.ptr7.i = getelementptr inbounds %struct.CC, ptr %p.0.lcssa.i, i64 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %bum6.i, ptr noundef nonnull align 4 dereferenceable(12) %incdec.ptr7.i, i64 12, i1 false), !tbaa.struct !23
store i32 %pores.sroa.0.0.copyload.i, ptr %incdec.ptr7.i, align 4, !tbaa.struct !23
%pores.sroa.4.0.p.0.16.sroa_idx.i = getelementptr inbounds %struct.CC, ptr %p.0.lcssa.i, i64 1, i32 1
store <2 x i32> %0, ptr %pores.sroa.4.0.p.0.16.sroa_idx.i, align 4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %add.ptr.i, ptr noundef nonnull align 4 dereferenceable(12) %bum6.i, i64 12, i1 false), !tbaa.struct !23
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %bum6.i)
tail call void @clock(ptr noundef %lon.tr11, ptr noundef nonnull %incdec.ptr7.i, i64 noundef %C)
%sub.ptr.rhs.cast = ptrtoint ptr %incdec.ptr7.i to i64
%sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast
%cmp.not = icmp ugt i64 %sub.ptr.sub, %C
br i1 %cmp.not, label %if.end, label %return
return: ; preds = %qp.exit, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%c.i = alloca [11 x i8], align 1
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14
%cmp.not.i.i = icmp ult ptr %1, %2
br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15
cond.true.i.i: ; preds = %entry
%call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #6
br label %getchar_unlocked.exit.i
cond.false.i.i: ; preds = %entry
%incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i.i = zext i8 %3 to i32
br label %getchar_unlocked.exit.i
getchar_unlocked.exit.i: ; preds = %cond.false.i.i, %cond.true.i.i
%cond.i.i = phi i32 [ %call.i.i, %cond.true.i.i ], [ %conv3.i.i, %cond.false.i.i ]
%4 = add i32 %cond.i.i, -58
%or.cond.i = icmp ult i32 %4, -10
br i1 %or.cond.i, label %gu.exit, label %while.body.preheader.i
while.body.preheader.i: ; preds = %getchar_unlocked.exit.i
%.pre24.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body.i
while.body.i: ; preds = %getchar_unlocked.exit21.i, %while.body.preheader.i
%5 = phi ptr [ %9, %getchar_unlocked.exit21.i ], [ %.pre24.i, %while.body.preheader.i ]
%x.023.i = phi i32 [ %cond.i17.i, %getchar_unlocked.exit21.i ], [ %cond.i.i, %while.body.preheader.i ]
%n.022.i = phi i32 [ %add.i, %getchar_unlocked.exit21.i ], [ 0, %while.body.preheader.i ]
%mul.i = mul nsw i32 %n.022.i, 10
%and.i = and i32 %x.023.i, 15
%add.i = add nsw i32 %mul.i, %and.i
%_IO_read_ptr.i12.i = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %_IO_read_ptr.i12.i, align 8, !tbaa !9
%_IO_read_end.i13.i = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 2
%7 = load ptr, ptr %_IO_read_end.i13.i, align 8, !tbaa !14
%cmp.not.i14.i = icmp ult ptr %6, %7
br i1 %cmp.not.i14.i, label %cond.false.i18.i, label %cond.true.i15.i, !prof !15
cond.true.i15.i: ; preds = %while.body.i
%call.i16.i = tail call i32 @__uflow(ptr noundef nonnull %5) #6
%.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit21.i
cond.false.i18.i: ; preds = %while.body.i
%incdec.ptr.i19.i = getelementptr inbounds i8, ptr %6, i64 1
store ptr %incdec.ptr.i19.i, ptr %_IO_read_ptr.i12.i, align 8, !tbaa !9
%8 = load i8, ptr %6, align 1, !tbaa !16
%conv3.i20.i = zext i8 %8 to i32
br label %getchar_unlocked.exit21.i
getchar_unlocked.exit21.i: ; preds = %cond.false.i18.i, %cond.true.i15.i
%9 = phi ptr [ %.pre.i, %cond.true.i15.i ], [ %5, %cond.false.i18.i ]
%cond.i17.i = phi i32 [ %call.i16.i, %cond.true.i15.i ], [ %conv3.i20.i, %cond.false.i18.i ]
%10 = add i32 %cond.i17.i, -48
%11 = icmp ult i32 %10, 10
br i1 %11, label %while.body.i, label %gu.exit, !llvm.loop !17
gu.exit: ; preds = %getchar_unlocked.exit21.i, %getchar_unlocked.exit.i
%retval.0.i = phi i32 [ %cond.i.i, %getchar_unlocked.exit.i ], [ %add.i, %getchar_unlocked.exit21.i ]
%12 = zext i32 %retval.0.i to i64
%vla = alloca %struct.CC, i64 %12, align 16
%cmp.not.not152 = icmp sgt i32 %retval.0.i, 0
br i1 %cmp.not.not152, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %gu.exit
%.pre171 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %for.body
for.cond.cleanup: ; preds = %gu.exit120, %gu.exit
%idx.ext = sext i32 %retval.0.i to i64
%add.ptr = getelementptr inbounds %struct.CC, ptr %vla, i64 %idx.ext
call void @clock(ptr noundef nonnull %vla, ptr noundef nonnull %add.ptr, i64 noundef 12)
%cmp12.not.not.not154 = icmp sgt i32 %retval.0.i, 1
br i1 %cmp12.not.not.not154, label %for.body15.preheader, label %cleanup
for.body15.preheader: ; preds = %for.cond.cleanup
%y22.phi.trans.insert = getelementptr inbounds %struct.CC, ptr %vla, i64 0, i32 1
%.pre183 = load i32, ptr %y22.phi.trans.insert, align 4, !tbaa !25
%invariant.gep = getelementptr %struct.CC, ptr %vla, i64 -1
br label %for.body15
for.body: ; preds = %for.body.preheader, %gu.exit120
%.pre24.i98180 = phi ptr [ %.pre171, %for.body.preheader ], [ %.pre24.i98181, %gu.exit120 ]
%13 = phi ptr [ %.pre171, %for.body.preheader ], [ %33, %gu.exit120 ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %gu.exit120 ]
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1
%14 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2
%15 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %14, %15
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %for.body
%call.i = tail call i32 @__uflow(ptr noundef nonnull %13) #6
%.pre172 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i79.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre172, i64 0, i32 1
%.pre173 = load ptr, ptr %_IO_read_ptr.i79.phi.trans.insert, align 8, !tbaa !9
%_IO_read_end.i80.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre172, i64 0, i32 2
%.pre174 = load ptr, ptr %_IO_read_end.i80.phi.trans.insert, align 8, !tbaa !14
br label %getchar_unlocked.exit
cond.false.i: ; preds = %for.body
%incdec.ptr.i = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%16 = load i8, ptr %14, align 1, !tbaa !16
%conv3.i = zext i8 %16 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%.pre24.i98179 = phi ptr [ %.pre172, %cond.true.i ], [ %.pre24.i98180, %cond.false.i ]
%17 = phi ptr [ %.pre172, %cond.true.i ], [ %13, %cond.false.i ]
%18 = phi ptr [ %.pre174, %cond.true.i ], [ %15, %cond.false.i ]
%19 = phi ptr [ %.pre173, %cond.true.i ], [ %incdec.ptr.i, %cond.false.i ]
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%conv = trunc i32 %cond.i to i8
%arrayidx = getelementptr inbounds %struct.CC, ptr %vla, i64 %indvars.iv
%z = getelementptr inbounds %struct.CC, ptr %vla, i64 %indvars.iv, i32 2
store i8 %conv, ptr %z, align 4, !tbaa !28
%cmp.not.i81 = icmp ult ptr %19, %18
br i1 %cmp.not.i81, label %cond.false.i85, label %cond.true.i82, !prof !15
cond.true.i82: ; preds = %getchar_unlocked.exit
%call.i83 = tail call i32 @__uflow(ptr noundef nonnull %17) #6
%.pre175 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i.i89.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre175, i64 0, i32 1
%.pre184 = load ptr, ptr %_IO_read_ptr.i.i89.phi.trans.insert, align 8, !tbaa !9
%_IO_read_end.i.i90.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre175, i64 0, i32 2
%.pre185 = load ptr, ptr %_IO_read_end.i.i90.phi.trans.insert, align 8, !tbaa !14
br label %getchar_unlocked.exit88
cond.false.i85: ; preds = %getchar_unlocked.exit
%_IO_read_ptr.i79 = getelementptr inbounds %struct._IO_FILE, ptr %17, i64 0, i32 1
%incdec.ptr.i86 = getelementptr inbounds i8, ptr %19, i64 1
store ptr %incdec.ptr.i86, ptr %_IO_read_ptr.i79, align 8, !tbaa !9
br label %getchar_unlocked.exit88
getchar_unlocked.exit88: ; preds = %cond.true.i82, %cond.false.i85
%20 = phi ptr [ %.pre185, %cond.true.i82 ], [ %18, %cond.false.i85 ]
%21 = phi ptr [ %.pre184, %cond.true.i82 ], [ %incdec.ptr.i86, %cond.false.i85 ]
%.pre24.i98178 = phi ptr [ %.pre175, %cond.true.i82 ], [ %.pre24.i98179, %cond.false.i85 ]
%22 = phi ptr [ %.pre175, %cond.true.i82 ], [ %17, %cond.false.i85 ]
%cmp.not.i.i91 = icmp ult ptr %21, %20
br i1 %cmp.not.i.i91, label %cond.false.i.i117, label %cond.true.i.i92, !prof !15
cond.true.i.i92: ; preds = %getchar_unlocked.exit88
%call.i.i93 = tail call i32 @__uflow(ptr noundef nonnull %22) #6
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit.i94
cond.false.i.i117: ; preds = %getchar_unlocked.exit88
%_IO_read_ptr.i.i89 = getelementptr inbounds %struct._IO_FILE, ptr %22, i64 0, i32 1
%incdec.ptr.i.i118 = getelementptr inbounds i8, ptr %21, i64 1
store ptr %incdec.ptr.i.i118, ptr %_IO_read_ptr.i.i89, align 8, !tbaa !9
%23 = load i8, ptr %21, align 1, !tbaa !16
%conv3.i.i119 = zext i8 %23 to i32
br label %getchar_unlocked.exit.i94
getchar_unlocked.exit.i94: ; preds = %cond.false.i.i117, %cond.true.i.i92
%.pre24.i98 = phi ptr [ %.pre, %cond.true.i.i92 ], [ %.pre24.i98178, %cond.false.i.i117 ]
%24 = phi ptr [ %.pre, %cond.true.i.i92 ], [ %22, %cond.false.i.i117 ]
%cond.i.i95 = phi i32 [ %call.i.i93, %cond.true.i.i92 ], [ %conv3.i.i119, %cond.false.i.i117 ]
%25 = add i32 %cond.i.i95, -58
%or.cond.i96 = icmp ult i32 %25, -10
br i1 %or.cond.i96, label %gu.exit120, label %while.body.i99
while.body.i99: ; preds = %getchar_unlocked.exit.i94, %getchar_unlocked.exit21.i111
%.pre24.i98177 = phi ptr [ %.pre24.i98176, %getchar_unlocked.exit21.i111 ], [ %.pre24.i98, %getchar_unlocked.exit.i94 ]
%26 = phi ptr [ %30, %getchar_unlocked.exit21.i111 ], [ %.pre24.i98, %getchar_unlocked.exit.i94 ]
%x.023.i100 = phi i32 [ %cond.i17.i112, %getchar_unlocked.exit21.i111 ], [ %cond.i.i95, %getchar_unlocked.exit.i94 ]
%n.022.i101 = phi i32 [ %add.i104, %getchar_unlocked.exit21.i111 ], [ 0, %getchar_unlocked.exit.i94 ]
%mul.i102 = mul nsw i32 %n.022.i101, 10
%and.i103 = and i32 %x.023.i100, 15
%add.i104 = add nsw i32 %mul.i102, %and.i103
%_IO_read_ptr.i12.i105 = getelementptr inbounds %struct._IO_FILE, ptr %26, i64 0, i32 1
%27 = load ptr, ptr %_IO_read_ptr.i12.i105, align 8, !tbaa !9
%_IO_read_end.i13.i106 = getelementptr inbounds %struct._IO_FILE, ptr %26, i64 0, i32 2
%28 = load ptr, ptr %_IO_read_end.i13.i106, align 8, !tbaa !14
%cmp.not.i14.i107 = icmp ult ptr %27, %28
br i1 %cmp.not.i14.i107, label %cond.false.i18.i114, label %cond.true.i15.i108, !prof !15
cond.true.i15.i108: ; preds = %while.body.i99
%call.i16.i109 = tail call i32 @__uflow(ptr noundef nonnull %26) #6
%.pre.i110 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit21.i111
cond.false.i18.i114: ; preds = %while.body.i99
%incdec.ptr.i19.i115 = getelementptr inbounds i8, ptr %27, i64 1
store ptr %incdec.ptr.i19.i115, ptr %_IO_read_ptr.i12.i105, align 8, !tbaa !9
%29 = load i8, ptr %27, align 1, !tbaa !16
%conv3.i20.i116 = zext i8 %29 to i32
br label %getchar_unlocked.exit21.i111
getchar_unlocked.exit21.i111: ; preds = %cond.false.i18.i114, %cond.true.i15.i108
%.pre24.i98176 = phi ptr [ %.pre.i110, %cond.true.i15.i108 ], [ %.pre24.i98177, %cond.false.i18.i114 ]
%30 = phi ptr [ %.pre.i110, %cond.true.i15.i108 ], [ %26, %cond.false.i18.i114 ]
%cond.i17.i112 = phi i32 [ %call.i16.i109, %cond.true.i15.i108 ], [ %conv3.i20.i116, %cond.false.i18.i114 ]
%31 = add i32 %cond.i17.i112, -48
%32 = icmp ult i32 %31, 10
br i1 %32, label %while.body.i99, label %gu.exit120, !llvm.loop !17
gu.exit120: ; preds = %getchar_unlocked.exit21.i111, %getchar_unlocked.exit.i94
%.pre24.i98181 = phi ptr [ %.pre24.i98, %getchar_unlocked.exit.i94 ], [ %.pre24.i98176, %getchar_unlocked.exit21.i111 ]
%33 = phi ptr [ %24, %getchar_unlocked.exit.i94 ], [ %30, %getchar_unlocked.exit21.i111 ]
%retval.0.i113 = phi i32 [ %cond.i.i95, %getchar_unlocked.exit.i94 ], [ %add.i104, %getchar_unlocked.exit21.i111 ]
%y = getelementptr inbounds %struct.CC, ptr %vla, i64 %indvars.iv, i32 1
store i32 %retval.0.i113, ptr %y, align 4, !tbaa !25
%34 = trunc i64 %indvars.iv to i32
store i32 %34, ptr %arrayidx, align 4, !tbaa !29
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %12
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !30
for.body15: ; preds = %for.body15.preheader, %for.inc34
%35 = phi i32 [ %.pre183, %for.body15.preheader ], [ %36, %for.inc34 ]
%indvars.iv160 = phi i64 [ 1, %for.body15.preheader ], [ %indvars.iv.next161, %for.inc34 ]
%y18 = getelementptr inbounds %struct.CC, ptr %vla, i64 %indvars.iv160, i32 1
%36 = load i32, ptr %y18, align 4, !tbaa !25
%cmp23 = icmp eq i32 %36, %35
br i1 %cmp23, label %land.lhs.true, label %for.inc34
land.lhs.true: ; preds = %for.body15
%gep = getelementptr %struct.CC, ptr %invariant.gep, i64 %indvars.iv160
%arrayidx17 = getelementptr inbounds %struct.CC, ptr %vla, i64 %indvars.iv160
%37 = load i32, ptr %arrayidx17, align 4, !tbaa !29
%38 = load i32, ptr %gep, align 4, !tbaa !29
%cmp32 = icmp slt i32 %37, %38
br i1 %cmp32, label %cleanup, label %for.inc34
for.inc34: ; preds = %for.body15, %land.lhs.true
%indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
%exitcond165.not = icmp eq i64 %indvars.iv.next161, %12
br i1 %exitcond165.not, label %cleanup, label %for.body15, !llvm.loop !31
cleanup: ; preds = %for.inc34, %land.lhs.true, %for.cond.cleanup
%cond = phi ptr [ @.str.1, %for.cond.cleanup ], [ @.str, %land.lhs.true ], [ @.str.1, %for.inc34 ]
%call37 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
br i1 %cmp.not.not152, label %for.body44, label %for.cond.cleanup43
for.cond.cleanup43: ; preds = %putchar_unlocked.exit151, %cleanup
ret i32 0
for.body44: ; preds = %cleanup, %putchar_unlocked.exit151
%indvars.iv166 = phi i64 [ %indvars.iv.next167, %putchar_unlocked.exit151 ], [ 0, %cleanup ]
%z47 = getelementptr inbounds %struct.CC, ptr %vla, i64 %indvars.iv166, i32 2
%39 = load i8, ptr %z47, align 4, !tbaa !28
%40 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %40, i64 0, i32 5
%41 = load ptr, ptr %_IO_write_ptr.i, align 8, !tbaa !19
%_IO_write_end.i = getelementptr inbounds %struct._IO_FILE, ptr %40, i64 0, i32 6
%42 = load ptr, ptr %_IO_write_end.i, align 8, !tbaa !20
%cmp.not.i121 = icmp ult ptr %41, %42
br i1 %cmp.not.i121, label %cond.false.i126, label %cond.true.i122, !prof !15
cond.true.i122: ; preds = %for.body44
%conv48 = zext i8 %39 to i32
%call.i124 = call i32 @__overflow(ptr noundef nonnull %40, i32 noundef %conv48) #6
br label %putchar_unlocked.exit
cond.false.i126: ; preds = %for.body44
%incdec.ptr.i127 = getelementptr inbounds i8, ptr %41, i64 1
store ptr %incdec.ptr.i127, ptr %_IO_write_ptr.i, align 8, !tbaa !19
store i8 %39, ptr %41, align 1, !tbaa !16
br label %putchar_unlocked.exit
putchar_unlocked.exit: ; preds = %cond.true.i122, %cond.false.i126
%43 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i128 = getelementptr inbounds %struct._IO_FILE, ptr %43, i64 0, i32 5
%44 = load ptr, ptr %_IO_write_ptr.i128, align 8, !tbaa !19
%_IO_write_end.i129 = getelementptr inbounds %struct._IO_FILE, ptr %43, i64 0, i32 6
%45 = load ptr, ptr %_IO_write_end.i129, align 8, !tbaa !20
%cmp.not.i130 = icmp ult ptr %44, %45
br i1 %cmp.not.i130, label %cond.false.i134, label %cond.true.i131, !prof !15
cond.true.i131: ; preds = %putchar_unlocked.exit
%call.i132 = call i32 @__overflow(ptr noundef nonnull %43, i32 noundef 32) #6
br label %putchar_unlocked.exit136
cond.false.i134: ; preds = %putchar_unlocked.exit
%incdec.ptr.i135 = getelementptr inbounds i8, ptr %44, i64 1
store ptr %incdec.ptr.i135, ptr %_IO_write_ptr.i128, align 8, !tbaa !19
store i8 32, ptr %44, align 1, !tbaa !16
br label %putchar_unlocked.exit136
putchar_unlocked.exit136: ; preds = %cond.true.i131, %cond.false.i134
%y53 = getelementptr inbounds %struct.CC, ptr %vla, i64 %indvars.iv166, i32 1
%46 = load i32, ptr %y53, align 4, !tbaa !25
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %c.i) #6
%tobool.not.i = icmp eq i32 %46, 0
br i1 %tobool.not.i, label %if.then.i, label %while.body.i137
if.then.i: ; preds = %putchar_unlocked.exit136
%47 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %47, i64 0, i32 5
%48 = load ptr, ptr %_IO_write_ptr.i.i, align 8, !tbaa !19
%_IO_write_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %47, i64 0, i32 6
%49 = load ptr, ptr %_IO_write_end.i.i, align 8, !tbaa !20
%cmp.not.i.i138 = icmp ult ptr %48, %49
br i1 %cmp.not.i.i138, label %cond.false.i.i141, label %cond.true.i.i139, !prof !15
cond.true.i.i139: ; preds = %if.then.i
%call.i.i140 = call i32 @__overflow(ptr noundef nonnull %47, i32 noundef 48) #6
br label %pn.exit
cond.false.i.i141: ; preds = %if.then.i
%incdec.ptr.i.i142 = getelementptr inbounds i8, ptr %48, i64 1
store ptr %incdec.ptr.i.i142, ptr %_IO_write_ptr.i.i, align 8, !tbaa !19
store i8 48, ptr %48, align 1, !tbaa !16
br label %pn.exit
while.body.i137: ; preds = %putchar_unlocked.exit136, %while.body.i137
%indvars.iv29.i = phi i32 [ %indvars.iv.next30.i, %while.body.i137 ], [ 1, %putchar_unlocked.exit136 ]
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.body.i137 ], [ 0, %putchar_unlocked.exit136 ]
%n.addr.025.i = phi i32 [ %div.i, %while.body.i137 ], [ %46, %putchar_unlocked.exit136 ]
%rem.i = srem i32 %n.addr.025.i, 10
%50 = trunc i32 %rem.i to i8
%conv.i = add nsw i8 %50, 48
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
%arrayidx.i = getelementptr inbounds [11 x i8], ptr %c.i, i64 0, i64 %indvars.iv.i
store i8 %conv.i, ptr %arrayidx.i, align 1, !tbaa !16
%div.i = sdiv i32 %n.addr.025.i, 10
%n.addr.025.off.i = add i32 %n.addr.025.i, 9
%tobool1.not.i = icmp ult i32 %n.addr.025.off.i, 19
%indvars.iv.next30.i = add nuw i32 %indvars.iv29.i, 1
br i1 %tobool1.not.i, label %while.body4.preheader.i, label %while.body.i137, !llvm.loop !21
while.body4.preheader.i: ; preds = %while.body.i137
%51 = sext i32 %indvars.iv29.i to i64
br label %while.body4.i
while.body4.i: ; preds = %putchar_unlocked.exit24.i, %while.body4.preheader.i
%indvars.iv31.i = phi i64 [ %51, %while.body4.preheader.i ], [ %indvars.iv.next32.i, %putchar_unlocked.exit24.i ]
%indvars.iv.next32.i = add nsw i64 %indvars.iv31.i, -1
%arrayidx6.i = getelementptr inbounds [11 x i8], ptr %c.i, i64 0, i64 %indvars.iv.next32.i
%52 = load i8, ptr %arrayidx6.i, align 1, !tbaa !16
%53 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i16.i = getelementptr inbounds %struct._IO_FILE, ptr %53, i64 0, i32 5
%54 = load ptr, ptr %_IO_write_ptr.i16.i, align 8, !tbaa !19
%_IO_write_end.i17.i = getelementptr inbounds %struct._IO_FILE, ptr %53, i64 0, i32 6
%55 = load ptr, ptr %_IO_write_end.i17.i, align 8, !tbaa !20
%cmp.not.i18.i = icmp ult ptr %54, %55
br i1 %cmp.not.i18.i, label %cond.false.i22.i, label %cond.true.i19.i, !prof !15
cond.true.i19.i: ; preds = %while.body4.i
%conv7.i = zext i8 %52 to i32
%call.i20.i = call i32 @__overflow(ptr noundef nonnull %53, i32 noundef %conv7.i) #6
br label %putchar_unlocked.exit24.i
cond.false.i22.i: ; preds = %while.body4.i
%incdec.ptr.i23.i = getelementptr inbounds i8, ptr %54, i64 1
store ptr %incdec.ptr.i23.i, ptr %_IO_write_ptr.i16.i, align 8, !tbaa !19
store i8 %52, ptr %54, align 1, !tbaa !16
br label %putchar_unlocked.exit24.i
putchar_unlocked.exit24.i: ; preds = %cond.false.i22.i, %cond.true.i19.i
%56 = and i64 %indvars.iv.next32.i, 4294967295
%tobool3.not.i = icmp eq i64 %56, 0
br i1 %tobool3.not.i, label %pn.exit, label %while.body4.i, !llvm.loop !22
pn.exit: ; preds = %putchar_unlocked.exit24.i, %cond.true.i.i139, %cond.false.i.i141
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %c.i) #6
%57 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i143 = getelementptr inbounds %struct._IO_FILE, ptr %57, i64 0, i32 5
%58 = load ptr, ptr %_IO_write_ptr.i143, align 8, !tbaa !19
%_IO_write_end.i144 = getelementptr inbounds %struct._IO_FILE, ptr %57, i64 0, i32 6
%59 = load ptr, ptr %_IO_write_end.i144, align 8, !tbaa !20
%cmp.not.i145 = icmp ult ptr %58, %59
br i1 %cmp.not.i145, label %cond.false.i149, label %cond.true.i146, !prof !15
cond.true.i146: ; preds = %pn.exit
%call.i147 = call i32 @__overflow(ptr noundef nonnull %57, i32 noundef 10) #6
br label %putchar_unlocked.exit151
cond.false.i149: ; preds = %pn.exit
%incdec.ptr.i150 = getelementptr inbounds i8, ptr %58, i64 1
store ptr %incdec.ptr.i150, ptr %_IO_write_ptr.i143, align 8, !tbaa !19
store i8 10, ptr %58, align 1, !tbaa !16
br label %putchar_unlocked.exit151
putchar_unlocked.exit151: ; preds = %cond.true.i146, %cond.false.i149
%indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
%exitcond170.not = icmp eq i64 %indvars.iv.next167, %12
br i1 %exitcond170.not, label %for.cond.cleanup43, label %for.body44, !llvm.loop !32
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
declare i32 @__uflow(ptr noundef) local_unnamed_addr #5
declare i32 @__overflow(ptr noundef, i32 noundef) local_unnamed_addr #5
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !6, i64 40}
!20 = !{!10, !6, i64 48}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24, i64 8, i64 1, !16}
!24 = !{!11, !11, i64 0}
!25 = !{!26, !11, i64 4}
!26 = !{!"CC", !11, i64 0, !11, i64 4, !7, i64 8}
!27 = distinct !{!27, !18}
!28 = !{!26, !7, i64 8}
!29 = !{!26, !11, i64 0}
!30 = distinct !{!30, !18}
!31 = distinct !{!31, !18}
!32 = distinct !{!32, !18}
|
#include<stdio.h>
int main(void){
char s[1000];
int n,i;
scanf("%s",s);
scanf("%d",&n);
if(n==1){
printf("%s",s);
return 0;
}
while(s[i]){
if((i+1)%n==1){
printf("%c",s[i]);
}
i++;
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270169/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270169/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [1000 x i8], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %while.cond.preheader
while.cond.preheader: ; preds = %entry
%1 = load i8, ptr %s, align 16, !tbaa !9
%tobool.not17 = icmp eq i8 %1, 0
br i1 %tobool.not17, label %while.end, label %while.body
if.then: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
br label %cleanup
while.body: ; preds = %while.cond.preheader, %if.end9
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end9 ], [ 0, %while.cond.preheader ]
%2 = phi i8 [ %5, %if.end9 ], [ %1, %while.cond.preheader ]
%indvars.iv.next = add i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = trunc i64 %indvars.iv.next to i32
%rem = srem i32 %4, %3
%cmp4 = icmp eq i32 %rem, 1
br i1 %cmp4, label %if.then5, label %if.end9
if.then5: ; preds = %while.body
%conv = sext i8 %2 to i32
%putchar16 = call i32 @putchar(i32 %conv)
br label %if.end9
if.end9: ; preds = %if.then5, %while.body
%arrayidx = getelementptr inbounds [1000 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%5 = load i8, ptr %arrayidx, align 1, !tbaa !9
%tobool.not = icmp eq i8 %5, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !10
while.end: ; preds = %if.end9, %while.cond.preheader
%putchar = call i32 @putchar(i32 10)
br label %cleanup
cleanup: ; preds = %while.end, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main()
{
char s[1003];
scanf("%s", s);
int i, w, n;
scanf("%d", &w);
n = strlen(s);
i = 0;
while (i < n)
{
printf("%c", s[i]);
i += w;
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270226/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270226/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [1003 x i8], align 16
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1003, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call3 to i32
%cmp11 = icmp sgt i32 %conv, 0
br i1 %cmp11, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%i.012 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%idxprom = sext i32 %i.012 to i64
%arrayidx = getelementptr inbounds [1003 x i8], ptr %s, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv5 = sext i8 %0 to i32
%putchar10 = call i32 @putchar(i32 %conv5)
%1 = load i32, ptr %w, align 4, !tbaa !8
%add = add nsw i32 %1, %i.012
%cmp = icmp slt i32 %add, %conv
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !10
while.end: ; preds = %while.body, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 1003, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#pragma GCC optimize("Ofast")
#include <stdio.h>
int arr1[10][10] = {
{0,0,0,0,0,0,0,0,0,0},
{0,100000,0,9029,0,0,0,7519,7572,1},
{0,0,0,0,9527,0,0,13336,0,0},
{0,14416,0,0,0,0,0,0,0,0},
{0,0,3,0,0,0,16971,0,18448,0},
{50000,342,0,0,0,0,0,0,0,50000},
{0,20398,0,0,7169,0,0,5300,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,17391,0,0,0,0,0,0},
{0,0,0,0,0,799,0,0,0,0}
};
char ch[10];
void puti(int i) {
if (i >= 10) {
puti(i / 10);
i %= 10;
}
fputc(i + '0', stdout);
}
int main(void) {
// テストケースハックする良くないコード
fread(ch, sizeof(char), 8, stdin);
if (ch[7] == '\n') {
if (ch[0] == '3') {
puti('4' - ch[2]);
}
else if (ch[0] == '2' && ch[1] == ' ') {
puti(ch[2] - '0');
}
else
puti(arr1[ch[0] - '0'][ch[6] - '0']);
}
else if (ch[6] == '9') {
if (ch[0] == '6') {
puti(22888);
}
else if (ch[0] == '9') {
puti(25436);
}
else
puti(arr1[ch[0] - '0'][ch[7] - '0']);
}
else
puti(arr1[ch[0] - '0'][ch[7] - '0']);
fputc('\n', stdout);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270277/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270277/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@arr1 = dso_local local_unnamed_addr global <{ [10 x i32], [10 x i32], [10 x i32], <{ i32, i32, [8 x i32] }>, [10 x i32], [10 x i32], [10 x i32], [10 x i32], [10 x i32], [10 x i32] }> <{ [10 x i32] zeroinitializer, [10 x i32] [i32 0, i32 100000, i32 0, i32 9029, i32 0, i32 0, i32 0, i32 7519, i32 7572, i32 1], [10 x i32] [i32 0, i32 0, i32 0, i32 0, i32 9527, i32 0, i32 0, i32 13336, i32 0, i32 0], <{ i32, i32, [8 x i32] }> <{ i32 0, i32 14416, [8 x i32] zeroinitializer }>, [10 x i32] [i32 0, i32 0, i32 3, i32 0, i32 0, i32 0, i32 16971, i32 0, i32 18448, i32 0], [10 x i32] [i32 50000, i32 342, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 50000], [10 x i32] [i32 0, i32 20398, i32 0, i32 0, i32 7169, i32 0, i32 0, i32 5300, i32 0, i32 0], [10 x i32] zeroinitializer, [10 x i32] [i32 0, i32 0, i32 0, i32 17391, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 799, i32 0, i32 0, i32 0, i32 0] }>, align 16
@stdout = external local_unnamed_addr global ptr, align 8
@ch = dso_local global [10 x i8] zeroinitializer, align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local void @puti(i32 noundef %i) local_unnamed_addr #0 {
entry:
%cmp = icmp sgt i32 %i, 9
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%div = udiv i32 %i, 10
tail call void @puti(i32 noundef %div)
%rem = urem i32 %i, 10
br label %if.end
if.end: ; preds = %if.then, %entry
%i.addr.0 = phi i32 [ %rem, %if.then ], [ %i, %entry ]
%add = add nsw i32 %i.addr.0, 48
%0 = load ptr, ptr @stdout, align 8, !tbaa !5
%call = tail call i32 @fputc(i32 noundef %add, ptr noundef %0)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @fputc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call i64 @fread(ptr noundef nonnull @ch, i64 noundef 1, i64 noundef 8, ptr noundef %0)
%1 = load i8, ptr getelementptr inbounds ([10 x i8], ptr @ch, i64 0, i64 7), align 1, !tbaa !9
%conv = sext i8 %1 to i32
%cmp = icmp eq i8 %1, 10
br i1 %cmp, label %if.then, label %if.else24
if.then: ; preds = %entry
%2 = load i8, ptr @ch, align 1, !tbaa !9
%conv2 = sext i8 %2 to i64
%cmp3 = icmp eq i8 %2, 51
br i1 %cmp3, label %if.then5, label %if.else
if.then5: ; preds = %if.then
%3 = load i8, ptr getelementptr inbounds ([10 x i8], ptr @ch, i64 0, i64 2), align 1, !tbaa !9
%conv6 = sext i8 %3 to i32
%sub = sub nsw i32 52, %conv6
br label %if.end59
if.else: ; preds = %if.then
%cmp8 = icmp eq i8 %2, 50
%4 = load i8, ptr getelementptr inbounds ([10 x i8], ptr @ch, i64 0, i64 1), align 1
%cmp11 = icmp eq i8 %4, 32
%or.cond = select i1 %cmp8, i1 %cmp11, i1 false
br i1 %or.cond, label %if.then13, label %if.else16
if.then13: ; preds = %if.else
%5 = load i8, ptr getelementptr inbounds ([10 x i8], ptr @ch, i64 0, i64 2), align 1, !tbaa !9
%conv14 = sext i8 %5 to i32
%sub15 = add nsw i32 %conv14, -48
br label %if.end59
if.else16: ; preds = %if.else
%sub18 = add nsw i64 %conv2, -48
%6 = load i8, ptr getelementptr inbounds ([10 x i8], ptr @ch, i64 0, i64 6), align 1, !tbaa !9
%conv19 = sext i8 %6 to i64
%sub20 = add nsw i64 %conv19, -48
%arrayidx22 = getelementptr inbounds [10 x [10 x i32]], ptr @arr1, i64 0, i64 %sub18, i64 %sub20
%7 = load i32, ptr %arrayidx22, align 4, !tbaa !10
br label %if.end59
if.else24: ; preds = %entry
%8 = load i8, ptr getelementptr inbounds ([10 x i8], ptr @ch, i64 0, i64 6), align 1, !tbaa !9
%cmp26 = icmp eq i8 %8, 57
%9 = load i8, ptr @ch, align 1, !tbaa !9
br i1 %cmp26, label %if.then28, label %if.else49
if.then28: ; preds = %if.else24
switch i8 %9, label %if.else38 [
i8 54, label %if.end59
i8 57, label %if.then37
]
if.then37: ; preds = %if.then28
br label %if.end59
if.else38: ; preds = %if.then28
%conv29 = sext i8 %9 to i64
%sub40 = add nsw i64 %conv29, -48
%sub44 = add nsw i32 %conv, -48
%idxprom45 = sext i32 %sub44 to i64
%arrayidx46 = getelementptr inbounds [10 x [10 x i32]], ptr @arr1, i64 0, i64 %sub40, i64 %idxprom45
%10 = load i32, ptr %arrayidx46, align 4, !tbaa !10
br label %if.end59
if.else49: ; preds = %if.else24
%conv50 = sext i8 %9 to i64
%sub51 = add nsw i64 %conv50, -48
%sub55 = add nsw i32 %conv, -48
%idxprom56 = sext i32 %sub55 to i64
%arrayidx57 = getelementptr inbounds [10 x [10 x i32]], ptr @arr1, i64 0, i64 %sub51, i64 %idxprom56
%11 = load i32, ptr %arrayidx57, align 4, !tbaa !10
br label %if.end59
if.end59: ; preds = %if.then28, %if.else49, %if.then37, %if.else38, %if.then5, %if.else16, %if.then13
%.sink = phi i32 [ %11, %if.else49 ], [ 25436, %if.then37 ], [ %10, %if.else38 ], [ %sub, %if.then5 ], [ %7, %if.else16 ], [ %sub15, %if.then13 ], [ 22888, %if.then28 ]
tail call void @puti(i32 noundef %.sink)
%12 = load ptr, ptr @stdout, align 8, !tbaa !5
%call60 = tail call i32 @fputc(i32 noundef 10, ptr noundef %12)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int main(void)
{
int a,b,i=0;
scanf("%d", &a);
while (a--)
{
scanf("%d", &b);
if ((b - 4) % 4 == 0)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27032/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27032/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%dec5 = add nsw i32 %0, -1
store i32 %dec5, ptr %a, align 4, !tbaa !5
%tobool.not6 = icmp eq i32 %0, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = and i32 %1, 3
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%3 = load i32, ptr %a, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int n,m;
scanf("%d%d",&n,&m);
for(int i=0; i<m; i++){
int t;
scanf("%d", &t);
n-=t;
}
if(n<0)
puts("-1");
else printf("%d", n);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270363/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270363/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%1 = phi i32 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %sub, %for.body ]
%cmp2 = icmp slt i32 %1, 0
br i1 %cmp2, label %if.then, label %if.else
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t)
%2 = load i32, ptr %t, align 4, !tbaa !5
%3 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %3, %2
store i32 %sub, ptr %n, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
%inc = add nuw nsw i32 %i.07, 1
%4 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.then: ; preds = %for.cond.cleanup
%call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.else: ; preds = %for.cond.cleanup
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
int a,b,c,i;
scanf("%d",&a);scanf("%d",&b);
for(i=0;i<b;i++){
scanf("%d",&c);
a-=c;
}
if(a<0)
a=-1;
printf("%d",a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270406/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270406/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = load i32, ptr %a, align 4, !tbaa !5
br label %for.end
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%1 = load i32, ptr %c, align 4, !tbaa !5
%2 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
store i32 %sub, ptr %a, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.07, 1
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%4 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %sub, %for.body ]
%cmp3 = icmp slt i32 %4, 0
br i1 %cmp3, label %if.then, label %if.end
if.then: ; preds = %for.end
store i32 -1, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.end
%5 = phi i32 [ -1, %if.then ], [ %4, %for.end ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int n,t;
scanf("%d",&t);
for(int i=0; i<t; i++){
scanf("%d",&n);
if(n%4==0)
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27045/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27045/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.08 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = and i32 %1, 3
%cmp2 = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp2, ptr @str.3, ptr @str
%puts6 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%inc = add nuw nsw i32 %i.08, 1
%3 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include "stdio.h"
int main(void)
{
int N,M;
scanf("%d",&N);
scanf("%d",&M);
int A[M];
int i;
int nissu=0;
for(i=0;i<M;i++)
{
scanf("%d",&A[i]);
nissu = nissu + A[i];
}
if(N-nissu>=0)
{
printf("%d",N-nissu);
}
else
{
printf("-1");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270493/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270493/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %M)
%0 = load i32, ptr %M, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %M, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %3, 0
br i1 %cmp14, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%nissu.016 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %4, %nissu.016
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %M, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%nissu.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%7 = load i32, ptr %N, align 4, !tbaa !5
%sub = sub nsw i32 %7, %nissu.0.lcssa
%cmp5 = icmp sgt i32 %sub, -1
br i1 %cmp5, label %if.then, label %if.else
if.then: ; preds = %for.end
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
br label %if.end
if.else: ; preds = %for.end
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int main (void){
int i;
int n,m;
int *arr;
int all=0;
if( scanf("%d %d",&n,&m) == 2){
arr = (int*)calloc(m,sizeof(int));
for(i=0; i<m; i++){
scanf("%d",&arr[i]);
}
for(i=0; i<m; i++) all += arr[i];
if (n >= all) printf("%d\n",n-all);
else printf("-1\n");
free(arr);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270536/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270536/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%cmp = icmp eq i32 %call, 2
br i1 %cmp, label %if.then, label %if.end19
if.then: ; preds = %entry
%0 = load i32, ptr %m, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%call1 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #8
%cmp229 = icmp sgt i32 %0, 0
br i1 %cmp229, label %for.body, label %for.end13
for.cond5.preheader: ; preds = %for.body
%cmp631 = icmp sgt i32 %7, 0
br i1 %cmp631, label %for.body8.preheader, label %for.end13
for.body8.preheader: ; preds = %for.cond5.preheader
%wide.trip.count = zext i32 %7 to i64
%min.iters.check = icmp ult i32 %7, 8
br i1 %min.iters.check, label %for.body8.preheader44, label %vector.ph
vector.ph: ; preds = %for.body8.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi42 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds i32, ptr %call1, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 4, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load43 = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = add <4 x i32> %wide.load, %vec.phi
%4 = add <4 x i32> %wide.load43, %vec.phi42
%index.next = add nuw i64 %index, 8
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %4, %3
%6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end13, label %for.body8.preheader44
for.body8.preheader44: ; preds = %for.body8.preheader, %middle.block
%indvars.iv37.ph = phi i64 [ 0, %for.body8.preheader ], [ %n.vec, %middle.block ]
%all.033.ph = phi i32 [ 0, %for.body8.preheader ], [ %6, %middle.block ]
br label %for.body8
for.body: ; preds = %if.then, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %if.then ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %m, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp2, label %for.body, label %for.cond5.preheader, !llvm.loop !13
for.body8: ; preds = %for.body8.preheader44, %for.body8
%indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.body8 ], [ %indvars.iv37.ph, %for.body8.preheader44 ]
%all.033 = phi i32 [ %add, %for.body8 ], [ %all.033.ph, %for.body8.preheader44 ]
%arrayidx10 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv37
%9 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add = add nsw i32 %9, %all.033
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%exitcond.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count
br i1 %exitcond.not, label %for.end13, label %for.body8, !llvm.loop !14
for.end13: ; preds = %for.body8, %middle.block, %if.then, %for.cond5.preheader
%all.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %if.then ], [ %6, %middle.block ], [ %add, %for.body8 ]
%10 = load i32, ptr %n, align 4, !tbaa !5
%cmp14.not = icmp slt i32 %10, %all.0.lcssa
br i1 %cmp14.not, label %if.else, label %if.then16
if.then16: ; preds = %for.end13
%sub = sub nsw i32 %10, %all.0.lcssa
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
br label %if.end
if.else: ; preds = %for.end13
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then16
call void @free(ptr noundef %call1) #7
br label %if.end19
if.end19: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
int main() {
int n, p;
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
scanf("%d", &p);
if (p == 4)
printf("YES\n");
else if (p >= 4 && ((p -= 4) % 4 == 0))
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27058/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27058/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %0, 0
br i1 %cmp14, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.015 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%1 = load i32, ptr %p, align 4, !tbaa !5
%cmp2 = icmp eq i32 %1, 4
br i1 %cmp2, label %for.inc, label %if.else
if.else: ; preds = %for.body
%cmp4 = icmp sgt i32 %1, 3
br i1 %cmp4, label %land.lhs.true, label %if.else8
land.lhs.true: ; preds = %if.else
%sub = add nsw i32 %1, -4
store i32 %sub, ptr %p, align 4, !tbaa !5
%rem = and i32 %1, 3
%cmp5 = icmp eq i32 %rem, 0
br i1 %cmp5, label %for.inc, label %if.else8
if.else8: ; preds = %land.lhs.true, %if.else
br label %for.inc
for.inc: ; preds = %land.lhs.true, %for.body, %if.else8
%str.4.sink = phi ptr [ @str, %if.else8 ], [ @str.4, %for.body ], [ @str.4, %land.lhs.true ]
%puts13 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
%inc = add nuw nsw i32 %i.015, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int N,M,A,homework = 0;
scanf("%d %d",&N,&M);
for (int i = 0;i < M;i++){
scanf("%d",&A);
homework += A;
}
if (homework <= N){
printf("%d\n",N - homework);
}else{
printf("-1\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270622/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270622/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%A = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %M, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%homework.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%1 = load i32, ptr %N, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %homework.0.lcssa, %1
br i1 %cmp2.not, label %if.else, label %if.then
for.body: ; preds = %entry, %for.body
%i.010 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%homework.09 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A)
%2 = load i32, ptr %A, align 4, !tbaa !5
%add = add nsw i32 %2, %homework.09
%inc = add nuw nsw i32 %i.010, 1
%3 = load i32, ptr %M, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.then: ; preds = %for.cond.cleanup
%sub = sub nsw i32 %1, %homework.0.lcssa
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
br label %if.end
if.else: ; preds = %for.cond.cleanup
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int n,m,i;
int a[10001];
scanf("%d %d",&n,&m);
for (i = 0; i < m; i++){
scanf("%d", &a[i]);
}
for (i = 0; i < m; i++){
n = n - a[i];
}
if (n < 0) {
puts("-1");
}
else {
printf("%d",n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270666/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270666/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [10001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.cond2.preheader.thread
for.cond2.preheader.thread: ; preds = %entry
%n.promoted30 = load i32, ptr %n, align 4, !tbaa !5
br label %for.end9
for.cond2.preheader: ; preds = %for.body
%n.promoted = load i32, ptr %n, align 4, !tbaa !5
%cmp321 = icmp sgt i32 %8, 0
br i1 %cmp321, label %for.body4.preheader, label %for.end9
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %8 to i64
%min.iters.check = icmp ult i32 %8, 8
br i1 %min.iters.check, label %for.body4.preheader34, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %n.promoted, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %1, %vector.ph ], [ %4, %vector.body ]
%vec.phi32 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%2 = getelementptr inbounds [10001 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load33 = load <4 x i32>, ptr %3, align 16, !tbaa !5
%4 = sub <4 x i32> %vec.phi, %wide.load
%5 = sub <4 x i32> %vec.phi32, %wide.load33
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %5, %4
%7 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond2.for.end9_crit_edge, label %for.body4.preheader34
for.body4.preheader34: ; preds = %for.body4.preheader, %middle.block
%indvars.iv26.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
%sub2022.ph = phi i32 [ %n.promoted, %for.body4.preheader ], [ %7, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %m, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader34, %for.body4
%indvars.iv26 = phi i64 [ %indvars.iv.next27, %for.body4 ], [ %indvars.iv26.ph, %for.body4.preheader34 ]
%sub2022 = phi i32 [ %sub, %for.body4 ], [ %sub2022.ph, %for.body4.preheader34 ]
%arrayidx6 = getelementptr inbounds [10001 x i32], ptr %a, i64 0, i64 %indvars.iv26
%10 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%sub = sub nsw i32 %sub2022, %10
%indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1
%exitcond.not = icmp eq i64 %indvars.iv.next27, %wide.trip.count
br i1 %exitcond.not, label %for.cond2.for.end9_crit_edge, label %for.body4, !llvm.loop !14
for.cond2.for.end9_crit_edge: ; preds = %for.body4, %middle.block
%sub.lcssa = phi i32 [ %7, %middle.block ], [ %sub, %for.body4 ]
store i32 %sub.lcssa, ptr %n, align 4, !tbaa !5
br label %for.end9
for.end9: ; preds = %for.cond2.preheader.thread, %for.cond2.for.end9_crit_edge, %for.cond2.preheader
%11 = phi i32 [ %sub.lcssa, %for.cond2.for.end9_crit_edge ], [ %n.promoted, %for.cond2.preheader ], [ %n.promoted30, %for.cond2.preheader.thread ]
%cmp10 = icmp slt i32 %11, 0
br i1 %cmp10, label %if.then, label %if.else
if.then: ; preds = %for.end9
%call11 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.else: ; preds = %for.end9
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
#include<math.h>
int main(void) {
int A,N,M,R;
int i;
int ans = 0;
scanf("%d%d", &N, &M);
for (i = 0; i < M; i++) {
scanf("%d", &A);
ans = ans + A;
}
if (N >= ans)
printf("%d", N - ans);
else
printf("-1");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270709/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270709/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%N = alloca i32, align 4
%M = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %M, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%ans.010 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A)
%1 = load i32, ptr %A, align 4, !tbaa !5
%add = add nsw i32 %1, %ans.010
%inc = add nuw nsw i32 %i.09, 1
%2 = load i32, ptr %M, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp2.not = icmp slt i32 %3, %ans.0.lcssa
br i1 %cmp2.not, label %if.else, label %if.then
if.then: ; preds = %for.end
%sub = sub nsw i32 %3, %ans.0.lcssa
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
br label %if.end
if.else: ; preds = %for.end
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int m, n, i, sum=0, ans;
scanf("%d%d", &m, &n);
for(i=0; i<n; i++){
scanf("%d", &ans);
sum += ans;
}
ans = sum<=m ? m-sum : -1;
printf("%d", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270752/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270752/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%n = alloca i32, align 4
%ans = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ans) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%sum.09 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%i.08 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ans)
%1 = load i32, ptr %ans, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.09
%inc = add nuw nsw i32 %i.08, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%3 = load i32, ptr %m, align 4
%cmp2.not = icmp sgt i32 %sum.0.lcssa, %3
%sub = sub nsw i32 %3, %sum.0.lcssa
%cond = select i1 %cmp2.not, i32 -1, i32 %sub
store i32 %cond, ptr %ans, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ans) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int i;
int n;
int m;
int a[10000];
scanf("%d%d",&n, &m);
for(i = 0; i < m; i++){
scanf("%d", &a[i]);
n -= a[i];
}
if (n < -1)
n=-1;
printf("%d",n);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270796/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270796/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %0, 0
br i1 %cmp9, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
store i32 %sub, ptr %n, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %m, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%5 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %sub, %for.body ]
%cmp4 = icmp slt i32 %5, -1
br i1 %cmp4, label %if.then, label %if.end
if.then: ; preds = %for.end
store i32 -1, ptr %n, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.end
%6 = phi i32 [ -1, %if.then ], [ %5, %for.end ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
long long n,m,sum=0;
scanf("%lld%lld",&n,&m);
for(long long i=0;i<m;i++)
{
long long x;
scanf("%lld",&x);
sum=sum+x;
}
if(sum>n)
printf("-1\n");
else
printf("%lld",n-sum);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270839/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270839/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %m, align 8, !tbaa !5
%cmp8 = icmp sgt i64 %0, 0
br i1 %cmp8, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ]
%1 = load i64, ptr %n, align 8, !tbaa !5
%cmp2 = icmp sgt i64 %sum.0.lcssa, %1
br i1 %cmp2, label %if.then, label %if.else
for.body: ; preds = %entry, %for.body
%i.010 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%sum.09 = phi i64 [ %add, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load i64, ptr %x, align 8, !tbaa !5
%add = add nsw i64 %2, %sum.09
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
%inc = add nuw nsw i64 %i.010, 1
%3 = load i64, ptr %m, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.then: ; preds = %for.cond.cleanup
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %for.cond.cleanup
%sub = sub nsw i64 %1, %sum.0.lcssa
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int n, m, a;
scanf("%d %d",&n,&m);
for(int i=0;i<m;i++){
scanf("%d", &a);
n-=a;
}
if(n<0) n=-1;
printf("%d",n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270882/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270882/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %0, 0
br i1 %cmp5, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%1 = phi i32 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %sub, %for.body ]
%cmp2 = icmp slt i32 %1, 0
br i1 %cmp2, label %if.then, label %if.end
for.body: ; preds = %entry, %for.body
%i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %3, %2
store i32 %sub, ptr %n, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.06, 1
%4 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.then: ; preds = %for.cond.cleanup
store i32 -1, ptr %n, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.cond.cleanup
%5 = phi i32 [ -1, %if.then ], [ %1, %for.cond.cleanup ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int N, M, A[10000];
long int sum=0;
scanf("%d%d", &N, &M);
for (int i = 0; i < M;i++) {
scanf("%d", &A[i]);
sum += (long int)A[i];
}
if (sum > (long int)N)printf("-1");
else printf("%ld", (long int)N - sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270925/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270925/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%A = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %M, align 4, !tbaa !5
%cmp15 = icmp sgt i32 %0, 0
br i1 %cmp15, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ]
%1 = load i32, ptr %N, align 4, !tbaa !5
%conv4 = sext i32 %1 to i64
%cmp5 = icmp sgt i64 %sum.0.lcssa, %conv4
br i1 %cmp5, label %if.then, label %if.else
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.016 = phi i64 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sext i32 %2 to i64
%add = add nsw i64 %sum.016, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %M, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.then: ; preds = %for.cond.cleanup
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.else: ; preds = %for.cond.cleanup
%sub = sub nsw i64 %conv4, %sum.0.lcssa
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %sub)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#define ll long long
ll max(ll a,ll b){return a>b?a:b;}
int main(){
ll n, m, i;
scanf("%lld%lld",&n,&m);
ll a[n];
for(ll i = 0; i < m; i++)
scanf("%lld",&a[i]);
ll sum = 0;
for(ll i = 0; i < m; i++)
sum += a[i];
printf("%lld\n",max(-1, n- sum));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270969/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270969/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %m, align 8, !tbaa !5
%cmp19 = icmp sgt i64 %2, 0
br i1 %cmp19, label %for.body, label %for.cond.cleanup6
for.cond4.preheader: ; preds = %for.body
%cmp521 = icmp sgt i64 %9, 0
br i1 %cmp521, label %for.body7.preheader, label %for.cond.cleanup6
for.body7.preheader: ; preds = %for.cond4.preheader
%min.iters.check = icmp ult i64 %9, 4
br i1 %min.iters.check, label %for.body7.preheader30, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.vec = and i64 %9, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%vec.phi28 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%3 = getelementptr inbounds i64, ptr %vla, i64 %index
%wide.load = load <2 x i64>, ptr %3, align 16, !tbaa !5
%4 = getelementptr inbounds i64, ptr %3, i64 2
%wide.load29 = load <2 x i64>, ptr %4, align 16, !tbaa !5
%5 = add <2 x i64> %wide.load, %vec.phi
%6 = add <2 x i64> %wide.load29, %vec.phi28
%index.next = add nuw i64 %index, 4
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %6, %5
%8 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %9, %n.vec
br i1 %cmp.n, label %for.cond.cleanup6, label %for.body7.preheader30
for.body7.preheader30: ; preds = %for.body7.preheader, %middle.block
%i3.023.ph = phi i64 [ 0, %for.body7.preheader ], [ %n.vec, %middle.block ]
%sum.022.ph = phi i64 [ 0, %for.body7.preheader ], [ %8, %middle.block ]
br label %for.body7
for.body: ; preds = %entry, %for.body
%i1.020 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i1.020
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i1.020, 1
%9 = load i64, ptr %m, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %9
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13
for.cond.cleanup6: ; preds = %for.body7, %middle.block, %entry, %for.cond4.preheader
%sum.0.lcssa = phi i64 [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %8, %middle.block ], [ %add, %for.body7 ]
%10 = load i64, ptr %n, align 8, !tbaa !5
%sub = sub nsw i64 %10, %sum.0.lcssa
%cond.i = call i64 @llvm.smax.i64(i64 %sub, i64 -1)
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %cond.i)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6
ret i32 0
for.body7: ; preds = %for.body7.preheader30, %for.body7
%i3.023 = phi i64 [ %inc10, %for.body7 ], [ %i3.023.ph, %for.body7.preheader30 ]
%sum.022 = phi i64 [ %add, %for.body7 ], [ %sum.022.ph, %for.body7.preheader30 ]
%arrayidx8 = getelementptr inbounds i64, ptr %vla, i64 %i3.023
%11 = load i64, ptr %arrayidx8, align 8, !tbaa !5
%add = add nsw i64 %11, %sum.022
%inc10 = add nuw nsw i64 %i3.023, 1
%exitcond.not = icmp eq i64 %inc10, %9
br i1 %exitcond.not, label %for.cond.cleanup6, label %for.body7, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main(){
int n,m,a;
scanf("%d %d",&n,&m);
while(m--){
scanf("%d",&a);
n-=a;
}
if(n<0)n=-1;
printf("%d\n",n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271010/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271010/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%dec3 = add nsw i32 %0, -1
store i32 %dec3, ptr %m, align 4, !tbaa !5
%tobool.not4 = icmp eq i32 %0, 0
br i1 %tobool.not4, label %entry.while.end_crit_edge, label %while.body
entry.while.end_crit_edge: ; preds = %entry
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %while.end
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
store i32 %sub, ptr %n, align 4, !tbaa !5
%3 = load i32, ptr %m, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %m, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry.while.end_crit_edge
%4 = phi i32 [ %.pre, %entry.while.end_crit_edge ], [ %sub, %while.body ]
%cmp = icmp slt i32 %4, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %while.end
store i32 -1, ptr %n, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.end
%5 = phi i32 [ -1, %if.then ], [ %4, %while.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
// cd Desktop/Atcoder
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include<math.h>
#define rep(i,n) for(i=0;i<(n);i++)
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
int x[10]={},y[10]={};
long double ans=0.0;
void perm(int *array,int n,int i){
int j,k,tmp;
if (i<n) {
for (j=i; j<=n; j++) {
tmp=array[j];
for (k=j; k>i; k--) array[k]=array[k-1];
array[i]=tmp;
perm(array, n, i+1);
for (k=i; k<j; k++) array[k]=array[k+1];
array[j]=tmp;
}
}else{
for (j=1; j<n; j++) ans+=sqrt((double)(x[array[j]-1]-x[array[j+1]-1])*(x[array[j]-1]-x[array[j+1]-1])+(y[array[j]-1]-y[array[j+1]-1])*(y[array[j]-1]-y[array[j+1]-1]));
}
}
int main(){
int i,n,ways=1,array[10]={};
scanf("%d",&n);
rep(i,n){
scanf("%d%d",&x[i],&y[i]);
ways*=i+1;
array[i+1]=i+1;
}
perm(array,n,1);
printf("%.10Lf",ans/ways);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271054/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271054/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@x = dso_local global [10 x i32] zeroinitializer, align 16
@y = dso_local global [10 x i32] zeroinitializer, align 16
@ans = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%.10Lf\00", align 1
; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: write) uwtable
define dso_local void @perm(ptr nocapture noundef %array, i32 noundef %n, i32 noundef %i) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i32 %i, %n
br i1 %cmp, label %for.cond.preheader, label %for.cond26.preheader
for.cond26.preheader: ; preds = %entry
%cmp27132 = icmp sgt i32 %n, 1
br i1 %cmp27132, label %for.body28.preheader, label %if.end
for.body28.preheader: ; preds = %for.cond26.preheader
%wide.trip.count = zext i32 %n to i64
br label %for.body28
for.cond.preheader: ; preds = %entry
%idxprom9 = sext i32 %i to i64
%arrayidx10 = getelementptr inbounds i32, ptr %array, i64 %idxprom9
%add = add nsw i32 %i, 1
%0 = add i32 %n, 1
br label %for.body
for.body: ; preds = %for.cond.preheader, %for.end20
%indvar = phi i64 [ 0, %for.cond.preheader ], [ %indvar.next, %for.end20 ]
%indvars.iv143 = phi i64 [ %idxprom9, %for.cond.preheader ], [ %indvars.iv.next144, %for.end20 ]
%1 = add i64 %indvar, -1
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv143
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp3134 = icmp sgt i64 %indvars.iv143, %idxprom9
br i1 %cmp3134, label %for.body4.preheader, label %for.end.thread
for.body4.preheader: ; preds = %for.body
%xtraiter = and i64 %indvar, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body4.prol.loopexit, label %for.body4.prol
for.body4.prol: ; preds = %for.body4.preheader, %for.body4.prol
%indvars.iv145.prol = phi i64 [ %indvars.iv.next146.prol, %for.body4.prol ], [ %indvars.iv143, %for.body4.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body4.prol ], [ 0, %for.body4.preheader ]
%indvars.iv.next146.prol = add nsw i64 %indvars.iv145.prol, -1
%arrayidx6.prol = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next146.prol
%3 = load i32, ptr %arrayidx6.prol, align 4, !tbaa !5
%arrayidx8.prol = getelementptr inbounds i32, ptr %array, i64 %indvars.iv145.prol
store i32 %3, ptr %arrayidx8.prol, align 4, !tbaa !5
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body4.prol.loopexit, label %for.body4.prol, !llvm.loop !9
for.body4.prol.loopexit: ; preds = %for.body4.prol, %for.body4.preheader
%indvars.iv145.unr = phi i64 [ %indvars.iv143, %for.body4.preheader ], [ %indvars.iv.next146.prol, %for.body4.prol ]
%4 = icmp ult i64 %1, 3
br i1 %4, label %for.end, label %for.body4
for.end.thread: ; preds = %for.body
store i32 %2, ptr %arrayidx10, align 4, !tbaa !5
tail call void @perm(ptr noundef nonnull %array, i32 noundef %n, i32 noundef %add)
br label %for.end20
for.body4: ; preds = %for.body4.prol.loopexit, %for.body4
%indvars.iv145 = phi i64 [ %indvars.iv.next146.3, %for.body4 ], [ %indvars.iv145.unr, %for.body4.prol.loopexit ]
%indvars.iv.next146 = add nsw i64 %indvars.iv145, -1
%arrayidx6 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next146
%5 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%arrayidx8 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv145
store i32 %5, ptr %arrayidx8, align 4, !tbaa !5
%indvars.iv.next146.1 = add nsw i64 %indvars.iv145, -2
%arrayidx6.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next146.1
%6 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
%arrayidx8.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next146
store i32 %6, ptr %arrayidx8.1, align 4, !tbaa !5
%indvars.iv.next146.2 = add nsw i64 %indvars.iv145, -3
%arrayidx6.2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next146.2
%7 = load i32, ptr %arrayidx6.2, align 4, !tbaa !5
%arrayidx8.2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next146.1
store i32 %7, ptr %arrayidx8.2, align 4, !tbaa !5
%indvars.iv.next146.3 = add nsw i64 %indvars.iv145, -4
%arrayidx6.3 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next146.3
%8 = load i32, ptr %arrayidx6.3, align 4, !tbaa !5
%arrayidx8.3 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next146.2
store i32 %8, ptr %arrayidx8.3, align 4, !tbaa !5
%cmp3.3 = icmp sgt i64 %indvars.iv.next146.3, %idxprom9
br i1 %cmp3.3, label %for.body4, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body4, %for.body4.prol.loopexit
store i32 %2, ptr %arrayidx10, align 4, !tbaa !5
tail call void @perm(ptr noundef nonnull %array, i32 noundef %n, i32 noundef %add)
br i1 %cmp3134, label %for.body13.preheader, label %for.end20
for.body13.preheader: ; preds = %for.end
%min.iters.check = icmp ult i64 %indvar, 8
br i1 %min.iters.check, label %for.body13.preheader159, label %vector.ph
vector.ph: ; preds = %for.body13.preheader
%n.vec = and i64 %indvar, -8
%ind.end = add i64 %n.vec, %idxprom9
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = add i64 %index, %idxprom9
%9 = getelementptr i32, ptr %array, i64 %offset.idx
%10 = getelementptr i32, ptr %9, i64 1
%wide.load = load <4 x i32>, ptr %10, align 4, !tbaa !5
%11 = getelementptr i32, ptr %9, i64 5
%wide.load158 = load <4 x i32>, ptr %11, align 4, !tbaa !5
%12 = getelementptr inbounds i32, ptr %array, i64 %offset.idx
store <4 x i32> %wide.load, ptr %12, align 4, !tbaa !5
%13 = getelementptr inbounds i32, ptr %12, i64 4
store <4 x i32> %wide.load158, ptr %13, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%14 = icmp eq i64 %index.next, %n.vec
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %indvar, %n.vec
br i1 %cmp.n, label %for.end20, label %for.body13.preheader159
for.body13.preheader159: ; preds = %for.body13.preheader, %middle.block
%indvars.iv149.ph = phi i64 [ %idxprom9, %for.body13.preheader ], [ %ind.end, %middle.block ]
br label %for.body13
for.body13: ; preds = %for.body13.preheader159, %for.body13
%indvars.iv149 = phi i64 [ %indvars.iv.next150, %for.body13 ], [ %indvars.iv149.ph, %for.body13.preheader159 ]
%indvars.iv.next150 = add nsw i64 %indvars.iv149, 1
%arrayidx16 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next150
%15 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv149
store i32 %15, ptr %arrayidx18, align 4, !tbaa !5
%exitcond153.not = icmp eq i64 %indvars.iv.next150, %indvars.iv143
br i1 %exitcond153.not, label %for.end20, label %for.body13, !llvm.loop !16
for.end20: ; preds = %for.body13, %middle.block, %for.end.thread, %for.end
store i32 %2, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next144 = add nsw i64 %indvars.iv143, 1
%lftr.wideiv = trunc i64 %indvars.iv.next144 to i32
%exitcond155.not = icmp eq i32 %0, %lftr.wideiv
%indvar.next = add i64 %indvar, 1
br i1 %exitcond155.not, label %if.end, label %for.body, !llvm.loop !17
for.body28: ; preds = %for.body28.preheader, %for.body28
%indvars.iv = phi i64 [ 1, %for.body28.preheader ], [ %indvars.iv.next, %for.body28 ]
%arrayidx30 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%16 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%sub31 = add nsw i32 %16, -1
%idxprom32 = sext i32 %sub31 to i64
%arrayidx33 = getelementptr inbounds [10 x i32], ptr @x, i64 0, i64 %idxprom32
%17 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx36 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%18 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%sub37 = add nsw i32 %18, -1
%idxprom38 = sext i32 %sub37 to i64
%arrayidx39 = getelementptr inbounds [10 x i32], ptr @x, i64 0, i64 %idxprom38
%19 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%sub40 = sub nsw i32 %17, %19
%conv = sitofp i32 %sub40 to double
%arrayidx58 = getelementptr inbounds [10 x i32], ptr @y, i64 0, i64 %idxprom32
%20 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%arrayidx64 = getelementptr inbounds [10 x i32], ptr @y, i64 0, i64 %idxprom38
%21 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%sub65 = sub nsw i32 %20, %21
%mul78 = mul nsw i32 %sub65, %sub65
%conv79 = sitofp i32 %mul78 to double
%22 = tail call double @llvm.fmuladd.f64(double %conv, double %conv, double %conv79)
%call = tail call double @sqrt(double noundef %22) #7
%conv80 = fpext double %call to x86_fp80
%23 = load x86_fp80, ptr @ans, align 16, !tbaa !18
%add81 = fadd x86_fp80 %23, %conv80
store x86_fp80 %add81, ptr @ans, align 16, !tbaa !18
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %if.end, label %for.body28, !llvm.loop !20
if.end: ; preds = %for.body28, %for.end20, %for.cond26.preheader
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%array = alloca [10 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %array) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %array, i8 0, i64 40, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %0, 0
br i1 %cmp16, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%ways.018 = phi i32 [ %mul, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [10 x i32], ptr @x, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [10 x i32], ptr @y, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = trunc i64 %indvars.iv.next to i32
%mul = mul nsw i32 %ways.018, %1
%arrayidx7 = getelementptr inbounds [10 x i32], ptr %array, i64 0, i64 %indvars.iv.next
store i32 %1, ptr %arrayidx7, align 4, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !21
for.end.loopexit: ; preds = %for.body
%4 = sitofp i32 %mul to x86_fp80
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%ways.0.lcssa = phi x86_fp80 [ 0xK3FFF8000000000000000, %entry ], [ %4, %for.end.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %2, %for.end.loopexit ]
call void @perm(ptr noundef nonnull %array, i32 noundef %.lcssa, i32 noundef 1)
%5 = load x86_fp80, ptr @ans, align 16, !tbaa !18
%div = fdiv x86_fp80 %5, %ways.0.lcssa
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, x86_fp80 noundef %div)
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %array) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
attributes #0 = { nofree nounwind memory(readwrite, inaccessiblemem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !15, !14}
!17 = distinct !{!17, !12}
!18 = !{!19, !19, i64 0}
!19 = !{!"long double", !7, i64 0}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
|
#include <stdio.h>
#include <math.h>
int square(int x) {
return x * x;
}
int main() {
int n, town[9][2];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d %d", &town[i][0], &town[i][1]);
}
double ans = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
ans += sqrt( square(town[i][0] - town[j][0]) + square(town[i][1] - town[j][1]) );
}
}
ans = ans * 2 / n;
printf("%.16f", ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271098/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271098/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%.16f\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @square(i32 noundef %x) local_unnamed_addr #0 {
entry:
%mul = mul nsw i32 %x, %x
ret i32 %mul
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%town = alloca [9 x [2 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %town) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp54 = icmp sgt i32 %0, 0
br i1 %cmp54, label %for.body, label %for.cond.cleanup9
for.cond7.preheader: ; preds = %for.body
%cmp859 = icmp sgt i32 %1, 0
br i1 %cmp859, label %for.body10, label %for.cond.cleanup9
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv, i64 1
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond7.preheader, !llvm.loop !9
for.cond7.loopexit.loopexit: ; preds = %for.body14
%.pre = sext i32 %11 to i64
br label %for.cond7.loopexit
for.cond7.loopexit: ; preds = %for.cond7.loopexit.loopexit, %for.body10
%.pre-phi = phi i64 [ %.pre, %for.cond7.loopexit.loopexit ], [ %6, %for.body10 ]
%3 = phi i32 [ %11, %for.cond7.loopexit.loopexit ], [ %5, %for.body10 ]
%ans.1.lcssa = phi double [ %add32, %for.cond7.loopexit.loopexit ], [ %ans.060, %for.body10 ]
%cmp8 = icmp slt i64 %indvars.iv.next72, %.pre-phi
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
br i1 %cmp8, label %for.body10, label %for.cond.cleanup9.loopexit, !llvm.loop !11
for.cond.cleanup9.loopexit: ; preds = %for.cond7.loopexit
%4 = fmul double %ans.1.lcssa, 2.000000e+00
br label %for.cond.cleanup9
for.cond.cleanup9: ; preds = %entry, %for.cond.cleanup9.loopexit, %for.cond7.preheader
%ans.0.lcssa = phi double [ 0.000000e+00, %for.cond7.preheader ], [ %4, %for.cond.cleanup9.loopexit ], [ 0.000000e+00, %entry ]
%.lcssa = phi i32 [ %1, %for.cond7.preheader ], [ %3, %for.cond.cleanup9.loopexit ], [ %0, %entry ]
%conv39 = sitofp i32 %.lcssa to double
%div = fdiv double %ans.0.lcssa, %conv39
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div)
call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %town) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body10: ; preds = %for.cond7.preheader, %for.cond7.loopexit
%5 = phi i32 [ %3, %for.cond7.loopexit ], [ %1, %for.cond7.preheader ]
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.cond7.loopexit ], [ 0, %for.cond7.preheader ]
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.cond7.loopexit ], [ 1, %for.cond7.preheader ]
%ans.060 = phi double [ %ans.1.lcssa, %for.cond7.loopexit ], [ 0.000000e+00, %for.cond7.preheader ]
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%6 = sext i32 %5 to i64
%cmp1256 = icmp slt i64 %indvars.iv.next72, %6
br i1 %cmp1256, label %for.body14.lr.ph, label %for.cond7.loopexit
for.body14.lr.ph: ; preds = %for.body10
%arrayidx16 = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv71
%arrayidx24 = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv71, i64 1
br label %for.body14
for.body14: ; preds = %for.body14.lr.ph, %for.body14
%indvars.iv68 = phi i64 [ %indvars.iv66, %for.body14.lr.ph ], [ %indvars.iv.next69, %for.body14 ]
%ans.157 = phi double [ %ans.060, %for.body14.lr.ph ], [ %add32, %for.body14 ]
%7 = load i32, ptr %arrayidx16, align 8, !tbaa !5
%arrayidx19 = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv68
%8 = load i32, ptr %arrayidx19, align 8, !tbaa !5
%sub = sub nsw i32 %7, %8
%mul.i = mul nsw i32 %sub, %sub
%9 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%arrayidx27 = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv68, i64 1
%10 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%sub28 = sub nsw i32 %9, %10
%mul.i53 = mul nsw i32 %sub28, %sub28
%add30 = add nuw nsw i32 %mul.i53, %mul.i
%conv = sitofp i32 %add30 to double
%call31 = call double @sqrt(double noundef %conv) #5
%add32 = fadd double %ans.157, %call31
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = trunc i64 %indvars.iv.next69 to i32
%cmp12 = icmp sgt i32 %11, %12
br i1 %cmp12, label %for.body14, label %for.cond7.loopexit.loopexit, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
typedef struct city{
double x, y;
}city;
int main() {
city cities[8];
int n, i, j;
double dist = 0.0;
scanf("%d\n", &n);
for(i = 0; i < n; i++)
scanf("%lf %lf\n", &cities[i].x, &cities[i].y);
for(i = 0; i < n; i++)
for(j = i + 1; j < n; j++)
dist += sqrt((cities[i].x - cities[j].x) * (cities[i].x - cities[j].x) + (cities[i].y - cities[j].y) * (cities[i].y - cities[j].y));
dist *= 2;
dist /= n;
printf("%lf\n", dist);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271140/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271140/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.city = type { double, double }
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%cities = alloca [8 x %struct.city], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %cities) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, label %for.body, label %for.end45
for.cond4.preheader: ; preds = %for.body
%cmp570 = icmp sgt i32 %2, 0
br i1 %cmp570, label %for.body6.lr.ph, label %for.end45
for.body6.lr.ph: ; preds = %for.cond4.preheader
%1 = zext i32 %2 to i64
%wide.trip.count84 = zext i32 %2 to i64
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [8 x %struct.city], ptr %cities, i64 0, i64 %indvars.iv
%y = getelementptr inbounds [8 x %struct.city], ptr %cities, i64 0, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %y)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.cond4.loopexit: ; preds = %for.body9, %for.body6
%dist.1.lcssa = phi double [ %dist.072, %for.body6 ], [ %add39, %for.body9 ]
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count84
br i1 %exitcond85.not, label %for.end45.loopexit, label %for.body6, !llvm.loop !11
for.body6: ; preds = %for.body6.lr.ph, %for.cond4.loopexit
%indvars.iv81 = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next82, %for.cond4.loopexit ]
%indvars.iv76 = phi i64 [ 1, %for.body6.lr.ph ], [ %indvars.iv.next77, %for.cond4.loopexit ]
%dist.072 = phi double [ 0.000000e+00, %for.body6.lr.ph ], [ %dist.1.lcssa, %for.cond4.loopexit ]
%indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
%cmp867 = icmp ult i64 %indvars.iv.next82, %1
br i1 %cmp867, label %for.body9.lr.ph, label %for.cond4.loopexit
for.body9.lr.ph: ; preds = %for.body6
%arrayidx11 = getelementptr inbounds [8 x %struct.city], ptr %cities, i64 0, i64 %indvars.iv81
%4 = load double, ptr %arrayidx11, align 16, !tbaa !12
%y25 = getelementptr inbounds [8 x %struct.city], ptr %cities, i64 0, i64 %indvars.iv81, i32 1
%5 = load double, ptr %y25, align 8, !tbaa !15
br label %for.body9
for.body9: ; preds = %for.body9.lr.ph, %for.body9
%indvars.iv78 = phi i64 [ %indvars.iv76, %for.body9.lr.ph ], [ %indvars.iv.next79, %for.body9 ]
%dist.169 = phi double [ %dist.072, %for.body9.lr.ph ], [ %add39, %for.body9 ]
%arrayidx14 = getelementptr inbounds [8 x %struct.city], ptr %cities, i64 0, i64 %indvars.iv78
%6 = load double, ptr %arrayidx14, align 16, !tbaa !12
%sub = fsub double %4, %6
%y28 = getelementptr inbounds [8 x %struct.city], ptr %cities, i64 0, i64 %indvars.iv78, i32 1
%7 = load double, ptr %y28, align 8, !tbaa !15
%sub29 = fsub double %5, %7
%mul37 = fmul double %sub29, %sub29
%8 = call double @llvm.fmuladd.f64(double %sub, double %sub, double %mul37)
%sqrt = call double @llvm.sqrt.f64(double %8)
%add39 = fadd double %dist.169, %sqrt
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%exitcond.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count84
br i1 %exitcond.not, label %for.cond4.loopexit, label %for.body9, !llvm.loop !16
for.end45.loopexit: ; preds = %for.cond4.loopexit
%9 = fmul double %dist.1.lcssa, 2.000000e+00
br label %for.end45
for.end45: ; preds = %entry, %for.end45.loopexit, %for.cond4.preheader
%10 = phi i32 [ %2, %for.cond4.preheader ], [ %2, %for.end45.loopexit ], [ %0, %entry ]
%dist.0.lcssa = phi double [ 0.000000e+00, %for.cond4.preheader ], [ %9, %for.end45.loopexit ], [ 0.000000e+00, %entry ]
%conv = sitofp i32 %10 to double
%div = fdiv double %dist.0.lcssa, %conv
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %cities) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !14, i64 0}
!13 = !{!"city", !14, i64 0, !14, i64 8}
!14 = !{!"double", !7, i64 0}
!15 = !{!13, !14, i64 8}
!16 = distinct !{!16, !10}
|
#include<math.h>
#include<stdio.h>
int a[10],n;
int nextperm(void){
int i,j,t;
i=n-1;
a[0]=0;
while(a[i]>=a[i+1])i--;
if(i==0)return 0;
j=n;
while(a[i] >= a[j])j--;
t=a[i];a[i]=a[j];a[j]=t;
i++;j=n;
while(i<j){
t=a[i];a[i]=a[j];a[j]=t;i++,j--;
}
return 1;
}
int main(){
int x[10],y[10],i,z=1;
double t,sum=0,ans,o,p,q,r;
scanf("%d\n",&n);
for(i=1;i<=n;i++){
scanf("%d %d",&x[i],&y[i]);
}
for(i=1;i<=n;i++)a[i]=i;
do{
for(i=2;i<=n;i++){
o=x[a[i-1]],p=y[a[i-1]],q=x[a[i]],r=y[a[i]];
ans=(o-q)*(o-q)+(p-r)*(p-r);
ans=sqrt(ans);
sum=sum+ans;
}
}while(nextperm()==1);
for(i=1;i<=n;i++){
z=z*i;
}
t=z;
printf("%lf\n",sum/t);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271184/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271184/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@n = dso_local global i32 0, align 4
@a = dso_local local_unnamed_addr global [10 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @nextperm() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
store i32 0, ptr @a, align 16, !tbaa !5
%1 = sext i32 %0 to i64
%arrayidx2.phi.trans.insert = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %1
%.pre = load i32, ptr %arrayidx2.phi.trans.insert, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%2 = phi i32 [ %3, %while.cond ], [ %.pre, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ %1, %entry ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv.next
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not = icmp slt i32 %3, %2
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%4 = trunc i64 %indvars.iv to i32
%5 = and i64 %indvars.iv.next, 4294967295
%cmp3 = icmp eq i64 %5, 0
br i1 %cmp3, label %cleanup, label %while.cond4
while.cond4: ; preds = %while.end, %while.cond4
%indvars.iv63 = phi i64 [ %indvars.iv.next64, %while.cond4 ], [ %1, %while.end ]
%arrayidx8 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv63
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not = icmp slt i32 %3, %6
%indvars.iv.next64 = add i64 %indvars.iv63, -1
br i1 %cmp9.not, label %while.end12, label %while.cond4, !llvm.loop !11
while.end12: ; preds = %while.cond4
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
store i32 %3, ptr %arrayidx8, align 4, !tbaa !5
%cmp2258 = icmp sgt i32 %0, %4
br i1 %cmp2258, label %while.body23, label %cleanup
while.body23: ; preds = %while.end12, %while.body23
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %while.body23 ], [ %indvars.iv, %while.end12 ]
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %while.body23 ], [ %1, %while.end12 ]
%arrayidx25 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv68
%7 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx27 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv66
%8 = load i32, ptr %arrayidx27, align 4, !tbaa !5
store i32 %8, ptr %arrayidx25, align 4, !tbaa !5
store i32 %7, ptr %arrayidx27, align 4, !tbaa !5
%indvars.iv.next69 = add nsw i64 %indvars.iv68, 1
%indvars.iv.next67 = add nsw i64 %indvars.iv66, -1
%cmp22 = icmp slt i64 %indvars.iv.next69, %indvars.iv.next67
br i1 %cmp22, label %while.body23, label %cleanup, !llvm.loop !12
cleanup: ; preds = %while.body23, %while.end12, %while.end
%retval.0 = phi i32 [ 0, %while.end ], [ 1, %while.end12 ], [ 1, %while.body23 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%x = alloca [10 x i32], align 16
%y = alloca [10 x i32], align 16
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %y) #6
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not82 = icmp slt i32 %0, 1
br i1 %cmp.not82, label %for.cond4.preheader.do.body.preheader_crit_edge, label %for.body
for.cond4.preheader: ; preds = %for.body
%cmp5.not84 = icmp slt i32 %7, 1
br i1 %cmp5.not84, label %for.cond4.preheader.do.body.preheader_crit_edge, label %for.body6.preheader
for.cond4.preheader.do.body.preheader_crit_edge: ; preds = %entry, %for.cond4.preheader
%1 = phi i32 [ %7, %for.cond4.preheader ], [ %0, %entry ]
%.pre110 = add nsw i32 %1, 1
br label %do.body.preheader
for.body6.preheader: ; preds = %for.cond4.preheader
%2 = add nuw i32 %7, 1
%wide.trip.count = zext i32 %2 to i64
%3 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %7, 8
br i1 %min.iters.check, label %for.body6.preheader141, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %3, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%offset.idx = or i64 %index, 1
%4 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %offset.idx
store <4 x i32> %vec.ind, ptr %4, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
store <4 x i32> %step.add, ptr %5, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %3, %n.vec
br i1 %cmp.n, label %do.body.preheader, label %for.body6.preheader141
for.body6.preheader141: ; preds = %for.body6.preheader, %middle.block
%indvars.iv98.ph = phi i64 [ 1, %for.body6.preheader ], [ %ind.end, %middle.block ]
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [10 x i32], ptr %x, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [10 x i32], ptr %y, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr @n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %8
br i1 %cmp.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !16
do.body.preheader: ; preds = %for.body6, %middle.block, %for.cond4.preheader.do.body.preheader_crit_edge
%cmp5.not84112 = phi i1 [ true, %for.cond4.preheader.do.body.preheader_crit_edge ], [ %cmp5.not84, %middle.block ], [ %cmp5.not84, %for.body6 ]
%9 = phi i32 [ %1, %for.cond4.preheader.do.body.preheader_crit_edge ], [ %7, %middle.block ], [ %7, %for.body6 ]
%.pre-phi = phi i32 [ %.pre110, %for.cond4.preheader.do.body.preheader_crit_edge ], [ %2, %middle.block ], [ %2, %for.body6 ]
%cmp13.not86 = icmp slt i32 %9, 2
%10 = sext i32 %9 to i64
%arrayidx2.phi.trans.insert.i = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %10
%wide.trip.count105 = zext i32 %.pre-phi to i64
br label %do.body
for.body6: ; preds = %for.body6.preheader141, %for.body6
%indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.body6 ], [ %indvars.iv98.ph, %for.body6.preheader141 ]
%arrayidx8 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv98
%11 = trunc i64 %indvars.iv98 to i32
store i32 %11, ptr %arrayidx8, align 4, !tbaa !5
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%exitcond.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count
br i1 %exitcond.not, label %do.body.preheader, label %for.body6, !llvm.loop !17
do.body: ; preds = %do.body.backedge, %do.body.preheader
%sum.0 = phi double [ 0.000000e+00, %do.body.preheader ], [ %sum.1.lcssa, %do.body.backedge ]
br i1 %cmp13.not86, label %do.cond, label %for.body14.preheader
for.body14.preheader: ; preds = %do.body
%.pre = load i32, ptr getelementptr inbounds ([10 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
%idxprom17.phi.trans.insert = sext i32 %.pre to i64
%arrayidx18.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %x, i64 0, i64 %idxprom17.phi.trans.insert
%.pre108 = load i32, ptr %arrayidx18.phi.trans.insert, align 4, !tbaa !5
%arrayidx23.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %y, i64 0, i64 %idxprom17.phi.trans.insert
%.pre109 = load i32, ptr %arrayidx23.phi.trans.insert, align 4, !tbaa !5
br label %for.body14
for.body14: ; preds = %for.body14.preheader, %for.body14
%12 = phi i32 [ %.pre109, %for.body14.preheader ], [ %16, %for.body14 ]
%13 = phi i32 [ %.pre108, %for.body14.preheader ], [ %15, %for.body14 ]
%indvars.iv101 = phi i64 [ 2, %for.body14.preheader ], [ %indvars.iv.next102, %for.body14 ]
%sum.187 = phi double [ %sum.0, %for.body14.preheader ], [ %add, %for.body14 ]
%conv = sitofp i32 %13 to double
%conv24 = sitofp i32 %12 to double
%arrayidx26 = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv101
%14 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%idxprom27 = sext i32 %14 to i64
%arrayidx28 = getelementptr inbounds [10 x i32], ptr %x, i64 0, i64 %idxprom27
%15 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%conv29 = sitofp i32 %15 to double
%arrayidx33 = getelementptr inbounds [10 x i32], ptr %y, i64 0, i64 %idxprom27
%16 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%conv34 = sitofp i32 %16 to double
%sub35 = fsub double %conv, %conv29
%sub37 = fsub double %conv24, %conv34
%mul39 = fmul double %sub37, %sub37
%17 = call double @llvm.fmuladd.f64(double %sub35, double %sub35, double %mul39)
%sqrt = call double @llvm.sqrt.f64(double %17)
%add = fadd double %sum.187, %sqrt
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%exitcond106.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count105
br i1 %exitcond106.not, label %do.cond, label %for.body14, !llvm.loop !18
do.cond: ; preds = %for.body14, %do.body
%sum.1.lcssa = phi double [ %sum.0, %do.body ], [ %add, %for.body14 ]
store i32 0, ptr @a, align 16, !tbaa !5
%.pre.i = load i32, ptr %arrayidx2.phi.trans.insert.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %do.cond
%18 = phi i32 [ %19, %while.cond.i ], [ %.pre.i, %do.cond ]
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ %10, %do.cond ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%arrayidx.i = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv.next.i
%19 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.not.i = icmp slt i32 %19, %18
br i1 %cmp.not.i, label %while.end.i, label %while.cond.i, !llvm.loop !9
while.end.i: ; preds = %while.cond.i
%20 = trunc i64 %indvars.iv.i to i32
%21 = and i64 %indvars.iv.next.i, 4294967295
%cmp3.i = icmp eq i64 %21, 0
br i1 %cmp3.i, label %for.cond47.preheader, label %while.cond4.i
while.cond4.i: ; preds = %while.end.i, %while.cond4.i
%indvars.iv63.i = phi i64 [ %indvars.iv.next64.i, %while.cond4.i ], [ %10, %while.end.i ]
%arrayidx8.i = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv63.i
%22 = load i32, ptr %arrayidx8.i, align 4, !tbaa !5
%cmp9.not.i = icmp slt i32 %19, %22
%indvars.iv.next64.i = add i64 %indvars.iv63.i, -1
br i1 %cmp9.not.i, label %while.end12.i, label %while.cond4.i, !llvm.loop !11
while.end12.i: ; preds = %while.cond4.i
store i32 %22, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %19, ptr %arrayidx8.i, align 4, !tbaa !5
%cmp2258.i = icmp sgt i32 %9, %20
br i1 %cmp2258.i, label %while.body23.i, label %do.body.backedge
do.body.backedge: ; preds = %while.body23.i, %while.end12.i
br label %do.body
while.body23.i: ; preds = %while.end12.i, %while.body23.i
%indvars.iv68.i = phi i64 [ %indvars.iv.next69.i, %while.body23.i ], [ %indvars.iv.i, %while.end12.i ]
%indvars.iv66.i = phi i64 [ %indvars.iv.next67.i, %while.body23.i ], [ %10, %while.end12.i ]
%arrayidx25.i = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv68.i
%23 = load i32, ptr %arrayidx25.i, align 4, !tbaa !5
%arrayidx27.i = getelementptr inbounds [10 x i32], ptr @a, i64 0, i64 %indvars.iv66.i
%24 = load i32, ptr %arrayidx27.i, align 4, !tbaa !5
store i32 %24, ptr %arrayidx25.i, align 4, !tbaa !5
store i32 %23, ptr %arrayidx27.i, align 4, !tbaa !5
%indvars.iv.next69.i = add nsw i64 %indvars.iv68.i, 1
%indvars.iv.next67.i = add nsw i64 %indvars.iv66.i, -1
%cmp22.i = icmp slt i64 %indvars.iv.next69.i, %indvars.iv.next67.i
br i1 %cmp22.i, label %while.body23.i, label %do.body.backedge, !llvm.loop !12
for.cond47.preheader: ; preds = %while.end.i
br i1 %cmp5.not84112, label %for.end53, label %for.body50.preheader
for.body50.preheader: ; preds = %for.cond47.preheader
%25 = add i32 %.pre-phi, -1
%min.iters.check121 = icmp ult i32 %25, 8
br i1 %min.iters.check121, label %for.body50.preheader136, label %vector.ph122
vector.ph122: ; preds = %for.body50.preheader
%n.vec124 = and i32 %25, -8
%ind.end125 = or i32 %n.vec124, 1
br label %vector.body128
vector.body128: ; preds = %vector.body128, %vector.ph122
%index129 = phi i32 [ 0, %vector.ph122 ], [ %index.next135, %vector.body128 ]
%vec.ind130 = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph122 ], [ %vec.ind.next133, %vector.body128 ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph122 ], [ %26, %vector.body128 ]
%vec.phi134 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph122 ], [ %27, %vector.body128 ]
%step.add131 = add <4 x i32> %vec.ind130, <i32 4, i32 4, i32 4, i32 4>
%26 = mul <4 x i32> %vec.ind130, %vec.phi
%27 = mul <4 x i32> %step.add131, %vec.phi134
%index.next135 = add nuw i32 %index129, 8
%vec.ind.next133 = add <4 x i32> %vec.ind130, <i32 8, i32 8, i32 8, i32 8>
%28 = icmp eq i32 %index.next135, %n.vec124
br i1 %28, label %middle.block119, label %vector.body128, !llvm.loop !19
middle.block119: ; preds = %vector.body128
%bin.rdx = mul <4 x i32> %27, %26
%29 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n127 = icmp eq i32 %25, %n.vec124
br i1 %cmp.n127, label %for.end53.loopexit, label %for.body50.preheader136
for.body50.preheader136: ; preds = %for.body50.preheader, %middle.block119
%i.393.ph = phi i32 [ 1, %for.body50.preheader ], [ %ind.end125, %middle.block119 ]
%z.092.ph = phi i32 [ 1, %for.body50.preheader ], [ %29, %middle.block119 ]
br label %for.body50
for.body50: ; preds = %for.body50.preheader136, %for.body50
%i.393 = phi i32 [ %inc52, %for.body50 ], [ %i.393.ph, %for.body50.preheader136 ]
%z.092 = phi i32 [ %mul, %for.body50 ], [ %z.092.ph, %for.body50.preheader136 ]
%mul = mul nsw i32 %i.393, %z.092
%inc52 = add nuw i32 %i.393, 1
%exitcond107.not = icmp eq i32 %inc52, %.pre-phi
br i1 %exitcond107.not, label %for.end53.loopexit, label %for.body50, !llvm.loop !20
for.end53.loopexit: ; preds = %for.body50, %middle.block119
%mul.lcssa = phi i32 [ %29, %middle.block119 ], [ %mul, %for.body50 ]
%30 = sitofp i32 %mul.lcssa to double
br label %for.end53
for.end53: ; preds = %for.end53.loopexit, %for.cond47.preheader
%z.0.lcssa = phi double [ 1.000000e+00, %for.cond47.preheader ], [ %30, %for.end53.loopexit ]
%div = fdiv double %sum.1.lcssa, %z.0.lcssa
%call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div)
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %x) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #5
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !15, !14}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !14, !15}
!20 = distinct !{!20, !10, !15, !14}
|
#include <stdio.h>
void gotonext(char map[100][101],int x,int y,int xmax,int ymax) {
char current=map[y][x];
if(current=='.')return;
map[y][x]='.';
if(y<ymax-1 && map[y+1][x]==current)gotonext(map,x,y+1,xmax,ymax);
if(y>0 && map[y-1][x]==current)gotonext(map,x,y-1,xmax,ymax);
if(x<xmax-1 && map[y][x+1]==current)gotonext(map,x+1,y,xmax,ymax);
if(x>0 && map[y][x-1]==current)gotonext(map,x-1,y,xmax,ymax);
}
int main(void) {
char map[100][101];
int ymax,xmax;
int x,y;
int count;
while(1) {
scanf("%d %d",&ymax,&xmax);
if(ymax==0 && xmax==0)break;
for(y=0;y<ymax;y++)scanf("%s",map[y]);
count=0;
for(y=0;y<ymax;y++) {
for(x=0;x<xmax;x++) {
if(map[y][x]!='.') {
gotonext(map,x,y,xmax,ymax);
count++;
}
}
}
printf("%d\n",count);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271234/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271234/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @gotonext(ptr noundef %map, i32 noundef %x, i32 noundef %y, i32 noundef %xmax, i32 noundef %ymax) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %y to i64
%sub = add i32 %ymax, -1
%cmp8 = icmp sgt i32 %sub, %y
%add = add nsw i32 %y, 1
%idxprom10 = sext i32 %add to i64
%cmp21 = icmp sgt i32 %y, 0
%sub24 = add nsw i32 %y, -1
%idxprom25 = zext i32 %sub24 to i64
%sub36 = add nsw i32 %xmax, -1
%0 = sext i32 %x to i64
%1 = sext i32 %sub36 to i64
br i1 %cmp8, label %entry.split.us, label %entry.split
entry.split.us: ; preds = %entry
br i1 %cmp21, label %tailrecurse.us.us, label %tailrecurse.us
tailrecurse.us.us: ; preds = %entry.split.us, %land.lhs.true54.us.us
%indvars.iv148 = phi i64 [ %indvars.iv.next149, %land.lhs.true54.us.us ], [ %0, %entry.split.us ]
%arrayidx2.us.us = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %indvars.iv148
%2 = load i8, ptr %arrayidx2.us.us, align 1, !tbaa !5
%cmp.us.us = icmp eq i8 %2, 46
br i1 %cmp.us.us, label %cleanup, label %if.end.us.us
if.end.us.us: ; preds = %tailrecurse.us.us
store i8 46, ptr %arrayidx2.us.us, align 1, !tbaa !5
%arrayidx13.us.us = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom10, i64 %indvars.iv148
%3 = load i8, ptr %arrayidx13.us.us, align 1, !tbaa !5
%cmp16.us.us = icmp eq i8 %3, %2
br i1 %cmp16.us.us, label %if.then18.us.us, label %if.end20.us.us
if.then18.us.us: ; preds = %if.end.us.us
%4 = trunc i64 %indvars.iv148 to i32
tail call void @gotonext(ptr noundef nonnull %map, i32 noundef %4, i32 noundef %add, i32 noundef %xmax, i32 noundef %ymax)
br label %if.end20.us.us
if.end20.us.us: ; preds = %if.then18.us.us, %if.end.us.us
%arrayidx28.us.us = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom25, i64 %indvars.iv148
%5 = load i8, ptr %arrayidx28.us.us, align 1, !tbaa !5
%cmp31.us.us = icmp eq i8 %5, %2
br i1 %cmp31.us.us, label %if.then33.us.us, label %if.end35.us.us
if.then33.us.us: ; preds = %if.end20.us.us
%6 = trunc i64 %indvars.iv148 to i32
tail call void @gotonext(ptr noundef nonnull %map, i32 noundef %6, i32 noundef %sub24, i32 noundef %xmax, i32 noundef %ymax)
br label %if.end35.us.us
if.end35.us.us: ; preds = %if.then33.us.us, %if.end20.us.us
%cmp37.us.us = icmp slt i64 %indvars.iv148, %1
br i1 %cmp37.us.us, label %land.lhs.true39.us.us, label %if.end51.us.us
land.lhs.true39.us.us: ; preds = %if.end35.us.us
%7 = add nsw i64 %indvars.iv148, 1
%arrayidx44.us.us = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %7
%8 = load i8, ptr %arrayidx44.us.us, align 1, !tbaa !5
%cmp47.us.us = icmp eq i8 %8, %2
br i1 %cmp47.us.us, label %if.then49.us.us, label %if.end51.us.us
if.then49.us.us: ; preds = %land.lhs.true39.us.us
%9 = trunc i64 %7 to i32
tail call void @gotonext(ptr noundef nonnull %map, i32 noundef %9, i32 noundef %y, i32 noundef %xmax, i32 noundef %ymax)
br label %if.end51.us.us
if.end51.us.us: ; preds = %if.then49.us.us, %land.lhs.true39.us.us, %if.end35.us.us
%cmp52.us.us = icmp sgt i64 %indvars.iv148, 0
br i1 %cmp52.us.us, label %land.lhs.true54.us.us, label %cleanup
land.lhs.true54.us.us: ; preds = %if.end51.us.us
%indvars.iv.next149 = add nsw i64 %indvars.iv148, -1
%idxprom58.us.us = and i64 %indvars.iv.next149, 4294967295
%arrayidx59.us.us = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %idxprom58.us.us
%10 = load i8, ptr %arrayidx59.us.us, align 1, !tbaa !5
%cmp62.us.us = icmp eq i8 %10, %2
br i1 %cmp62.us.us, label %tailrecurse.us.us, label %cleanup
tailrecurse.us: ; preds = %entry.split.us, %land.lhs.true54.us
%indvars.iv144 = phi i64 [ %indvars.iv.next145, %land.lhs.true54.us ], [ %0, %entry.split.us ]
%arrayidx2.us = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %indvars.iv144
%11 = load i8, ptr %arrayidx2.us, align 1, !tbaa !5
%cmp.us = icmp eq i8 %11, 46
br i1 %cmp.us, label %cleanup, label %if.end.us
if.end.us: ; preds = %tailrecurse.us
store i8 46, ptr %arrayidx2.us, align 1, !tbaa !5
%arrayidx13.us = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom10, i64 %indvars.iv144
%12 = load i8, ptr %arrayidx13.us, align 1, !tbaa !5
%cmp16.us = icmp eq i8 %12, %11
br i1 %cmp16.us, label %if.then18.us, label %if.end20.us
if.then18.us: ; preds = %if.end.us
%13 = trunc i64 %indvars.iv144 to i32
tail call void @gotonext(ptr noundef nonnull %map, i32 noundef %13, i32 noundef %add, i32 noundef %xmax, i32 noundef %ymax)
br label %if.end20.us
if.end20.us: ; preds = %if.then18.us, %if.end.us
%cmp37.us = icmp slt i64 %indvars.iv144, %1
br i1 %cmp37.us, label %land.lhs.true39.us, label %if.end51.us
land.lhs.true39.us: ; preds = %if.end20.us
%14 = add nsw i64 %indvars.iv144, 1
%arrayidx44.us = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %14
%15 = load i8, ptr %arrayidx44.us, align 1, !tbaa !5
%cmp47.us = icmp eq i8 %15, %11
br i1 %cmp47.us, label %if.then49.us, label %if.end51.us
if.then49.us: ; preds = %land.lhs.true39.us
%16 = trunc i64 %14 to i32
tail call void @gotonext(ptr noundef nonnull %map, i32 noundef %16, i32 noundef %y, i32 noundef %xmax, i32 noundef %ymax)
br label %if.end51.us
if.end51.us: ; preds = %if.then49.us, %land.lhs.true39.us, %if.end20.us
%cmp52.us = icmp sgt i64 %indvars.iv144, 0
br i1 %cmp52.us, label %land.lhs.true54.us, label %cleanup
land.lhs.true54.us: ; preds = %if.end51.us
%indvars.iv.next145 = add nsw i64 %indvars.iv144, -1
%idxprom58.us = and i64 %indvars.iv.next145, 4294967295
%arrayidx59.us = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %idxprom58.us
%17 = load i8, ptr %arrayidx59.us, align 1, !tbaa !5
%cmp62.us = icmp eq i8 %17, %11
br i1 %cmp62.us, label %tailrecurse.us, label %cleanup
entry.split: ; preds = %entry
br i1 %cmp21, label %tailrecurse.us110, label %tailrecurse
tailrecurse.us110: ; preds = %entry.split, %land.lhs.true54.us130
%indvars.iv140 = phi i64 [ %indvars.iv.next141, %land.lhs.true54.us130 ], [ %0, %entry.split ]
%arrayidx2.us113 = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %indvars.iv140
%18 = load i8, ptr %arrayidx2.us113, align 1, !tbaa !5
%cmp.us114 = icmp eq i8 %18, 46
br i1 %cmp.us114, label %cleanup, label %if.end.us115
if.end.us115: ; preds = %tailrecurse.us110
store i8 46, ptr %arrayidx2.us113, align 1, !tbaa !5
%arrayidx28.us117 = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom25, i64 %indvars.iv140
%19 = load i8, ptr %arrayidx28.us117, align 1, !tbaa !5
%cmp31.us118 = icmp eq i8 %19, %18
br i1 %cmp31.us118, label %if.then33.us119, label %if.end35.us120
if.then33.us119: ; preds = %if.end.us115
%20 = trunc i64 %indvars.iv140 to i32
tail call void @gotonext(ptr noundef nonnull %map, i32 noundef %20, i32 noundef %sub24, i32 noundef %xmax, i32 noundef %ymax)
br label %if.end35.us120
if.end35.us120: ; preds = %if.then33.us119, %if.end.us115
%cmp37.us121 = icmp slt i64 %indvars.iv140, %1
br i1 %cmp37.us121, label %land.lhs.true39.us122, label %if.end51.us128
land.lhs.true39.us122: ; preds = %if.end35.us120
%21 = add nsw i64 %indvars.iv140, 1
%arrayidx44.us125 = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %21
%22 = load i8, ptr %arrayidx44.us125, align 1, !tbaa !5
%cmp47.us126 = icmp eq i8 %22, %18
br i1 %cmp47.us126, label %if.then49.us127, label %if.end51.us128
if.then49.us127: ; preds = %land.lhs.true39.us122
%23 = trunc i64 %21 to i32
tail call void @gotonext(ptr noundef nonnull %map, i32 noundef %23, i32 noundef %y, i32 noundef %xmax, i32 noundef %ymax)
br label %if.end51.us128
if.end51.us128: ; preds = %if.then49.us127, %land.lhs.true39.us122, %if.end35.us120
%cmp52.us129 = icmp sgt i64 %indvars.iv140, 0
br i1 %cmp52.us129, label %land.lhs.true54.us130, label %cleanup
land.lhs.true54.us130: ; preds = %if.end51.us128
%indvars.iv.next141 = add nsw i64 %indvars.iv140, -1
%idxprom58.us132 = and i64 %indvars.iv.next141, 4294967295
%arrayidx59.us133 = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %idxprom58.us132
%24 = load i8, ptr %arrayidx59.us133, align 1, !tbaa !5
%cmp62.us134 = icmp eq i8 %24, %18
br i1 %cmp62.us134, label %tailrecurse.us110, label %cleanup
tailrecurse: ; preds = %entry.split, %land.lhs.true54
%indvars.iv = phi i64 [ %indvars.iv.next, %land.lhs.true54 ], [ %0, %entry.split ]
%arrayidx2 = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %indvars.iv
%25 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp = icmp eq i8 %25, 46
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %tailrecurse
store i8 46, ptr %arrayidx2, align 1, !tbaa !5
%cmp37 = icmp slt i64 %indvars.iv, %1
br i1 %cmp37, label %land.lhs.true39, label %if.end51
land.lhs.true39: ; preds = %if.end
%26 = add nsw i64 %indvars.iv, 1
%arrayidx44 = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %26
%27 = load i8, ptr %arrayidx44, align 1, !tbaa !5
%cmp47 = icmp eq i8 %27, %25
br i1 %cmp47, label %if.then49, label %if.end51
if.then49: ; preds = %land.lhs.true39
%28 = trunc i64 %26 to i32
tail call void @gotonext(ptr noundef nonnull %map, i32 noundef %28, i32 noundef %y, i32 noundef %xmax, i32 noundef %ymax)
br label %if.end51
if.end51: ; preds = %if.then49, %land.lhs.true39, %if.end
%cmp52 = icmp sgt i64 %indvars.iv, 0
br i1 %cmp52, label %land.lhs.true54, label %cleanup
land.lhs.true54: ; preds = %if.end51
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%idxprom58 = and i64 %indvars.iv.next, 4294967295
%arrayidx59 = getelementptr inbounds [101 x i8], ptr %map, i64 %idxprom, i64 %idxprom58
%29 = load i8, ptr %arrayidx59, align 1, !tbaa !5
%cmp62 = icmp eq i8 %29, %25
br i1 %cmp62, label %tailrecurse, label %cleanup
cleanup: ; preds = %if.end51, %land.lhs.true54, %tailrecurse, %land.lhs.true54.us130, %if.end51.us128, %tailrecurse.us110, %land.lhs.true54.us, %if.end51.us, %tailrecurse.us, %land.lhs.true54.us.us, %if.end51.us.us, %tailrecurse.us.us
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%map = alloca [100 x [101 x i8]], align 16
%ymax = alloca i32, align 4
%xmax = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 10100, ptr nonnull %map) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ymax) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %xmax) #4
%call47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ymax, ptr noundef nonnull %xmax)
%0 = load i32, ptr %ymax, align 4, !tbaa !8
%cmp48 = icmp eq i32 %0, 0
%1 = load i32, ptr %xmax, align 4
%cmp149 = icmp eq i32 %1, 0
%or.cond50 = select i1 %cmp48, i1 %cmp149, i1 false
br i1 %or.cond50, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end25
%2 = phi i32 [ %9, %for.end25 ], [ %0, %entry ]
%cmp237 = icmp sgt i32 %2, 0
br i1 %cmp237, label %for.body, label %for.end25
for.cond4.preheader: ; preds = %for.body
%cmp543 = icmp sgt i32 %7, 0
br i1 %cmp543, label %for.cond7.preheader.lr.ph, label %for.end25
for.cond7.preheader.lr.ph: ; preds = %for.cond4.preheader
%3 = load i32, ptr %xmax, align 4, !tbaa !8
%cmp839 = icmp sgt i32 %3, 0
br i1 %cmp839, label %for.cond7.preheader.us.preheader, label %for.end25
for.cond7.preheader.us.preheader: ; preds = %for.cond7.preheader.lr.ph
%wide.trip.count60 = zext i32 %7 to i64
%wide.trip.count = zext i32 %3 to i64
br label %for.cond7.preheader.us
for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.cond7.for.inc23_crit_edge.us
%indvars.iv57 = phi i64 [ 0, %for.cond7.preheader.us.preheader ], [ %indvars.iv.next58, %for.cond7.for.inc23_crit_edge.us ]
%count.045.us = phi i32 [ 0, %for.cond7.preheader.us.preheader ], [ %count.2.us, %for.cond7.for.inc23_crit_edge.us ]
%4 = trunc i64 %indvars.iv57 to i32
br label %for.body9.us
for.body9.us: ; preds = %for.cond7.preheader.us, %for.inc20.us
%indvars.iv54 = phi i64 [ 0, %for.cond7.preheader.us ], [ %indvars.iv.next55, %for.inc20.us ]
%count.141.us = phi i32 [ %count.045.us, %for.cond7.preheader.us ], [ %count.2.us, %for.inc20.us ]
%arrayidx13.us = getelementptr inbounds [100 x [101 x i8]], ptr %map, i64 0, i64 %indvars.iv57, i64 %indvars.iv54
%5 = load i8, ptr %arrayidx13.us, align 1, !tbaa !5
%cmp14.not.us = icmp eq i8 %5, 46
br i1 %cmp14.not.us, label %for.inc20.us, label %if.then16.us
if.then16.us: ; preds = %for.body9.us
%6 = trunc i64 %indvars.iv54 to i32
call void @gotonext(ptr noundef nonnull %map, i32 noundef %6, i32 noundef %4, i32 noundef %3, i32 noundef %7)
%inc18.us = add nsw i32 %count.141.us, 1
br label %for.inc20.us
for.inc20.us: ; preds = %if.then16.us, %for.body9.us
%count.2.us = phi i32 [ %inc18.us, %if.then16.us ], [ %count.141.us, %for.body9.us ]
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count
br i1 %exitcond.not, label %for.cond7.for.inc23_crit_edge.us, label %for.body9.us, !llvm.loop !10
for.cond7.for.inc23_crit_edge.us: ; preds = %for.inc20.us
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
br i1 %exitcond61.not, label %for.end25, label %for.cond7.preheader.us, !llvm.loop !12
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [100 x [101 x i8]], ptr %map, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %ymax, align 4, !tbaa !8
%8 = sext i32 %7 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp2, label %for.body, label %for.cond4.preheader, !llvm.loop !13
for.end25: ; preds = %for.cond7.for.inc23_crit_edge.us, %for.cond.preheader, %for.cond7.preheader.lr.ph, %for.cond4.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %for.cond7.preheader.lr.ph ], [ 0, %for.cond.preheader ], [ %count.2.us, %for.cond7.for.inc23_crit_edge.us ]
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ymax, ptr noundef nonnull %xmax)
%9 = load i32, ptr %ymax, align 4, !tbaa !8
%cmp = icmp eq i32 %9, 0
%10 = load i32, ptr %xmax, align 4
%cmp1 = icmp eq i32 %10, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end25, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %xmax) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ymax) #4
call void @llvm.lifetime.end.p0(i64 10100, ptr nonnull %map) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include<stdio.h>
#include<ctype.h>
int main(){
int a,b;
int x=0;
int z=0;
char A;
while(scanf("%c",&A)!=EOF){
if(islower(A)){
A=toupper(A);
}
printf("%c",A);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271285/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271285/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %A) #5
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%cmp.not11 = icmp eq i32 %call10, -1
br i1 %cmp.not11, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%call1 = tail call ptr @__ctype_b_loc() #6
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end
%0 = load ptr, ptr %call1, align 8, !tbaa !5
%1 = load i8, ptr %A, align 1, !tbaa !9
%idxprom = sext i8 %1 to i64
%arrayidx = getelementptr inbounds i16, ptr %0, i64 %idxprom
%2 = load i16, ptr %arrayidx, align 2, !tbaa !10
%3 = and i16 %2, 512
%tobool.not = icmp eq i16 %3, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%call3 = tail call ptr @__ctype_toupper_loc() #6
%4 = load ptr, ptr %call3, align 8, !tbaa !5
%arrayidx6 = getelementptr inbounds i32, ptr %4, i64 %idxprom
%5 = load i32, ptr %arrayidx6, align 4, !tbaa !12
%conv7 = trunc i32 %5 to i8
store i8 %conv7, ptr %A, align 1, !tbaa !9
br label %if.end
if.end: ; preds = %if.then, %while.body
%6 = phi i8 [ %conv7, %if.then ], [ %1, %while.body ]
%conv8 = sext i8 %6 to i32
%putchar = call i32 @putchar(i32 %conv8)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() local_unnamed_addr #3
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int
main(int argc, char *argv[])
{
char buf;
while((buf = getc(stdin)) != EOF) {
if ('a' <= buf && buf <= 'z')
buf = buf - 'a' + 'A';
putc(buf, stdout);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271342/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271342/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call17 = tail call i32 @getc(ptr noundef %0)
%sext18 = shl i32 %call17, 24
%cmp.not19 = icmp eq i32 %sext18, -16777216
br i1 %cmp.not19, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%sext21 = phi i32 [ %sext, %while.body ], [ %sext18, %entry ]
%call20 = phi i32 [ %call, %while.body ], [ %call17, %entry ]
%1 = add i32 %sext21, -1610612737
%or.cond = icmp ult i32 %1, 452984831
%2 = shl i32 %call20, 24
%3 = add i32 %2, -536870912
%sext16 = select i1 %or.cond, i32 %3, i32 %2
%conv11 = ashr exact i32 %sext16, 24
%4 = load ptr, ptr @stdout, align 8, !tbaa !5
%call12 = tail call i32 @putc(i32 noundef %conv11, ptr noundef %4)
%5 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call i32 @getc(ptr noundef %5)
%sext = shl i32 %call, 24
%cmp.not = icmp eq i32 %sext, -16777216
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
/** Application main entry point. */
int main (
int argc,
char *argv[ ]
)
{
int ch;
while ( 1 )
{
ch = getchar ( );
if ( ch == EOF ) break;
putchar ( ch >= 'a' && ch <= 'z'
? ch - 'a' + 'A'
: ch );
if ( ch == '\n' ) break;
}
return ( 0 );
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271450/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271450/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %if.end, %entry
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %0)
%cmp = icmp eq i32 %call.i, -1
br i1 %cmp, label %while.end, label %if.end
if.end: ; preds = %while.cond
%1 = add i32 %call.i, -97
%or.cond = icmp ult i32 %1, 26
%add = add nsw i32 %call.i, -32
%cond = select i1 %or.cond, i32 %add, i32 %call.i
%2 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i12 = tail call i32 @putc(i32 noundef %cond, ptr noundef %2)
%cmp4 = icmp eq i32 %call.i, 10
br i1 %cmp4, label %while.end, label %while.cond
while.end: ; preds = %if.end, %while.cond
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
char c;
while(scanf("%c",&c)!=EOF) {
if('a'<=c && 'z'>=c) {
c=c-('a'-'A');
}
printf("%c",c);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271508/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271508/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp.not11 = icmp eq i32 %call10, -1
br i1 %cmp.not11, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%0 = load i8, ptr %c, align 1
%1 = add i8 %0, -97
%or.cond = icmp ult i8 %1, 26
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %while.body
%sub = add nsw i8 %0, -32
store i8 %sub, ptr %c, align 1, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%2 = phi i8 [ %sub, %if.then ], [ %0, %while.body ]
%conv8 = sext i8 %2 to i32
%putchar = call i32 @putchar(i32 %conv8)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main(void) {
char ch;
while ((ch = getchar()) != EOF) {
putchar(toupper(ch));
}
return EXIT_SUCCESS;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271580/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271580/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i7 = tail call i32 @getc(ptr noundef %0)
%sext8 = shl i32 %call.i7, 24
%cmp.not9 = icmp eq i32 %sext8, -16777216
br i1 %cmp.not9, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%call3 = tail call ptr @__ctype_toupper_loc() #3
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%sext10 = phi i32 [ %sext8, %while.body.lr.ph ], [ %sext, %while.body ]
%conv1 = ashr exact i32 %sext10, 24
%1 = load ptr, ptr %call3, align 8, !tbaa !5
%idxprom = sext i32 %conv1 to i64
%arrayidx = getelementptr inbounds i32, ptr %1, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !9
%3 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i6 = tail call i32 @putc(i32 noundef %2, ptr noundef %3)
%4 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %4)
%sext = shl i32 %call.i, 24
%cmp.not = icmp eq i32 %sext, -16777216
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
ret i32 0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#define N_MAX 100000
#define A_MAX (1e9+1)
int main() {
int i, n, m, a[N_MAX];
scanf("%d", &n);
for (i=0; i<n; i++) a[i] = A_MAX;
while (~scanf("%d", &m)) {
int x = 0, y = n - 1;
while (x != y) {
int z = (x + y) / 2;
if (m > a[z]) x = z + 1;
else if (m <= a[z]) y = z;
}
a[x] = m;
}
for (i=n-1; a[i]==A_MAX; i--);
printf("%d\n", i+1);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271630/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271630/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp39 = icmp sgt i32 %0, 0
br i1 %cmp39, label %for.body.preheader, label %while.cond.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader50, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%1 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %index
store <4 x i32> <i32 1000000001, i32 1000000001, i32 1000000001, i32 1000000001>, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> <i32 1000000001, i32 1000000001, i32 1000000001, i32 1000000001>, ptr %2, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %while.cond.preheader, label %for.body.preheader50
for.body.preheader50: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
while.cond.preheader: ; preds = %for.body, %middle.block, %entry
%call144 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%tobool.not45 = icmp eq i32 %call144, -1
br i1 %tobool.not45, label %while.end16, label %while.body
for.body: ; preds = %for.body.preheader50, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader50 ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv
store i32 1000000001, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %while.cond.preheader, label %for.body, !llvm.loop !13
while.body: ; preds = %while.cond.preheader, %while.end
%4 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %4, -1
%cmp3.not41 = icmp eq i32 %sub, 0
%.pre = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp3.not41, label %while.end, label %while.body4
while.body4: ; preds = %while.body, %while.body4
%y.043 = phi i32 [ %y.1, %while.body4 ], [ %sub, %while.body ]
%x.042 = phi i32 [ %x.1, %while.body4 ], [ 0, %while.body ]
%add = add nsw i32 %y.043, %x.042
%div = sdiv i32 %add, 2
%idxprom5 = sext i32 %div to i64
%arrayidx6 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %idxprom5
%5 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %.pre, %5
%add8 = add nsw i32 %div, 1
%x.1 = select i1 %cmp7, i32 %add8, i32 %x.042
%y.1 = select i1 %cmp7, i32 %y.043, i32 %div
%cmp3.not = icmp eq i32 %x.1, %y.1
br i1 %cmp3.not, label %while.end, label %while.body4, !llvm.loop !14
while.end: ; preds = %while.body4, %while.body
%x.0.lcssa = phi i32 [ 0, %while.body ], [ %x.1, %while.body4 ]
%idxprom14 = sext i32 %x.0.lcssa to i64
%arrayidx15 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %idxprom14
store i32 %.pre, ptr %arrayidx15, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%tobool.not = icmp eq i32 %call1, -1
br i1 %tobool.not, label %while.end16, label %while.body, !llvm.loop !15
while.end16: ; preds = %while.end, %while.cond.preheader
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
br label %for.cond18
for.cond18: ; preds = %for.cond18, %while.end16
%indvars.iv47 = phi i64 [ %indvars.iv.next48, %for.cond18 ], [ %7, %while.end16 ]
%indvars.iv.next48 = add nsw i64 %indvars.iv47, -1
%arrayidx20 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv.next48
%8 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%cmp21 = icmp eq i32 %8, 1000000001
br i1 %cmp21, label %for.cond18, label %for.end25, !llvm.loop !16
for.end25: ; preds = %for.cond18
%9 = trunc i64 %indvars.iv47 to i32
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <limits.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define FOR(i,a,n) for(i=(a);i<(n);i++)
void fill(int a[],int b,int c){
int i;
FOR(i,0,b) a[i]=c;
return;
}
typedef struct{
int a,b;
}Pair;
int comp(const void* a,const void* b){
Pair p1=*(Pair*)a,p2=*(Pair*)b;
return p1.a==p2.a?p1.b-p2.b:p1.a-p2.a;
}
Pair p[100000];
int main(void)
{
int n,a,res=0,i;
scanf("%d",&n);
FOR(i,0,n){
scanf("%d",&a);
p[i].a=MAX(i+1,a);
p[i].b=MIN(i+1,a);
}
qsort(p,n,sizeof(Pair),comp);
FOR(i,0,n-1){
if(p[i].a==p[i+1].a&&p[i].b==p[i+1].b) res++;
}
printf("%d\n",res);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271674/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271674/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Pair = type { i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@p = dso_local global [100000 x %struct.Pair] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable
define dso_local void @fill(ptr nocapture noundef writeonly %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i32 %b, 0
br i1 %cmp3, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %b to i64
%min.iters.check = icmp ult i32 %b, 8
br i1 %min.iters.check, label %for.body.preheader6, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %c, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%0 = getelementptr inbounds i32, ptr %a, i64 %index
store <4 x i32> %broadcast.splat, ptr %0, align 4, !tbaa !5
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %broadcast.splat, ptr %1, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader6
for.body.preheader6: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader6, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader6 ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
store i32 %c, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #2 {
entry:
%p1.sroa.0.0.copyload = load i32, ptr %a, align 4, !tbaa.struct !14
%p2.sroa.0.0.copyload = load i32, ptr %b, align 4, !tbaa.struct !14
%cmp = icmp eq i32 %p1.sroa.0.0.copyload, %p2.sroa.0.0.copyload
br i1 %cmp, label %cond.true, label %cond.false
cond.true: ; preds = %entry
%p2.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %b, i64 4
%p2.sroa.5.0.copyload = load i32, ptr %p2.sroa.5.0..sroa_idx, align 4, !tbaa.struct !15
%p1.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %a, i64 4
%p1.sroa.5.0.copyload = load i32, ptr %p1.sroa.5.0..sroa_idx, align 4, !tbaa.struct !15
%sub = sub nsw i32 %p1.sroa.5.0.copyload, %p2.sroa.5.0.copyload
br label %cond.end
cond.false: ; preds = %entry
%sub7 = sub nsw i32 %p1.sroa.0.0.copyload, %p2.sroa.0.0.copyload
br label %cond.end
cond.end: ; preds = %cond.false, %cond.true
%cond = phi i32 [ %sub, %cond.true ], [ %sub7, %cond.false ]
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp55 = icmp sgt i32 %0, 0
br i1 %cmp55, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre66 = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %a, align 4
%2 = trunc i64 %indvars.iv.next to i32
%cond = call i32 @llvm.smax.i32(i32 %2, i32 %1)
%arrayidx = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv
store i32 %cond, ptr %arrayidx, align 8, !tbaa !16
%cond11 = call i32 @llvm.smin.i32(i32 %2, i32 %1)
%b = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv, i32 1
store i32 %cond11, ptr %b, align 4, !tbaa !18
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !19
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre66, %entry.for.end_crit_edge ], [ %4, %for.body ]
call void @qsort(ptr noundef nonnull @p, i64 noundef %conv.pre-phi, i64 noundef 8, ptr noundef nonnull @comp) #7
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp1557 = icmp sgt i32 %5, 1
br i1 %cmp1557, label %for.body17.preheader, label %for.end39
for.body17.preheader: ; preds = %for.end
%sub = add i32 %5, -1
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr @p, align 16, !tbaa !16
%xtraiter = and i64 %wide.trip.count, 1
%6 = icmp eq i32 %sub, 1
br i1 %6, label %for.end39.loopexit.unr-lcssa, label %for.body17.preheader.new
for.body17.preheader.new: ; preds = %for.body17.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body17
for.body17: ; preds = %for.inc37.1, %for.body17.preheader.new
%7 = phi i32 [ %.pre, %for.body17.preheader.new ], [ %11, %for.inc37.1 ]
%indvars.iv63 = phi i64 [ 0, %for.body17.preheader.new ], [ %indvars.iv.next64.1, %for.inc37.1 ]
%res.058 = phi i32 [ 0, %for.body17.preheader.new ], [ %res.1.1, %for.inc37.1 ]
%niter = phi i64 [ 0, %for.body17.preheader.new ], [ %niter.next.1, %for.inc37.1 ]
%indvars.iv.next64 = or i64 %indvars.iv63, 1
%arrayidx23 = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv.next64
%8 = load i32, ptr %arrayidx23, align 8, !tbaa !16
%cmp25 = icmp eq i32 %7, %8
br i1 %cmp25, label %land.lhs.true, label %for.inc37
land.lhs.true: ; preds = %for.body17
%b29 = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv63, i32 1
%9 = load i32, ptr %b29, align 4, !tbaa !18
%b33 = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv.next64, i32 1
%10 = load i32, ptr %b33, align 4, !tbaa !18
%cmp34 = icmp eq i32 %9, %10
%inc36 = zext i1 %cmp34 to i32
%spec.select = add nsw i32 %res.058, %inc36
br label %for.inc37
for.inc37: ; preds = %land.lhs.true, %for.body17
%res.1 = phi i32 [ %res.058, %for.body17 ], [ %spec.select, %land.lhs.true ]
%indvars.iv.next64.1 = add nuw nsw i64 %indvars.iv63, 2
%arrayidx23.1 = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv.next64.1
%11 = load i32, ptr %arrayidx23.1, align 16, !tbaa !16
%cmp25.1 = icmp eq i32 %8, %11
br i1 %cmp25.1, label %land.lhs.true.1, label %for.inc37.1
land.lhs.true.1: ; preds = %for.inc37
%b29.1 = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv.next64, i32 1
%12 = load i32, ptr %b29.1, align 4, !tbaa !18
%b33.1 = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv.next64.1, i32 1
%13 = load i32, ptr %b33.1, align 4, !tbaa !18
%cmp34.1 = icmp eq i32 %12, %13
%inc36.1 = zext i1 %cmp34.1 to i32
%spec.select.1 = add nsw i32 %res.1, %inc36.1
br label %for.inc37.1
for.inc37.1: ; preds = %land.lhs.true.1, %for.inc37
%res.1.1 = phi i32 [ %res.1, %for.inc37 ], [ %spec.select.1, %land.lhs.true.1 ]
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end39.loopexit.unr-lcssa, label %for.body17, !llvm.loop !20
for.end39.loopexit.unr-lcssa: ; preds = %for.inc37.1, %for.body17.preheader
%res.1.lcssa.ph = phi i32 [ undef, %for.body17.preheader ], [ %res.1.1, %for.inc37.1 ]
%.unr = phi i32 [ %.pre, %for.body17.preheader ], [ %11, %for.inc37.1 ]
%indvars.iv63.unr = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next64.1, %for.inc37.1 ]
%res.058.unr = phi i32 [ 0, %for.body17.preheader ], [ %res.1.1, %for.inc37.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end39, label %for.body17.epil
for.body17.epil: ; preds = %for.end39.loopexit.unr-lcssa
%indvars.iv.next64.epil = add nuw nsw i64 %indvars.iv63.unr, 1
%arrayidx23.epil = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv.next64.epil
%14 = load i32, ptr %arrayidx23.epil, align 8, !tbaa !16
%cmp25.epil = icmp eq i32 %.unr, %14
br i1 %cmp25.epil, label %land.lhs.true.epil, label %for.end39
land.lhs.true.epil: ; preds = %for.body17.epil
%b29.epil = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv63.unr, i32 1
%15 = load i32, ptr %b29.epil, align 4, !tbaa !18
%b33.epil = getelementptr inbounds [100000 x %struct.Pair], ptr @p, i64 0, i64 %indvars.iv.next64.epil, i32 1
%16 = load i32, ptr %b33.epil, align 4, !tbaa !18
%cmp34.epil = icmp eq i32 %15, %16
%inc36.epil = zext i1 %cmp34.epil to i32
%spec.select.epil = add nsw i32 %res.058.unr, %inc36.epil
br label %for.end39
for.end39: ; preds = %for.end39.loopexit.unr-lcssa, %land.lhs.true.epil, %for.body17.epil, %for.end
%res.0.lcssa = phi i32 [ 0, %for.end ], [ %res.1.lcssa.ph, %for.end39.loopexit.unr-lcssa ], [ %res.058.unr, %for.body17.epil ], [ %spec.select.epil, %land.lhs.true.epil ]
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %res.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!15 = !{i64 0, i64 4, !5}
!16 = !{!17, !6, i64 0}
!17 = !{!"", !6, i64 0, !6, i64 4}
!18 = !{!17, !6, i64 4}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
|
#include <stdio.h>
int main(void)
{
int cards[4][13] = {0};
char design;
int number,count,i,j;
scanf("%d",&count);
for(i = 0;i < count;i++)
{
scanf(" %c",&design);
scanf(" %d",&number);
switch(design)
{
case 'S':
cards[0][number - 1] = 1;
break;
case 'H':
cards[1][number - 1] = 1;
break;
case 'C':
cards[2][number - 1] = 1;
break;
case 'D':
cards[3][number - 1] = 1;
break;
default:
printf("%s",design);
break;
}
}
for(i = 0;i < 4;i++)
{
for(j = 0;j < 13;j++)
{
if(cards[i][j] == 0)
{
switch(i)
{
case 0:
printf("S %d\n",j + 1);
break;
case 1:
printf("H %d\n",j + 1);
break;
case 2:
printf("C %d\n",j + 1);
break;
case 3:
printf("D %d\n",j + 1);
break;
}
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271717/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271717/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %c\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"S %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"H %d\0A\00", align 1
@.str.6 = private unnamed_addr constant [6 x i8] c"C %d\0A\00", align 1
@.str.7 = private unnamed_addr constant [6 x i8] c"D %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%cards = alloca [4 x [13 x i32]], align 16
%design = alloca i8, align 1
%number = alloca i32, align 4
%count = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %cards) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %cards, i8 0, i64 208, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %design) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %number) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %count) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %count)
%0 = load i32, ptr %count, align 4, !tbaa !5
%cmp64 = icmp sgt i32 %0, 0
br i1 %cmp64, label %for.body, label %for.cond25.preheader.preheader
for.body: ; preds = %entry, %for.inc
%i.065 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %design)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %number)
%1 = load i8, ptr %design, align 1, !tbaa !9
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.default [
i32 83, label %sw.bb
i32 72, label %sw.bb4
i32 67, label %sw.bb9
i32 68, label %sw.bb14
]
sw.bb: ; preds = %for.body
%2 = load i32, ptr %number, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom = sext i32 %sub to i64
%arrayidx3 = getelementptr inbounds [13 x i32], ptr %cards, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx3, align 4, !tbaa !5
br label %for.inc
sw.bb4: ; preds = %for.body
%3 = load i32, ptr %number, align 4, !tbaa !5
%sub6 = add nsw i32 %3, -1
%idxprom7 = sext i32 %sub6 to i64
%arrayidx8 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 1, i64 %idxprom7
store i32 1, ptr %arrayidx8, align 4, !tbaa !5
br label %for.inc
sw.bb9: ; preds = %for.body
%4 = load i32, ptr %number, align 4, !tbaa !5
%sub11 = add nsw i32 %4, -1
%idxprom12 = sext i32 %sub11 to i64
%arrayidx13 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 2, i64 %idxprom12
store i32 1, ptr %arrayidx13, align 4, !tbaa !5
br label %for.inc
sw.bb14: ; preds = %for.body
%5 = load i32, ptr %number, align 4, !tbaa !5
%sub16 = add nsw i32 %5, -1
%idxprom17 = sext i32 %sub16 to i64
%arrayidx18 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 3, i64 %idxprom17
store i32 1, ptr %arrayidx18, align 4, !tbaa !5
br label %for.inc
sw.default: ; preds = %for.body
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %conv)
br label %for.inc
for.inc: ; preds = %sw.bb, %sw.bb4, %sw.bb9, %sw.bb14, %sw.default
%inc = add nuw nsw i32 %i.065, 1
%6 = load i32, ptr %count, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %6
br i1 %cmp, label %for.body, label %for.cond25.preheader.preheader, !llvm.loop !10
for.cond25.preheader.preheader: ; preds = %for.inc, %entry
br label %for.cond25.preheader
for.cond25.preheader: ; preds = %for.cond25.preheader.preheader, %for.inc50
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc50 ], [ 0, %for.cond25.preheader.preheader ]
%7 = trunc i64 %indvars.iv to i32
switch i32 %7, label %for.inc50 [
i32 0, label %for.body28.us.preheader
i32 1, label %for.body28.us68.preheader
i32 2, label %for.body28.us78.preheader
i32 3, label %for.body28.us88.preheader
]
for.body28.us88.preheader: ; preds = %for.cond25.preheader
%arrayidx32.us91 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 0
%8 = load i32, ptr %arrayidx32.us91, align 4, !tbaa !5
%cmp33.us92 = icmp eq i32 %8, 0
br i1 %cmp33.us92, label %if.then.us93, label %for.inc47.us94
for.body28.us78.preheader: ; preds = %for.cond25.preheader
%arrayidx32.us81 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 0
%9 = load i32, ptr %arrayidx32.us81, align 4, !tbaa !5
%cmp33.us82 = icmp eq i32 %9, 0
br i1 %cmp33.us82, label %if.then.us83, label %for.inc47.us84
for.body28.us68.preheader: ; preds = %for.cond25.preheader
%arrayidx32.us71 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 0
%10 = load i32, ptr %arrayidx32.us71, align 4, !tbaa !5
%cmp33.us72 = icmp eq i32 %10, 0
br i1 %cmp33.us72, label %if.then.us73, label %for.inc47.us74
for.body28.us.preheader: ; preds = %for.cond25.preheader
%arrayidx32.us = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 0
%11 = load i32, ptr %arrayidx32.us, align 4, !tbaa !5
%cmp33.us = icmp eq i32 %11, 0
br i1 %cmp33.us, label %if.then.us, label %for.inc47.us
if.then.us: ; preds = %for.body28.us.preheader
%call36.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 1)
br label %for.inc47.us
for.inc47.us: ; preds = %if.then.us, %for.body28.us.preheader
%arrayidx32.us.1 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 1
%12 = load i32, ptr %arrayidx32.us.1, align 4, !tbaa !5
%cmp33.us.1 = icmp eq i32 %12, 0
br i1 %cmp33.us.1, label %if.then.us.1, label %for.inc47.us.1
if.then.us.1: ; preds = %for.inc47.us
%call36.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 2)
br label %for.inc47.us.1
for.inc47.us.1: ; preds = %if.then.us.1, %for.inc47.us
%arrayidx32.us.2 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 2
%13 = load i32, ptr %arrayidx32.us.2, align 4, !tbaa !5
%cmp33.us.2 = icmp eq i32 %13, 0
br i1 %cmp33.us.2, label %if.then.us.2, label %for.inc47.us.2
if.then.us.2: ; preds = %for.inc47.us.1
%call36.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 3)
br label %for.inc47.us.2
for.inc47.us.2: ; preds = %if.then.us.2, %for.inc47.us.1
%arrayidx32.us.3 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 3
%14 = load i32, ptr %arrayidx32.us.3, align 4, !tbaa !5
%cmp33.us.3 = icmp eq i32 %14, 0
br i1 %cmp33.us.3, label %if.then.us.3, label %for.inc47.us.3
if.then.us.3: ; preds = %for.inc47.us.2
%call36.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 4)
br label %for.inc47.us.3
for.inc47.us.3: ; preds = %if.then.us.3, %for.inc47.us.2
%arrayidx32.us.4 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 4
%15 = load i32, ptr %arrayidx32.us.4, align 4, !tbaa !5
%cmp33.us.4 = icmp eq i32 %15, 0
br i1 %cmp33.us.4, label %if.then.us.4, label %for.inc47.us.4
if.then.us.4: ; preds = %for.inc47.us.3
%call36.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 5)
br label %for.inc47.us.4
for.inc47.us.4: ; preds = %if.then.us.4, %for.inc47.us.3
%arrayidx32.us.5 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 5
%16 = load i32, ptr %arrayidx32.us.5, align 4, !tbaa !5
%cmp33.us.5 = icmp eq i32 %16, 0
br i1 %cmp33.us.5, label %if.then.us.5, label %for.inc47.us.5
if.then.us.5: ; preds = %for.inc47.us.4
%call36.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 6)
br label %for.inc47.us.5
for.inc47.us.5: ; preds = %if.then.us.5, %for.inc47.us.4
%arrayidx32.us.6 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 6
%17 = load i32, ptr %arrayidx32.us.6, align 4, !tbaa !5
%cmp33.us.6 = icmp eq i32 %17, 0
br i1 %cmp33.us.6, label %if.then.us.6, label %for.inc47.us.6
if.then.us.6: ; preds = %for.inc47.us.5
%call36.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 7)
br label %for.inc47.us.6
for.inc47.us.6: ; preds = %if.then.us.6, %for.inc47.us.5
%arrayidx32.us.7 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 7
%18 = load i32, ptr %arrayidx32.us.7, align 4, !tbaa !5
%cmp33.us.7 = icmp eq i32 %18, 0
br i1 %cmp33.us.7, label %if.then.us.7, label %for.inc47.us.7
if.then.us.7: ; preds = %for.inc47.us.6
%call36.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 8)
br label %for.inc47.us.7
for.inc47.us.7: ; preds = %if.then.us.7, %for.inc47.us.6
%arrayidx32.us.8 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 8
%19 = load i32, ptr %arrayidx32.us.8, align 4, !tbaa !5
%cmp33.us.8 = icmp eq i32 %19, 0
br i1 %cmp33.us.8, label %if.then.us.8, label %for.inc47.us.8
if.then.us.8: ; preds = %for.inc47.us.7
%call36.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 9)
br label %for.inc47.us.8
for.inc47.us.8: ; preds = %if.then.us.8, %for.inc47.us.7
%arrayidx32.us.9 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 9
%20 = load i32, ptr %arrayidx32.us.9, align 4, !tbaa !5
%cmp33.us.9 = icmp eq i32 %20, 0
br i1 %cmp33.us.9, label %if.then.us.9, label %for.inc47.us.9
if.then.us.9: ; preds = %for.inc47.us.8
%call36.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 10)
br label %for.inc47.us.9
for.inc47.us.9: ; preds = %if.then.us.9, %for.inc47.us.8
%arrayidx32.us.10 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 10
%21 = load i32, ptr %arrayidx32.us.10, align 4, !tbaa !5
%cmp33.us.10 = icmp eq i32 %21, 0
br i1 %cmp33.us.10, label %if.then.us.10, label %for.inc47.us.10
if.then.us.10: ; preds = %for.inc47.us.9
%call36.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 11)
br label %for.inc47.us.10
for.inc47.us.10: ; preds = %if.then.us.10, %for.inc47.us.9
%arrayidx32.us.11 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 11
%22 = load i32, ptr %arrayidx32.us.11, align 4, !tbaa !5
%cmp33.us.11 = icmp eq i32 %22, 0
br i1 %cmp33.us.11, label %if.then.us.11, label %for.inc47.us.11
if.then.us.11: ; preds = %for.inc47.us.10
%call36.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 12)
br label %for.inc47.us.11
for.inc47.us.11: ; preds = %if.then.us.11, %for.inc47.us.10
%arrayidx32.us.12 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 12
%23 = load i32, ptr %arrayidx32.us.12, align 4, !tbaa !5
%cmp33.us.12 = icmp eq i32 %23, 0
br i1 %cmp33.us.12, label %for.inc50.sink.split, label %for.inc50
if.then.us73: ; preds = %for.body28.us68.preheader
%call39.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1)
br label %for.inc47.us74
for.inc47.us74: ; preds = %if.then.us73, %for.body28.us68.preheader
%arrayidx32.us71.1 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 1
%24 = load i32, ptr %arrayidx32.us71.1, align 4, !tbaa !5
%cmp33.us72.1 = icmp eq i32 %24, 0
br i1 %cmp33.us72.1, label %if.then.us73.1, label %for.inc47.us74.1
if.then.us73.1: ; preds = %for.inc47.us74
%call39.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 2)
br label %for.inc47.us74.1
for.inc47.us74.1: ; preds = %if.then.us73.1, %for.inc47.us74
%arrayidx32.us71.2 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 2
%25 = load i32, ptr %arrayidx32.us71.2, align 4, !tbaa !5
%cmp33.us72.2 = icmp eq i32 %25, 0
br i1 %cmp33.us72.2, label %if.then.us73.2, label %for.inc47.us74.2
if.then.us73.2: ; preds = %for.inc47.us74.1
%call39.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 3)
br label %for.inc47.us74.2
for.inc47.us74.2: ; preds = %if.then.us73.2, %for.inc47.us74.1
%arrayidx32.us71.3 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 3
%26 = load i32, ptr %arrayidx32.us71.3, align 4, !tbaa !5
%cmp33.us72.3 = icmp eq i32 %26, 0
br i1 %cmp33.us72.3, label %if.then.us73.3, label %for.inc47.us74.3
if.then.us73.3: ; preds = %for.inc47.us74.2
%call39.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 4)
br label %for.inc47.us74.3
for.inc47.us74.3: ; preds = %if.then.us73.3, %for.inc47.us74.2
%arrayidx32.us71.4 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 4
%27 = load i32, ptr %arrayidx32.us71.4, align 4, !tbaa !5
%cmp33.us72.4 = icmp eq i32 %27, 0
br i1 %cmp33.us72.4, label %if.then.us73.4, label %for.inc47.us74.4
if.then.us73.4: ; preds = %for.inc47.us74.3
%call39.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 5)
br label %for.inc47.us74.4
for.inc47.us74.4: ; preds = %if.then.us73.4, %for.inc47.us74.3
%arrayidx32.us71.5 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 5
%28 = load i32, ptr %arrayidx32.us71.5, align 4, !tbaa !5
%cmp33.us72.5 = icmp eq i32 %28, 0
br i1 %cmp33.us72.5, label %if.then.us73.5, label %for.inc47.us74.5
if.then.us73.5: ; preds = %for.inc47.us74.4
%call39.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 6)
br label %for.inc47.us74.5
for.inc47.us74.5: ; preds = %if.then.us73.5, %for.inc47.us74.4
%arrayidx32.us71.6 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 6
%29 = load i32, ptr %arrayidx32.us71.6, align 4, !tbaa !5
%cmp33.us72.6 = icmp eq i32 %29, 0
br i1 %cmp33.us72.6, label %if.then.us73.6, label %for.inc47.us74.6
if.then.us73.6: ; preds = %for.inc47.us74.5
%call39.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 7)
br label %for.inc47.us74.6
for.inc47.us74.6: ; preds = %if.then.us73.6, %for.inc47.us74.5
%arrayidx32.us71.7 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 7
%30 = load i32, ptr %arrayidx32.us71.7, align 4, !tbaa !5
%cmp33.us72.7 = icmp eq i32 %30, 0
br i1 %cmp33.us72.7, label %if.then.us73.7, label %for.inc47.us74.7
if.then.us73.7: ; preds = %for.inc47.us74.6
%call39.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 8)
br label %for.inc47.us74.7
for.inc47.us74.7: ; preds = %if.then.us73.7, %for.inc47.us74.6
%arrayidx32.us71.8 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 8
%31 = load i32, ptr %arrayidx32.us71.8, align 4, !tbaa !5
%cmp33.us72.8 = icmp eq i32 %31, 0
br i1 %cmp33.us72.8, label %if.then.us73.8, label %for.inc47.us74.8
if.then.us73.8: ; preds = %for.inc47.us74.7
%call39.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 9)
br label %for.inc47.us74.8
for.inc47.us74.8: ; preds = %if.then.us73.8, %for.inc47.us74.7
%arrayidx32.us71.9 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 9
%32 = load i32, ptr %arrayidx32.us71.9, align 4, !tbaa !5
%cmp33.us72.9 = icmp eq i32 %32, 0
br i1 %cmp33.us72.9, label %if.then.us73.9, label %for.inc47.us74.9
if.then.us73.9: ; preds = %for.inc47.us74.8
%call39.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 10)
br label %for.inc47.us74.9
for.inc47.us74.9: ; preds = %if.then.us73.9, %for.inc47.us74.8
%arrayidx32.us71.10 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 10
%33 = load i32, ptr %arrayidx32.us71.10, align 4, !tbaa !5
%cmp33.us72.10 = icmp eq i32 %33, 0
br i1 %cmp33.us72.10, label %if.then.us73.10, label %for.inc47.us74.10
if.then.us73.10: ; preds = %for.inc47.us74.9
%call39.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 11)
br label %for.inc47.us74.10
for.inc47.us74.10: ; preds = %if.then.us73.10, %for.inc47.us74.9
%arrayidx32.us71.11 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 11
%34 = load i32, ptr %arrayidx32.us71.11, align 4, !tbaa !5
%cmp33.us72.11 = icmp eq i32 %34, 0
br i1 %cmp33.us72.11, label %if.then.us73.11, label %for.inc47.us74.11
if.then.us73.11: ; preds = %for.inc47.us74.10
%call39.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 12)
br label %for.inc47.us74.11
for.inc47.us74.11: ; preds = %if.then.us73.11, %for.inc47.us74.10
%arrayidx32.us71.12 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 12
%35 = load i32, ptr %arrayidx32.us71.12, align 4, !tbaa !5
%cmp33.us72.12 = icmp eq i32 %35, 0
br i1 %cmp33.us72.12, label %for.inc50.sink.split, label %for.inc50
if.then.us83: ; preds = %for.body28.us78.preheader
%call42.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 1)
br label %for.inc47.us84
for.inc47.us84: ; preds = %if.then.us83, %for.body28.us78.preheader
%arrayidx32.us81.1 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 1
%36 = load i32, ptr %arrayidx32.us81.1, align 4, !tbaa !5
%cmp33.us82.1 = icmp eq i32 %36, 0
br i1 %cmp33.us82.1, label %if.then.us83.1, label %for.inc47.us84.1
if.then.us83.1: ; preds = %for.inc47.us84
%call42.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 2)
br label %for.inc47.us84.1
for.inc47.us84.1: ; preds = %if.then.us83.1, %for.inc47.us84
%arrayidx32.us81.2 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 2
%37 = load i32, ptr %arrayidx32.us81.2, align 4, !tbaa !5
%cmp33.us82.2 = icmp eq i32 %37, 0
br i1 %cmp33.us82.2, label %if.then.us83.2, label %for.inc47.us84.2
if.then.us83.2: ; preds = %for.inc47.us84.1
%call42.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 3)
br label %for.inc47.us84.2
for.inc47.us84.2: ; preds = %if.then.us83.2, %for.inc47.us84.1
%arrayidx32.us81.3 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 3
%38 = load i32, ptr %arrayidx32.us81.3, align 4, !tbaa !5
%cmp33.us82.3 = icmp eq i32 %38, 0
br i1 %cmp33.us82.3, label %if.then.us83.3, label %for.inc47.us84.3
if.then.us83.3: ; preds = %for.inc47.us84.2
%call42.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 4)
br label %for.inc47.us84.3
for.inc47.us84.3: ; preds = %if.then.us83.3, %for.inc47.us84.2
%arrayidx32.us81.4 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 4
%39 = load i32, ptr %arrayidx32.us81.4, align 4, !tbaa !5
%cmp33.us82.4 = icmp eq i32 %39, 0
br i1 %cmp33.us82.4, label %if.then.us83.4, label %for.inc47.us84.4
if.then.us83.4: ; preds = %for.inc47.us84.3
%call42.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 5)
br label %for.inc47.us84.4
for.inc47.us84.4: ; preds = %if.then.us83.4, %for.inc47.us84.3
%arrayidx32.us81.5 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 5
%40 = load i32, ptr %arrayidx32.us81.5, align 4, !tbaa !5
%cmp33.us82.5 = icmp eq i32 %40, 0
br i1 %cmp33.us82.5, label %if.then.us83.5, label %for.inc47.us84.5
if.then.us83.5: ; preds = %for.inc47.us84.4
%call42.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 6)
br label %for.inc47.us84.5
for.inc47.us84.5: ; preds = %if.then.us83.5, %for.inc47.us84.4
%arrayidx32.us81.6 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 6
%41 = load i32, ptr %arrayidx32.us81.6, align 4, !tbaa !5
%cmp33.us82.6 = icmp eq i32 %41, 0
br i1 %cmp33.us82.6, label %if.then.us83.6, label %for.inc47.us84.6
if.then.us83.6: ; preds = %for.inc47.us84.5
%call42.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 7)
br label %for.inc47.us84.6
for.inc47.us84.6: ; preds = %if.then.us83.6, %for.inc47.us84.5
%arrayidx32.us81.7 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 7
%42 = load i32, ptr %arrayidx32.us81.7, align 4, !tbaa !5
%cmp33.us82.7 = icmp eq i32 %42, 0
br i1 %cmp33.us82.7, label %if.then.us83.7, label %for.inc47.us84.7
if.then.us83.7: ; preds = %for.inc47.us84.6
%call42.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 8)
br label %for.inc47.us84.7
for.inc47.us84.7: ; preds = %if.then.us83.7, %for.inc47.us84.6
%arrayidx32.us81.8 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 8
%43 = load i32, ptr %arrayidx32.us81.8, align 4, !tbaa !5
%cmp33.us82.8 = icmp eq i32 %43, 0
br i1 %cmp33.us82.8, label %if.then.us83.8, label %for.inc47.us84.8
if.then.us83.8: ; preds = %for.inc47.us84.7
%call42.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 9)
br label %for.inc47.us84.8
for.inc47.us84.8: ; preds = %if.then.us83.8, %for.inc47.us84.7
%arrayidx32.us81.9 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 9
%44 = load i32, ptr %arrayidx32.us81.9, align 4, !tbaa !5
%cmp33.us82.9 = icmp eq i32 %44, 0
br i1 %cmp33.us82.9, label %if.then.us83.9, label %for.inc47.us84.9
if.then.us83.9: ; preds = %for.inc47.us84.8
%call42.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 10)
br label %for.inc47.us84.9
for.inc47.us84.9: ; preds = %if.then.us83.9, %for.inc47.us84.8
%arrayidx32.us81.10 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 10
%45 = load i32, ptr %arrayidx32.us81.10, align 4, !tbaa !5
%cmp33.us82.10 = icmp eq i32 %45, 0
br i1 %cmp33.us82.10, label %if.then.us83.10, label %for.inc47.us84.10
if.then.us83.10: ; preds = %for.inc47.us84.9
%call42.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 11)
br label %for.inc47.us84.10
for.inc47.us84.10: ; preds = %if.then.us83.10, %for.inc47.us84.9
%arrayidx32.us81.11 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 11
%46 = load i32, ptr %arrayidx32.us81.11, align 4, !tbaa !5
%cmp33.us82.11 = icmp eq i32 %46, 0
br i1 %cmp33.us82.11, label %if.then.us83.11, label %for.inc47.us84.11
if.then.us83.11: ; preds = %for.inc47.us84.10
%call42.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 12)
br label %for.inc47.us84.11
for.inc47.us84.11: ; preds = %if.then.us83.11, %for.inc47.us84.10
%arrayidx32.us81.12 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 12
%47 = load i32, ptr %arrayidx32.us81.12, align 4, !tbaa !5
%cmp33.us82.12 = icmp eq i32 %47, 0
br i1 %cmp33.us82.12, label %for.inc50.sink.split, label %for.inc50
if.then.us93: ; preds = %for.body28.us88.preheader
%call45.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 1)
br label %for.inc47.us94
for.inc47.us94: ; preds = %if.then.us93, %for.body28.us88.preheader
%arrayidx32.us91.1 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 1
%48 = load i32, ptr %arrayidx32.us91.1, align 4, !tbaa !5
%cmp33.us92.1 = icmp eq i32 %48, 0
br i1 %cmp33.us92.1, label %if.then.us93.1, label %for.inc47.us94.1
if.then.us93.1: ; preds = %for.inc47.us94
%call45.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 2)
br label %for.inc47.us94.1
for.inc47.us94.1: ; preds = %if.then.us93.1, %for.inc47.us94
%arrayidx32.us91.2 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 2
%49 = load i32, ptr %arrayidx32.us91.2, align 4, !tbaa !5
%cmp33.us92.2 = icmp eq i32 %49, 0
br i1 %cmp33.us92.2, label %if.then.us93.2, label %for.inc47.us94.2
if.then.us93.2: ; preds = %for.inc47.us94.1
%call45.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 3)
br label %for.inc47.us94.2
for.inc47.us94.2: ; preds = %if.then.us93.2, %for.inc47.us94.1
%arrayidx32.us91.3 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 3
%50 = load i32, ptr %arrayidx32.us91.3, align 4, !tbaa !5
%cmp33.us92.3 = icmp eq i32 %50, 0
br i1 %cmp33.us92.3, label %if.then.us93.3, label %for.inc47.us94.3
if.then.us93.3: ; preds = %for.inc47.us94.2
%call45.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 4)
br label %for.inc47.us94.3
for.inc47.us94.3: ; preds = %if.then.us93.3, %for.inc47.us94.2
%arrayidx32.us91.4 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 4
%51 = load i32, ptr %arrayidx32.us91.4, align 4, !tbaa !5
%cmp33.us92.4 = icmp eq i32 %51, 0
br i1 %cmp33.us92.4, label %if.then.us93.4, label %for.inc47.us94.4
if.then.us93.4: ; preds = %for.inc47.us94.3
%call45.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 5)
br label %for.inc47.us94.4
for.inc47.us94.4: ; preds = %if.then.us93.4, %for.inc47.us94.3
%arrayidx32.us91.5 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 5
%52 = load i32, ptr %arrayidx32.us91.5, align 4, !tbaa !5
%cmp33.us92.5 = icmp eq i32 %52, 0
br i1 %cmp33.us92.5, label %if.then.us93.5, label %for.inc47.us94.5
if.then.us93.5: ; preds = %for.inc47.us94.4
%call45.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 6)
br label %for.inc47.us94.5
for.inc47.us94.5: ; preds = %if.then.us93.5, %for.inc47.us94.4
%arrayidx32.us91.6 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 6
%53 = load i32, ptr %arrayidx32.us91.6, align 4, !tbaa !5
%cmp33.us92.6 = icmp eq i32 %53, 0
br i1 %cmp33.us92.6, label %if.then.us93.6, label %for.inc47.us94.6
if.then.us93.6: ; preds = %for.inc47.us94.5
%call45.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 7)
br label %for.inc47.us94.6
for.inc47.us94.6: ; preds = %if.then.us93.6, %for.inc47.us94.5
%arrayidx32.us91.7 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 7
%54 = load i32, ptr %arrayidx32.us91.7, align 4, !tbaa !5
%cmp33.us92.7 = icmp eq i32 %54, 0
br i1 %cmp33.us92.7, label %if.then.us93.7, label %for.inc47.us94.7
if.then.us93.7: ; preds = %for.inc47.us94.6
%call45.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 8)
br label %for.inc47.us94.7
for.inc47.us94.7: ; preds = %if.then.us93.7, %for.inc47.us94.6
%arrayidx32.us91.8 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 8
%55 = load i32, ptr %arrayidx32.us91.8, align 4, !tbaa !5
%cmp33.us92.8 = icmp eq i32 %55, 0
br i1 %cmp33.us92.8, label %if.then.us93.8, label %for.inc47.us94.8
if.then.us93.8: ; preds = %for.inc47.us94.7
%call45.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 9)
br label %for.inc47.us94.8
for.inc47.us94.8: ; preds = %if.then.us93.8, %for.inc47.us94.7
%arrayidx32.us91.9 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 9
%56 = load i32, ptr %arrayidx32.us91.9, align 4, !tbaa !5
%cmp33.us92.9 = icmp eq i32 %56, 0
br i1 %cmp33.us92.9, label %if.then.us93.9, label %for.inc47.us94.9
if.then.us93.9: ; preds = %for.inc47.us94.8
%call45.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 10)
br label %for.inc47.us94.9
for.inc47.us94.9: ; preds = %if.then.us93.9, %for.inc47.us94.8
%arrayidx32.us91.10 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 10
%57 = load i32, ptr %arrayidx32.us91.10, align 4, !tbaa !5
%cmp33.us92.10 = icmp eq i32 %57, 0
br i1 %cmp33.us92.10, label %if.then.us93.10, label %for.inc47.us94.10
if.then.us93.10: ; preds = %for.inc47.us94.9
%call45.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 11)
br label %for.inc47.us94.10
for.inc47.us94.10: ; preds = %if.then.us93.10, %for.inc47.us94.9
%arrayidx32.us91.11 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 11
%58 = load i32, ptr %arrayidx32.us91.11, align 4, !tbaa !5
%cmp33.us92.11 = icmp eq i32 %58, 0
br i1 %cmp33.us92.11, label %if.then.us93.11, label %for.inc47.us94.11
if.then.us93.11: ; preds = %for.inc47.us94.10
%call45.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 12)
br label %for.inc47.us94.11
for.inc47.us94.11: ; preds = %if.then.us93.11, %for.inc47.us94.10
%arrayidx32.us91.12 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 12
%59 = load i32, ptr %arrayidx32.us91.12, align 4, !tbaa !5
%cmp33.us92.12 = icmp eq i32 %59, 0
br i1 %cmp33.us92.12, label %for.inc50.sink.split, label %for.inc50
for.inc50.sink.split: ; preds = %for.inc47.us94.11, %for.inc47.us84.11, %for.inc47.us74.11, %for.inc47.us.11
%.str.7.sink = phi ptr [ @.str.4, %for.inc47.us.11 ], [ @.str.5, %for.inc47.us74.11 ], [ @.str.6, %for.inc47.us84.11 ], [ @.str.7, %for.inc47.us94.11 ]
%call45.us.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.7.sink, i32 noundef 13)
br label %for.inc50
for.inc50: ; preds = %for.inc50.sink.split, %for.inc47.us94.11, %for.inc47.us84.11, %for.inc47.us74.11, %for.inc47.us.11, %for.cond25.preheader
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4
br i1 %exitcond.not, label %for.end52, label %for.cond25.preheader, !llvm.loop !12
for.end52: ; preds = %for.inc50
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %count) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %number) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %design) #4
call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %cards) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
int main(void)
{
int n, i, a;
int S[14] = {0}, H[14] = {0}, C[14] = {0}, D[14] = {0};
char c;
scanf("%d",&n);
for(i = 1;i <= n;i++)
{
getchar();
scanf("%c%d",&c,&a);
if(c=='S')
{
S[a] = 1;
}
if(c == 'H')
{
H[a] = 1;
}
if(c == 'C')
{
C[a] = 1;
}
if(c == 'D')
{
D[a] = 1;
}
}
for(a = 1;a<=13;a++)
{
if(S[a]==0)
{
printf("S %d\n", a);
}
}
for(a = 1;a<=13;a++)
{
if(H[a]==0)
{
printf("H %d\n",a);
}
}
for(a = 1;a<=13;a++)
{ if(C[a]==0)
{
printf("C %d\n",a);
}
}
for(a = 1;a<=13;a++)
{
if(D[a]==0)
{
printf("D %d\n",a);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271768/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271768/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%c%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"S %d\0A\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"H %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"C %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"D %d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%S = alloca [14 x i32], align 16
%H = alloca [14 x i32], align 16
%C = alloca [14 x i32], align 16
%D = alloca [14 x i32], align 16
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %S) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(56) %S, i8 0, i64 56, i1 false)
call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %H) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(56) %H, i8 0, i64 56, i1 false)
call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %C) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(56) %C, i8 0, i64 56, i1 false)
call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %D) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(56) %D, i8 0, i64 56, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not92 = icmp slt i32 %0, 1
br i1 %cmp.not92, label %for.cond26.preheader, label %for.body
for.cond26.preheader: ; preds = %for.inc, %entry
store i32 1, ptr %a, align 4, !tbaa !5
br label %for.body29
for.body: ; preds = %entry, %for.inc
%i.093 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%1 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i = call i32 @getc(ptr noundef %1)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c, ptr noundef nonnull %a)
%2 = load i8, ptr %c, align 1, !tbaa !11
switch i8 %2, label %for.inc [
i8 83, label %for.inc.sink.split
i8 72, label %if.then8
i8 67, label %if.then15
i8 68, label %if.then22
]
if.then8: ; preds = %for.body
br label %for.inc.sink.split
if.then15: ; preds = %for.body
br label %for.inc.sink.split
if.then22: ; preds = %for.body
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %for.body, %if.then22, %if.then15, %if.then8
%H.sink = phi ptr [ %H, %if.then8 ], [ %C, %if.then15 ], [ %D, %if.then22 ], [ %S, %for.body ]
%.sink = load i32, ptr %a, align 4, !tbaa !5
%idxprom9 = sext i32 %.sink to i64
%arrayidx10 = getelementptr inbounds [14 x i32], ptr %H.sink, i64 0, i64 %idxprom9
store i32 1, ptr %arrayidx10, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%inc = add nuw nsw i32 %i.093, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.093, %3
br i1 %cmp.not.not, label %for.body, label %for.cond26.preheader, !llvm.loop !12
for.cond40.preheader: ; preds = %for.inc37
store i32 1, ptr %a, align 4, !tbaa !5
br label %for.body43
for.body29: ; preds = %for.cond26.preheader, %for.inc37
%storemerge94 = phi i32 [ 1, %for.cond26.preheader ], [ %inc38, %for.inc37 ]
%idxprom30 = sext i32 %storemerge94 to i64
%arrayidx31 = getelementptr inbounds [14 x i32], ptr %S, i64 0, i64 %idxprom30
%4 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%cmp32 = icmp eq i32 %4, 0
br i1 %cmp32, label %if.then34, label %for.inc37
if.then34: ; preds = %for.body29
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %storemerge94)
%.pre = load i32, ptr %a, align 4, !tbaa !5
br label %for.inc37
for.inc37: ; preds = %for.body29, %if.then34
%5 = phi i32 [ %storemerge94, %for.body29 ], [ %.pre, %if.then34 ]
%inc38 = add nsw i32 %5, 1
store i32 %inc38, ptr %a, align 4, !tbaa !5
%cmp27 = icmp slt i32 %5, 13
br i1 %cmp27, label %for.body29, label %for.cond40.preheader, !llvm.loop !14
for.cond54.preheader: ; preds = %for.inc51
store i32 1, ptr %a, align 4, !tbaa !5
br label %for.body57
for.body43: ; preds = %for.cond40.preheader, %for.inc51
%storemerge8695 = phi i32 [ 1, %for.cond40.preheader ], [ %inc52, %for.inc51 ]
%idxprom44 = sext i32 %storemerge8695 to i64
%arrayidx45 = getelementptr inbounds [14 x i32], ptr %H, i64 0, i64 %idxprom44
%6 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%cmp46 = icmp eq i32 %6, 0
br i1 %cmp46, label %if.then48, label %for.inc51
if.then48: ; preds = %for.body43
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %storemerge8695)
%.pre98 = load i32, ptr %a, align 4, !tbaa !5
br label %for.inc51
for.inc51: ; preds = %for.body43, %if.then48
%7 = phi i32 [ %storemerge8695, %for.body43 ], [ %.pre98, %if.then48 ]
%inc52 = add nsw i32 %7, 1
store i32 %inc52, ptr %a, align 4, !tbaa !5
%cmp41 = icmp slt i32 %7, 13
br i1 %cmp41, label %for.body43, label %for.cond54.preheader, !llvm.loop !15
for.cond68.preheader: ; preds = %for.inc65
store i32 1, ptr %a, align 4, !tbaa !5
br label %for.body71
for.body57: ; preds = %for.cond54.preheader, %for.inc65
%storemerge8796 = phi i32 [ 1, %for.cond54.preheader ], [ %inc66, %for.inc65 ]
%idxprom58 = sext i32 %storemerge8796 to i64
%arrayidx59 = getelementptr inbounds [14 x i32], ptr %C, i64 0, i64 %idxprom58
%8 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%cmp60 = icmp eq i32 %8, 0
br i1 %cmp60, label %if.then62, label %for.inc65
if.then62: ; preds = %for.body57
%call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %storemerge8796)
%.pre99 = load i32, ptr %a, align 4, !tbaa !5
br label %for.inc65
for.inc65: ; preds = %for.body57, %if.then62
%9 = phi i32 [ %storemerge8796, %for.body57 ], [ %.pre99, %if.then62 ]
%inc66 = add nsw i32 %9, 1
store i32 %inc66, ptr %a, align 4, !tbaa !5
%cmp55 = icmp slt i32 %9, 13
br i1 %cmp55, label %for.body57, label %for.cond68.preheader, !llvm.loop !16
for.body71: ; preds = %for.cond68.preheader, %for.inc79
%storemerge8897 = phi i32 [ 1, %for.cond68.preheader ], [ %inc80, %for.inc79 ]
%idxprom72 = sext i32 %storemerge8897 to i64
%arrayidx73 = getelementptr inbounds [14 x i32], ptr %D, i64 0, i64 %idxprom72
%10 = load i32, ptr %arrayidx73, align 4, !tbaa !5
%cmp74 = icmp eq i32 %10, 0
br i1 %cmp74, label %if.then76, label %for.inc79
if.then76: ; preds = %for.body71
%call77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %storemerge8897)
%.pre100 = load i32, ptr %a, align 4, !tbaa !5
br label %for.inc79
for.inc79: ; preds = %for.body71, %if.then76
%11 = phi i32 [ %storemerge8897, %for.body71 ], [ %.pre100, %if.then76 ]
%inc80 = add nsw i32 %11, 1
store i32 %inc80, ptr %a, align 4, !tbaa !5
%cmp69 = icmp slt i32 %11, 13
br i1 %cmp69, label %for.body71, label %for.end81, !llvm.loop !17
for.end81: ; preds = %for.inc79
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %D) #4
call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %H) #4
call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
|
#include <stdio.h>
int main()
{
int card[4][13] = {0};
int n, m;
int i, j;
char mark;
scanf("%d", &n);
for(i=0; i<n; i++)
{
scanf("%*c%c %d", &mark, &m);
switch(mark)
{
case 'S': card[0][m-1] = 1; break;
case 'H': card[1][m-1] = 1; break;
case 'C': card[2][m-1] = 1; break;
case 'D': card[3][m-1] = 1; break;
}
}
for(i=0; i<4; i++)
{
for(j=0; j<13; j++)
{
if(card[i][j] != 1)
{
switch(i)
{
case 0: printf("S %d\n", j+1); break;
case 1: printf("H %d\n", j+1); break;
case 2: printf("C %d\n", j+1); break;
case 3: printf("D %d\n", j+1); break;
}
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271810/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271810/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%*c%c %d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"S %d\0A\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"H %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"C %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"D %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%card = alloca [4 x [13 x i32]], align 16
%n = alloca i32, align 4
%m = alloca i32, align 4
%mark = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %card) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %card, i8 0, i64 208, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %mark) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp61 = icmp sgt i32 %0, 0
br i1 %cmp61, label %for.body, label %for.cond22.preheader.preheader
for.body: ; preds = %entry, %for.inc
%i.062 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %mark, ptr noundef nonnull %m)
%1 = load i8, ptr %mark, align 1, !tbaa !9
%conv = sext i8 %1 to i32
switch i32 %conv, label %for.inc [
i32 83, label %sw.bb
i32 72, label %sw.bb3
i32 67, label %sw.bb8
i32 68, label %sw.bb13
]
sw.bb: ; preds = %for.body
%2 = load i32, ptr %m, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom = sext i32 %sub to i64
%arrayidx2 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 %idxprom
br label %for.inc.sink.split
sw.bb3: ; preds = %for.body
%3 = load i32, ptr %m, align 4, !tbaa !5
%sub5 = add nsw i32 %3, -1
%idxprom6 = sext i32 %sub5 to i64
%arrayidx7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 %idxprom6
br label %for.inc.sink.split
sw.bb8: ; preds = %for.body
%4 = load i32, ptr %m, align 4, !tbaa !5
%sub10 = add nsw i32 %4, -1
%idxprom11 = sext i32 %sub10 to i64
%arrayidx12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 %idxprom11
br label %for.inc.sink.split
sw.bb13: ; preds = %for.body
%5 = load i32, ptr %m, align 4, !tbaa !5
%sub15 = add nsw i32 %5, -1
%idxprom16 = sext i32 %sub15 to i64
%arrayidx17 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 %idxprom16
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %sw.bb13, %sw.bb8, %sw.bb3, %sw.bb
%arrayidx2.sink = phi ptr [ %arrayidx2, %sw.bb ], [ %arrayidx7, %sw.bb3 ], [ %arrayidx12, %sw.bb8 ], [ %arrayidx17, %sw.bb13 ]
store i32 1, ptr %arrayidx2.sink, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%inc = add nuw nsw i32 %i.062, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %6
br i1 %cmp, label %for.body, label %for.cond22.preheader.preheader, !llvm.loop !10
for.cond22.preheader.preheader: ; preds = %for.inc, %entry
br label %for.cond22.preheader
for.cond22.preheader: ; preds = %for.cond22.preheader.preheader, %for.inc47
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc47 ], [ 0, %for.cond22.preheader.preheader ]
%7 = trunc i64 %indvars.iv to i32
switch i32 %7, label %for.inc47 [
i32 0, label %for.body25.us.preheader
i32 1, label %for.body25.us65.preheader
i32 2, label %for.body25.us75.preheader
i32 3, label %for.body25.us85.preheader
]
for.body25.us85.preheader: ; preds = %for.cond22.preheader
%arrayidx29.us88 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 0
%8 = load i32, ptr %arrayidx29.us88, align 4, !tbaa !5
%cmp30.not.us89 = icmp eq i32 %8, 1
br i1 %cmp30.not.us89, label %for.inc44.us91, label %if.then.us90
for.body25.us75.preheader: ; preds = %for.cond22.preheader
%arrayidx29.us78 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 0
%9 = load i32, ptr %arrayidx29.us78, align 4, !tbaa !5
%cmp30.not.us79 = icmp eq i32 %9, 1
br i1 %cmp30.not.us79, label %for.inc44.us81, label %if.then.us80
for.body25.us65.preheader: ; preds = %for.cond22.preheader
%arrayidx29.us68 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 0
%10 = load i32, ptr %arrayidx29.us68, align 4, !tbaa !5
%cmp30.not.us69 = icmp eq i32 %10, 1
br i1 %cmp30.not.us69, label %for.inc44.us71, label %if.then.us70
for.body25.us.preheader: ; preds = %for.cond22.preheader
%arrayidx29.us = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 0
%11 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5
%cmp30.not.us = icmp eq i32 %11, 1
br i1 %cmp30.not.us, label %for.inc44.us, label %if.then.us
if.then.us: ; preds = %for.body25.us.preheader
%call33.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
br label %for.inc44.us
for.inc44.us: ; preds = %if.then.us, %for.body25.us.preheader
%arrayidx29.us.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 1
%12 = load i32, ptr %arrayidx29.us.1, align 4, !tbaa !5
%cmp30.not.us.1 = icmp eq i32 %12, 1
br i1 %cmp30.not.us.1, label %for.inc44.us.1, label %if.then.us.1
if.then.us.1: ; preds = %for.inc44.us
%call33.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2)
br label %for.inc44.us.1
for.inc44.us.1: ; preds = %if.then.us.1, %for.inc44.us
%arrayidx29.us.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 2
%13 = load i32, ptr %arrayidx29.us.2, align 4, !tbaa !5
%cmp30.not.us.2 = icmp eq i32 %13, 1
br i1 %cmp30.not.us.2, label %for.inc44.us.2, label %if.then.us.2
if.then.us.2: ; preds = %for.inc44.us.1
%call33.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3)
br label %for.inc44.us.2
for.inc44.us.2: ; preds = %if.then.us.2, %for.inc44.us.1
%arrayidx29.us.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 3
%14 = load i32, ptr %arrayidx29.us.3, align 4, !tbaa !5
%cmp30.not.us.3 = icmp eq i32 %14, 1
br i1 %cmp30.not.us.3, label %for.inc44.us.3, label %if.then.us.3
if.then.us.3: ; preds = %for.inc44.us.2
%call33.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4)
br label %for.inc44.us.3
for.inc44.us.3: ; preds = %if.then.us.3, %for.inc44.us.2
%arrayidx29.us.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 4
%15 = load i32, ptr %arrayidx29.us.4, align 4, !tbaa !5
%cmp30.not.us.4 = icmp eq i32 %15, 1
br i1 %cmp30.not.us.4, label %for.inc44.us.4, label %if.then.us.4
if.then.us.4: ; preds = %for.inc44.us.3
%call33.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 5)
br label %for.inc44.us.4
for.inc44.us.4: ; preds = %if.then.us.4, %for.inc44.us.3
%arrayidx29.us.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 5
%16 = load i32, ptr %arrayidx29.us.5, align 4, !tbaa !5
%cmp30.not.us.5 = icmp eq i32 %16, 1
br i1 %cmp30.not.us.5, label %for.inc44.us.5, label %if.then.us.5
if.then.us.5: ; preds = %for.inc44.us.4
%call33.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 6)
br label %for.inc44.us.5
for.inc44.us.5: ; preds = %if.then.us.5, %for.inc44.us.4
%arrayidx29.us.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 6
%17 = load i32, ptr %arrayidx29.us.6, align 4, !tbaa !5
%cmp30.not.us.6 = icmp eq i32 %17, 1
br i1 %cmp30.not.us.6, label %for.inc44.us.6, label %if.then.us.6
if.then.us.6: ; preds = %for.inc44.us.5
%call33.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 7)
br label %for.inc44.us.6
for.inc44.us.6: ; preds = %if.then.us.6, %for.inc44.us.5
%arrayidx29.us.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 7
%18 = load i32, ptr %arrayidx29.us.7, align 4, !tbaa !5
%cmp30.not.us.7 = icmp eq i32 %18, 1
br i1 %cmp30.not.us.7, label %for.inc44.us.7, label %if.then.us.7
if.then.us.7: ; preds = %for.inc44.us.6
%call33.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 8)
br label %for.inc44.us.7
for.inc44.us.7: ; preds = %if.then.us.7, %for.inc44.us.6
%arrayidx29.us.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 8
%19 = load i32, ptr %arrayidx29.us.8, align 4, !tbaa !5
%cmp30.not.us.8 = icmp eq i32 %19, 1
br i1 %cmp30.not.us.8, label %for.inc44.us.8, label %if.then.us.8
if.then.us.8: ; preds = %for.inc44.us.7
%call33.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 9)
br label %for.inc44.us.8
for.inc44.us.8: ; preds = %if.then.us.8, %for.inc44.us.7
%arrayidx29.us.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 9
%20 = load i32, ptr %arrayidx29.us.9, align 4, !tbaa !5
%cmp30.not.us.9 = icmp eq i32 %20, 1
br i1 %cmp30.not.us.9, label %for.inc44.us.9, label %if.then.us.9
if.then.us.9: ; preds = %for.inc44.us.8
%call33.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 10)
br label %for.inc44.us.9
for.inc44.us.9: ; preds = %if.then.us.9, %for.inc44.us.8
%arrayidx29.us.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 10
%21 = load i32, ptr %arrayidx29.us.10, align 4, !tbaa !5
%cmp30.not.us.10 = icmp eq i32 %21, 1
br i1 %cmp30.not.us.10, label %for.inc44.us.10, label %if.then.us.10
if.then.us.10: ; preds = %for.inc44.us.9
%call33.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 11)
br label %for.inc44.us.10
for.inc44.us.10: ; preds = %if.then.us.10, %for.inc44.us.9
%arrayidx29.us.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 11
%22 = load i32, ptr %arrayidx29.us.11, align 4, !tbaa !5
%cmp30.not.us.11 = icmp eq i32 %22, 1
br i1 %cmp30.not.us.11, label %for.inc44.us.11, label %if.then.us.11
if.then.us.11: ; preds = %for.inc44.us.10
%call33.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 12)
br label %for.inc44.us.11
for.inc44.us.11: ; preds = %if.then.us.11, %for.inc44.us.10
%arrayidx29.us.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 12
%23 = load i32, ptr %arrayidx29.us.12, align 4, !tbaa !5
%cmp30.not.us.12 = icmp eq i32 %23, 1
br i1 %cmp30.not.us.12, label %for.inc47, label %for.inc47.sink.split
if.then.us70: ; preds = %for.body25.us65.preheader
%call36.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1)
br label %for.inc44.us71
for.inc44.us71: ; preds = %if.then.us70, %for.body25.us65.preheader
%arrayidx29.us68.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 1
%24 = load i32, ptr %arrayidx29.us68.1, align 4, !tbaa !5
%cmp30.not.us69.1 = icmp eq i32 %24, 1
br i1 %cmp30.not.us69.1, label %for.inc44.us71.1, label %if.then.us70.1
if.then.us70.1: ; preds = %for.inc44.us71
%call36.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2)
br label %for.inc44.us71.1
for.inc44.us71.1: ; preds = %if.then.us70.1, %for.inc44.us71
%arrayidx29.us68.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 2
%25 = load i32, ptr %arrayidx29.us68.2, align 4, !tbaa !5
%cmp30.not.us69.2 = icmp eq i32 %25, 1
br i1 %cmp30.not.us69.2, label %for.inc44.us71.2, label %if.then.us70.2
if.then.us70.2: ; preds = %for.inc44.us71.1
%call36.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3)
br label %for.inc44.us71.2
for.inc44.us71.2: ; preds = %if.then.us70.2, %for.inc44.us71.1
%arrayidx29.us68.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 3
%26 = load i32, ptr %arrayidx29.us68.3, align 4, !tbaa !5
%cmp30.not.us69.3 = icmp eq i32 %26, 1
br i1 %cmp30.not.us69.3, label %for.inc44.us71.3, label %if.then.us70.3
if.then.us70.3: ; preds = %for.inc44.us71.2
%call36.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4)
br label %for.inc44.us71.3
for.inc44.us71.3: ; preds = %if.then.us70.3, %for.inc44.us71.2
%arrayidx29.us68.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 4
%27 = load i32, ptr %arrayidx29.us68.4, align 4, !tbaa !5
%cmp30.not.us69.4 = icmp eq i32 %27, 1
br i1 %cmp30.not.us69.4, label %for.inc44.us71.4, label %if.then.us70.4
if.then.us70.4: ; preds = %for.inc44.us71.3
%call36.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 5)
br label %for.inc44.us71.4
for.inc44.us71.4: ; preds = %if.then.us70.4, %for.inc44.us71.3
%arrayidx29.us68.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 5
%28 = load i32, ptr %arrayidx29.us68.5, align 4, !tbaa !5
%cmp30.not.us69.5 = icmp eq i32 %28, 1
br i1 %cmp30.not.us69.5, label %for.inc44.us71.5, label %if.then.us70.5
if.then.us70.5: ; preds = %for.inc44.us71.4
%call36.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 6)
br label %for.inc44.us71.5
for.inc44.us71.5: ; preds = %if.then.us70.5, %for.inc44.us71.4
%arrayidx29.us68.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 6
%29 = load i32, ptr %arrayidx29.us68.6, align 4, !tbaa !5
%cmp30.not.us69.6 = icmp eq i32 %29, 1
br i1 %cmp30.not.us69.6, label %for.inc44.us71.6, label %if.then.us70.6
if.then.us70.6: ; preds = %for.inc44.us71.5
%call36.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 7)
br label %for.inc44.us71.6
for.inc44.us71.6: ; preds = %if.then.us70.6, %for.inc44.us71.5
%arrayidx29.us68.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 7
%30 = load i32, ptr %arrayidx29.us68.7, align 4, !tbaa !5
%cmp30.not.us69.7 = icmp eq i32 %30, 1
br i1 %cmp30.not.us69.7, label %for.inc44.us71.7, label %if.then.us70.7
if.then.us70.7: ; preds = %for.inc44.us71.6
%call36.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 8)
br label %for.inc44.us71.7
for.inc44.us71.7: ; preds = %if.then.us70.7, %for.inc44.us71.6
%arrayidx29.us68.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 8
%31 = load i32, ptr %arrayidx29.us68.8, align 4, !tbaa !5
%cmp30.not.us69.8 = icmp eq i32 %31, 1
br i1 %cmp30.not.us69.8, label %for.inc44.us71.8, label %if.then.us70.8
if.then.us70.8: ; preds = %for.inc44.us71.7
%call36.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 9)
br label %for.inc44.us71.8
for.inc44.us71.8: ; preds = %if.then.us70.8, %for.inc44.us71.7
%arrayidx29.us68.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 9
%32 = load i32, ptr %arrayidx29.us68.9, align 4, !tbaa !5
%cmp30.not.us69.9 = icmp eq i32 %32, 1
br i1 %cmp30.not.us69.9, label %for.inc44.us71.9, label %if.then.us70.9
if.then.us70.9: ; preds = %for.inc44.us71.8
%call36.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 10)
br label %for.inc44.us71.9
for.inc44.us71.9: ; preds = %if.then.us70.9, %for.inc44.us71.8
%arrayidx29.us68.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 10
%33 = load i32, ptr %arrayidx29.us68.10, align 4, !tbaa !5
%cmp30.not.us69.10 = icmp eq i32 %33, 1
br i1 %cmp30.not.us69.10, label %for.inc44.us71.10, label %if.then.us70.10
if.then.us70.10: ; preds = %for.inc44.us71.9
%call36.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 11)
br label %for.inc44.us71.10
for.inc44.us71.10: ; preds = %if.then.us70.10, %for.inc44.us71.9
%arrayidx29.us68.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 11
%34 = load i32, ptr %arrayidx29.us68.11, align 4, !tbaa !5
%cmp30.not.us69.11 = icmp eq i32 %34, 1
br i1 %cmp30.not.us69.11, label %for.inc44.us71.11, label %if.then.us70.11
if.then.us70.11: ; preds = %for.inc44.us71.10
%call36.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 12)
br label %for.inc44.us71.11
for.inc44.us71.11: ; preds = %if.then.us70.11, %for.inc44.us71.10
%arrayidx29.us68.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 12
%35 = load i32, ptr %arrayidx29.us68.12, align 4, !tbaa !5
%cmp30.not.us69.12 = icmp eq i32 %35, 1
br i1 %cmp30.not.us69.12, label %for.inc47, label %for.inc47.sink.split
if.then.us80: ; preds = %for.body25.us75.preheader
%call39.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 1)
br label %for.inc44.us81
for.inc44.us81: ; preds = %if.then.us80, %for.body25.us75.preheader
%arrayidx29.us78.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 1
%36 = load i32, ptr %arrayidx29.us78.1, align 4, !tbaa !5
%cmp30.not.us79.1 = icmp eq i32 %36, 1
br i1 %cmp30.not.us79.1, label %for.inc44.us81.1, label %if.then.us80.1
if.then.us80.1: ; preds = %for.inc44.us81
%call39.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 2)
br label %for.inc44.us81.1
for.inc44.us81.1: ; preds = %if.then.us80.1, %for.inc44.us81
%arrayidx29.us78.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 2
%37 = load i32, ptr %arrayidx29.us78.2, align 4, !tbaa !5
%cmp30.not.us79.2 = icmp eq i32 %37, 1
br i1 %cmp30.not.us79.2, label %for.inc44.us81.2, label %if.then.us80.2
if.then.us80.2: ; preds = %for.inc44.us81.1
%call39.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 3)
br label %for.inc44.us81.2
for.inc44.us81.2: ; preds = %if.then.us80.2, %for.inc44.us81.1
%arrayidx29.us78.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 3
%38 = load i32, ptr %arrayidx29.us78.3, align 4, !tbaa !5
%cmp30.not.us79.3 = icmp eq i32 %38, 1
br i1 %cmp30.not.us79.3, label %for.inc44.us81.3, label %if.then.us80.3
if.then.us80.3: ; preds = %for.inc44.us81.2
%call39.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 4)
br label %for.inc44.us81.3
for.inc44.us81.3: ; preds = %if.then.us80.3, %for.inc44.us81.2
%arrayidx29.us78.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 4
%39 = load i32, ptr %arrayidx29.us78.4, align 4, !tbaa !5
%cmp30.not.us79.4 = icmp eq i32 %39, 1
br i1 %cmp30.not.us79.4, label %for.inc44.us81.4, label %if.then.us80.4
if.then.us80.4: ; preds = %for.inc44.us81.3
%call39.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 5)
br label %for.inc44.us81.4
for.inc44.us81.4: ; preds = %if.then.us80.4, %for.inc44.us81.3
%arrayidx29.us78.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 5
%40 = load i32, ptr %arrayidx29.us78.5, align 4, !tbaa !5
%cmp30.not.us79.5 = icmp eq i32 %40, 1
br i1 %cmp30.not.us79.5, label %for.inc44.us81.5, label %if.then.us80.5
if.then.us80.5: ; preds = %for.inc44.us81.4
%call39.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 6)
br label %for.inc44.us81.5
for.inc44.us81.5: ; preds = %if.then.us80.5, %for.inc44.us81.4
%arrayidx29.us78.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 6
%41 = load i32, ptr %arrayidx29.us78.6, align 4, !tbaa !5
%cmp30.not.us79.6 = icmp eq i32 %41, 1
br i1 %cmp30.not.us79.6, label %for.inc44.us81.6, label %if.then.us80.6
if.then.us80.6: ; preds = %for.inc44.us81.5
%call39.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 7)
br label %for.inc44.us81.6
for.inc44.us81.6: ; preds = %if.then.us80.6, %for.inc44.us81.5
%arrayidx29.us78.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 7
%42 = load i32, ptr %arrayidx29.us78.7, align 4, !tbaa !5
%cmp30.not.us79.7 = icmp eq i32 %42, 1
br i1 %cmp30.not.us79.7, label %for.inc44.us81.7, label %if.then.us80.7
if.then.us80.7: ; preds = %for.inc44.us81.6
%call39.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 8)
br label %for.inc44.us81.7
for.inc44.us81.7: ; preds = %if.then.us80.7, %for.inc44.us81.6
%arrayidx29.us78.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 8
%43 = load i32, ptr %arrayidx29.us78.8, align 4, !tbaa !5
%cmp30.not.us79.8 = icmp eq i32 %43, 1
br i1 %cmp30.not.us79.8, label %for.inc44.us81.8, label %if.then.us80.8
if.then.us80.8: ; preds = %for.inc44.us81.7
%call39.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 9)
br label %for.inc44.us81.8
for.inc44.us81.8: ; preds = %if.then.us80.8, %for.inc44.us81.7
%arrayidx29.us78.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 9
%44 = load i32, ptr %arrayidx29.us78.9, align 4, !tbaa !5
%cmp30.not.us79.9 = icmp eq i32 %44, 1
br i1 %cmp30.not.us79.9, label %for.inc44.us81.9, label %if.then.us80.9
if.then.us80.9: ; preds = %for.inc44.us81.8
%call39.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 10)
br label %for.inc44.us81.9
for.inc44.us81.9: ; preds = %if.then.us80.9, %for.inc44.us81.8
%arrayidx29.us78.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 10
%45 = load i32, ptr %arrayidx29.us78.10, align 4, !tbaa !5
%cmp30.not.us79.10 = icmp eq i32 %45, 1
br i1 %cmp30.not.us79.10, label %for.inc44.us81.10, label %if.then.us80.10
if.then.us80.10: ; preds = %for.inc44.us81.9
%call39.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 11)
br label %for.inc44.us81.10
for.inc44.us81.10: ; preds = %if.then.us80.10, %for.inc44.us81.9
%arrayidx29.us78.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 11
%46 = load i32, ptr %arrayidx29.us78.11, align 4, !tbaa !5
%cmp30.not.us79.11 = icmp eq i32 %46, 1
br i1 %cmp30.not.us79.11, label %for.inc44.us81.11, label %if.then.us80.11
if.then.us80.11: ; preds = %for.inc44.us81.10
%call39.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 12)
br label %for.inc44.us81.11
for.inc44.us81.11: ; preds = %if.then.us80.11, %for.inc44.us81.10
%arrayidx29.us78.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 12
%47 = load i32, ptr %arrayidx29.us78.12, align 4, !tbaa !5
%cmp30.not.us79.12 = icmp eq i32 %47, 1
br i1 %cmp30.not.us79.12, label %for.inc47, label %for.inc47.sink.split
if.then.us90: ; preds = %for.body25.us85.preheader
%call42.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1)
br label %for.inc44.us91
for.inc44.us91: ; preds = %if.then.us90, %for.body25.us85.preheader
%arrayidx29.us88.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 1
%48 = load i32, ptr %arrayidx29.us88.1, align 4, !tbaa !5
%cmp30.not.us89.1 = icmp eq i32 %48, 1
br i1 %cmp30.not.us89.1, label %for.inc44.us91.1, label %if.then.us90.1
if.then.us90.1: ; preds = %for.inc44.us91
%call42.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 2)
br label %for.inc44.us91.1
for.inc44.us91.1: ; preds = %if.then.us90.1, %for.inc44.us91
%arrayidx29.us88.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 2
%49 = load i32, ptr %arrayidx29.us88.2, align 4, !tbaa !5
%cmp30.not.us89.2 = icmp eq i32 %49, 1
br i1 %cmp30.not.us89.2, label %for.inc44.us91.2, label %if.then.us90.2
if.then.us90.2: ; preds = %for.inc44.us91.1
%call42.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 3)
br label %for.inc44.us91.2
for.inc44.us91.2: ; preds = %if.then.us90.2, %for.inc44.us91.1
%arrayidx29.us88.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 3
%50 = load i32, ptr %arrayidx29.us88.3, align 4, !tbaa !5
%cmp30.not.us89.3 = icmp eq i32 %50, 1
br i1 %cmp30.not.us89.3, label %for.inc44.us91.3, label %if.then.us90.3
if.then.us90.3: ; preds = %for.inc44.us91.2
%call42.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 4)
br label %for.inc44.us91.3
for.inc44.us91.3: ; preds = %if.then.us90.3, %for.inc44.us91.2
%arrayidx29.us88.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 4
%51 = load i32, ptr %arrayidx29.us88.4, align 4, !tbaa !5
%cmp30.not.us89.4 = icmp eq i32 %51, 1
br i1 %cmp30.not.us89.4, label %for.inc44.us91.4, label %if.then.us90.4
if.then.us90.4: ; preds = %for.inc44.us91.3
%call42.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 5)
br label %for.inc44.us91.4
for.inc44.us91.4: ; preds = %if.then.us90.4, %for.inc44.us91.3
%arrayidx29.us88.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 5
%52 = load i32, ptr %arrayidx29.us88.5, align 4, !tbaa !5
%cmp30.not.us89.5 = icmp eq i32 %52, 1
br i1 %cmp30.not.us89.5, label %for.inc44.us91.5, label %if.then.us90.5
if.then.us90.5: ; preds = %for.inc44.us91.4
%call42.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 6)
br label %for.inc44.us91.5
for.inc44.us91.5: ; preds = %if.then.us90.5, %for.inc44.us91.4
%arrayidx29.us88.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 6
%53 = load i32, ptr %arrayidx29.us88.6, align 4, !tbaa !5
%cmp30.not.us89.6 = icmp eq i32 %53, 1
br i1 %cmp30.not.us89.6, label %for.inc44.us91.6, label %if.then.us90.6
if.then.us90.6: ; preds = %for.inc44.us91.5
%call42.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 7)
br label %for.inc44.us91.6
for.inc44.us91.6: ; preds = %if.then.us90.6, %for.inc44.us91.5
%arrayidx29.us88.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 7
%54 = load i32, ptr %arrayidx29.us88.7, align 4, !tbaa !5
%cmp30.not.us89.7 = icmp eq i32 %54, 1
br i1 %cmp30.not.us89.7, label %for.inc44.us91.7, label %if.then.us90.7
if.then.us90.7: ; preds = %for.inc44.us91.6
%call42.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 8)
br label %for.inc44.us91.7
for.inc44.us91.7: ; preds = %if.then.us90.7, %for.inc44.us91.6
%arrayidx29.us88.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 8
%55 = load i32, ptr %arrayidx29.us88.8, align 4, !tbaa !5
%cmp30.not.us89.8 = icmp eq i32 %55, 1
br i1 %cmp30.not.us89.8, label %for.inc44.us91.8, label %if.then.us90.8
if.then.us90.8: ; preds = %for.inc44.us91.7
%call42.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 9)
br label %for.inc44.us91.8
for.inc44.us91.8: ; preds = %if.then.us90.8, %for.inc44.us91.7
%arrayidx29.us88.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 9
%56 = load i32, ptr %arrayidx29.us88.9, align 4, !tbaa !5
%cmp30.not.us89.9 = icmp eq i32 %56, 1
br i1 %cmp30.not.us89.9, label %for.inc44.us91.9, label %if.then.us90.9
if.then.us90.9: ; preds = %for.inc44.us91.8
%call42.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 10)
br label %for.inc44.us91.9
for.inc44.us91.9: ; preds = %if.then.us90.9, %for.inc44.us91.8
%arrayidx29.us88.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 10
%57 = load i32, ptr %arrayidx29.us88.10, align 4, !tbaa !5
%cmp30.not.us89.10 = icmp eq i32 %57, 1
br i1 %cmp30.not.us89.10, label %for.inc44.us91.10, label %if.then.us90.10
if.then.us90.10: ; preds = %for.inc44.us91.9
%call42.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 11)
br label %for.inc44.us91.10
for.inc44.us91.10: ; preds = %if.then.us90.10, %for.inc44.us91.9
%arrayidx29.us88.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 11
%58 = load i32, ptr %arrayidx29.us88.11, align 4, !tbaa !5
%cmp30.not.us89.11 = icmp eq i32 %58, 1
br i1 %cmp30.not.us89.11, label %for.inc44.us91.11, label %if.then.us90.11
if.then.us90.11: ; preds = %for.inc44.us91.10
%call42.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 12)
br label %for.inc44.us91.11
for.inc44.us91.11: ; preds = %if.then.us90.11, %for.inc44.us91.10
%arrayidx29.us88.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 12
%59 = load i32, ptr %arrayidx29.us88.12, align 4, !tbaa !5
%cmp30.not.us89.12 = icmp eq i32 %59, 1
br i1 %cmp30.not.us89.12, label %for.inc47, label %for.inc47.sink.split
for.inc47.sink.split: ; preds = %for.inc44.us91.11, %for.inc44.us81.11, %for.inc44.us71.11, %for.inc44.us.11
%.str.5.sink = phi ptr [ @.str.2, %for.inc44.us.11 ], [ @.str.3, %for.inc44.us71.11 ], [ @.str.4, %for.inc44.us81.11 ], [ @.str.5, %for.inc44.us91.11 ]
%call42.us.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink, i32 noundef 13)
br label %for.inc47
for.inc47: ; preds = %for.inc47.sink.split, %for.inc44.us91.11, %for.inc44.us81.11, %for.inc44.us71.11, %for.inc44.us.11, %for.cond22.preheader
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4
br i1 %exitcond.not, label %for.end49, label %for.cond22.preheader, !llvm.loop !12
for.end49: ; preds = %for.inc47
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %mark) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %card) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
int main(void){
char egara;
int mai,i,suuzi,h[14],s[14],c[14],d[14];
for(i=1;i<=13;i++){
h[i]=0;
s[i]=0;
c[i]=0;
d[i]=0;
}
scanf("%d",&mai);
if(mai==52){
return 0;
}
for(i=0;i<mai*2;i++){
scanf("%c %d",&egara,&suuzi);
switch(egara){
case 'H':h[suuzi]=1;
break;
case 'S':s[suuzi]=1;
break;
case 'C':c[suuzi]=1;
break;
case 'D':d[suuzi]=1;
break;
}
}
for(i=1;i<=13;i++){
if(s[i]==0){
printf("S %d\n",i);
}
}
for(i=1;i<=13;i++){
if(h[i]==0){
printf("H %d\n",i);
}
}
for(i=1;i<=13;i++){
if(c[i]==0){
printf("C %d\n",i);
}
}
for(i=1;i<=13;i++){
if(d[i]==0){
printf("D %d\n",i);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271861/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271861/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%c %d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"S %d\0A\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"H %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"C %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"D %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%egara = alloca i8, align 1
%mai = alloca i32, align 4
%suuzi = alloca i32, align 4
%h = alloca [14 x i32], align 16
%s = alloca [14 x i32], align 16
%c = alloca [14 x i32], align 16
%d = alloca [14 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %egara) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %mai) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %suuzi) #4
call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %d) #4
%scevgep = getelementptr inbounds i8, ptr %h, i64 4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(52) %scevgep, i8 0, i64 52, i1 false), !tbaa !5
%scevgep120 = getelementptr inbounds i8, ptr %s, i64 4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(52) %scevgep120, i8 0, i64 52, i1 false), !tbaa !5
%scevgep121 = getelementptr inbounds i8, ptr %c, i64 4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(52) %scevgep121, i8 0, i64 52, i1 false), !tbaa !5
%scevgep122 = getelementptr inbounds i8, ptr %d, i64 4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(52) %scevgep122, i8 0, i64 52, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %mai)
%0 = load i32, ptr %mai, align 4, !tbaa !5
%cmp7 = icmp eq i32 %0, 52
br i1 %cmp7, label %cleanup, label %for.cond8.preheader
for.cond8.preheader: ; preds = %entry
%cmp9114 = icmp sgt i32 %0, 0
br i1 %cmp9114, label %for.body10, label %if.then34
for.cond26.preheader: ; preds = %for.inc23
%.pre = load i32, ptr %scevgep120, align 4, !tbaa !5
%cmp32 = icmp eq i32 %.pre, 0
br i1 %cmp32, label %if.then34, label %for.inc37
for.body10: ; preds = %for.cond8.preheader, %for.inc23
%i.1115 = phi i32 [ %inc24, %for.inc23 ], [ 0, %for.cond8.preheader ]
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %egara, ptr noundef nonnull %suuzi)
%1 = load i8, ptr %egara, align 1, !tbaa !9
%conv = sext i8 %1 to i32
switch i32 %conv, label %for.inc23 [
i32 72, label %for.inc23.sink.split
i32 83, label %sw.bb14
i32 67, label %sw.bb17
i32 68, label %sw.bb20
]
sw.bb14: ; preds = %for.body10
br label %for.inc23.sink.split
sw.bb17: ; preds = %for.body10
br label %for.inc23.sink.split
sw.bb20: ; preds = %for.body10
br label %for.inc23.sink.split
for.inc23.sink.split: ; preds = %for.body10, %sw.bb20, %sw.bb17, %sw.bb14
%h.sink = phi ptr [ %s, %sw.bb14 ], [ %c, %sw.bb17 ], [ %d, %sw.bb20 ], [ %h, %for.body10 ]
%.sink = load i32, ptr %suuzi, align 4, !tbaa !5
%idxprom12 = sext i32 %.sink to i64
%arrayidx13 = getelementptr inbounds [14 x i32], ptr %h.sink, i64 0, i64 %idxprom12
store i32 1, ptr %arrayidx13, align 4, !tbaa !5
br label %for.inc23
for.inc23: ; preds = %for.inc23.sink.split, %for.body10
%inc24 = add nuw nsw i32 %i.1115, 1
%2 = load i32, ptr %mai, align 4, !tbaa !5
%mul = shl nsw i32 %2, 1
%cmp9 = icmp slt i32 %inc24, %mul
br i1 %cmp9, label %for.body10, label %for.cond26.preheader, !llvm.loop !10
if.then34: ; preds = %for.cond8.preheader, %for.cond26.preheader
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
br label %for.inc37
for.inc37: ; preds = %for.cond26.preheader, %if.then34
%arrayidx31.1 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 2
%3 = load i32, ptr %arrayidx31.1, align 8, !tbaa !5
%cmp32.1 = icmp eq i32 %3, 0
br i1 %cmp32.1, label %if.then34.1, label %for.inc37.1
if.then34.1: ; preds = %for.inc37
%call35.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2)
br label %for.inc37.1
for.inc37.1: ; preds = %if.then34.1, %for.inc37
%arrayidx31.2 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 3
%4 = load i32, ptr %arrayidx31.2, align 4, !tbaa !5
%cmp32.2 = icmp eq i32 %4, 0
br i1 %cmp32.2, label %if.then34.2, label %for.inc37.2
if.then34.2: ; preds = %for.inc37.1
%call35.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3)
br label %for.inc37.2
for.inc37.2: ; preds = %if.then34.2, %for.inc37.1
%arrayidx31.3 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 4
%5 = load i32, ptr %arrayidx31.3, align 16, !tbaa !5
%cmp32.3 = icmp eq i32 %5, 0
br i1 %cmp32.3, label %if.then34.3, label %for.inc37.3
if.then34.3: ; preds = %for.inc37.2
%call35.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4)
br label %for.inc37.3
for.inc37.3: ; preds = %if.then34.3, %for.inc37.2
%arrayidx31.4 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 5
%6 = load i32, ptr %arrayidx31.4, align 4, !tbaa !5
%cmp32.4 = icmp eq i32 %6, 0
br i1 %cmp32.4, label %if.then34.4, label %for.inc37.4
if.then34.4: ; preds = %for.inc37.3
%call35.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 5)
br label %for.inc37.4
for.inc37.4: ; preds = %if.then34.4, %for.inc37.3
%arrayidx31.5 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 6
%7 = load i32, ptr %arrayidx31.5, align 8, !tbaa !5
%cmp32.5 = icmp eq i32 %7, 0
br i1 %cmp32.5, label %if.then34.5, label %for.inc37.5
if.then34.5: ; preds = %for.inc37.4
%call35.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 6)
br label %for.inc37.5
for.inc37.5: ; preds = %if.then34.5, %for.inc37.4
%arrayidx31.6 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 7
%8 = load i32, ptr %arrayidx31.6, align 4, !tbaa !5
%cmp32.6 = icmp eq i32 %8, 0
br i1 %cmp32.6, label %if.then34.6, label %for.inc37.6
if.then34.6: ; preds = %for.inc37.5
%call35.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 7)
br label %for.inc37.6
for.inc37.6: ; preds = %if.then34.6, %for.inc37.5
%arrayidx31.7 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 8
%9 = load i32, ptr %arrayidx31.7, align 16, !tbaa !5
%cmp32.7 = icmp eq i32 %9, 0
br i1 %cmp32.7, label %if.then34.7, label %for.inc37.7
if.then34.7: ; preds = %for.inc37.6
%call35.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 8)
br label %for.inc37.7
for.inc37.7: ; preds = %if.then34.7, %for.inc37.6
%arrayidx31.8 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 9
%10 = load i32, ptr %arrayidx31.8, align 4, !tbaa !5
%cmp32.8 = icmp eq i32 %10, 0
br i1 %cmp32.8, label %if.then34.8, label %for.inc37.8
if.then34.8: ; preds = %for.inc37.7
%call35.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 9)
br label %for.inc37.8
for.inc37.8: ; preds = %if.then34.8, %for.inc37.7
%arrayidx31.9 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 10
%11 = load i32, ptr %arrayidx31.9, align 8, !tbaa !5
%cmp32.9 = icmp eq i32 %11, 0
br i1 %cmp32.9, label %if.then34.9, label %for.inc37.9
if.then34.9: ; preds = %for.inc37.8
%call35.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 10)
br label %for.inc37.9
for.inc37.9: ; preds = %if.then34.9, %for.inc37.8
%arrayidx31.10 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 11
%12 = load i32, ptr %arrayidx31.10, align 4, !tbaa !5
%cmp32.10 = icmp eq i32 %12, 0
br i1 %cmp32.10, label %if.then34.10, label %for.inc37.10
if.then34.10: ; preds = %for.inc37.9
%call35.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 11)
br label %for.inc37.10
for.inc37.10: ; preds = %if.then34.10, %for.inc37.9
%arrayidx31.11 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 12
%13 = load i32, ptr %arrayidx31.11, align 16, !tbaa !5
%cmp32.11 = icmp eq i32 %13, 0
br i1 %cmp32.11, label %if.then34.11, label %for.inc37.11
if.then34.11: ; preds = %for.inc37.10
%call35.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 12)
br label %for.inc37.11
for.inc37.11: ; preds = %if.then34.11, %for.inc37.10
%arrayidx31.12 = getelementptr inbounds [14 x i32], ptr %s, i64 0, i64 13
%14 = load i32, ptr %arrayidx31.12, align 4, !tbaa !5
%cmp32.12 = icmp eq i32 %14, 0
br i1 %cmp32.12, label %if.then34.12, label %for.inc37.12
if.then34.12: ; preds = %for.inc37.11
%call35.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 13)
br label %for.inc37.12
for.inc37.12: ; preds = %if.then34.12, %for.inc37.11
%15 = load i32, ptr %scevgep, align 4, !tbaa !5
%cmp46 = icmp eq i32 %15, 0
br i1 %cmp46, label %if.then48, label %for.inc51
if.then48: ; preds = %for.inc37.12
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1)
br label %for.inc51
for.inc51: ; preds = %for.inc37.12, %if.then48
%arrayidx45.1 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 2
%16 = load i32, ptr %arrayidx45.1, align 8, !tbaa !5
%cmp46.1 = icmp eq i32 %16, 0
br i1 %cmp46.1, label %if.then48.1, label %for.inc51.1
if.then48.1: ; preds = %for.inc51
%call49.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2)
br label %for.inc51.1
for.inc51.1: ; preds = %if.then48.1, %for.inc51
%arrayidx45.2 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 3
%17 = load i32, ptr %arrayidx45.2, align 4, !tbaa !5
%cmp46.2 = icmp eq i32 %17, 0
br i1 %cmp46.2, label %if.then48.2, label %for.inc51.2
if.then48.2: ; preds = %for.inc51.1
%call49.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3)
br label %for.inc51.2
for.inc51.2: ; preds = %if.then48.2, %for.inc51.1
%arrayidx45.3 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 4
%18 = load i32, ptr %arrayidx45.3, align 16, !tbaa !5
%cmp46.3 = icmp eq i32 %18, 0
br i1 %cmp46.3, label %if.then48.3, label %for.inc51.3
if.then48.3: ; preds = %for.inc51.2
%call49.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4)
br label %for.inc51.3
for.inc51.3: ; preds = %if.then48.3, %for.inc51.2
%arrayidx45.4 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 5
%19 = load i32, ptr %arrayidx45.4, align 4, !tbaa !5
%cmp46.4 = icmp eq i32 %19, 0
br i1 %cmp46.4, label %if.then48.4, label %for.inc51.4
if.then48.4: ; preds = %for.inc51.3
%call49.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 5)
br label %for.inc51.4
for.inc51.4: ; preds = %if.then48.4, %for.inc51.3
%arrayidx45.5 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 6
%20 = load i32, ptr %arrayidx45.5, align 8, !tbaa !5
%cmp46.5 = icmp eq i32 %20, 0
br i1 %cmp46.5, label %if.then48.5, label %for.inc51.5
if.then48.5: ; preds = %for.inc51.4
%call49.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 6)
br label %for.inc51.5
for.inc51.5: ; preds = %if.then48.5, %for.inc51.4
%arrayidx45.6 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 7
%21 = load i32, ptr %arrayidx45.6, align 4, !tbaa !5
%cmp46.6 = icmp eq i32 %21, 0
br i1 %cmp46.6, label %if.then48.6, label %for.inc51.6
if.then48.6: ; preds = %for.inc51.5
%call49.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 7)
br label %for.inc51.6
for.inc51.6: ; preds = %if.then48.6, %for.inc51.5
%arrayidx45.7 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 8
%22 = load i32, ptr %arrayidx45.7, align 16, !tbaa !5
%cmp46.7 = icmp eq i32 %22, 0
br i1 %cmp46.7, label %if.then48.7, label %for.inc51.7
if.then48.7: ; preds = %for.inc51.6
%call49.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 8)
br label %for.inc51.7
for.inc51.7: ; preds = %if.then48.7, %for.inc51.6
%arrayidx45.8 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 9
%23 = load i32, ptr %arrayidx45.8, align 4, !tbaa !5
%cmp46.8 = icmp eq i32 %23, 0
br i1 %cmp46.8, label %if.then48.8, label %for.inc51.8
if.then48.8: ; preds = %for.inc51.7
%call49.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 9)
br label %for.inc51.8
for.inc51.8: ; preds = %if.then48.8, %for.inc51.7
%arrayidx45.9 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 10
%24 = load i32, ptr %arrayidx45.9, align 8, !tbaa !5
%cmp46.9 = icmp eq i32 %24, 0
br i1 %cmp46.9, label %if.then48.9, label %for.inc51.9
if.then48.9: ; preds = %for.inc51.8
%call49.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 10)
br label %for.inc51.9
for.inc51.9: ; preds = %if.then48.9, %for.inc51.8
%arrayidx45.10 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 11
%25 = load i32, ptr %arrayidx45.10, align 4, !tbaa !5
%cmp46.10 = icmp eq i32 %25, 0
br i1 %cmp46.10, label %if.then48.10, label %for.inc51.10
if.then48.10: ; preds = %for.inc51.9
%call49.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 11)
br label %for.inc51.10
for.inc51.10: ; preds = %if.then48.10, %for.inc51.9
%arrayidx45.11 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 12
%26 = load i32, ptr %arrayidx45.11, align 16, !tbaa !5
%cmp46.11 = icmp eq i32 %26, 0
br i1 %cmp46.11, label %if.then48.11, label %for.inc51.11
if.then48.11: ; preds = %for.inc51.10
%call49.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 12)
br label %for.inc51.11
for.inc51.11: ; preds = %if.then48.11, %for.inc51.10
%arrayidx45.12 = getelementptr inbounds [14 x i32], ptr %h, i64 0, i64 13
%27 = load i32, ptr %arrayidx45.12, align 4, !tbaa !5
%cmp46.12 = icmp eq i32 %27, 0
br i1 %cmp46.12, label %if.then48.12, label %for.inc51.12
if.then48.12: ; preds = %for.inc51.11
%call49.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 13)
br label %for.inc51.12
for.inc51.12: ; preds = %if.then48.12, %for.inc51.11
%28 = load i32, ptr %scevgep121, align 4, !tbaa !5
%cmp60 = icmp eq i32 %28, 0
br i1 %cmp60, label %if.then62, label %for.inc65
if.then62: ; preds = %for.inc51.12
%call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 1)
br label %for.inc65
for.inc65: ; preds = %for.inc51.12, %if.then62
%arrayidx59.1 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 2
%29 = load i32, ptr %arrayidx59.1, align 8, !tbaa !5
%cmp60.1 = icmp eq i32 %29, 0
br i1 %cmp60.1, label %if.then62.1, label %for.inc65.1
if.then62.1: ; preds = %for.inc65
%call63.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 2)
br label %for.inc65.1
for.inc65.1: ; preds = %if.then62.1, %for.inc65
%arrayidx59.2 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 3
%30 = load i32, ptr %arrayidx59.2, align 4, !tbaa !5
%cmp60.2 = icmp eq i32 %30, 0
br i1 %cmp60.2, label %if.then62.2, label %for.inc65.2
if.then62.2: ; preds = %for.inc65.1
%call63.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 3)
br label %for.inc65.2
for.inc65.2: ; preds = %if.then62.2, %for.inc65.1
%arrayidx59.3 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 4
%31 = load i32, ptr %arrayidx59.3, align 16, !tbaa !5
%cmp60.3 = icmp eq i32 %31, 0
br i1 %cmp60.3, label %if.then62.3, label %for.inc65.3
if.then62.3: ; preds = %for.inc65.2
%call63.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 4)
br label %for.inc65.3
for.inc65.3: ; preds = %if.then62.3, %for.inc65.2
%arrayidx59.4 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 5
%32 = load i32, ptr %arrayidx59.4, align 4, !tbaa !5
%cmp60.4 = icmp eq i32 %32, 0
br i1 %cmp60.4, label %if.then62.4, label %for.inc65.4
if.then62.4: ; preds = %for.inc65.3
%call63.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 5)
br label %for.inc65.4
for.inc65.4: ; preds = %if.then62.4, %for.inc65.3
%arrayidx59.5 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 6
%33 = load i32, ptr %arrayidx59.5, align 8, !tbaa !5
%cmp60.5 = icmp eq i32 %33, 0
br i1 %cmp60.5, label %if.then62.5, label %for.inc65.5
if.then62.5: ; preds = %for.inc65.4
%call63.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 6)
br label %for.inc65.5
for.inc65.5: ; preds = %if.then62.5, %for.inc65.4
%arrayidx59.6 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 7
%34 = load i32, ptr %arrayidx59.6, align 4, !tbaa !5
%cmp60.6 = icmp eq i32 %34, 0
br i1 %cmp60.6, label %if.then62.6, label %for.inc65.6
if.then62.6: ; preds = %for.inc65.5
%call63.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 7)
br label %for.inc65.6
for.inc65.6: ; preds = %if.then62.6, %for.inc65.5
%arrayidx59.7 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 8
%35 = load i32, ptr %arrayidx59.7, align 16, !tbaa !5
%cmp60.7 = icmp eq i32 %35, 0
br i1 %cmp60.7, label %if.then62.7, label %for.inc65.7
if.then62.7: ; preds = %for.inc65.6
%call63.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 8)
br label %for.inc65.7
for.inc65.7: ; preds = %if.then62.7, %for.inc65.6
%arrayidx59.8 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 9
%36 = load i32, ptr %arrayidx59.8, align 4, !tbaa !5
%cmp60.8 = icmp eq i32 %36, 0
br i1 %cmp60.8, label %if.then62.8, label %for.inc65.8
if.then62.8: ; preds = %for.inc65.7
%call63.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 9)
br label %for.inc65.8
for.inc65.8: ; preds = %if.then62.8, %for.inc65.7
%arrayidx59.9 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 10
%37 = load i32, ptr %arrayidx59.9, align 8, !tbaa !5
%cmp60.9 = icmp eq i32 %37, 0
br i1 %cmp60.9, label %if.then62.9, label %for.inc65.9
if.then62.9: ; preds = %for.inc65.8
%call63.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 10)
br label %for.inc65.9
for.inc65.9: ; preds = %if.then62.9, %for.inc65.8
%arrayidx59.10 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 11
%38 = load i32, ptr %arrayidx59.10, align 4, !tbaa !5
%cmp60.10 = icmp eq i32 %38, 0
br i1 %cmp60.10, label %if.then62.10, label %for.inc65.10
if.then62.10: ; preds = %for.inc65.9
%call63.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 11)
br label %for.inc65.10
for.inc65.10: ; preds = %if.then62.10, %for.inc65.9
%arrayidx59.11 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 12
%39 = load i32, ptr %arrayidx59.11, align 16, !tbaa !5
%cmp60.11 = icmp eq i32 %39, 0
br i1 %cmp60.11, label %if.then62.11, label %for.inc65.11
if.then62.11: ; preds = %for.inc65.10
%call63.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 12)
br label %for.inc65.11
for.inc65.11: ; preds = %if.then62.11, %for.inc65.10
%arrayidx59.12 = getelementptr inbounds [14 x i32], ptr %c, i64 0, i64 13
%40 = load i32, ptr %arrayidx59.12, align 4, !tbaa !5
%cmp60.12 = icmp eq i32 %40, 0
br i1 %cmp60.12, label %if.then62.12, label %for.inc65.12
if.then62.12: ; preds = %for.inc65.11
%call63.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 13)
br label %for.inc65.12
for.inc65.12: ; preds = %if.then62.12, %for.inc65.11
%41 = load i32, ptr %scevgep122, align 4, !tbaa !5
%cmp74 = icmp eq i32 %41, 0
br i1 %cmp74, label %if.then76, label %for.inc79
if.then76: ; preds = %for.inc65.12
%call77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1)
br label %for.inc79
for.inc79: ; preds = %for.inc65.12, %if.then76
%arrayidx73.1 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 2
%42 = load i32, ptr %arrayidx73.1, align 8, !tbaa !5
%cmp74.1 = icmp eq i32 %42, 0
br i1 %cmp74.1, label %if.then76.1, label %for.inc79.1
if.then76.1: ; preds = %for.inc79
%call77.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 2)
br label %for.inc79.1
for.inc79.1: ; preds = %if.then76.1, %for.inc79
%arrayidx73.2 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 3
%43 = load i32, ptr %arrayidx73.2, align 4, !tbaa !5
%cmp74.2 = icmp eq i32 %43, 0
br i1 %cmp74.2, label %if.then76.2, label %for.inc79.2
if.then76.2: ; preds = %for.inc79.1
%call77.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 3)
br label %for.inc79.2
for.inc79.2: ; preds = %if.then76.2, %for.inc79.1
%arrayidx73.3 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 4
%44 = load i32, ptr %arrayidx73.3, align 16, !tbaa !5
%cmp74.3 = icmp eq i32 %44, 0
br i1 %cmp74.3, label %if.then76.3, label %for.inc79.3
if.then76.3: ; preds = %for.inc79.2
%call77.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 4)
br label %for.inc79.3
for.inc79.3: ; preds = %if.then76.3, %for.inc79.2
%arrayidx73.4 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 5
%45 = load i32, ptr %arrayidx73.4, align 4, !tbaa !5
%cmp74.4 = icmp eq i32 %45, 0
br i1 %cmp74.4, label %if.then76.4, label %for.inc79.4
if.then76.4: ; preds = %for.inc79.3
%call77.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 5)
br label %for.inc79.4
for.inc79.4: ; preds = %if.then76.4, %for.inc79.3
%arrayidx73.5 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 6
%46 = load i32, ptr %arrayidx73.5, align 8, !tbaa !5
%cmp74.5 = icmp eq i32 %46, 0
br i1 %cmp74.5, label %if.then76.5, label %for.inc79.5
if.then76.5: ; preds = %for.inc79.4
%call77.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 6)
br label %for.inc79.5
for.inc79.5: ; preds = %if.then76.5, %for.inc79.4
%arrayidx73.6 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 7
%47 = load i32, ptr %arrayidx73.6, align 4, !tbaa !5
%cmp74.6 = icmp eq i32 %47, 0
br i1 %cmp74.6, label %if.then76.6, label %for.inc79.6
if.then76.6: ; preds = %for.inc79.5
%call77.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 7)
br label %for.inc79.6
for.inc79.6: ; preds = %if.then76.6, %for.inc79.5
%arrayidx73.7 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 8
%48 = load i32, ptr %arrayidx73.7, align 16, !tbaa !5
%cmp74.7 = icmp eq i32 %48, 0
br i1 %cmp74.7, label %if.then76.7, label %for.inc79.7
if.then76.7: ; preds = %for.inc79.6
%call77.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 8)
br label %for.inc79.7
for.inc79.7: ; preds = %if.then76.7, %for.inc79.6
%arrayidx73.8 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 9
%49 = load i32, ptr %arrayidx73.8, align 4, !tbaa !5
%cmp74.8 = icmp eq i32 %49, 0
br i1 %cmp74.8, label %if.then76.8, label %for.inc79.8
if.then76.8: ; preds = %for.inc79.7
%call77.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 9)
br label %for.inc79.8
for.inc79.8: ; preds = %if.then76.8, %for.inc79.7
%arrayidx73.9 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 10
%50 = load i32, ptr %arrayidx73.9, align 8, !tbaa !5
%cmp74.9 = icmp eq i32 %50, 0
br i1 %cmp74.9, label %if.then76.9, label %for.inc79.9
if.then76.9: ; preds = %for.inc79.8
%call77.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 10)
br label %for.inc79.9
for.inc79.9: ; preds = %if.then76.9, %for.inc79.8
%arrayidx73.10 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 11
%51 = load i32, ptr %arrayidx73.10, align 4, !tbaa !5
%cmp74.10 = icmp eq i32 %51, 0
br i1 %cmp74.10, label %if.then76.10, label %for.inc79.10
if.then76.10: ; preds = %for.inc79.9
%call77.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 11)
br label %for.inc79.10
for.inc79.10: ; preds = %if.then76.10, %for.inc79.9
%arrayidx73.11 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 12
%52 = load i32, ptr %arrayidx73.11, align 16, !tbaa !5
%cmp74.11 = icmp eq i32 %52, 0
br i1 %cmp74.11, label %if.then76.11, label %for.inc79.11
if.then76.11: ; preds = %for.inc79.10
%call77.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 12)
br label %for.inc79.11
for.inc79.11: ; preds = %if.then76.11, %for.inc79.10
%arrayidx73.12 = getelementptr inbounds [14 x i32], ptr %d, i64 0, i64 13
%53 = load i32, ptr %arrayidx73.12, align 4, !tbaa !5
%cmp74.12 = icmp eq i32 %53, 0
br i1 %cmp74.12, label %if.then76.12, label %cleanup
if.then76.12: ; preds = %for.inc79.11
%call77.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 13)
br label %cleanup
cleanup: ; preds = %for.inc79.11, %if.then76.12, %entry
call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %suuzi) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %mai) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %egara) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
char mark1,mark2;
int a,b,n,i,j,k,l,rank;
int card[4][13];
for(a=0;a<4;a++){
for(b=0;b<13;b++){
card[a][b]=0;
}
}
scanf("%d",&n);
for(i = 1;i <= n;i++){
scanf(" %c %d",&mark1,&rank);
if(mark1 == 'S'){
j = 0;
}else if(mark1 == 'H'){
j = 1;
}else if(mark1 == 'C'){
j = 2;
}else if(mark1 == 'D'){
j = 3;
}
card[j][rank - 1] = 1;
}
for(k = 0;k <= 3;k++){
for(l = 0;l <= 12;l++){
if(card[k][l] == 0){
if(k == 0){
mark2 = 'S';
}else if(k == 1){
mark2 = 'H';
}else if(k == 2){
mark2 = 'C';
}else if(k == 3){
mark2 = 'D';
}
printf("%c %d\n",mark2,l + 1);
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271904/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271904/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c" %c %d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%mark1 = alloca i8, align 1
%n = alloca i32, align 4
%rank = alloca i32, align 4
%card = alloca [4 x [13 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %mark1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %rank) #4
call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %card) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %card, i8 0, i64 208, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp10.not98 = icmp slt i32 %0, 1
br i1 %cmp10.not98, label %for.cond43.preheader.preheader, label %for.body11
for.body11: ; preds = %entry, %if.end31
%j.0100 = phi i32 [ %j.1, %if.end31 ], [ undef, %entry ]
%i.099 = phi i32 [ %inc37, %if.end31 ], [ 1, %entry ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %mark1, ptr noundef nonnull %rank)
%1 = load i8, ptr %mark1, align 1, !tbaa !9
switch i8 %1, label %if.end31.fold.split [
i8 83, label %if.end31
i8 72, label %if.then18
i8 67, label %if.then23
i8 68, label %if.then28
]
if.then18: ; preds = %for.body11
br label %if.end31
if.then23: ; preds = %for.body11
br label %if.end31
if.then28: ; preds = %for.body11
br label %if.end31
if.end31.fold.split: ; preds = %for.body11
br label %if.end31
if.end31: ; preds = %for.body11, %if.end31.fold.split, %if.then18, %if.then28, %if.then23
%j.1 = phi i32 [ 1, %if.then18 ], [ 2, %if.then23 ], [ 3, %if.then28 ], [ 0, %for.body11 ], [ %j.0100, %if.end31.fold.split ]
%idxprom32 = sext i32 %j.1 to i64
%2 = load i32, ptr %rank, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom34 = sext i32 %sub to i64
%arrayidx35 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %idxprom32, i64 %idxprom34
store i32 1, ptr %arrayidx35, align 4, !tbaa !5
%inc37 = add nuw nsw i32 %i.099, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp10.not.not = icmp slt i32 %i.099, %3
br i1 %cmp10.not.not, label %for.body11, label %for.cond43.preheader.preheader, !llvm.loop !10
for.cond43.preheader.preheader: ; preds = %if.end31, %entry
br label %for.cond43.preheader
for.cond43.preheader: ; preds = %for.cond43.preheader.preheader, %for.inc76.12
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc76.12 ], [ 0, %for.cond43.preheader.preheader ]
%mark2.0103 = phi i8 [ %mark2.3.12, %for.inc76.12 ], [ undef, %for.cond43.preheader.preheader ]
%arrayidx50 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 0
%4 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%cmp51 = icmp eq i32 %4, 0
br i1 %cmp51, label %if.then53, label %for.inc76
if.then53: ; preds = %for.cond43.preheader
%5 = trunc i64 %indvars.iv to i32
%6 = icmp ult i32 %5, 4
%switch.shiftamt = shl nuw nsw i32 %5, 3
%switch.downshift = lshr i32 1145260115, %switch.shiftamt
%switch.masked = trunc i32 %switch.downshift to i8
%mark2.2 = select i1 %6, i8 %switch.masked, i8 %mark2.0103
%conv73 = sext i8 %mark2.2 to i32
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73, i32 noundef 1)
br label %for.inc76
for.inc76: ; preds = %for.cond43.preheader, %if.then53
%mark2.3 = phi i8 [ %mark2.2, %if.then53 ], [ %mark2.0103, %for.cond43.preheader ]
%arrayidx50.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 1
%7 = load i32, ptr %arrayidx50.1, align 4, !tbaa !5
%cmp51.1 = icmp eq i32 %7, 0
br i1 %cmp51.1, label %if.then53.1, label %for.inc76.1
if.then53.1: ; preds = %for.inc76
%8 = trunc i64 %indvars.iv to i32
%9 = icmp ult i32 %8, 4
%switch.shiftamt109 = shl nuw nsw i32 %8, 3
%switch.downshift110 = lshr i32 1145260115, %switch.shiftamt109
%switch.masked111 = trunc i32 %switch.downshift110 to i8
%mark2.2.1 = select i1 %9, i8 %switch.masked111, i8 %mark2.3
%conv73.1 = sext i8 %mark2.2.1 to i32
%call74.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.1, i32 noundef 2)
br label %for.inc76.1
for.inc76.1: ; preds = %if.then53.1, %for.inc76
%mark2.3.1 = phi i8 [ %mark2.2.1, %if.then53.1 ], [ %mark2.3, %for.inc76 ]
%arrayidx50.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 2
%10 = load i32, ptr %arrayidx50.2, align 4, !tbaa !5
%cmp51.2 = icmp eq i32 %10, 0
br i1 %cmp51.2, label %if.then53.2, label %for.inc76.2
if.then53.2: ; preds = %for.inc76.1
%11 = trunc i64 %indvars.iv to i32
%12 = icmp ult i32 %11, 4
%switch.shiftamt113 = shl nuw nsw i32 %11, 3
%switch.downshift114 = lshr i32 1145260115, %switch.shiftamt113
%switch.masked115 = trunc i32 %switch.downshift114 to i8
%mark2.2.2 = select i1 %12, i8 %switch.masked115, i8 %mark2.3.1
%conv73.2 = sext i8 %mark2.2.2 to i32
%call74.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.2, i32 noundef 3)
br label %for.inc76.2
for.inc76.2: ; preds = %if.then53.2, %for.inc76.1
%mark2.3.2 = phi i8 [ %mark2.2.2, %if.then53.2 ], [ %mark2.3.1, %for.inc76.1 ]
%arrayidx50.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 3
%13 = load i32, ptr %arrayidx50.3, align 4, !tbaa !5
%cmp51.3 = icmp eq i32 %13, 0
br i1 %cmp51.3, label %if.then53.3, label %for.inc76.3
if.then53.3: ; preds = %for.inc76.2
%14 = trunc i64 %indvars.iv to i32
%15 = icmp ult i32 %14, 4
%switch.shiftamt117 = shl nuw nsw i32 %14, 3
%switch.downshift118 = lshr i32 1145260115, %switch.shiftamt117
%switch.masked119 = trunc i32 %switch.downshift118 to i8
%mark2.2.3 = select i1 %15, i8 %switch.masked119, i8 %mark2.3.2
%conv73.3 = sext i8 %mark2.2.3 to i32
%call74.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.3, i32 noundef 4)
br label %for.inc76.3
for.inc76.3: ; preds = %if.then53.3, %for.inc76.2
%mark2.3.3 = phi i8 [ %mark2.2.3, %if.then53.3 ], [ %mark2.3.2, %for.inc76.2 ]
%arrayidx50.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 4
%16 = load i32, ptr %arrayidx50.4, align 4, !tbaa !5
%cmp51.4 = icmp eq i32 %16, 0
br i1 %cmp51.4, label %if.then53.4, label %for.inc76.4
if.then53.4: ; preds = %for.inc76.3
%17 = trunc i64 %indvars.iv to i32
%18 = icmp ult i32 %17, 4
%switch.shiftamt121 = shl nuw nsw i32 %17, 3
%switch.downshift122 = lshr i32 1145260115, %switch.shiftamt121
%switch.masked123 = trunc i32 %switch.downshift122 to i8
%mark2.2.4 = select i1 %18, i8 %switch.masked123, i8 %mark2.3.3
%conv73.4 = sext i8 %mark2.2.4 to i32
%call74.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.4, i32 noundef 5)
br label %for.inc76.4
for.inc76.4: ; preds = %if.then53.4, %for.inc76.3
%mark2.3.4 = phi i8 [ %mark2.2.4, %if.then53.4 ], [ %mark2.3.3, %for.inc76.3 ]
%arrayidx50.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 5
%19 = load i32, ptr %arrayidx50.5, align 4, !tbaa !5
%cmp51.5 = icmp eq i32 %19, 0
br i1 %cmp51.5, label %if.then53.5, label %for.inc76.5
if.then53.5: ; preds = %for.inc76.4
%20 = trunc i64 %indvars.iv to i32
%21 = icmp ult i32 %20, 4
%switch.shiftamt125 = shl nuw nsw i32 %20, 3
%switch.downshift126 = lshr i32 1145260115, %switch.shiftamt125
%switch.masked127 = trunc i32 %switch.downshift126 to i8
%mark2.2.5 = select i1 %21, i8 %switch.masked127, i8 %mark2.3.4
%conv73.5 = sext i8 %mark2.2.5 to i32
%call74.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.5, i32 noundef 6)
br label %for.inc76.5
for.inc76.5: ; preds = %if.then53.5, %for.inc76.4
%mark2.3.5 = phi i8 [ %mark2.2.5, %if.then53.5 ], [ %mark2.3.4, %for.inc76.4 ]
%arrayidx50.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 6
%22 = load i32, ptr %arrayidx50.6, align 4, !tbaa !5
%cmp51.6 = icmp eq i32 %22, 0
br i1 %cmp51.6, label %if.then53.6, label %for.inc76.6
if.then53.6: ; preds = %for.inc76.5
%23 = trunc i64 %indvars.iv to i32
%24 = icmp ult i32 %23, 4
%switch.shiftamt129 = shl nuw nsw i32 %23, 3
%switch.downshift130 = lshr i32 1145260115, %switch.shiftamt129
%switch.masked131 = trunc i32 %switch.downshift130 to i8
%mark2.2.6 = select i1 %24, i8 %switch.masked131, i8 %mark2.3.5
%conv73.6 = sext i8 %mark2.2.6 to i32
%call74.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.6, i32 noundef 7)
br label %for.inc76.6
for.inc76.6: ; preds = %if.then53.6, %for.inc76.5
%mark2.3.6 = phi i8 [ %mark2.2.6, %if.then53.6 ], [ %mark2.3.5, %for.inc76.5 ]
%arrayidx50.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 7
%25 = load i32, ptr %arrayidx50.7, align 4, !tbaa !5
%cmp51.7 = icmp eq i32 %25, 0
br i1 %cmp51.7, label %if.then53.7, label %for.inc76.7
if.then53.7: ; preds = %for.inc76.6
%26 = trunc i64 %indvars.iv to i32
%27 = icmp ult i32 %26, 4
%switch.shiftamt133 = shl nuw nsw i32 %26, 3
%switch.downshift134 = lshr i32 1145260115, %switch.shiftamt133
%switch.masked135 = trunc i32 %switch.downshift134 to i8
%mark2.2.7 = select i1 %27, i8 %switch.masked135, i8 %mark2.3.6
%conv73.7 = sext i8 %mark2.2.7 to i32
%call74.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.7, i32 noundef 8)
br label %for.inc76.7
for.inc76.7: ; preds = %if.then53.7, %for.inc76.6
%mark2.3.7 = phi i8 [ %mark2.2.7, %if.then53.7 ], [ %mark2.3.6, %for.inc76.6 ]
%arrayidx50.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 8
%28 = load i32, ptr %arrayidx50.8, align 4, !tbaa !5
%cmp51.8 = icmp eq i32 %28, 0
br i1 %cmp51.8, label %if.then53.8, label %for.inc76.8
if.then53.8: ; preds = %for.inc76.7
%29 = trunc i64 %indvars.iv to i32
%30 = icmp ult i32 %29, 4
%switch.shiftamt137 = shl nuw nsw i32 %29, 3
%switch.downshift138 = lshr i32 1145260115, %switch.shiftamt137
%switch.masked139 = trunc i32 %switch.downshift138 to i8
%mark2.2.8 = select i1 %30, i8 %switch.masked139, i8 %mark2.3.7
%conv73.8 = sext i8 %mark2.2.8 to i32
%call74.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.8, i32 noundef 9)
br label %for.inc76.8
for.inc76.8: ; preds = %if.then53.8, %for.inc76.7
%mark2.3.8 = phi i8 [ %mark2.2.8, %if.then53.8 ], [ %mark2.3.7, %for.inc76.7 ]
%arrayidx50.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 9
%31 = load i32, ptr %arrayidx50.9, align 4, !tbaa !5
%cmp51.9 = icmp eq i32 %31, 0
br i1 %cmp51.9, label %if.then53.9, label %for.inc76.9
if.then53.9: ; preds = %for.inc76.8
%32 = trunc i64 %indvars.iv to i32
%33 = icmp ult i32 %32, 4
%switch.shiftamt141 = shl nuw nsw i32 %32, 3
%switch.downshift142 = lshr i32 1145260115, %switch.shiftamt141
%switch.masked143 = trunc i32 %switch.downshift142 to i8
%mark2.2.9 = select i1 %33, i8 %switch.masked143, i8 %mark2.3.8
%conv73.9 = sext i8 %mark2.2.9 to i32
%call74.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.9, i32 noundef 10)
br label %for.inc76.9
for.inc76.9: ; preds = %if.then53.9, %for.inc76.8
%mark2.3.9 = phi i8 [ %mark2.2.9, %if.then53.9 ], [ %mark2.3.8, %for.inc76.8 ]
%arrayidx50.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 10
%34 = load i32, ptr %arrayidx50.10, align 4, !tbaa !5
%cmp51.10 = icmp eq i32 %34, 0
br i1 %cmp51.10, label %if.then53.10, label %for.inc76.10
if.then53.10: ; preds = %for.inc76.9
%35 = trunc i64 %indvars.iv to i32
%36 = icmp ult i32 %35, 4
%switch.shiftamt145 = shl nuw nsw i32 %35, 3
%switch.downshift146 = lshr i32 1145260115, %switch.shiftamt145
%switch.masked147 = trunc i32 %switch.downshift146 to i8
%mark2.2.10 = select i1 %36, i8 %switch.masked147, i8 %mark2.3.9
%conv73.10 = sext i8 %mark2.2.10 to i32
%call74.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.10, i32 noundef 11)
br label %for.inc76.10
for.inc76.10: ; preds = %if.then53.10, %for.inc76.9
%mark2.3.10 = phi i8 [ %mark2.2.10, %if.then53.10 ], [ %mark2.3.9, %for.inc76.9 ]
%arrayidx50.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 11
%37 = load i32, ptr %arrayidx50.11, align 4, !tbaa !5
%cmp51.11 = icmp eq i32 %37, 0
br i1 %cmp51.11, label %if.then53.11, label %for.inc76.11
if.then53.11: ; preds = %for.inc76.10
%38 = trunc i64 %indvars.iv to i32
%39 = icmp ult i32 %38, 4
%switch.shiftamt149 = shl nuw nsw i32 %38, 3
%switch.downshift150 = lshr i32 1145260115, %switch.shiftamt149
%switch.masked151 = trunc i32 %switch.downshift150 to i8
%mark2.2.11 = select i1 %39, i8 %switch.masked151, i8 %mark2.3.10
%conv73.11 = sext i8 %mark2.2.11 to i32
%call74.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.11, i32 noundef 12)
br label %for.inc76.11
for.inc76.11: ; preds = %if.then53.11, %for.inc76.10
%mark2.3.11 = phi i8 [ %mark2.2.11, %if.then53.11 ], [ %mark2.3.10, %for.inc76.10 ]
%arrayidx50.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 12
%40 = load i32, ptr %arrayidx50.12, align 4, !tbaa !5
%cmp51.12 = icmp eq i32 %40, 0
br i1 %cmp51.12, label %if.then53.12, label %for.inc76.12
if.then53.12: ; preds = %for.inc76.11
%41 = trunc i64 %indvars.iv to i32
%42 = icmp ult i32 %41, 4
%switch.shiftamt153 = shl nuw nsw i32 %41, 3
%switch.downshift154 = lshr i32 1145260115, %switch.shiftamt153
%switch.masked155 = trunc i32 %switch.downshift154 to i8
%mark2.2.12 = select i1 %42, i8 %switch.masked155, i8 %mark2.3.11
%conv73.12 = sext i8 %mark2.2.12 to i32
%call74.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv73.12, i32 noundef 13)
br label %for.inc76.12
for.inc76.12: ; preds = %if.then53.12, %for.inc76.11
%mark2.3.12 = phi i8 [ %mark2.2.12, %if.then53.12 ], [ %mark2.3.11, %for.inc76.11 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4
br i1 %exitcond.not, label %for.end81, label %for.cond43.preheader, !llvm.loop !12
for.end81: ; preds = %for.inc76.12
call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %card) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %rank) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %mark1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
void print_card(int va[][14]) {
int i, j;
for(i = 0; i < 4; i++) {
for(j = 1; j < 14; j++) {
if(va[i][j] != 1) {
switch(i) {
case 0:putchar('S'); break;
case 1:putchar('H'); break;
case 2:putchar('C'); break;
case 3:putchar('D'); break;
}
printf(" %d\n", j);
}
}
}
}
int main(void) {
int quantity, i, num;
int card_num[4][14] = {0};
char design;
scanf("%d", &quantity);
for(i = 0; i < quantity * 2; i++) {
scanf("%c %d", &design, &num);
if(design == 'S') {
card_num[0][num]++;
} else if(design == 'H') {
card_num[1][num]++;
} else if(design == 'C') {
card_num[2][num]++;
} else if(design == 'D') {
card_num[3][num]++;
}
}
print_card(card_num);
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271948/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271948/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c" %d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%c %d\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local void @print_card(ptr nocapture noundef readonly %va) local_unnamed_addr #0 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc14
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc14 ]
%0 = trunc i64 %indvars.iv to i32
%arrayidx5 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 1
%1 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6.not = icmp eq i32 %1, 1
switch i32 %0, label %for.body3.preheader [
i32 0, label %for.body3.us.preheader
i32 1, label %for.body3.us28.preheader
i32 2, label %for.body3.us40.preheader
i32 3, label %for.body3.us52.preheader
]
for.body3.us52.preheader: ; preds = %for.cond1.preheader
br i1 %cmp6.not, label %for.inc.us60, label %if.then.us57
for.body3.us40.preheader: ; preds = %for.cond1.preheader
br i1 %cmp6.not, label %for.inc.us48, label %if.then.us45
for.body3.us28.preheader: ; preds = %for.cond1.preheader
br i1 %cmp6.not, label %for.inc.us36, label %if.then.us33
for.body3.us.preheader: ; preds = %for.cond1.preheader
br i1 %cmp6.not, label %for.inc.us, label %if.then.us
for.body3.preheader: ; preds = %for.cond1.preheader
br i1 %cmp6.not, label %for.inc, label %if.then
if.then.us: ; preds = %for.body3.us.preheader
%2 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us = tail call i32 @putc(i32 noundef 83, ptr noundef %2)
%call13.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1)
br label %for.inc.us
for.inc.us: ; preds = %if.then.us, %for.body3.us.preheader
%arrayidx5.us.1 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 2
%3 = load i32, ptr %arrayidx5.us.1, align 4, !tbaa !5
%cmp6.not.us.1 = icmp eq i32 %3, 1
br i1 %cmp6.not.us.1, label %for.inc.us.1, label %if.then.us.1
if.then.us.1: ; preds = %for.inc.us
%4 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.1 = tail call i32 @putc(i32 noundef 83, ptr noundef %4)
%call13.us.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 2)
br label %for.inc.us.1
for.inc.us.1: ; preds = %if.then.us.1, %for.inc.us
%arrayidx5.us.2 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 3
%5 = load i32, ptr %arrayidx5.us.2, align 4, !tbaa !5
%cmp6.not.us.2 = icmp eq i32 %5, 1
br i1 %cmp6.not.us.2, label %for.inc.us.2, label %if.then.us.2
if.then.us.2: ; preds = %for.inc.us.1
%6 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.2 = tail call i32 @putc(i32 noundef 83, ptr noundef %6)
%call13.us.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 3)
br label %for.inc.us.2
for.inc.us.2: ; preds = %if.then.us.2, %for.inc.us.1
%arrayidx5.us.3 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 4
%7 = load i32, ptr %arrayidx5.us.3, align 4, !tbaa !5
%cmp6.not.us.3 = icmp eq i32 %7, 1
br i1 %cmp6.not.us.3, label %for.inc.us.3, label %if.then.us.3
if.then.us.3: ; preds = %for.inc.us.2
%8 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.3 = tail call i32 @putc(i32 noundef 83, ptr noundef %8)
%call13.us.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 4)
br label %for.inc.us.3
for.inc.us.3: ; preds = %if.then.us.3, %for.inc.us.2
%arrayidx5.us.4 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 5
%9 = load i32, ptr %arrayidx5.us.4, align 4, !tbaa !5
%cmp6.not.us.4 = icmp eq i32 %9, 1
br i1 %cmp6.not.us.4, label %for.inc.us.4, label %if.then.us.4
if.then.us.4: ; preds = %for.inc.us.3
%10 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.4 = tail call i32 @putc(i32 noundef 83, ptr noundef %10)
%call13.us.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 5)
br label %for.inc.us.4
for.inc.us.4: ; preds = %if.then.us.4, %for.inc.us.3
%arrayidx5.us.5 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 6
%11 = load i32, ptr %arrayidx5.us.5, align 4, !tbaa !5
%cmp6.not.us.5 = icmp eq i32 %11, 1
br i1 %cmp6.not.us.5, label %for.inc.us.5, label %if.then.us.5
if.then.us.5: ; preds = %for.inc.us.4
%12 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.5 = tail call i32 @putc(i32 noundef 83, ptr noundef %12)
%call13.us.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 6)
br label %for.inc.us.5
for.inc.us.5: ; preds = %if.then.us.5, %for.inc.us.4
%arrayidx5.us.6 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 7
%13 = load i32, ptr %arrayidx5.us.6, align 4, !tbaa !5
%cmp6.not.us.6 = icmp eq i32 %13, 1
br i1 %cmp6.not.us.6, label %for.inc.us.6, label %if.then.us.6
if.then.us.6: ; preds = %for.inc.us.5
%14 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.6 = tail call i32 @putc(i32 noundef 83, ptr noundef %14)
%call13.us.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 7)
br label %for.inc.us.6
for.inc.us.6: ; preds = %if.then.us.6, %for.inc.us.5
%arrayidx5.us.7 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 8
%15 = load i32, ptr %arrayidx5.us.7, align 4, !tbaa !5
%cmp6.not.us.7 = icmp eq i32 %15, 1
br i1 %cmp6.not.us.7, label %for.inc.us.7, label %if.then.us.7
if.then.us.7: ; preds = %for.inc.us.6
%16 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.7 = tail call i32 @putc(i32 noundef 83, ptr noundef %16)
%call13.us.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 8)
br label %for.inc.us.7
for.inc.us.7: ; preds = %if.then.us.7, %for.inc.us.6
%arrayidx5.us.8 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 9
%17 = load i32, ptr %arrayidx5.us.8, align 4, !tbaa !5
%cmp6.not.us.8 = icmp eq i32 %17, 1
br i1 %cmp6.not.us.8, label %for.inc.us.8, label %if.then.us.8
if.then.us.8: ; preds = %for.inc.us.7
%18 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.8 = tail call i32 @putc(i32 noundef 83, ptr noundef %18)
%call13.us.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 9)
br label %for.inc.us.8
for.inc.us.8: ; preds = %if.then.us.8, %for.inc.us.7
%arrayidx5.us.9 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 10
%19 = load i32, ptr %arrayidx5.us.9, align 4, !tbaa !5
%cmp6.not.us.9 = icmp eq i32 %19, 1
br i1 %cmp6.not.us.9, label %for.inc.us.9, label %if.then.us.9
if.then.us.9: ; preds = %for.inc.us.8
%20 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.9 = tail call i32 @putc(i32 noundef 83, ptr noundef %20)
%call13.us.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 10)
br label %for.inc.us.9
for.inc.us.9: ; preds = %if.then.us.9, %for.inc.us.8
%arrayidx5.us.10 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 11
%21 = load i32, ptr %arrayidx5.us.10, align 4, !tbaa !5
%cmp6.not.us.10 = icmp eq i32 %21, 1
br i1 %cmp6.not.us.10, label %for.inc.us.10, label %if.then.us.10
if.then.us.10: ; preds = %for.inc.us.9
%22 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.10 = tail call i32 @putc(i32 noundef 83, ptr noundef %22)
%call13.us.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 11)
br label %for.inc.us.10
for.inc.us.10: ; preds = %if.then.us.10, %for.inc.us.9
%arrayidx5.us.11 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 12
%23 = load i32, ptr %arrayidx5.us.11, align 4, !tbaa !5
%cmp6.not.us.11 = icmp eq i32 %23, 1
br i1 %cmp6.not.us.11, label %for.inc.us.11, label %if.then.us.11
if.then.us.11: ; preds = %for.inc.us.10
%24 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.11 = tail call i32 @putc(i32 noundef 83, ptr noundef %24)
%call13.us.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 12)
br label %for.inc.us.11
for.inc.us.11: ; preds = %if.then.us.11, %for.inc.us.10
%arrayidx5.us.12 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 13
%25 = load i32, ptr %arrayidx5.us.12, align 4, !tbaa !5
%cmp6.not.us.12 = icmp eq i32 %25, 1
br i1 %cmp6.not.us.12, label %for.inc14, label %for.inc14.sink.split.sink.split
if.then.us33: ; preds = %for.body3.us28.preheader
%26 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us = tail call i32 @putc(i32 noundef 72, ptr noundef %26)
%call13.us35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1)
br label %for.inc.us36
for.inc.us36: ; preds = %if.then.us33, %for.body3.us28.preheader
%arrayidx5.us31.1 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 2
%27 = load i32, ptr %arrayidx5.us31.1, align 4, !tbaa !5
%cmp6.not.us32.1 = icmp eq i32 %27, 1
br i1 %cmp6.not.us32.1, label %for.inc.us36.1, label %if.then.us33.1
if.then.us33.1: ; preds = %for.inc.us36
%28 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.1 = tail call i32 @putc(i32 noundef 72, ptr noundef %28)
%call13.us35.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 2)
br label %for.inc.us36.1
for.inc.us36.1: ; preds = %if.then.us33.1, %for.inc.us36
%arrayidx5.us31.2 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 3
%29 = load i32, ptr %arrayidx5.us31.2, align 4, !tbaa !5
%cmp6.not.us32.2 = icmp eq i32 %29, 1
br i1 %cmp6.not.us32.2, label %for.inc.us36.2, label %if.then.us33.2
if.then.us33.2: ; preds = %for.inc.us36.1
%30 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.2 = tail call i32 @putc(i32 noundef 72, ptr noundef %30)
%call13.us35.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 3)
br label %for.inc.us36.2
for.inc.us36.2: ; preds = %if.then.us33.2, %for.inc.us36.1
%arrayidx5.us31.3 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 4
%31 = load i32, ptr %arrayidx5.us31.3, align 4, !tbaa !5
%cmp6.not.us32.3 = icmp eq i32 %31, 1
br i1 %cmp6.not.us32.3, label %for.inc.us36.3, label %if.then.us33.3
if.then.us33.3: ; preds = %for.inc.us36.2
%32 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.3 = tail call i32 @putc(i32 noundef 72, ptr noundef %32)
%call13.us35.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 4)
br label %for.inc.us36.3
for.inc.us36.3: ; preds = %if.then.us33.3, %for.inc.us36.2
%arrayidx5.us31.4 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 5
%33 = load i32, ptr %arrayidx5.us31.4, align 4, !tbaa !5
%cmp6.not.us32.4 = icmp eq i32 %33, 1
br i1 %cmp6.not.us32.4, label %for.inc.us36.4, label %if.then.us33.4
if.then.us33.4: ; preds = %for.inc.us36.3
%34 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.4 = tail call i32 @putc(i32 noundef 72, ptr noundef %34)
%call13.us35.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 5)
br label %for.inc.us36.4
for.inc.us36.4: ; preds = %if.then.us33.4, %for.inc.us36.3
%arrayidx5.us31.5 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 6
%35 = load i32, ptr %arrayidx5.us31.5, align 4, !tbaa !5
%cmp6.not.us32.5 = icmp eq i32 %35, 1
br i1 %cmp6.not.us32.5, label %for.inc.us36.5, label %if.then.us33.5
if.then.us33.5: ; preds = %for.inc.us36.4
%36 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.5 = tail call i32 @putc(i32 noundef 72, ptr noundef %36)
%call13.us35.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 6)
br label %for.inc.us36.5
for.inc.us36.5: ; preds = %if.then.us33.5, %for.inc.us36.4
%arrayidx5.us31.6 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 7
%37 = load i32, ptr %arrayidx5.us31.6, align 4, !tbaa !5
%cmp6.not.us32.6 = icmp eq i32 %37, 1
br i1 %cmp6.not.us32.6, label %for.inc.us36.6, label %if.then.us33.6
if.then.us33.6: ; preds = %for.inc.us36.5
%38 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.6 = tail call i32 @putc(i32 noundef 72, ptr noundef %38)
%call13.us35.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 7)
br label %for.inc.us36.6
for.inc.us36.6: ; preds = %if.then.us33.6, %for.inc.us36.5
%arrayidx5.us31.7 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 8
%39 = load i32, ptr %arrayidx5.us31.7, align 4, !tbaa !5
%cmp6.not.us32.7 = icmp eq i32 %39, 1
br i1 %cmp6.not.us32.7, label %for.inc.us36.7, label %if.then.us33.7
if.then.us33.7: ; preds = %for.inc.us36.6
%40 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.7 = tail call i32 @putc(i32 noundef 72, ptr noundef %40)
%call13.us35.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 8)
br label %for.inc.us36.7
for.inc.us36.7: ; preds = %if.then.us33.7, %for.inc.us36.6
%arrayidx5.us31.8 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 9
%41 = load i32, ptr %arrayidx5.us31.8, align 4, !tbaa !5
%cmp6.not.us32.8 = icmp eq i32 %41, 1
br i1 %cmp6.not.us32.8, label %for.inc.us36.8, label %if.then.us33.8
if.then.us33.8: ; preds = %for.inc.us36.7
%42 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.8 = tail call i32 @putc(i32 noundef 72, ptr noundef %42)
%call13.us35.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 9)
br label %for.inc.us36.8
for.inc.us36.8: ; preds = %if.then.us33.8, %for.inc.us36.7
%arrayidx5.us31.9 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 10
%43 = load i32, ptr %arrayidx5.us31.9, align 4, !tbaa !5
%cmp6.not.us32.9 = icmp eq i32 %43, 1
br i1 %cmp6.not.us32.9, label %for.inc.us36.9, label %if.then.us33.9
if.then.us33.9: ; preds = %for.inc.us36.8
%44 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.9 = tail call i32 @putc(i32 noundef 72, ptr noundef %44)
%call13.us35.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 10)
br label %for.inc.us36.9
for.inc.us36.9: ; preds = %if.then.us33.9, %for.inc.us36.8
%arrayidx5.us31.10 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 11
%45 = load i32, ptr %arrayidx5.us31.10, align 4, !tbaa !5
%cmp6.not.us32.10 = icmp eq i32 %45, 1
br i1 %cmp6.not.us32.10, label %for.inc.us36.10, label %if.then.us33.10
if.then.us33.10: ; preds = %for.inc.us36.9
%46 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.10 = tail call i32 @putc(i32 noundef 72, ptr noundef %46)
%call13.us35.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 11)
br label %for.inc.us36.10
for.inc.us36.10: ; preds = %if.then.us33.10, %for.inc.us36.9
%arrayidx5.us31.11 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 12
%47 = load i32, ptr %arrayidx5.us31.11, align 4, !tbaa !5
%cmp6.not.us32.11 = icmp eq i32 %47, 1
br i1 %cmp6.not.us32.11, label %for.inc.us36.11, label %if.then.us33.11
if.then.us33.11: ; preds = %for.inc.us36.10
%48 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i23.us.11 = tail call i32 @putc(i32 noundef 72, ptr noundef %48)
%call13.us35.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 12)
br label %for.inc.us36.11
for.inc.us36.11: ; preds = %if.then.us33.11, %for.inc.us36.10
%arrayidx5.us31.12 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 13
%49 = load i32, ptr %arrayidx5.us31.12, align 4, !tbaa !5
%cmp6.not.us32.12 = icmp eq i32 %49, 1
br i1 %cmp6.not.us32.12, label %for.inc14, label %for.inc14.sink.split.sink.split
if.then.us45: ; preds = %for.body3.us40.preheader
%50 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us = tail call i32 @putc(i32 noundef 67, ptr noundef %50)
%call13.us47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1)
br label %for.inc.us48
for.inc.us48: ; preds = %if.then.us45, %for.body3.us40.preheader
%arrayidx5.us43.1 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 2
%51 = load i32, ptr %arrayidx5.us43.1, align 4, !tbaa !5
%cmp6.not.us44.1 = icmp eq i32 %51, 1
br i1 %cmp6.not.us44.1, label %for.inc.us48.1, label %if.then.us45.1
if.then.us45.1: ; preds = %for.inc.us48
%52 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.1 = tail call i32 @putc(i32 noundef 67, ptr noundef %52)
%call13.us47.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 2)
br label %for.inc.us48.1
for.inc.us48.1: ; preds = %if.then.us45.1, %for.inc.us48
%arrayidx5.us43.2 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 3
%53 = load i32, ptr %arrayidx5.us43.2, align 4, !tbaa !5
%cmp6.not.us44.2 = icmp eq i32 %53, 1
br i1 %cmp6.not.us44.2, label %for.inc.us48.2, label %if.then.us45.2
if.then.us45.2: ; preds = %for.inc.us48.1
%54 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.2 = tail call i32 @putc(i32 noundef 67, ptr noundef %54)
%call13.us47.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 3)
br label %for.inc.us48.2
for.inc.us48.2: ; preds = %if.then.us45.2, %for.inc.us48.1
%arrayidx5.us43.3 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 4
%55 = load i32, ptr %arrayidx5.us43.3, align 4, !tbaa !5
%cmp6.not.us44.3 = icmp eq i32 %55, 1
br i1 %cmp6.not.us44.3, label %for.inc.us48.3, label %if.then.us45.3
if.then.us45.3: ; preds = %for.inc.us48.2
%56 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.3 = tail call i32 @putc(i32 noundef 67, ptr noundef %56)
%call13.us47.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 4)
br label %for.inc.us48.3
for.inc.us48.3: ; preds = %if.then.us45.3, %for.inc.us48.2
%arrayidx5.us43.4 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 5
%57 = load i32, ptr %arrayidx5.us43.4, align 4, !tbaa !5
%cmp6.not.us44.4 = icmp eq i32 %57, 1
br i1 %cmp6.not.us44.4, label %for.inc.us48.4, label %if.then.us45.4
if.then.us45.4: ; preds = %for.inc.us48.3
%58 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.4 = tail call i32 @putc(i32 noundef 67, ptr noundef %58)
%call13.us47.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 5)
br label %for.inc.us48.4
for.inc.us48.4: ; preds = %if.then.us45.4, %for.inc.us48.3
%arrayidx5.us43.5 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 6
%59 = load i32, ptr %arrayidx5.us43.5, align 4, !tbaa !5
%cmp6.not.us44.5 = icmp eq i32 %59, 1
br i1 %cmp6.not.us44.5, label %for.inc.us48.5, label %if.then.us45.5
if.then.us45.5: ; preds = %for.inc.us48.4
%60 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.5 = tail call i32 @putc(i32 noundef 67, ptr noundef %60)
%call13.us47.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 6)
br label %for.inc.us48.5
for.inc.us48.5: ; preds = %if.then.us45.5, %for.inc.us48.4
%arrayidx5.us43.6 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 7
%61 = load i32, ptr %arrayidx5.us43.6, align 4, !tbaa !5
%cmp6.not.us44.6 = icmp eq i32 %61, 1
br i1 %cmp6.not.us44.6, label %for.inc.us48.6, label %if.then.us45.6
if.then.us45.6: ; preds = %for.inc.us48.5
%62 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.6 = tail call i32 @putc(i32 noundef 67, ptr noundef %62)
%call13.us47.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 7)
br label %for.inc.us48.6
for.inc.us48.6: ; preds = %if.then.us45.6, %for.inc.us48.5
%arrayidx5.us43.7 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 8
%63 = load i32, ptr %arrayidx5.us43.7, align 4, !tbaa !5
%cmp6.not.us44.7 = icmp eq i32 %63, 1
br i1 %cmp6.not.us44.7, label %for.inc.us48.7, label %if.then.us45.7
if.then.us45.7: ; preds = %for.inc.us48.6
%64 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.7 = tail call i32 @putc(i32 noundef 67, ptr noundef %64)
%call13.us47.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 8)
br label %for.inc.us48.7
for.inc.us48.7: ; preds = %if.then.us45.7, %for.inc.us48.6
%arrayidx5.us43.8 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 9
%65 = load i32, ptr %arrayidx5.us43.8, align 4, !tbaa !5
%cmp6.not.us44.8 = icmp eq i32 %65, 1
br i1 %cmp6.not.us44.8, label %for.inc.us48.8, label %if.then.us45.8
if.then.us45.8: ; preds = %for.inc.us48.7
%66 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.8 = tail call i32 @putc(i32 noundef 67, ptr noundef %66)
%call13.us47.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 9)
br label %for.inc.us48.8
for.inc.us48.8: ; preds = %if.then.us45.8, %for.inc.us48.7
%arrayidx5.us43.9 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 10
%67 = load i32, ptr %arrayidx5.us43.9, align 4, !tbaa !5
%cmp6.not.us44.9 = icmp eq i32 %67, 1
br i1 %cmp6.not.us44.9, label %for.inc.us48.9, label %if.then.us45.9
if.then.us45.9: ; preds = %for.inc.us48.8
%68 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.9 = tail call i32 @putc(i32 noundef 67, ptr noundef %68)
%call13.us47.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 10)
br label %for.inc.us48.9
for.inc.us48.9: ; preds = %if.then.us45.9, %for.inc.us48.8
%arrayidx5.us43.10 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 11
%69 = load i32, ptr %arrayidx5.us43.10, align 4, !tbaa !5
%cmp6.not.us44.10 = icmp eq i32 %69, 1
br i1 %cmp6.not.us44.10, label %for.inc.us48.10, label %if.then.us45.10
if.then.us45.10: ; preds = %for.inc.us48.9
%70 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.10 = tail call i32 @putc(i32 noundef 67, ptr noundef %70)
%call13.us47.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 11)
br label %for.inc.us48.10
for.inc.us48.10: ; preds = %if.then.us45.10, %for.inc.us48.9
%arrayidx5.us43.11 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 12
%71 = load i32, ptr %arrayidx5.us43.11, align 4, !tbaa !5
%cmp6.not.us44.11 = icmp eq i32 %71, 1
br i1 %cmp6.not.us44.11, label %for.inc.us48.11, label %if.then.us45.11
if.then.us45.11: ; preds = %for.inc.us48.10
%72 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i24.us.11 = tail call i32 @putc(i32 noundef 67, ptr noundef %72)
%call13.us47.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 12)
br label %for.inc.us48.11
for.inc.us48.11: ; preds = %if.then.us45.11, %for.inc.us48.10
%arrayidx5.us43.12 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 13
%73 = load i32, ptr %arrayidx5.us43.12, align 4, !tbaa !5
%cmp6.not.us44.12 = icmp eq i32 %73, 1
br i1 %cmp6.not.us44.12, label %for.inc14, label %for.inc14.sink.split.sink.split
if.then.us57: ; preds = %for.body3.us52.preheader
%74 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us = tail call i32 @putc(i32 noundef 68, ptr noundef %74)
%call13.us59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1)
br label %for.inc.us60
for.inc.us60: ; preds = %if.then.us57, %for.body3.us52.preheader
%arrayidx5.us55.1 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 2
%75 = load i32, ptr %arrayidx5.us55.1, align 4, !tbaa !5
%cmp6.not.us56.1 = icmp eq i32 %75, 1
br i1 %cmp6.not.us56.1, label %for.inc.us60.1, label %if.then.us57.1
if.then.us57.1: ; preds = %for.inc.us60
%76 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.1 = tail call i32 @putc(i32 noundef 68, ptr noundef %76)
%call13.us59.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 2)
br label %for.inc.us60.1
for.inc.us60.1: ; preds = %if.then.us57.1, %for.inc.us60
%arrayidx5.us55.2 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 3
%77 = load i32, ptr %arrayidx5.us55.2, align 4, !tbaa !5
%cmp6.not.us56.2 = icmp eq i32 %77, 1
br i1 %cmp6.not.us56.2, label %for.inc.us60.2, label %if.then.us57.2
if.then.us57.2: ; preds = %for.inc.us60.1
%78 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.2 = tail call i32 @putc(i32 noundef 68, ptr noundef %78)
%call13.us59.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 3)
br label %for.inc.us60.2
for.inc.us60.2: ; preds = %if.then.us57.2, %for.inc.us60.1
%arrayidx5.us55.3 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 4
%79 = load i32, ptr %arrayidx5.us55.3, align 4, !tbaa !5
%cmp6.not.us56.3 = icmp eq i32 %79, 1
br i1 %cmp6.not.us56.3, label %for.inc.us60.3, label %if.then.us57.3
if.then.us57.3: ; preds = %for.inc.us60.2
%80 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.3 = tail call i32 @putc(i32 noundef 68, ptr noundef %80)
%call13.us59.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 4)
br label %for.inc.us60.3
for.inc.us60.3: ; preds = %if.then.us57.3, %for.inc.us60.2
%arrayidx5.us55.4 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 5
%81 = load i32, ptr %arrayidx5.us55.4, align 4, !tbaa !5
%cmp6.not.us56.4 = icmp eq i32 %81, 1
br i1 %cmp6.not.us56.4, label %for.inc.us60.4, label %if.then.us57.4
if.then.us57.4: ; preds = %for.inc.us60.3
%82 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.4 = tail call i32 @putc(i32 noundef 68, ptr noundef %82)
%call13.us59.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 5)
br label %for.inc.us60.4
for.inc.us60.4: ; preds = %if.then.us57.4, %for.inc.us60.3
%arrayidx5.us55.5 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 6
%83 = load i32, ptr %arrayidx5.us55.5, align 4, !tbaa !5
%cmp6.not.us56.5 = icmp eq i32 %83, 1
br i1 %cmp6.not.us56.5, label %for.inc.us60.5, label %if.then.us57.5
if.then.us57.5: ; preds = %for.inc.us60.4
%84 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.5 = tail call i32 @putc(i32 noundef 68, ptr noundef %84)
%call13.us59.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 6)
br label %for.inc.us60.5
for.inc.us60.5: ; preds = %if.then.us57.5, %for.inc.us60.4
%arrayidx5.us55.6 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 7
%85 = load i32, ptr %arrayidx5.us55.6, align 4, !tbaa !5
%cmp6.not.us56.6 = icmp eq i32 %85, 1
br i1 %cmp6.not.us56.6, label %for.inc.us60.6, label %if.then.us57.6
if.then.us57.6: ; preds = %for.inc.us60.5
%86 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.6 = tail call i32 @putc(i32 noundef 68, ptr noundef %86)
%call13.us59.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 7)
br label %for.inc.us60.6
for.inc.us60.6: ; preds = %if.then.us57.6, %for.inc.us60.5
%arrayidx5.us55.7 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 8
%87 = load i32, ptr %arrayidx5.us55.7, align 4, !tbaa !5
%cmp6.not.us56.7 = icmp eq i32 %87, 1
br i1 %cmp6.not.us56.7, label %for.inc.us60.7, label %if.then.us57.7
if.then.us57.7: ; preds = %for.inc.us60.6
%88 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.7 = tail call i32 @putc(i32 noundef 68, ptr noundef %88)
%call13.us59.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 8)
br label %for.inc.us60.7
for.inc.us60.7: ; preds = %if.then.us57.7, %for.inc.us60.6
%arrayidx5.us55.8 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 9
%89 = load i32, ptr %arrayidx5.us55.8, align 4, !tbaa !5
%cmp6.not.us56.8 = icmp eq i32 %89, 1
br i1 %cmp6.not.us56.8, label %for.inc.us60.8, label %if.then.us57.8
if.then.us57.8: ; preds = %for.inc.us60.7
%90 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.8 = tail call i32 @putc(i32 noundef 68, ptr noundef %90)
%call13.us59.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 9)
br label %for.inc.us60.8
for.inc.us60.8: ; preds = %if.then.us57.8, %for.inc.us60.7
%arrayidx5.us55.9 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 10
%91 = load i32, ptr %arrayidx5.us55.9, align 4, !tbaa !5
%cmp6.not.us56.9 = icmp eq i32 %91, 1
br i1 %cmp6.not.us56.9, label %for.inc.us60.9, label %if.then.us57.9
if.then.us57.9: ; preds = %for.inc.us60.8
%92 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.9 = tail call i32 @putc(i32 noundef 68, ptr noundef %92)
%call13.us59.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 10)
br label %for.inc.us60.9
for.inc.us60.9: ; preds = %if.then.us57.9, %for.inc.us60.8
%arrayidx5.us55.10 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 11
%93 = load i32, ptr %arrayidx5.us55.10, align 4, !tbaa !5
%cmp6.not.us56.10 = icmp eq i32 %93, 1
br i1 %cmp6.not.us56.10, label %for.inc.us60.10, label %if.then.us57.10
if.then.us57.10: ; preds = %for.inc.us60.9
%94 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.10 = tail call i32 @putc(i32 noundef 68, ptr noundef %94)
%call13.us59.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 11)
br label %for.inc.us60.10
for.inc.us60.10: ; preds = %if.then.us57.10, %for.inc.us60.9
%arrayidx5.us55.11 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 12
%95 = load i32, ptr %arrayidx5.us55.11, align 4, !tbaa !5
%cmp6.not.us56.11 = icmp eq i32 %95, 1
br i1 %cmp6.not.us56.11, label %for.inc.us60.11, label %if.then.us57.11
if.then.us57.11: ; preds = %for.inc.us60.10
%96 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i25.us.11 = tail call i32 @putc(i32 noundef 68, ptr noundef %96)
%call13.us59.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 12)
br label %for.inc.us60.11
for.inc.us60.11: ; preds = %if.then.us57.11, %for.inc.us60.10
%arrayidx5.us55.12 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 13
%97 = load i32, ptr %arrayidx5.us55.12, align 4, !tbaa !5
%cmp6.not.us56.12 = icmp eq i32 %97, 1
br i1 %cmp6.not.us56.12, label %for.inc14, label %for.inc14.sink.split.sink.split
if.then: ; preds = %for.body3.preheader
%call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1)
br label %for.inc
for.inc: ; preds = %for.body3.preheader, %if.then
%arrayidx5.1 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 2
%98 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%cmp6.not.1 = icmp eq i32 %98, 1
br i1 %cmp6.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%call13.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 2)
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx5.2 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 3
%99 = load i32, ptr %arrayidx5.2, align 4, !tbaa !5
%cmp6.not.2 = icmp eq i32 %99, 1
br i1 %cmp6.not.2, label %for.inc.2, label %if.then.2
if.then.2: ; preds = %for.inc.1
%call13.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 3)
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx5.3 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 4
%100 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5
%cmp6.not.3 = icmp eq i32 %100, 1
br i1 %cmp6.not.3, label %for.inc.3, label %if.then.3
if.then.3: ; preds = %for.inc.2
%call13.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 4)
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx5.4 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 5
%101 = load i32, ptr %arrayidx5.4, align 4, !tbaa !5
%cmp6.not.4 = icmp eq i32 %101, 1
br i1 %cmp6.not.4, label %for.inc.4, label %if.then.4
if.then.4: ; preds = %for.inc.3
%call13.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 5)
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx5.5 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 6
%102 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5
%cmp6.not.5 = icmp eq i32 %102, 1
br i1 %cmp6.not.5, label %for.inc.5, label %if.then.5
if.then.5: ; preds = %for.inc.4
%call13.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 6)
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx5.6 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 7
%103 = load i32, ptr %arrayidx5.6, align 4, !tbaa !5
%cmp6.not.6 = icmp eq i32 %103, 1
br i1 %cmp6.not.6, label %for.inc.6, label %if.then.6
if.then.6: ; preds = %for.inc.5
%call13.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 7)
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx5.7 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 8
%104 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5
%cmp6.not.7 = icmp eq i32 %104, 1
br i1 %cmp6.not.7, label %for.inc.7, label %if.then.7
if.then.7: ; preds = %for.inc.6
%call13.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 8)
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%arrayidx5.8 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 9
%105 = load i32, ptr %arrayidx5.8, align 4, !tbaa !5
%cmp6.not.8 = icmp eq i32 %105, 1
br i1 %cmp6.not.8, label %for.inc.8, label %if.then.8
if.then.8: ; preds = %for.inc.7
%call13.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 9)
br label %for.inc.8
for.inc.8: ; preds = %if.then.8, %for.inc.7
%arrayidx5.9 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 10
%106 = load i32, ptr %arrayidx5.9, align 4, !tbaa !5
%cmp6.not.9 = icmp eq i32 %106, 1
br i1 %cmp6.not.9, label %for.inc.9, label %if.then.9
if.then.9: ; preds = %for.inc.8
%call13.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 10)
br label %for.inc.9
for.inc.9: ; preds = %if.then.9, %for.inc.8
%arrayidx5.10 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 11
%107 = load i32, ptr %arrayidx5.10, align 4, !tbaa !5
%cmp6.not.10 = icmp eq i32 %107, 1
br i1 %cmp6.not.10, label %for.inc.10, label %if.then.10
if.then.10: ; preds = %for.inc.9
%call13.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 11)
br label %for.inc.10
for.inc.10: ; preds = %if.then.10, %for.inc.9
%arrayidx5.11 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 12
%108 = load i32, ptr %arrayidx5.11, align 4, !tbaa !5
%cmp6.not.11 = icmp eq i32 %108, 1
br i1 %cmp6.not.11, label %for.inc.11, label %if.then.11
if.then.11: ; preds = %for.inc.10
%call13.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 12)
br label %for.inc.11
for.inc.11: ; preds = %if.then.11, %for.inc.10
%arrayidx5.12 = getelementptr inbounds [14 x i32], ptr %va, i64 %indvars.iv, i64 13
%109 = load i32, ptr %arrayidx5.12, align 4, !tbaa !5
%cmp6.not.12 = icmp eq i32 %109, 1
br i1 %cmp6.not.12, label %for.inc14, label %for.inc14.sink.split
for.inc14.sink.split.sink.split: ; preds = %for.inc.us60.11, %for.inc.us48.11, %for.inc.us36.11, %for.inc.us.11
%.sink = phi i32 [ 83, %for.inc.us.11 ], [ 72, %for.inc.us36.11 ], [ 67, %for.inc.us48.11 ], [ 68, %for.inc.us60.11 ]
%110 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.us.12 = tail call i32 @putc(i32 noundef %.sink, ptr noundef %110)
br label %for.inc14.sink.split
for.inc14.sink.split: ; preds = %for.inc14.sink.split.sink.split, %for.inc.11
%call13.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 13)
br label %for.inc14
for.inc14: ; preds = %for.inc14.sink.split, %for.inc.11, %for.inc.us60.11, %for.inc.us48.11, %for.inc.us36.11, %for.inc.us.11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4
br i1 %exitcond.not, label %for.end16, label %for.cond1.preheader, !llvm.loop !11
for.end16: ; preds = %for.inc14
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%quantity = alloca i32, align 4
%num = alloca i32, align 4
%card_num = alloca [4 x [14 x i32]], align 16
%design = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %quantity) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4
call void @llvm.lifetime.start.p0(i64 224, ptr nonnull %card_num) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(224) %card_num, i8 0, i64 224, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %design) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %quantity)
%0 = load i32, ptr %quantity, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.038 = phi i32 [ %inc34, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %design, ptr noundef nonnull %num)
%1 = load i8, ptr %design, align 1, !tbaa !13
switch i8 %1, label %for.inc [
i8 83, label %if.then
i8 72, label %if.then8
i8 67, label %if.then17
i8 68, label %if.then26
]
if.then: ; preds = %for.body
%2 = load i32, ptr %num, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%arrayidx4 = getelementptr inbounds [14 x i32], ptr %card_num, i64 0, i64 %idxprom
br label %for.inc.sink.split
if.then8: ; preds = %for.body
%3 = load i32, ptr %num, align 4, !tbaa !5
%idxprom10 = sext i32 %3 to i64
%arrayidx11 = getelementptr inbounds [4 x [14 x i32]], ptr %card_num, i64 0, i64 1, i64 %idxprom10
br label %for.inc.sink.split
if.then17: ; preds = %for.body
%4 = load i32, ptr %num, align 4, !tbaa !5
%idxprom19 = sext i32 %4 to i64
%arrayidx20 = getelementptr inbounds [4 x [14 x i32]], ptr %card_num, i64 0, i64 2, i64 %idxprom19
br label %for.inc.sink.split
if.then26: ; preds = %for.body
%5 = load i32, ptr %num, align 4, !tbaa !5
%idxprom28 = sext i32 %5 to i64
%arrayidx29 = getelementptr inbounds [4 x [14 x i32]], ptr %card_num, i64 0, i64 3, i64 %idxprom28
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then8, %if.then26, %if.then17, %if.then
%arrayidx4.sink39 = phi ptr [ %arrayidx4, %if.then ], [ %arrayidx20, %if.then17 ], [ %arrayidx29, %if.then26 ], [ %arrayidx11, %if.then8 ]
%6 = load i32, ptr %arrayidx4.sink39, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr %arrayidx4.sink39, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%inc34 = add nuw nsw i32 %i.038, 1
%7 = load i32, ptr %quantity, align 4, !tbaa !5
%mul = shl nsw i32 %7, 1
%cmp = icmp slt i32 %inc34, %mul
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.inc, %entry
call void @print_card(ptr noundef nonnull %card_num)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %design) #4
call void @llvm.lifetime.end.p0(i64 224, ptr nonnull %card_num) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %quantity) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
|
#include <stdio.h>
int main(void) {
int a[4][13]={0};
int n,i,j,t;
char x;
scanf("%d",&n);
for(i=0;i<2*n;i++) {
scanf("%c %d",&x,&t);
switch(x) {
case 'S':
a[0][t-1]=t;break;
case 'H':
a[1][t-1]=t;break;
case 'C':
a[2][t-1]=t;break;
case 'D':
a[3][t-1]=t;break;
}
}
for(i=0;i<4;i++)
for(j=1;j<14;j++)
if(a[i][j-1]!=j)
switch(i) {
case 0:
printf("S %d\n",j);break;
case 1:
printf("H %d\n",j);break;
case 2:
printf("C %d\n",j);break;
case 3:
printf("D %d\n",j);break;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271991/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271991/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%c %d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"S %d\0A\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"H %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"C %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"D %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [4 x [13 x i32]], align 16
%n = alloca i32, align 4
%t = alloca i32, align 4
%x = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %a) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %a, i8 0, i64 208, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp61 = icmp sgt i32 %0, 0
br i1 %cmp61, label %for.body, label %for.cond22.preheader.preheader
for.body: ; preds = %entry, %for.inc
%i.062 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %t)
%1 = load i8, ptr %x, align 1, !tbaa !9
%conv = sext i8 %1 to i32
switch i32 %conv, label %for.inc [
i32 83, label %sw.bb
i32 72, label %sw.bb3
i32 67, label %sw.bb8
i32 68, label %sw.bb13
]
sw.bb: ; preds = %for.body
%2 = load i32, ptr %t, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom = sext i32 %sub to i64
%arrayidx2 = getelementptr inbounds [13 x i32], ptr %a, i64 0, i64 %idxprom
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
sw.bb3: ; preds = %for.body
%3 = load i32, ptr %t, align 4, !tbaa !5
%sub5 = add nsw i32 %3, -1
%idxprom6 = sext i32 %sub5 to i64
%arrayidx7 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 1, i64 %idxprom6
store i32 %3, ptr %arrayidx7, align 4, !tbaa !5
br label %for.inc
sw.bb8: ; preds = %for.body
%4 = load i32, ptr %t, align 4, !tbaa !5
%sub10 = add nsw i32 %4, -1
%idxprom11 = sext i32 %sub10 to i64
%arrayidx12 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 2, i64 %idxprom11
store i32 %4, ptr %arrayidx12, align 4, !tbaa !5
br label %for.inc
sw.bb13: ; preds = %for.body
%5 = load i32, ptr %t, align 4, !tbaa !5
%sub15 = add nsw i32 %5, -1
%idxprom16 = sext i32 %sub15 to i64
%arrayidx17 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 3, i64 %idxprom16
store i32 %5, ptr %arrayidx17, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %sw.bb, %sw.bb3, %sw.bb8, %sw.bb13, %for.body
%inc = add nuw nsw i32 %i.062, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%mul = shl nsw i32 %6, 1
%cmp = icmp slt i32 %inc, %mul
br i1 %cmp, label %for.body, label %for.cond22.preheader.preheader, !llvm.loop !10
for.cond22.preheader.preheader: ; preds = %for.inc, %entry
br label %for.cond22.preheader
for.cond22.preheader: ; preds = %for.cond22.preheader.preheader, %for.inc45
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc45 ], [ 0, %for.cond22.preheader.preheader ]
%7 = trunc i64 %indvars.iv to i32
switch i32 %7, label %for.inc45 [
i32 0, label %for.body25.us.preheader
i32 1, label %for.body25.us65.preheader
i32 2, label %for.body25.us76.preheader
i32 3, label %for.body25.us87.preheader
]
for.body25.us87.preheader: ; preds = %for.cond22.preheader
%arrayidx30.us91 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 0
%8 = load i32, ptr %arrayidx30.us91, align 4, !tbaa !5
%cmp31.not.us92 = icmp eq i32 %8, 1
br i1 %cmp31.not.us92, label %for.inc42.us94, label %if.then.us93
for.body25.us76.preheader: ; preds = %for.cond22.preheader
%arrayidx30.us80 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 0
%9 = load i32, ptr %arrayidx30.us80, align 4, !tbaa !5
%cmp31.not.us81 = icmp eq i32 %9, 1
br i1 %cmp31.not.us81, label %for.inc42.us83, label %if.then.us82
for.body25.us65.preheader: ; preds = %for.cond22.preheader
%arrayidx30.us69 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 0
%10 = load i32, ptr %arrayidx30.us69, align 4, !tbaa !5
%cmp31.not.us70 = icmp eq i32 %10, 1
br i1 %cmp31.not.us70, label %for.inc42.us72, label %if.then.us71
for.body25.us.preheader: ; preds = %for.cond22.preheader
%arrayidx30.us = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 0
%11 = load i32, ptr %arrayidx30.us, align 4, !tbaa !5
%cmp31.not.us = icmp eq i32 %11, 1
br i1 %cmp31.not.us, label %for.inc42.us, label %if.then.us
if.then.us: ; preds = %for.body25.us.preheader
%call34.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
br label %for.inc42.us
for.inc42.us: ; preds = %if.then.us, %for.body25.us.preheader
%arrayidx30.us.1 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 1
%12 = load i32, ptr %arrayidx30.us.1, align 4, !tbaa !5
%cmp31.not.us.1 = icmp eq i32 %12, 2
br i1 %cmp31.not.us.1, label %for.inc42.us.1, label %if.then.us.1
if.then.us.1: ; preds = %for.inc42.us
%call34.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2)
br label %for.inc42.us.1
for.inc42.us.1: ; preds = %if.then.us.1, %for.inc42.us
%arrayidx30.us.2 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 2
%13 = load i32, ptr %arrayidx30.us.2, align 4, !tbaa !5
%cmp31.not.us.2 = icmp eq i32 %13, 3
br i1 %cmp31.not.us.2, label %for.inc42.us.2, label %if.then.us.2
if.then.us.2: ; preds = %for.inc42.us.1
%call34.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3)
br label %for.inc42.us.2
for.inc42.us.2: ; preds = %if.then.us.2, %for.inc42.us.1
%arrayidx30.us.3 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 3
%14 = load i32, ptr %arrayidx30.us.3, align 4, !tbaa !5
%cmp31.not.us.3 = icmp eq i32 %14, 4
br i1 %cmp31.not.us.3, label %for.inc42.us.3, label %if.then.us.3
if.then.us.3: ; preds = %for.inc42.us.2
%call34.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4)
br label %for.inc42.us.3
for.inc42.us.3: ; preds = %if.then.us.3, %for.inc42.us.2
%arrayidx30.us.4 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 4
%15 = load i32, ptr %arrayidx30.us.4, align 4, !tbaa !5
%cmp31.not.us.4 = icmp eq i32 %15, 5
br i1 %cmp31.not.us.4, label %for.inc42.us.4, label %if.then.us.4
if.then.us.4: ; preds = %for.inc42.us.3
%call34.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 5)
br label %for.inc42.us.4
for.inc42.us.4: ; preds = %if.then.us.4, %for.inc42.us.3
%arrayidx30.us.5 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 5
%16 = load i32, ptr %arrayidx30.us.5, align 4, !tbaa !5
%cmp31.not.us.5 = icmp eq i32 %16, 6
br i1 %cmp31.not.us.5, label %for.inc42.us.5, label %if.then.us.5
if.then.us.5: ; preds = %for.inc42.us.4
%call34.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 6)
br label %for.inc42.us.5
for.inc42.us.5: ; preds = %if.then.us.5, %for.inc42.us.4
%arrayidx30.us.6 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 6
%17 = load i32, ptr %arrayidx30.us.6, align 4, !tbaa !5
%cmp31.not.us.6 = icmp eq i32 %17, 7
br i1 %cmp31.not.us.6, label %for.inc42.us.6, label %if.then.us.6
if.then.us.6: ; preds = %for.inc42.us.5
%call34.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 7)
br label %for.inc42.us.6
for.inc42.us.6: ; preds = %if.then.us.6, %for.inc42.us.5
%arrayidx30.us.7 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 7
%18 = load i32, ptr %arrayidx30.us.7, align 4, !tbaa !5
%cmp31.not.us.7 = icmp eq i32 %18, 8
br i1 %cmp31.not.us.7, label %for.inc42.us.7, label %if.then.us.7
if.then.us.7: ; preds = %for.inc42.us.6
%call34.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 8)
br label %for.inc42.us.7
for.inc42.us.7: ; preds = %if.then.us.7, %for.inc42.us.6
%arrayidx30.us.8 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 8
%19 = load i32, ptr %arrayidx30.us.8, align 4, !tbaa !5
%cmp31.not.us.8 = icmp eq i32 %19, 9
br i1 %cmp31.not.us.8, label %for.inc42.us.8, label %if.then.us.8
if.then.us.8: ; preds = %for.inc42.us.7
%call34.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 9)
br label %for.inc42.us.8
for.inc42.us.8: ; preds = %if.then.us.8, %for.inc42.us.7
%arrayidx30.us.9 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 9
%20 = load i32, ptr %arrayidx30.us.9, align 4, !tbaa !5
%cmp31.not.us.9 = icmp eq i32 %20, 10
br i1 %cmp31.not.us.9, label %for.inc42.us.9, label %if.then.us.9
if.then.us.9: ; preds = %for.inc42.us.8
%call34.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 10)
br label %for.inc42.us.9
for.inc42.us.9: ; preds = %if.then.us.9, %for.inc42.us.8
%arrayidx30.us.10 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 10
%21 = load i32, ptr %arrayidx30.us.10, align 4, !tbaa !5
%cmp31.not.us.10 = icmp eq i32 %21, 11
br i1 %cmp31.not.us.10, label %for.inc42.us.10, label %if.then.us.10
if.then.us.10: ; preds = %for.inc42.us.9
%call34.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 11)
br label %for.inc42.us.10
for.inc42.us.10: ; preds = %if.then.us.10, %for.inc42.us.9
%arrayidx30.us.11 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 11
%22 = load i32, ptr %arrayidx30.us.11, align 4, !tbaa !5
%cmp31.not.us.11 = icmp eq i32 %22, 12
br i1 %cmp31.not.us.11, label %for.inc42.us.11, label %if.then.us.11
if.then.us.11: ; preds = %for.inc42.us.10
%call34.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 12)
br label %for.inc42.us.11
for.inc42.us.11: ; preds = %if.then.us.11, %for.inc42.us.10
%arrayidx30.us.12 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 12
%23 = load i32, ptr %arrayidx30.us.12, align 4, !tbaa !5
%cmp31.not.us.12 = icmp eq i32 %23, 13
br i1 %cmp31.not.us.12, label %for.inc45, label %for.inc45.sink.split
if.then.us71: ; preds = %for.body25.us65.preheader
%call36.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1)
br label %for.inc42.us72
for.inc42.us72: ; preds = %if.then.us71, %for.body25.us65.preheader
%arrayidx30.us69.1 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 1
%24 = load i32, ptr %arrayidx30.us69.1, align 4, !tbaa !5
%cmp31.not.us70.1 = icmp eq i32 %24, 2
br i1 %cmp31.not.us70.1, label %for.inc42.us72.1, label %if.then.us71.1
if.then.us71.1: ; preds = %for.inc42.us72
%call36.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2)
br label %for.inc42.us72.1
for.inc42.us72.1: ; preds = %if.then.us71.1, %for.inc42.us72
%arrayidx30.us69.2 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 2
%25 = load i32, ptr %arrayidx30.us69.2, align 4, !tbaa !5
%cmp31.not.us70.2 = icmp eq i32 %25, 3
br i1 %cmp31.not.us70.2, label %for.inc42.us72.2, label %if.then.us71.2
if.then.us71.2: ; preds = %for.inc42.us72.1
%call36.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3)
br label %for.inc42.us72.2
for.inc42.us72.2: ; preds = %if.then.us71.2, %for.inc42.us72.1
%arrayidx30.us69.3 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 3
%26 = load i32, ptr %arrayidx30.us69.3, align 4, !tbaa !5
%cmp31.not.us70.3 = icmp eq i32 %26, 4
br i1 %cmp31.not.us70.3, label %for.inc42.us72.3, label %if.then.us71.3
if.then.us71.3: ; preds = %for.inc42.us72.2
%call36.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4)
br label %for.inc42.us72.3
for.inc42.us72.3: ; preds = %if.then.us71.3, %for.inc42.us72.2
%arrayidx30.us69.4 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 4
%27 = load i32, ptr %arrayidx30.us69.4, align 4, !tbaa !5
%cmp31.not.us70.4 = icmp eq i32 %27, 5
br i1 %cmp31.not.us70.4, label %for.inc42.us72.4, label %if.then.us71.4
if.then.us71.4: ; preds = %for.inc42.us72.3
%call36.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 5)
br label %for.inc42.us72.4
for.inc42.us72.4: ; preds = %if.then.us71.4, %for.inc42.us72.3
%arrayidx30.us69.5 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 5
%28 = load i32, ptr %arrayidx30.us69.5, align 4, !tbaa !5
%cmp31.not.us70.5 = icmp eq i32 %28, 6
br i1 %cmp31.not.us70.5, label %for.inc42.us72.5, label %if.then.us71.5
if.then.us71.5: ; preds = %for.inc42.us72.4
%call36.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 6)
br label %for.inc42.us72.5
for.inc42.us72.5: ; preds = %if.then.us71.5, %for.inc42.us72.4
%arrayidx30.us69.6 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 6
%29 = load i32, ptr %arrayidx30.us69.6, align 4, !tbaa !5
%cmp31.not.us70.6 = icmp eq i32 %29, 7
br i1 %cmp31.not.us70.6, label %for.inc42.us72.6, label %if.then.us71.6
if.then.us71.6: ; preds = %for.inc42.us72.5
%call36.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 7)
br label %for.inc42.us72.6
for.inc42.us72.6: ; preds = %if.then.us71.6, %for.inc42.us72.5
%arrayidx30.us69.7 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 7
%30 = load i32, ptr %arrayidx30.us69.7, align 4, !tbaa !5
%cmp31.not.us70.7 = icmp eq i32 %30, 8
br i1 %cmp31.not.us70.7, label %for.inc42.us72.7, label %if.then.us71.7
if.then.us71.7: ; preds = %for.inc42.us72.6
%call36.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 8)
br label %for.inc42.us72.7
for.inc42.us72.7: ; preds = %if.then.us71.7, %for.inc42.us72.6
%arrayidx30.us69.8 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 8
%31 = load i32, ptr %arrayidx30.us69.8, align 4, !tbaa !5
%cmp31.not.us70.8 = icmp eq i32 %31, 9
br i1 %cmp31.not.us70.8, label %for.inc42.us72.8, label %if.then.us71.8
if.then.us71.8: ; preds = %for.inc42.us72.7
%call36.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 9)
br label %for.inc42.us72.8
for.inc42.us72.8: ; preds = %if.then.us71.8, %for.inc42.us72.7
%arrayidx30.us69.9 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 9
%32 = load i32, ptr %arrayidx30.us69.9, align 4, !tbaa !5
%cmp31.not.us70.9 = icmp eq i32 %32, 10
br i1 %cmp31.not.us70.9, label %for.inc42.us72.9, label %if.then.us71.9
if.then.us71.9: ; preds = %for.inc42.us72.8
%call36.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 10)
br label %for.inc42.us72.9
for.inc42.us72.9: ; preds = %if.then.us71.9, %for.inc42.us72.8
%arrayidx30.us69.10 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 10
%33 = load i32, ptr %arrayidx30.us69.10, align 4, !tbaa !5
%cmp31.not.us70.10 = icmp eq i32 %33, 11
br i1 %cmp31.not.us70.10, label %for.inc42.us72.10, label %if.then.us71.10
if.then.us71.10: ; preds = %for.inc42.us72.9
%call36.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 11)
br label %for.inc42.us72.10
for.inc42.us72.10: ; preds = %if.then.us71.10, %for.inc42.us72.9
%arrayidx30.us69.11 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 11
%34 = load i32, ptr %arrayidx30.us69.11, align 4, !tbaa !5
%cmp31.not.us70.11 = icmp eq i32 %34, 12
br i1 %cmp31.not.us70.11, label %for.inc42.us72.11, label %if.then.us71.11
if.then.us71.11: ; preds = %for.inc42.us72.10
%call36.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 12)
br label %for.inc42.us72.11
for.inc42.us72.11: ; preds = %if.then.us71.11, %for.inc42.us72.10
%arrayidx30.us69.12 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 12
%35 = load i32, ptr %arrayidx30.us69.12, align 4, !tbaa !5
%cmp31.not.us70.12 = icmp eq i32 %35, 13
br i1 %cmp31.not.us70.12, label %for.inc45, label %for.inc45.sink.split
if.then.us82: ; preds = %for.body25.us76.preheader
%call38.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 1)
br label %for.inc42.us83
for.inc42.us83: ; preds = %if.then.us82, %for.body25.us76.preheader
%arrayidx30.us80.1 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 1
%36 = load i32, ptr %arrayidx30.us80.1, align 4, !tbaa !5
%cmp31.not.us81.1 = icmp eq i32 %36, 2
br i1 %cmp31.not.us81.1, label %for.inc42.us83.1, label %if.then.us82.1
if.then.us82.1: ; preds = %for.inc42.us83
%call38.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 2)
br label %for.inc42.us83.1
for.inc42.us83.1: ; preds = %if.then.us82.1, %for.inc42.us83
%arrayidx30.us80.2 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 2
%37 = load i32, ptr %arrayidx30.us80.2, align 4, !tbaa !5
%cmp31.not.us81.2 = icmp eq i32 %37, 3
br i1 %cmp31.not.us81.2, label %for.inc42.us83.2, label %if.then.us82.2
if.then.us82.2: ; preds = %for.inc42.us83.1
%call38.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 3)
br label %for.inc42.us83.2
for.inc42.us83.2: ; preds = %if.then.us82.2, %for.inc42.us83.1
%arrayidx30.us80.3 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 3
%38 = load i32, ptr %arrayidx30.us80.3, align 4, !tbaa !5
%cmp31.not.us81.3 = icmp eq i32 %38, 4
br i1 %cmp31.not.us81.3, label %for.inc42.us83.3, label %if.then.us82.3
if.then.us82.3: ; preds = %for.inc42.us83.2
%call38.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 4)
br label %for.inc42.us83.3
for.inc42.us83.3: ; preds = %if.then.us82.3, %for.inc42.us83.2
%arrayidx30.us80.4 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 4
%39 = load i32, ptr %arrayidx30.us80.4, align 4, !tbaa !5
%cmp31.not.us81.4 = icmp eq i32 %39, 5
br i1 %cmp31.not.us81.4, label %for.inc42.us83.4, label %if.then.us82.4
if.then.us82.4: ; preds = %for.inc42.us83.3
%call38.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 5)
br label %for.inc42.us83.4
for.inc42.us83.4: ; preds = %if.then.us82.4, %for.inc42.us83.3
%arrayidx30.us80.5 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 5
%40 = load i32, ptr %arrayidx30.us80.5, align 4, !tbaa !5
%cmp31.not.us81.5 = icmp eq i32 %40, 6
br i1 %cmp31.not.us81.5, label %for.inc42.us83.5, label %if.then.us82.5
if.then.us82.5: ; preds = %for.inc42.us83.4
%call38.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 6)
br label %for.inc42.us83.5
for.inc42.us83.5: ; preds = %if.then.us82.5, %for.inc42.us83.4
%arrayidx30.us80.6 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 6
%41 = load i32, ptr %arrayidx30.us80.6, align 4, !tbaa !5
%cmp31.not.us81.6 = icmp eq i32 %41, 7
br i1 %cmp31.not.us81.6, label %for.inc42.us83.6, label %if.then.us82.6
if.then.us82.6: ; preds = %for.inc42.us83.5
%call38.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 7)
br label %for.inc42.us83.6
for.inc42.us83.6: ; preds = %if.then.us82.6, %for.inc42.us83.5
%arrayidx30.us80.7 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 7
%42 = load i32, ptr %arrayidx30.us80.7, align 4, !tbaa !5
%cmp31.not.us81.7 = icmp eq i32 %42, 8
br i1 %cmp31.not.us81.7, label %for.inc42.us83.7, label %if.then.us82.7
if.then.us82.7: ; preds = %for.inc42.us83.6
%call38.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 8)
br label %for.inc42.us83.7
for.inc42.us83.7: ; preds = %if.then.us82.7, %for.inc42.us83.6
%arrayidx30.us80.8 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 8
%43 = load i32, ptr %arrayidx30.us80.8, align 4, !tbaa !5
%cmp31.not.us81.8 = icmp eq i32 %43, 9
br i1 %cmp31.not.us81.8, label %for.inc42.us83.8, label %if.then.us82.8
if.then.us82.8: ; preds = %for.inc42.us83.7
%call38.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 9)
br label %for.inc42.us83.8
for.inc42.us83.8: ; preds = %if.then.us82.8, %for.inc42.us83.7
%arrayidx30.us80.9 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 9
%44 = load i32, ptr %arrayidx30.us80.9, align 4, !tbaa !5
%cmp31.not.us81.9 = icmp eq i32 %44, 10
br i1 %cmp31.not.us81.9, label %for.inc42.us83.9, label %if.then.us82.9
if.then.us82.9: ; preds = %for.inc42.us83.8
%call38.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 10)
br label %for.inc42.us83.9
for.inc42.us83.9: ; preds = %if.then.us82.9, %for.inc42.us83.8
%arrayidx30.us80.10 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 10
%45 = load i32, ptr %arrayidx30.us80.10, align 4, !tbaa !5
%cmp31.not.us81.10 = icmp eq i32 %45, 11
br i1 %cmp31.not.us81.10, label %for.inc42.us83.10, label %if.then.us82.10
if.then.us82.10: ; preds = %for.inc42.us83.9
%call38.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 11)
br label %for.inc42.us83.10
for.inc42.us83.10: ; preds = %if.then.us82.10, %for.inc42.us83.9
%arrayidx30.us80.11 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 11
%46 = load i32, ptr %arrayidx30.us80.11, align 4, !tbaa !5
%cmp31.not.us81.11 = icmp eq i32 %46, 12
br i1 %cmp31.not.us81.11, label %for.inc42.us83.11, label %if.then.us82.11
if.then.us82.11: ; preds = %for.inc42.us83.10
%call38.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 12)
br label %for.inc42.us83.11
for.inc42.us83.11: ; preds = %if.then.us82.11, %for.inc42.us83.10
%arrayidx30.us80.12 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 12
%47 = load i32, ptr %arrayidx30.us80.12, align 4, !tbaa !5
%cmp31.not.us81.12 = icmp eq i32 %47, 13
br i1 %cmp31.not.us81.12, label %for.inc45, label %for.inc45.sink.split
if.then.us93: ; preds = %for.body25.us87.preheader
%call40.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1)
br label %for.inc42.us94
for.inc42.us94: ; preds = %if.then.us93, %for.body25.us87.preheader
%arrayidx30.us91.1 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 1
%48 = load i32, ptr %arrayidx30.us91.1, align 4, !tbaa !5
%cmp31.not.us92.1 = icmp eq i32 %48, 2
br i1 %cmp31.not.us92.1, label %for.inc42.us94.1, label %if.then.us93.1
if.then.us93.1: ; preds = %for.inc42.us94
%call40.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 2)
br label %for.inc42.us94.1
for.inc42.us94.1: ; preds = %if.then.us93.1, %for.inc42.us94
%arrayidx30.us91.2 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 2
%49 = load i32, ptr %arrayidx30.us91.2, align 4, !tbaa !5
%cmp31.not.us92.2 = icmp eq i32 %49, 3
br i1 %cmp31.not.us92.2, label %for.inc42.us94.2, label %if.then.us93.2
if.then.us93.2: ; preds = %for.inc42.us94.1
%call40.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 3)
br label %for.inc42.us94.2
for.inc42.us94.2: ; preds = %if.then.us93.2, %for.inc42.us94.1
%arrayidx30.us91.3 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 3
%50 = load i32, ptr %arrayidx30.us91.3, align 4, !tbaa !5
%cmp31.not.us92.3 = icmp eq i32 %50, 4
br i1 %cmp31.not.us92.3, label %for.inc42.us94.3, label %if.then.us93.3
if.then.us93.3: ; preds = %for.inc42.us94.2
%call40.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 4)
br label %for.inc42.us94.3
for.inc42.us94.3: ; preds = %if.then.us93.3, %for.inc42.us94.2
%arrayidx30.us91.4 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 4
%51 = load i32, ptr %arrayidx30.us91.4, align 4, !tbaa !5
%cmp31.not.us92.4 = icmp eq i32 %51, 5
br i1 %cmp31.not.us92.4, label %for.inc42.us94.4, label %if.then.us93.4
if.then.us93.4: ; preds = %for.inc42.us94.3
%call40.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 5)
br label %for.inc42.us94.4
for.inc42.us94.4: ; preds = %if.then.us93.4, %for.inc42.us94.3
%arrayidx30.us91.5 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 5
%52 = load i32, ptr %arrayidx30.us91.5, align 4, !tbaa !5
%cmp31.not.us92.5 = icmp eq i32 %52, 6
br i1 %cmp31.not.us92.5, label %for.inc42.us94.5, label %if.then.us93.5
if.then.us93.5: ; preds = %for.inc42.us94.4
%call40.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 6)
br label %for.inc42.us94.5
for.inc42.us94.5: ; preds = %if.then.us93.5, %for.inc42.us94.4
%arrayidx30.us91.6 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 6
%53 = load i32, ptr %arrayidx30.us91.6, align 4, !tbaa !5
%cmp31.not.us92.6 = icmp eq i32 %53, 7
br i1 %cmp31.not.us92.6, label %for.inc42.us94.6, label %if.then.us93.6
if.then.us93.6: ; preds = %for.inc42.us94.5
%call40.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 7)
br label %for.inc42.us94.6
for.inc42.us94.6: ; preds = %if.then.us93.6, %for.inc42.us94.5
%arrayidx30.us91.7 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 7
%54 = load i32, ptr %arrayidx30.us91.7, align 4, !tbaa !5
%cmp31.not.us92.7 = icmp eq i32 %54, 8
br i1 %cmp31.not.us92.7, label %for.inc42.us94.7, label %if.then.us93.7
if.then.us93.7: ; preds = %for.inc42.us94.6
%call40.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 8)
br label %for.inc42.us94.7
for.inc42.us94.7: ; preds = %if.then.us93.7, %for.inc42.us94.6
%arrayidx30.us91.8 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 8
%55 = load i32, ptr %arrayidx30.us91.8, align 4, !tbaa !5
%cmp31.not.us92.8 = icmp eq i32 %55, 9
br i1 %cmp31.not.us92.8, label %for.inc42.us94.8, label %if.then.us93.8
if.then.us93.8: ; preds = %for.inc42.us94.7
%call40.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 9)
br label %for.inc42.us94.8
for.inc42.us94.8: ; preds = %if.then.us93.8, %for.inc42.us94.7
%arrayidx30.us91.9 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 9
%56 = load i32, ptr %arrayidx30.us91.9, align 4, !tbaa !5
%cmp31.not.us92.9 = icmp eq i32 %56, 10
br i1 %cmp31.not.us92.9, label %for.inc42.us94.9, label %if.then.us93.9
if.then.us93.9: ; preds = %for.inc42.us94.8
%call40.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 10)
br label %for.inc42.us94.9
for.inc42.us94.9: ; preds = %if.then.us93.9, %for.inc42.us94.8
%arrayidx30.us91.10 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 10
%57 = load i32, ptr %arrayidx30.us91.10, align 4, !tbaa !5
%cmp31.not.us92.10 = icmp eq i32 %57, 11
br i1 %cmp31.not.us92.10, label %for.inc42.us94.10, label %if.then.us93.10
if.then.us93.10: ; preds = %for.inc42.us94.9
%call40.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 11)
br label %for.inc42.us94.10
for.inc42.us94.10: ; preds = %if.then.us93.10, %for.inc42.us94.9
%arrayidx30.us91.11 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 11
%58 = load i32, ptr %arrayidx30.us91.11, align 4, !tbaa !5
%cmp31.not.us92.11 = icmp eq i32 %58, 12
br i1 %cmp31.not.us92.11, label %for.inc42.us94.11, label %if.then.us93.11
if.then.us93.11: ; preds = %for.inc42.us94.10
%call40.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 12)
br label %for.inc42.us94.11
for.inc42.us94.11: ; preds = %if.then.us93.11, %for.inc42.us94.10
%arrayidx30.us91.12 = getelementptr inbounds [4 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 12
%59 = load i32, ptr %arrayidx30.us91.12, align 4, !tbaa !5
%cmp31.not.us92.12 = icmp eq i32 %59, 13
br i1 %cmp31.not.us92.12, label %for.inc45, label %for.inc45.sink.split
for.inc45.sink.split: ; preds = %for.inc42.us94.11, %for.inc42.us83.11, %for.inc42.us72.11, %for.inc42.us.11
%.str.5.sink = phi ptr [ @.str.2, %for.inc42.us.11 ], [ @.str.3, %for.inc42.us72.11 ], [ @.str.4, %for.inc42.us83.11 ], [ @.str.5, %for.inc42.us94.11 ]
%call40.us.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink, i32 noundef 13)
br label %for.inc45
for.inc45: ; preds = %for.inc45.sink.split, %for.inc42.us94.11, %for.inc42.us83.11, %for.inc42.us72.11, %for.inc42.us.11, %for.cond22.preheader
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4
br i1 %exitcond.not, label %for.end47, label %for.cond22.preheader, !llvm.loop !12
for.end47: ; preds = %for.inc45
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
int main(){
// freopen("1.in","r",stdin);
int t;
scanf("%d",&t);
int ans,anss;
while(t--){
int n;
scanf("%d",&n);
int a[n],b[n];
char c[n],d[n];
ans=0,anss=0;
scanf("%s",c);
scanf("%s",d);
for(int i=0;i<n;i++)a[i]=c[i]-'0';
for(int i=0;i<n;i++)b[i]=d[i]-'0';
for(int i=0;i<n;i++){
if(a[i]>b[i])ans++;
else if(a[i]<b[i])anss++;
}
//printf("%d %d\n",ans,anss);
if(ans>anss)printf("RED\n");
else if(ans<anss)printf("BLUE\n");
else if(ans==anss)printf("EQUAL\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27212/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27212/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [6 x i8] c"EQUAL\00", align 1
@str.5 = private unnamed_addr constant [5 x i8] c"BLUE\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"RED\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec96 = add nsw i32 %0, -1
store i32 %dec96, ptr %t, align 4, !tbaa !5
%tobool.not97 = icmp eq i32 %0, 0
br i1 %tobool.not97, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end65
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = zext i32 %1 to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %2, align 16
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = zext i32 %4 to i64
%vla2 = alloca i32, i64 %5, align 16
%vla3 = alloca i8, i64 %5, align 16
%vla4 = alloca i8, i64 %5, align 16
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla3)
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla4)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp86 = icmp sgt i32 %6, 0
br i1 %cmp86, label %for.body.preheader, label %if.end65.sink.split
for.body.preheader: ; preds = %while.body
%wide.trip.count = zext i32 %6 to i64
%min.iters.check145 = icmp ult i32 %6, 8
br i1 %min.iters.check145, label %for.body.preheader158, label %vector.ph146
vector.ph146: ; preds = %for.body.preheader
%n.vec148 = and i64 %wide.trip.count, 4294967288
br label %vector.body151
vector.body151: ; preds = %vector.body151, %vector.ph146
%index152 = phi i64 [ 0, %vector.ph146 ], [ %index.next155, %vector.body151 ]
%7 = getelementptr inbounds i8, ptr %vla3, i64 %index152
%wide.load153 = load <4 x i8>, ptr %7, align 8, !tbaa !9
%8 = getelementptr inbounds i8, ptr %7, i64 4
%wide.load154 = load <4 x i8>, ptr %8, align 4, !tbaa !9
%9 = sext <4 x i8> %wide.load153 to <4 x i32>
%10 = sext <4 x i8> %wide.load154 to <4 x i32>
%11 = add nsw <4 x i32> %9, <i32 -48, i32 -48, i32 -48, i32 -48>
%12 = add nsw <4 x i32> %10, <i32 -48, i32 -48, i32 -48, i32 -48>
%13 = getelementptr inbounds i32, ptr %vla, i64 %index152
store <4 x i32> %11, ptr %13, align 16, !tbaa !5
%14 = getelementptr inbounds i32, ptr %13, i64 4
store <4 x i32> %12, ptr %14, align 16, !tbaa !5
%index.next155 = add nuw i64 %index152, 8
%15 = icmp eq i64 %index.next155, %n.vec148
br i1 %15, label %middle.block143, label %vector.body151, !llvm.loop !10
middle.block143: ; preds = %vector.body151
%cmp.n150 = icmp eq i64 %n.vec148, %wide.trip.count
br i1 %cmp.n150, label %for.cond10.preheader, label %for.body.preheader158
for.body.preheader158: ; preds = %for.body.preheader, %middle.block143
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec148, %middle.block143 ]
br label %for.body
for.cond10.preheader: ; preds = %for.body, %middle.block143
br i1 %cmp86, label %for.body14.preheader, label %if.end65.sink.split
for.body14.preheader: ; preds = %for.cond10.preheader
%wide.trip.count102 = zext i32 %6 to i64
%min.iters.check132 = icmp ult i32 %6, 8
br i1 %min.iters.check132, label %for.body14.preheader157, label %vector.ph133
vector.ph133: ; preds = %for.body14.preheader
%n.vec135 = and i64 %wide.trip.count, 4294967288
br label %vector.body138
vector.body138: ; preds = %vector.body138, %vector.ph133
%index139 = phi i64 [ 0, %vector.ph133 ], [ %index.next142, %vector.body138 ]
%16 = getelementptr inbounds i8, ptr %vla4, i64 %index139
%wide.load140 = load <4 x i8>, ptr %16, align 8, !tbaa !9
%17 = getelementptr inbounds i8, ptr %16, i64 4
%wide.load141 = load <4 x i8>, ptr %17, align 4, !tbaa !9
%18 = sext <4 x i8> %wide.load140 to <4 x i32>
%19 = sext <4 x i8> %wide.load141 to <4 x i32>
%20 = add nsw <4 x i32> %18, <i32 -48, i32 -48, i32 -48, i32 -48>
%21 = add nsw <4 x i32> %19, <i32 -48, i32 -48, i32 -48, i32 -48>
%22 = getelementptr inbounds i32, ptr %vla2, i64 %index139
store <4 x i32> %20, ptr %22, align 16, !tbaa !5
%23 = getelementptr inbounds i32, ptr %22, i64 4
store <4 x i32> %21, ptr %23, align 16, !tbaa !5
%index.next142 = add nuw i64 %index139, 8
%24 = icmp eq i64 %index.next142, %n.vec135
br i1 %24, label %middle.block130, label %vector.body138, !llvm.loop !14
middle.block130: ; preds = %vector.body138
%cmp.n137 = icmp eq i64 %n.vec135, %wide.trip.count
br i1 %cmp.n137, label %for.cond25.preheader, label %for.body14.preheader157
for.body14.preheader157: ; preds = %for.body14.preheader, %middle.block130
%indvars.iv99.ph = phi i64 [ 0, %for.body14.preheader ], [ %n.vec135, %middle.block130 ]
br label %for.body14
for.body: ; preds = %for.body.preheader158, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader158 ]
%arrayidx = getelementptr inbounds i8, ptr %vla3, i64 %indvars.iv
%25 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %25 to i32
%sub = add nsw i32 %conv, -48
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
store i32 %sub, ptr %arrayidx8, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond10.preheader, label %for.body, !llvm.loop !15
for.cond25.preheader: ; preds = %for.body14, %middle.block130
br i1 %cmp86, label %for.body29.preheader, label %if.end65.sink.split
for.body29.preheader: ; preds = %for.cond25.preheader
%wide.trip.count107 = zext i32 %6 to i64
%min.iters.check = icmp ult i32 %6, 8
br i1 %min.iters.check, label %for.body29.preheader156, label %vector.ph
vector.ph: ; preds = %for.body29.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %40, %vector.body ]
%vec.phi122 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %41, %vector.body ]
%vec.phi123 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %36, %vector.body ]
%vec.phi124 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %37, %vector.body ]
%26 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %26, align 16, !tbaa !5
%27 = getelementptr inbounds i32, ptr %26, i64 4
%wide.load125 = load <4 x i32>, ptr %27, align 16, !tbaa !5
%28 = getelementptr inbounds i32, ptr %vla2, i64 %index
%wide.load126 = load <4 x i32>, ptr %28, align 16, !tbaa !5
%29 = getelementptr inbounds i32, ptr %28, i64 4
%wide.load127 = load <4 x i32>, ptr %29, align 16, !tbaa !5
%30 = icmp sgt <4 x i32> %wide.load, %wide.load126
%31 = icmp sgt <4 x i32> %wide.load125, %wide.load127
%32 = icmp slt <4 x i32> %wide.load, %wide.load126
%33 = icmp slt <4 x i32> %wide.load125, %wide.load127
%34 = zext <4 x i1> %32 to <4 x i32>
%35 = zext <4 x i1> %33 to <4 x i32>
%36 = add <4 x i32> %vec.phi123, %34
%37 = add <4 x i32> %vec.phi124, %35
%38 = zext <4 x i1> %30 to <4 x i32>
%39 = zext <4 x i1> %31 to <4 x i32>
%40 = add <4 x i32> %vec.phi, %38
%41 = add <4 x i32> %vec.phi122, %39
%index.next = add nuw i64 %index, 8
%42 = icmp eq i64 %index.next, %n.vec
br i1 %42, label %middle.block, label %vector.body, !llvm.loop !16
middle.block: ; preds = %vector.body
%bin.rdx128 = add <4 x i32> %37, %36
%43 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx128)
%bin.rdx = add <4 x i32> %41, %40
%44 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup28, label %for.body29.preheader156
for.body29.preheader156: ; preds = %for.body29.preheader, %middle.block
%indvars.iv104.ph = phi i64 [ 0, %for.body29.preheader ], [ %n.vec, %middle.block ]
%ans.092.ph = phi i32 [ 0, %for.body29.preheader ], [ %44, %middle.block ]
%anss.091.ph = phi i32 [ 0, %for.body29.preheader ], [ %43, %middle.block ]
br label %for.body29
for.body14: ; preds = %for.body14.preheader157, %for.body14
%indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.body14 ], [ %indvars.iv99.ph, %for.body14.preheader157 ]
%arrayidx16 = getelementptr inbounds i8, ptr %vla4, i64 %indvars.iv99
%45 = load i8, ptr %arrayidx16, align 1, !tbaa !9
%conv17 = sext i8 %45 to i32
%sub18 = add nsw i32 %conv17, -48
%arrayidx20 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv99
store i32 %sub18, ptr %arrayidx20, align 4, !tbaa !5
%indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
%exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count102
br i1 %exitcond103.not, label %for.cond25.preheader, label %for.body14, !llvm.loop !17
for.cond.cleanup28: ; preds = %for.body29, %middle.block
%anss.1.lcssa = phi i32 [ %43, %middle.block ], [ %anss.1, %for.body29 ]
%ans.1.lcssa = phi i32 [ %44, %middle.block ], [ %ans.1, %for.body29 ]
%cmp49 = icmp ugt i32 %ans.1.lcssa, %anss.1.lcssa
br i1 %cmp49, label %if.end65.sink.split, label %if.else53
for.body29: ; preds = %for.body29.preheader156, %for.body29
%indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.body29 ], [ %indvars.iv104.ph, %for.body29.preheader156 ]
%ans.092 = phi i32 [ %ans.1, %for.body29 ], [ %ans.092.ph, %for.body29.preheader156 ]
%anss.091 = phi i32 [ %anss.1, %for.body29 ], [ %anss.091.ph, %for.body29.preheader156 ]
%arrayidx31 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv104
%46 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%arrayidx33 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv104
%47 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%cmp34.not = icmp sgt i32 %46, %47
%cmp41 = icmp slt i32 %46, %47
%spec.select = zext i1 %cmp41 to i32
%anss.1 = add nuw nsw i32 %anss.091, %spec.select
%inc36 = zext i1 %cmp34.not to i32
%ans.1 = add nuw nsw i32 %ans.092, %inc36
%indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
%exitcond108.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count107
br i1 %exitcond108.not, label %for.cond.cleanup28, label %for.body29, !llvm.loop !18
if.else53: ; preds = %for.cond.cleanup28
%cmp54 = icmp ult i32 %ans.1.lcssa, %anss.1.lcssa
br i1 %cmp54, label %if.end65.sink.split, label %if.else58
if.else58: ; preds = %if.else53
%cmp59 = icmp eq i32 %ans.1.lcssa, %anss.1.lcssa
br i1 %cmp59, label %if.end65.sink.split, label %if.end65
if.end65.sink.split: ; preds = %if.else58, %for.cond25.preheader, %for.cond10.preheader, %while.body, %if.else53, %for.cond.cleanup28
%str.5.sink = phi ptr [ @str.6, %for.cond.cleanup28 ], [ @str.5, %if.else53 ], [ @str, %while.body ], [ @str, %for.cond10.preheader ], [ @str, %for.cond25.preheader ], [ @str, %if.else58 ]
%puts84 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
br label %if.end65
if.end65: ; preds = %if.end65.sink.split, %if.else58
call void @llvm.stackrestore.p0(ptr %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
%48 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %48, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %48, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !19
while.end: ; preds = %if.end65, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !12, !13}
!15 = distinct !{!15, !11, !13, !12}
!16 = distinct !{!16, !11, !12, !13}
!17 = distinct !{!17, !11, !13, !12}
!18 = distinct !{!18, !11, !13, !12}
!19 = distinct !{!19, !11}
|
#include<stdio.h>
int main(){
int t;
scanf("%d", &t);
while(t--){
int n;
scanf("%d", &n);
char r[n];
char b[n];
scanf("%s", r);
scanf("%s", b);
int tr = 0, tb = 0;
for(int i = 0;i < n;i++){
if(r[i] > b[i]){
tr++;
} else if(b[i] > r[i]){
tb++;
}
}
if(tr > tb){
printf("RED\n");
} else if(tb > tr){
printf("BLUE\n");
} else {
printf("EQUAL\n");
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27225/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27225/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [6 x i8] c"EQUAL\00", align 1
@str.5 = private unnamed_addr constant [5 x i8] c"BLUE\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"RED\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec51 = add nsw i32 %0, -1
store i32 %dec51, ptr %t, align 4, !tbaa !5
%tobool.not52 = icmp eq i32 %0, 0
br i1 %tobool.not52, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end34
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = zext i32 %1 to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %2, align 16
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = zext i32 %4 to i64
%vla2 = alloca i8, i64 %5, align 16
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla2)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp46 = icmp sgt i32 %6, 0
br i1 %cmp46, label %for.body.preheader, label %if.else31
for.body.preheader: ; preds = %while.body
%wide.trip.count = zext i32 %6 to i64
%min.iters.check = icmp ult i32 %6, 8
br i1 %min.iters.check, label %for.body.preheader70, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
%vec.phi62 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
%vec.phi63 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%vec.phi64 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
%7 = getelementptr inbounds i8, ptr %vla, i64 %index
%wide.load = load <4 x i8>, ptr %7, align 8, !tbaa !9
%8 = getelementptr inbounds i8, ptr %7, i64 4
%wide.load65 = load <4 x i8>, ptr %8, align 4, !tbaa !9
%9 = getelementptr inbounds i8, ptr %vla2, i64 %index
%wide.load66 = load <4 x i8>, ptr %9, align 8, !tbaa !9
%10 = getelementptr inbounds i8, ptr %9, i64 4
%wide.load67 = load <4 x i8>, ptr %10, align 4, !tbaa !9
%11 = icmp sgt <4 x i8> %wide.load, %wide.load66
%12 = icmp sgt <4 x i8> %wide.load65, %wide.load67
%13 = icmp sgt <4 x i8> %wide.load66, %wide.load
%14 = icmp sgt <4 x i8> %wide.load67, %wide.load65
%15 = zext <4 x i1> %11 to <4 x i32>
%16 = zext <4 x i1> %12 to <4 x i32>
%17 = add <4 x i32> %vec.phi63, %15
%18 = add <4 x i32> %vec.phi64, %16
%19 = zext <4 x i1> %13 to <4 x i32>
%20 = zext <4 x i1> %14 to <4 x i32>
%21 = add <4 x i32> %vec.phi, %19
%22 = add <4 x i32> %vec.phi62, %20
%index.next = add nuw i64 %index, 8
%23 = icmp eq i64 %index.next, %n.vec
br i1 %23, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%bin.rdx68 = add <4 x i32> %18, %17
%24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx68)
%bin.rdx = add <4 x i32> %22, %21
%25 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader70
for.body.preheader70: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%tb.048.ph = phi i32 [ 0, %for.body.preheader ], [ %25, %middle.block ]
%tr.047.ph = phi i32 [ 0, %for.body.preheader ], [ %24, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block
%tr.1.lcssa = phi i32 [ %24, %middle.block ], [ %tr.1, %for.body ]
%tb.1.lcssa = phi i32 [ %25, %middle.block ], [ %tb.1, %for.body ]
%cmp22 = icmp ugt i32 %tr.1.lcssa, %tb.1.lcssa
br i1 %cmp22, label %if.end34, label %if.else26
for.body: ; preds = %for.body.preheader70, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader70 ]
%tb.048 = phi i32 [ %tb.1, %for.body ], [ %tb.048.ph, %for.body.preheader70 ]
%tr.047 = phi i32 [ %tr.1, %for.body ], [ %tr.047.ph, %for.body.preheader70 ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%26 = load i8, ptr %arrayidx, align 1, !tbaa !9
%arrayidx6 = getelementptr inbounds i8, ptr %vla2, i64 %indvars.iv
%27 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%cmp8 = icmp sgt i8 %26, %27
%cmp16 = icmp sgt i8 %27, %26
%inc = zext i1 %cmp8 to i32
%tr.1 = add nuw nsw i32 %tr.047, %inc
%spec.select = zext i1 %cmp16 to i32
%tb.1 = add nuw nsw i32 %tb.048, %spec.select
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14
if.else26: ; preds = %for.cond.cleanup
%cmp27 = icmp ugt i32 %tb.1.lcssa, %tr.1.lcssa
br i1 %cmp27, label %if.end34, label %if.else31
if.else31: ; preds = %while.body, %if.else26
br label %if.end34
if.end34: ; preds = %if.else26, %for.cond.cleanup, %if.else31
%str.5.sink = phi ptr [ @str, %if.else31 ], [ @str.6, %for.cond.cleanup ], [ @str.5, %if.else26 ]
%puts44 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
call void @llvm.stackrestore.p0(ptr %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
%28 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %28, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %28, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %if.end34, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
!15 = distinct !{!15, !11}
|
// AOJ 2361: Sort
// 2018.4.10 bal4u
#include <stdio.h>
#include <string.h>
#define QSIZE 5000000
#define PARENT(i) ((i)>>1)
#define LEFT(i) ((i)<<1)
#define RIGHT(i) (((i)<<1)+1)
typedef struct { int s, t; } QUE;
QUE que[QSIZE+2]; int qsize;
void min_heapify(int i)
{
int l, r, min;
QUE qt;
l = LEFT(i), r = RIGHT(i);
if (l < qsize && que[l].t < que[i].t) min = l; else min = i;
if (r < qsize && que[r].t < que[min].t) min = r;
if (min != i) {
qt = que[i], que[i] = que[min], que[min] = qt;
min_heapify(min);
}
}
void deq()
{
que[0] = que[--qsize];
min_heapify(0);
}
void enq(int s, int t)
{
int i, min;
QUE qt;
i = qsize++;
que[i].s = s, que[i].t = t;
while (i > 0 && que[min = PARENT(i)].t > que[i].t) {
qt = que[i], que[i] = que[min], que[min] = qt;
i = min;
}
}
//#define getchar_unlocked() getchar()
int in()
{
int n = 0, c = getchar_unlocked();
do n = 10*n + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
return n;
}
#define INF 0x30303030
int c[8][8]; int n;
int dist[1<<24];
int main()
{
int i, j, s, ns, t, nt, a, b, bi, bj, ans;
n = in();
for (i = 0; i < n; i++) for (j = 0; j < n; j++) c[i][j] = in();
memset(dist, INF, sizeof(dist));
s = 0; for (i = 0; i < n; i++) s = (s << 3) | i;
//printf("n %d, s %x\n", n, s);
ans = 0, qsize = 0, enq(s, 0);
while (qsize) {
s = que[0].s, t = que[0].t, deq();
//printf("s %x, t %d\n", s, t);
if (dist[s] <= t) continue;
dist[s] = t;
if (t > ans) ans = t;
for (i = 0; i < n; i++) {
bi = 3*(n-i-1), a = (s >> bi) & 7;
//printf("s %x, i %d, bi %d, a %d\n", s, i, bi, a);
for (j = i+1; j < n; j++) {
bj = 3*(n-j-1), b = (s >> bj) & 7;
ns = (s ^ (a << bi) ^ (b << bj)) | (b << bi) | (a << bj);
nt = t + c[i][j];
//printf("s %x --> ns %x, b %x, i %d, j %d, nt %d\n", s, ns, b, i, j, nt);
if (dist[ns] <= nt) continue;
enq(ns, nt);
}
}
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272567/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272567/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.QUE = type { i32, i32 }
%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
@qsize = dso_local local_unnamed_addr global i32 0, align 4
@que = dso_local local_unnamed_addr global [5000002 x %struct.QUE] zeroinitializer, align 16
@n = dso_local local_unnamed_addr global i32 0, align 4
@c = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16
@dist = dso_local local_unnamed_addr global [16777216 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @min_heapify(i32 noundef %i) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qsize, align 4, !tbaa !5
br label %tailrecurse
tailrecurse: ; preds = %if.then18, %entry
%i.tr = phi i32 [ %i, %entry ], [ %min.1, %if.then18 ]
%shl = shl i32 %i.tr, 1
%add = or i32 %shl, 1
%cmp = icmp slt i32 %shl, %0
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %tailrecurse
%idxprom = sext i32 %shl to i64
%t = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 1
%1 = load i32, ptr %t, align 4, !tbaa !9
%idxprom2 = sext i32 %i.tr to i64
%t4 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2, i32 1
%2 = load i32, ptr %t4, align 4, !tbaa !9
%cmp5 = icmp slt i32 %1, %2
br i1 %cmp5, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %tailrecurse
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%min.0 = phi i32 [ %i.tr, %if.else ], [ %shl, %land.lhs.true ]
%cmp6 = icmp slt i32 %add, %0
br i1 %cmp6, label %land.lhs.true7, label %if.end16
land.lhs.true7: ; preds = %if.end
%idxprom8 = sext i32 %add to i64
%t10 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8, i32 1
%3 = load i32, ptr %t10, align 4, !tbaa !9
%idxprom11 = sext i32 %min.0 to i64
%t13 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11, i32 1
%4 = load i32, ptr %t13, align 4, !tbaa !9
%cmp14 = icmp slt i32 %3, %4
%spec.select = select i1 %cmp14, i32 %add, i32 %min.0
br label %if.end16
if.end16: ; preds = %land.lhs.true7, %if.end
%min.1 = phi i32 [ %min.0, %if.end ], [ %spec.select, %land.lhs.true7 ]
%cmp17.not = icmp eq i32 %min.1, %i.tr
br i1 %cmp17.not, label %if.end27, label %if.then18
if.then18: ; preds = %if.end16
%idxprom19 = sext i32 %i.tr to i64
%arrayidx20 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19
%5 = load i64, ptr %arrayidx20, align 8
%idxprom23 = sext i32 %min.1 to i64
%arrayidx24 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23
%6 = load i64, ptr %arrayidx24, align 8
store i64 %6, ptr %arrayidx20, align 8
store i64 %5, ptr %arrayidx24, align 8
br label %tailrecurse
if.end27: ; preds = %if.end16
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @deq() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @qsize, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8
store i64 %1, ptr @que, align 16
br label %tailrecurse.i
tailrecurse.i: ; preds = %if.then18.i, %entry
%i.tr.i = phi i32 [ 0, %entry ], [ %min.1.i, %if.then18.i ]
%shl.i = shl i32 %i.tr.i, 1
%add.i = or i32 %shl.i, 1
%cmp.i = icmp slt i32 %shl.i, %dec
br i1 %cmp.i, label %land.lhs.true.i, label %if.else.i
land.lhs.true.i: ; preds = %tailrecurse.i
%idxprom.i = sext i32 %shl.i to i64
%t.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i, i32 1
%2 = load i32, ptr %t.i, align 4, !tbaa !9
%idxprom2.i = sext i32 %i.tr.i to i64
%t4.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2.i, i32 1
%3 = load i32, ptr %t4.i, align 4, !tbaa !9
%cmp5.i = icmp slt i32 %2, %3
br i1 %cmp5.i, label %if.end.i, label %if.else.i
if.else.i: ; preds = %land.lhs.true.i, %tailrecurse.i
br label %if.end.i
if.end.i: ; preds = %if.else.i, %land.lhs.true.i
%min.0.i = phi i32 [ %i.tr.i, %if.else.i ], [ %shl.i, %land.lhs.true.i ]
%cmp6.i = icmp slt i32 %add.i, %dec
br i1 %cmp6.i, label %land.lhs.true7.i, label %if.end16.i
land.lhs.true7.i: ; preds = %if.end.i
%idxprom8.i = sext i32 %add.i to i64
%t10.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i, i32 1
%4 = load i32, ptr %t10.i, align 4, !tbaa !9
%idxprom11.i = sext i32 %min.0.i to i64
%t13.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11.i, i32 1
%5 = load i32, ptr %t13.i, align 4, !tbaa !9
%cmp14.i = icmp slt i32 %4, %5
%spec.select.i = select i1 %cmp14.i, i32 %add.i, i32 %min.0.i
br label %if.end16.i
if.end16.i: ; preds = %land.lhs.true7.i, %if.end.i
%min.1.i = phi i32 [ %min.0.i, %if.end.i ], [ %spec.select.i, %land.lhs.true7.i ]
%cmp17.not.i = icmp eq i32 %min.1.i, %i.tr.i
br i1 %cmp17.not.i, label %min_heapify.exit, label %if.then18.i
if.then18.i: ; preds = %if.end16.i
%idxprom19.i = sext i32 %i.tr.i to i64
%arrayidx20.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19.i
%6 = load i64, ptr %arrayidx20.i, align 8
%idxprom23.i = sext i32 %min.1.i to i64
%arrayidx24.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23.i
%7 = load i64, ptr %arrayidx24.i, align 8
store i64 %7, ptr %arrayidx20.i, align 8
store i64 %6, ptr %arrayidx24.i, align 8
br label %tailrecurse.i
min_heapify.exit: ; preds = %if.end16.i
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @enq(i32 noundef %s, i32 noundef %t) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @qsize, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
store i32 %s, ptr %arrayidx, align 8, !tbaa !11
%t4 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 1
store i32 %t, ptr %t4, align 4, !tbaa !9
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %land.rhs, label %while.end
land.rhs: ; preds = %entry, %while.body
%i.029 = phi i32 [ %shr, %while.body ], [ %0, %entry ]
%shr = lshr i32 %i.029, 1
%idxprom5 = zext i32 %shr to i64
%t7 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5, i32 1
%1 = load i32, ptr %t7, align 4, !tbaa !9
%idxprom8 = zext i32 %i.029 to i64
%t10 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8, i32 1
%2 = load i32, ptr %t10, align 4, !tbaa !9
%cmp11 = icmp sgt i32 %1, %2
br i1 %cmp11, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx9 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8
%arrayidx6 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5
%3 = load i64, ptr %arrayidx9, align 8
%4 = load i64, ptr %arrayidx6, align 8
store i64 %4, ptr %arrayidx9, align 8
store i64 %3, ptr %arrayidx6, align 8
%cmp.not = icmp ult i32 %i.029, 2
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !12
while.end: ; preds = %land.rhs, %while.body, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !14
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !16
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !20
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !21
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #6
%.pre14.pre = load ptr, ptr @stdin, align 8, !tbaa !14
br label %do.body.preheader
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !16
%3 = load i8, ptr %1, align 1, !tbaa !22
%conv3.i = zext i8 %3 to i32
br label %do.body.preheader
do.body.preheader: ; preds = %cond.true.i, %cond.false.i
%.ph = phi ptr [ %0, %cond.false.i ], [ %.pre14.pre, %cond.true.i ]
%c.0.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ]
br label %do.body
do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit13
%4 = phi ptr [ %8, %getchar_unlocked.exit13 ], [ %.ph, %do.body.preheader ]
%n.0 = phi i32 [ %add, %getchar_unlocked.exit13 ], [ 0, %do.body.preheader ]
%c.0 = phi i32 [ %cond.i9, %getchar_unlocked.exit13 ], [ %c.0.ph, %do.body.preheader ]
%mul = mul nsw i32 %n.0, 10
%and = and i32 %c.0, 15
%add = add nsw i32 %and, %mul
%_IO_read_ptr.i4 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i4, align 8, !tbaa !16
%_IO_read_end.i5 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i5, align 8, !tbaa !20
%cmp.not.i6 = icmp ult ptr %5, %6
br i1 %cmp.not.i6, label %cond.false.i10, label %cond.true.i7, !prof !21
cond.true.i7: ; preds = %do.body
%call.i8 = tail call i32 @__uflow(ptr noundef nonnull %4) #6
%.pre = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit13
cond.false.i10: ; preds = %do.body
%incdec.ptr.i11 = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i11, ptr %_IO_read_ptr.i4, align 8, !tbaa !16
%7 = load i8, ptr %5, align 1, !tbaa !22
%conv3.i12 = zext i8 %7 to i32
br label %getchar_unlocked.exit13
getchar_unlocked.exit13: ; preds = %cond.true.i7, %cond.false.i10
%8 = phi ptr [ %.pre, %cond.true.i7 ], [ %4, %cond.false.i10 ]
%cond.i9 = phi i32 [ %call.i8, %cond.true.i7 ], [ %conv3.i12, %cond.false.i10 ]
%cmp = icmp sgt i32 %cond.i9, 47
br i1 %cmp, label %do.body, label %do.end, !llvm.loop !23
do.end: ; preds = %getchar_unlocked.exit13
ret i32 %add
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !14
%_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !16
%_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !20
%cmp.not.i.i = icmp ult ptr %1, %2
br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !21
cond.true.i.i: ; preds = %entry
%call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #6
%.pre14.pre.i = load ptr, ptr @stdin, align 8, !tbaa !14
br label %do.body.i.preheader
cond.false.i.i: ; preds = %entry
%incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !16
%3 = load i8, ptr %1, align 1, !tbaa !22
%conv3.i.i = zext i8 %3 to i32
br label %do.body.i.preheader
do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i
%.ph210 = phi ptr [ %0, %cond.false.i.i ], [ %.pre14.pre.i, %cond.true.i.i ]
%c.0.i.ph = phi i32 [ %conv3.i.i, %cond.false.i.i ], [ %call.i.i, %cond.true.i.i ]
br label %do.body.i
do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit13.i
%4 = phi ptr [ %8, %getchar_unlocked.exit13.i ], [ %.ph210, %do.body.i.preheader ]
%n.0.i = phi i32 [ %add.i, %getchar_unlocked.exit13.i ], [ 0, %do.body.i.preheader ]
%c.0.i = phi i32 [ %cond.i9.i, %getchar_unlocked.exit13.i ], [ %c.0.i.ph, %do.body.i.preheader ]
%mul.i = mul nsw i32 %n.0.i, 10
%and.i = and i32 %c.0.i, 15
%add.i = add nsw i32 %and.i, %mul.i
%_IO_read_ptr.i4.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !16
%_IO_read_end.i5.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i5.i, align 8, !tbaa !20
%cmp.not.i6.i = icmp ult ptr %5, %6
br i1 %cmp.not.i6.i, label %cond.false.i10.i, label %cond.true.i7.i, !prof !21
cond.true.i7.i: ; preds = %do.body.i
%call.i8.i = tail call i32 @__uflow(ptr noundef nonnull %4) #6
%.pre.i = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit13.i
cond.false.i10.i: ; preds = %do.body.i
%incdec.ptr.i11.i = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i11.i, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !16
%7 = load i8, ptr %5, align 1, !tbaa !22
%conv3.i12.i = zext i8 %7 to i32
br label %getchar_unlocked.exit13.i
getchar_unlocked.exit13.i: ; preds = %cond.false.i10.i, %cond.true.i7.i
%8 = phi ptr [ %.pre.i, %cond.true.i7.i ], [ %4, %cond.false.i10.i ]
%cond.i9.i = phi i32 [ %call.i8.i, %cond.true.i7.i ], [ %conv3.i12.i, %cond.false.i10.i ]
%cmp.i = icmp sgt i32 %cond.i9.i, 47
br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !23
in.exit: ; preds = %getchar_unlocked.exit13.i
store i32 %add.i, ptr @n, align 4, !tbaa !5
%cmp150 = icmp sgt i32 %add.i, 0
br i1 %cmp150, label %for.cond1.preheader, label %for.end9.thread
for.end9.thread: ; preds = %in.exit
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(67108864) @dist, i8 48, i64 67108864, i1 false)
br label %enq.exit
for.cond1.preheader: ; preds = %in.exit, %for.inc7
%9 = phi i32 [ %24, %for.inc7 ], [ %add.i, %in.exit ]
%10 = phi ptr [ %25, %for.inc7 ], [ %8, %in.exit ]
%indvars.iv180 = phi i64 [ %indvars.iv.next181, %for.inc7 ], [ 0, %in.exit ]
%cmp2148 = icmp sgt i32 %9, 0
br i1 %cmp2148, label %for.body3, label %for.cond1.preheader.for.inc7_crit_edge
for.cond1.preheader.for.inc7_crit_edge: ; preds = %for.cond1.preheader
%.pre = sext i32 %9 to i64
br label %for.inc7
for.body3: ; preds = %for.cond1.preheader, %in.exit127
%11 = phi ptr [ %20, %in.exit127 ], [ %10, %for.cond1.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next, %in.exit127 ], [ 0, %for.cond1.preheader ]
%_IO_read_ptr.i.i97 = getelementptr inbounds %struct._IO_FILE, ptr %11, i64 0, i32 1
%12 = load ptr, ptr %_IO_read_ptr.i.i97, align 8, !tbaa !16
%_IO_read_end.i.i98 = getelementptr inbounds %struct._IO_FILE, ptr %11, i64 0, i32 2
%13 = load ptr, ptr %_IO_read_end.i.i98, align 8, !tbaa !20
%cmp.not.i.i99 = icmp ult ptr %12, %13
br i1 %cmp.not.i.i99, label %cond.false.i.i124, label %cond.true.i.i100, !prof !21
cond.true.i.i100: ; preds = %for.body3
%call.i.i101 = tail call i32 @__uflow(ptr noundef nonnull %11) #6
%.pre14.pre.i102 = load ptr, ptr @stdin, align 8, !tbaa !14
br label %do.body.i106.preheader
cond.false.i.i124: ; preds = %for.body3
%incdec.ptr.i.i125 = getelementptr inbounds i8, ptr %12, i64 1
store ptr %incdec.ptr.i.i125, ptr %_IO_read_ptr.i.i97, align 8, !tbaa !16
%14 = load i8, ptr %12, align 1, !tbaa !22
%conv3.i.i126 = zext i8 %14 to i32
br label %do.body.i106.preheader
do.body.i106.preheader: ; preds = %cond.false.i.i124, %cond.true.i.i100
%.ph206 = phi ptr [ %11, %cond.false.i.i124 ], [ %.pre14.pre.i102, %cond.true.i.i100 ]
%c.0.i108.ph = phi i32 [ %conv3.i.i126, %cond.false.i.i124 ], [ %call.i.i101, %cond.true.i.i100 ]
br label %do.body.i106
do.body.i106: ; preds = %do.body.i106.preheader, %getchar_unlocked.exit13.i118
%15 = phi ptr [ %20, %getchar_unlocked.exit13.i118 ], [ %.ph206, %do.body.i106.preheader ]
%16 = phi ptr [ %21, %getchar_unlocked.exit13.i118 ], [ %.ph206, %do.body.i106.preheader ]
%n.0.i107 = phi i32 [ %add.i111, %getchar_unlocked.exit13.i118 ], [ 0, %do.body.i106.preheader ]
%c.0.i108 = phi i32 [ %cond.i9.i119, %getchar_unlocked.exit13.i118 ], [ %c.0.i108.ph, %do.body.i106.preheader ]
%mul.i109 = mul nsw i32 %n.0.i107, 10
%and.i110 = and i32 %c.0.i108, 15
%add.i111 = add nsw i32 %and.i110, %mul.i109
%_IO_read_ptr.i4.i112 = getelementptr inbounds %struct._IO_FILE, ptr %16, i64 0, i32 1
%17 = load ptr, ptr %_IO_read_ptr.i4.i112, align 8, !tbaa !16
%_IO_read_end.i5.i113 = getelementptr inbounds %struct._IO_FILE, ptr %16, i64 0, i32 2
%18 = load ptr, ptr %_IO_read_end.i5.i113, align 8, !tbaa !20
%cmp.not.i6.i114 = icmp ult ptr %17, %18
br i1 %cmp.not.i6.i114, label %cond.false.i10.i121, label %cond.true.i7.i115, !prof !21
cond.true.i7.i115: ; preds = %do.body.i106
%call.i8.i116 = tail call i32 @__uflow(ptr noundef nonnull %16) #6
%.pre.i117 = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit13.i118
cond.false.i10.i121: ; preds = %do.body.i106
%incdec.ptr.i11.i122 = getelementptr inbounds i8, ptr %17, i64 1
store ptr %incdec.ptr.i11.i122, ptr %_IO_read_ptr.i4.i112, align 8, !tbaa !16
%19 = load i8, ptr %17, align 1, !tbaa !22
%conv3.i12.i123 = zext i8 %19 to i32
br label %getchar_unlocked.exit13.i118
getchar_unlocked.exit13.i118: ; preds = %cond.false.i10.i121, %cond.true.i7.i115
%20 = phi ptr [ %.pre.i117, %cond.true.i7.i115 ], [ %15, %cond.false.i10.i121 ]
%21 = phi ptr [ %.pre.i117, %cond.true.i7.i115 ], [ %16, %cond.false.i10.i121 ]
%cond.i9.i119 = phi i32 [ %call.i8.i116, %cond.true.i7.i115 ], [ %conv3.i12.i123, %cond.false.i10.i121 ]
%cmp.i120 = icmp sgt i32 %cond.i9.i119, 47
br i1 %cmp.i120, label %do.body.i106, label %in.exit127, !llvm.loop !23
in.exit127: ; preds = %getchar_unlocked.exit13.i118
%arrayidx6 = getelementptr inbounds [8 x [8 x i32]], ptr @c, i64 0, i64 %indvars.iv180, i64 %indvars.iv
store i32 %add.i111, ptr %arrayidx6, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%22 = load i32, ptr @n, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %23
br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !24
for.inc7: ; preds = %in.exit127, %for.cond1.preheader.for.inc7_crit_edge
%.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc7_crit_edge ], [ %23, %in.exit127 ]
%24 = phi i32 [ %9, %for.cond1.preheader.for.inc7_crit_edge ], [ %22, %in.exit127 ]
%25 = phi ptr [ %10, %for.cond1.preheader.for.inc7_crit_edge ], [ %20, %in.exit127 ]
%indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
%cmp = icmp slt i64 %indvars.iv.next181, %.pre-phi
br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !25
for.end9: ; preds = %for.inc7
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(67108864) @dist, i8 48, i64 67108864, i1 false)
%cmp11152 = icmp sgt i32 %24, 0
br i1 %cmp11152, label %for.body12.preheader, label %enq.exit
for.body12.preheader: ; preds = %for.end9
%xtraiter = and i32 %24, 7
%26 = icmp ult i32 %24, 8
br i1 %26, label %enq.exit.loopexit.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i32 %24, -8
br label %for.body12
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%i.1154 = phi i32 [ 0, %for.body12.preheader.new ], [ %inc14.7, %for.body12 ]
%s.0153 = phi i32 [ 0, %for.body12.preheader.new ], [ %or.7, %for.body12 ]
%niter = phi i32 [ 0, %for.body12.preheader.new ], [ %niter.next.7, %for.body12 ]
%inc14 = or i32 %i.1154, 1
%27 = shl i32 %s.0153, 6
%28 = shl i32 %i.1154, 3
%shl.1 = or i32 %27, %28
%or.1 = or i32 %shl.1, %inc14
%inc14.2 = or i32 %i.1154, 3
%29 = shl i32 %or.1, 6
%inc14.1 = shl i32 %i.1154, 3
%30 = or i32 %inc14.1, 16
%shl.3 = or i32 %29, %30
%or.3 = or i32 %shl.3, %inc14.2
%inc14.4 = or i32 %i.1154, 5
%31 = shl i32 %or.3, 6
%inc14.3 = shl i32 %i.1154, 3
%32 = or i32 %inc14.3, 32
%shl.5 = or i32 %31, %32
%or.5 = or i32 %shl.5, %inc14.4
%inc14.6 = or i32 %i.1154, 7
%33 = shl i32 %or.5, 6
%inc14.5 = shl i32 %i.1154, 3
%34 = or i32 %inc14.5, 48
%shl.7 = or i32 %33, %34
%or.7 = or i32 %shl.7, %inc14.6
%inc14.7 = add nuw nsw i32 %i.1154, 8
%niter.next.7 = add i32 %niter, 8
%niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %enq.exit.loopexit.unr-lcssa, label %for.body12, !llvm.loop !27
enq.exit.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%or.lcssa.ph = phi i32 [ undef, %for.body12.preheader ], [ %or.7, %for.body12 ]
%i.1154.unr = phi i32 [ 0, %for.body12.preheader ], [ %inc14.7, %for.body12 ]
%s.0153.unr = phi i32 [ 0, %for.body12.preheader ], [ %or.7, %for.body12 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %enq.exit, label %for.body12.epil
for.body12.epil: ; preds = %enq.exit.loopexit.unr-lcssa, %for.body12.epil
%i.1154.epil = phi i32 [ %inc14.epil, %for.body12.epil ], [ %i.1154.unr, %enq.exit.loopexit.unr-lcssa ]
%s.0153.epil = phi i32 [ %or.epil, %for.body12.epil ], [ %s.0153.unr, %enq.exit.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body12.epil ], [ 0, %enq.exit.loopexit.unr-lcssa ]
%shl.epil = shl i32 %s.0153.epil, 3
%or.epil = or i32 %shl.epil, %i.1154.epil
%inc14.epil = add nuw nsw i32 %i.1154.epil, 1
%epil.iter.next = add i32 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %enq.exit, label %for.body12.epil, !llvm.loop !28
enq.exit: ; preds = %enq.exit.loopexit.unr-lcssa, %for.body12.epil, %for.end9.thread, %for.end9
%cmp11152197 = phi i1 [ false, %for.end9 ], [ false, %for.end9.thread ], [ %cmp11152, %for.body12.epil ], [ %cmp11152, %enq.exit.loopexit.unr-lcssa ]
%.lcssa196 = phi i32 [ %24, %for.end9 ], [ %add.i, %for.end9.thread ], [ %24, %for.body12.epil ], [ %24, %enq.exit.loopexit.unr-lcssa ]
%s.0.lcssa = phi i32 [ 0, %for.end9 ], [ 0, %for.end9.thread ], [ %or.lcssa.ph, %enq.exit.loopexit.unr-lcssa ], [ %or.epil, %for.body12.epil ]
store i32 %s.0.lcssa, ptr @que, align 16, !tbaa !11
store i32 0, ptr getelementptr inbounds ([5000002 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 4, !tbaa !9
%35 = sext i32 %.lcssa196 to i64
%wide.trip.count192 = zext i32 %.lcssa196 to i64
br label %while.body
while.condthread-pre-split: ; preds = %for.cond24.loopexit, %if.end, %deq.exit
%qsize.promoted161169 = phi i32 [ %dec.i, %deq.exit ], [ %dec.i, %if.end ], [ %qsize.promoted161171, %for.cond24.loopexit ]
%ans.0.ph = phi i32 [ %ans.0176, %deq.exit ], [ %spec.select, %if.end ], [ %spec.select, %for.cond24.loopexit ]
%tobool.not = icmp eq i32 %qsize.promoted161169, 0
br i1 %tobool.not, label %while.end, label %while.body
while.body: ; preds = %enq.exit, %while.condthread-pre-split
%ans.0176 = phi i32 [ 0, %enq.exit ], [ %ans.0.ph, %while.condthread-pre-split ]
%36 = phi i32 [ 1, %enq.exit ], [ %qsize.promoted161169, %while.condthread-pre-split ]
%37 = load i32, ptr @que, align 16, !tbaa !11
%38 = load i32, ptr getelementptr inbounds ([5000002 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 4, !tbaa !9
%dec.i = add nsw i32 %36, -1
%idxprom.i128 = sext i32 %dec.i to i64
%arrayidx.i129 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i128
%39 = load i64, ptr %arrayidx.i129, align 8
store i64 %39, ptr @que, align 16
br label %tailrecurse.i.i
tailrecurse.i.i: ; preds = %if.then18.i.i, %while.body
%i.tr.i.i = phi i32 [ 0, %while.body ], [ %min.1.i.i, %if.then18.i.i ]
%shl.i.i = shl i32 %i.tr.i.i, 1
%add.i.i = or i32 %shl.i.i, 1
%cmp.i.i = icmp slt i32 %shl.i.i, %dec.i
br i1 %cmp.i.i, label %land.lhs.true.i.i, label %if.else.i.i
land.lhs.true.i.i: ; preds = %tailrecurse.i.i
%idxprom.i.i = sext i32 %shl.i.i to i64
%t.i.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i.i, i32 1
%40 = load i32, ptr %t.i.i, align 4, !tbaa !9
%idxprom2.i.i = sext i32 %i.tr.i.i to i64
%t4.i.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2.i.i, i32 1
%41 = load i32, ptr %t4.i.i, align 4, !tbaa !9
%cmp5.i.i = icmp slt i32 %40, %41
br i1 %cmp5.i.i, label %if.end.i.i, label %if.else.i.i
if.else.i.i: ; preds = %land.lhs.true.i.i, %tailrecurse.i.i
br label %if.end.i.i
if.end.i.i: ; preds = %if.else.i.i, %land.lhs.true.i.i
%min.0.i.i = phi i32 [ %i.tr.i.i, %if.else.i.i ], [ %shl.i.i, %land.lhs.true.i.i ]
%cmp6.i.i = icmp slt i32 %add.i.i, %dec.i
br i1 %cmp6.i.i, label %land.lhs.true7.i.i, label %if.end16.i.i
land.lhs.true7.i.i: ; preds = %if.end.i.i
%idxprom8.i.i = sext i32 %add.i.i to i64
%t10.i.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i.i, i32 1
%42 = load i32, ptr %t10.i.i, align 4, !tbaa !9
%idxprom11.i.i = sext i32 %min.0.i.i to i64
%t13.i.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11.i.i, i32 1
%43 = load i32, ptr %t13.i.i, align 4, !tbaa !9
%cmp14.i.i = icmp slt i32 %42, %43
%spec.select.i.i = select i1 %cmp14.i.i, i32 %add.i.i, i32 %min.0.i.i
br label %if.end16.i.i
if.end16.i.i: ; preds = %land.lhs.true7.i.i, %if.end.i.i
%min.1.i.i = phi i32 [ %min.0.i.i, %if.end.i.i ], [ %spec.select.i.i, %land.lhs.true7.i.i ]
%cmp17.not.i.i = icmp eq i32 %min.1.i.i, %i.tr.i.i
br i1 %cmp17.not.i.i, label %deq.exit, label %if.then18.i.i
if.then18.i.i: ; preds = %if.end16.i.i
%idxprom19.i.i = sext i32 %i.tr.i.i to i64
%arrayidx20.i.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19.i.i
%44 = load i64, ptr %arrayidx20.i.i, align 8
%idxprom23.i.i = sext i32 %min.1.i.i to i64
%arrayidx24.i.i = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23.i.i
%45 = load i64, ptr %arrayidx24.i.i, align 8
store i64 %45, ptr %arrayidx20.i.i, align 8
store i64 %44, ptr %arrayidx24.i.i, align 8
br label %tailrecurse.i.i
deq.exit: ; preds = %if.end16.i.i
%idxprom16 = sext i32 %37 to i64
%arrayidx17 = getelementptr inbounds [16777216 x i32], ptr @dist, i64 0, i64 %idxprom16
%46 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18.not = icmp sgt i32 %46, %38
br i1 %cmp18.not, label %if.end, label %while.condthread-pre-split, !llvm.loop !30
if.end: ; preds = %deq.exit
store i32 %38, ptr %arrayidx17, align 4, !tbaa !5
%spec.select = tail call i32 @llvm.smax.i32(i32 %38, i32 %ans.0176)
br i1 %cmp11152197, label %for.body26, label %while.condthread-pre-split, !llvm.loop !30
for.cond24.loopexit: ; preds = %for.inc53, %for.body26
%qsize.promoted161171 = phi i32 [ %qsize.promoted161174, %for.body26 ], [ %qsize.promoted161172, %for.inc53 ]
%qsize.promoted162 = phi i32 [ %qsize.promoted165167, %for.body26 ], [ %qsize.promoted163, %for.inc53 ]
%indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
%exitcond193.not = icmp eq i64 %indvars.iv.next190, %wide.trip.count192
br i1 %exitcond193.not, label %while.condthread-pre-split, label %for.body26, !llvm.loop !31
for.body26: ; preds = %if.end, %for.cond24.loopexit
%indvars.iv189 = phi i64 [ %indvars.iv.next190, %for.cond24.loopexit ], [ 0, %if.end ]
%indvars.iv183 = phi i64 [ %indvars.iv.next184, %for.cond24.loopexit ], [ 1, %if.end ]
%qsize.promoted161174 = phi i32 [ %qsize.promoted161171, %for.cond24.loopexit ], [ %dec.i, %if.end ]
%qsize.promoted165167 = phi i32 [ %qsize.promoted162, %for.cond24.loopexit ], [ %dec.i, %if.end ]
%indvars191 = trunc i64 %indvars.iv189 to i32
%47 = xor i32 %indvars191, -1
%sub27 = add i32 %.lcssa196, %47
%mul = mul nsw i32 %sub27, 3
%shr = ashr i32 %37, %mul
%and = and i32 %shr, 7
%indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
%cmp29158 = icmp slt i64 %indvars.iv.next190, %35
br i1 %cmp29158, label %for.body30.lr.ph, label %for.cond24.loopexit
for.body30.lr.ph: ; preds = %for.body26
%shl36 = shl i32 %and, %mul
br label %for.body30
for.body30: ; preds = %for.body30.lr.ph, %for.inc53
%indvars.iv185 = phi i64 [ %indvars.iv183, %for.body30.lr.ph ], [ %indvars.iv.next186, %for.inc53 ]
%qsize.promoted161173 = phi i32 [ %qsize.promoted161174, %for.body30.lr.ph ], [ %qsize.promoted161172, %for.inc53 ]
%qsize.promoted164 = phi i32 [ %qsize.promoted165167, %for.body30.lr.ph ], [ %qsize.promoted163, %for.inc53 ]
%inc.i130157159 = phi i32 [ %qsize.promoted165167, %for.body30.lr.ph ], [ %inc.i130156, %for.inc53 ]
%48 = trunc i64 %indvars.iv185 to i32
%49 = xor i32 %48, -1
%sub32 = add i32 %.lcssa196, %49
%mul33 = mul nsw i32 %sub32, 3
%shr34 = ashr i32 %37, %mul33
%and35 = and i32 %shr34, 7
%shl37 = shl i32 %and35, %mul33
%50 = xor i32 %shl36, %shl37
%xor38 = xor i32 %50, %37
%shl39 = shl i32 %and35, %mul
%shl41 = shl i32 %and, %mul33
%or40 = or i32 %shl39, %shl41
%or42 = or i32 %or40, %xor38
%arrayidx46 = getelementptr inbounds [8 x [8 x i32]], ptr @c, i64 0, i64 %indvars.iv189, i64 %indvars.iv185
%51 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%add47 = add nsw i32 %51, %38
%idxprom48 = sext i32 %or42 to i64
%arrayidx49 = getelementptr inbounds [16777216 x i32], ptr @dist, i64 0, i64 %idxprom48
%52 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%cmp50.not = icmp sgt i32 %52, %add47
br i1 %cmp50.not, label %if.end52, label %for.inc53
if.end52: ; preds = %for.body30
%inc.i130 = add nsw i32 %inc.i130157159, 1
%idxprom.i131 = sext i32 %inc.i130157159 to i64
%arrayidx.i132 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i131
store i32 %or42, ptr %arrayidx.i132, align 8, !tbaa !11
%t4.i133 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i131, i32 1
store i32 %add47, ptr %t4.i133, align 4, !tbaa !9
%cmp28.i134 = icmp sgt i32 %inc.i130157159, 0
br i1 %cmp28.i134, label %land.rhs.i135, label %for.inc53
land.rhs.i135: ; preds = %if.end52, %while.body.i143
%i.029.i136 = phi i32 [ %shr.i137, %while.body.i143 ], [ %inc.i130157159, %if.end52 ]
%shr.i137 = lshr i32 %i.029.i136, 1
%idxprom5.i138 = zext i32 %shr.i137 to i64
%t7.i139 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5.i138, i32 1
%53 = load i32, ptr %t7.i139, align 4, !tbaa !9
%idxprom8.i140 = zext i32 %i.029.i136 to i64
%t10.i141 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i140, i32 1
%54 = load i32, ptr %t10.i141, align 4, !tbaa !9
%cmp11.i142 = icmp sgt i32 %53, %54
br i1 %cmp11.i142, label %while.body.i143, label %for.inc53
while.body.i143: ; preds = %land.rhs.i135
%arrayidx9.i144 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i140
%arrayidx6.i145 = getelementptr inbounds [5000002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5.i138
%55 = load i64, ptr %arrayidx9.i144, align 8
%56 = load i64, ptr %arrayidx6.i145, align 8
store i64 %56, ptr %arrayidx9.i144, align 8
store i64 %55, ptr %arrayidx6.i145, align 8
%cmp.not.i146 = icmp ult i32 %i.029.i136, 2
br i1 %cmp.not.i146, label %for.inc53, label %land.rhs.i135, !llvm.loop !12
for.inc53: ; preds = %while.body.i143, %land.rhs.i135, %if.end52, %for.body30
%qsize.promoted161172 = phi i32 [ %inc.i130, %if.end52 ], [ %qsize.promoted161173, %for.body30 ], [ %inc.i130, %land.rhs.i135 ], [ %inc.i130, %while.body.i143 ]
%qsize.promoted163 = phi i32 [ %inc.i130, %if.end52 ], [ %qsize.promoted164, %for.body30 ], [ %inc.i130, %land.rhs.i135 ], [ %inc.i130, %while.body.i143 ]
%inc.i130156 = phi i32 [ %inc.i130, %if.end52 ], [ %inc.i130157159, %for.body30 ], [ %inc.i130, %land.rhs.i135 ], [ %inc.i130, %while.body.i143 ]
%indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1
%exitcond188.not = icmp eq i64 %indvars.iv.next186, %wide.trip.count192
br i1 %exitcond188.not, label %for.cond24.loopexit, label %for.body30, !llvm.loop !32
while.end: ; preds = %while.condthread-pre-split
store i32 0, ptr @qsize, align 4, !tbaa !5
%call59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.ph)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
declare i32 @__uflow(ptr noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!17, !15, i64 8}
!17 = !{!"_IO_FILE", !6, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !15, i64 96, !15, i64 104, !6, i64 112, !6, i64 116, !18, i64 120, !19, i64 128, !7, i64 130, !7, i64 131, !15, i64 136, !18, i64 144, !15, i64 152, !15, i64 160, !15, i64 168, !15, i64 176, !18, i64 184, !6, i64 192, !7, i64 196}
!18 = !{!"long", !7, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = !{!17, !15, i64 16}
!21 = !{!"branch_weights", i32 2000, i32 1}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}
!25 = distinct !{!25, !13, !26}
!26 = !{!"llvm.loop.unswitch.partial.disable"}
!27 = distinct !{!27, !13}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.unroll.disable"}
!30 = distinct !{!30, !13}
!31 = distinct !{!31, !13}
!32 = distinct !{!32, !13}
|
#include<stdio.h>
#include<string.h>
void dfs(long int i,long int j);
long int vis[21][21],m,n,t,k,l,ans;
char r[21],c[21];
int main()
{
long int i,j;
scanf("%ld%ld",&n,&m);
//for(i=1;i<=n;i++)
scanf("%s",r);
//for(i=1;i<=m;i++)
scanf("%s",c);
for(i=0;i<n;i++)
{ for(j=0;j<m;j++)
{ ans=0;
for(l=0;l<n;l++)
for(k=0;k<m;k++)
vis[l][k]=0;
dfs(i,j);
//printf("ans %ld\n",ans);
if(ans!=n*m)
break;
}
if(ans!=n*m)
break;
}
if(ans==n*m)
printf("YES\n");
else
printf("NO\n");
return 0;
}
void dfs(long int i,long int j)
{
vis[i][j]=1;
ans++;
//printf("%ld %ld\n",i,j);
if(r[i]=='<'&&j!=0&&vis[i][j-1]==0)
dfs(i,j-1);
else if(r[i]=='>'&&j!=m-1&&vis[i][j+1]==0)
dfs(i,j+1);
if(c[j]=='^'&&i!=0&&vis[i-1][j]==0)
dfs(i-1,j);
else if(c[j]=='v'&&i!=n-1&&vis[i+1][j]==0)
dfs(i+1,j);
//printf("b %ld %ld %ld\n",i,j,vis[i][j]);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27261/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27261/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1
@n = dso_local global i64 0, align 8
@m = dso_local global i64 0, align 8
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@r = dso_local global [21 x i8] zeroinitializer, align 16
@c = dso_local global [21 x i8] zeroinitializer, align 16
@ans = dso_local local_unnamed_addr global i64 0, align 8
@l = dso_local local_unnamed_addr global i64 0, align 8
@k = dso_local local_unnamed_addr global i64 0, align 8
@vis = dso_local local_unnamed_addr global [21 x [21 x i64]] zeroinitializer, align 16
@t = dso_local local_unnamed_addr global i64 0, align 8
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @r)
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @c)
%0 = load i64, ptr @n, align 8
%cmp47 = icmp sgt i64 %0, 0
br i1 %cmp47, label %for.cond3.preheader.lr.ph, label %entry.for.end26_crit_edge
entry.for.end26_crit_edge: ; preds = %entry
%.pre51 = load i64, ptr @ans, align 8, !tbaa !5
%.pre52 = load i64, ptr @m, align 8, !tbaa !5
%.pre54 = mul nsw i64 %.pre52, %0
br label %for.end26
for.cond3.preheader.lr.ph: ; preds = %entry
%1 = load i64, ptr @m, align 8, !tbaa !5
%2 = icmp sgt i64 %1, 0
br i1 %2, label %for.cond3.preheader, label %for.cond3.preheader.lr.ph.split.us
for.cond3.preheader.lr.ph.split.us: ; preds = %for.cond3.preheader.lr.ph
%3 = load i64, ptr @ans, align 8, !tbaa !5
%mul20.us = mul nsw i64 %1, %0
br label %for.end26
for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.end19
%4 = phi i64 [ %22, %for.end19 ], [ %0, %for.cond3.preheader.lr.ph ]
%5 = phi i64 [ %23, %for.end19 ], [ %1, %for.cond3.preheader.lr.ph ]
%i.048 = phi i64 [ %inc25, %for.end19 ], [ 0, %for.cond3.preheader.lr.ph ]
%cmp445 = icmp sgt i64 %5, 0
br i1 %cmp445, label %for.body5, label %for.cond3.preheader.for.end19_crit_edge
for.cond3.preheader.for.end19_crit_edge: ; preds = %for.cond3.preheader
%.pre = load i64, ptr @ans, align 8, !tbaa !5
%.pre53 = mul nsw i64 %5, %4
br label %for.end19
for.body5: ; preds = %for.cond3.preheader, %for.end15
%6 = phi i64 [ %20, %for.end15 ], [ %4, %for.cond3.preheader ]
%7 = phi i64 [ %21, %for.end15 ], [ %5, %for.cond3.preheader ]
%j.046 = phi i64 [ %inc18, %for.end15 ], [ 0, %for.cond3.preheader ]
store i64 0, ptr @ans, align 8, !tbaa !5
%cmp741 = icmp sgt i64 %6, 0
br i1 %cmp741, label %for.cond9.preheader.lr.ph, label %for.end15
for.cond9.preheader.lr.ph: ; preds = %for.body5
%cmp1039 = icmp sgt i64 %7, 0
br i1 %cmp1039, label %for.cond9.preheader.us.preheader, label %for.cond6.for.end15_crit_edge
for.cond9.preheader.us.preheader: ; preds = %for.cond9.preheader.lr.ph
%8 = shl nuw i64 %7, 3
%xtraiter = and i64 %6, 7
%9 = icmp ult i64 %6, 8
br i1 %9, label %for.cond6.for.end15_crit_edge.loopexit.unr-lcssa, label %for.cond9.preheader.us.preheader.new
for.cond9.preheader.us.preheader.new: ; preds = %for.cond9.preheader.us.preheader
%unroll_iter = and i64 %6, -8
br label %for.cond9.preheader.us
for.cond9.preheader.us: ; preds = %for.cond9.preheader.us, %for.cond9.preheader.us.preheader.new
%storemerge42.us = phi i64 [ 0, %for.cond9.preheader.us.preheader.new ], [ %inc14.us.7, %for.cond9.preheader.us ]
%niter = phi i64 [ 0, %for.cond9.preheader.us.preheader.new ], [ %niter.next.7, %for.cond9.preheader.us ]
%10 = mul nuw nsw i64 %storemerge42.us, 168
%scevgep = getelementptr i8, ptr @vis, i64 %10
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %8, i1 false), !tbaa !5
%11 = mul nuw i64 %storemerge42.us, 168
%gep = getelementptr i8, ptr getelementptr (i8, ptr @vis, i64 168), i64 %11
tail call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %8, i1 false), !tbaa !5
%12 = mul nuw i64 %storemerge42.us, 168
%gep68 = getelementptr i8, ptr getelementptr (i8, ptr @vis, i64 336), i64 %12
tail call void @llvm.memset.p0.i64(ptr align 16 %gep68, i8 0, i64 %8, i1 false), !tbaa !5
%13 = mul nuw i64 %storemerge42.us, 168
%gep69 = getelementptr i8, ptr getelementptr (i8, ptr @vis, i64 504), i64 %13
tail call void @llvm.memset.p0.i64(ptr align 8 %gep69, i8 0, i64 %8, i1 false), !tbaa !5
%14 = mul nuw i64 %storemerge42.us, 168
%gep70 = getelementptr i8, ptr getelementptr (i8, ptr @vis, i64 672), i64 %14
tail call void @llvm.memset.p0.i64(ptr align 16 %gep70, i8 0, i64 %8, i1 false), !tbaa !5
%15 = mul nuw i64 %storemerge42.us, 168
%gep71 = getelementptr i8, ptr getelementptr (i8, ptr @vis, i64 840), i64 %15
tail call void @llvm.memset.p0.i64(ptr align 8 %gep71, i8 0, i64 %8, i1 false), !tbaa !5
%16 = mul nuw i64 %storemerge42.us, 168
%gep72 = getelementptr i8, ptr getelementptr (i8, ptr @vis, i64 1008), i64 %16
tail call void @llvm.memset.p0.i64(ptr align 16 %gep72, i8 0, i64 %8, i1 false), !tbaa !5
%17 = mul nuw i64 %storemerge42.us, 168
%gep73 = getelementptr i8, ptr getelementptr (i8, ptr @vis, i64 1176), i64 %17
tail call void @llvm.memset.p0.i64(ptr align 8 %gep73, i8 0, i64 %8, i1 false), !tbaa !5
%inc14.us.7 = add nuw nsw i64 %storemerge42.us, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond6.for.end15_crit_edge.loopexit.unr-lcssa, label %for.cond9.preheader.us, !llvm.loop !9
for.cond6.for.end15_crit_edge.loopexit.unr-lcssa: ; preds = %for.cond9.preheader.us, %for.cond9.preheader.us.preheader
%storemerge42.us.unr = phi i64 [ 0, %for.cond9.preheader.us.preheader ], [ %inc14.us.7, %for.cond9.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond6.for.end15_crit_edge, label %for.cond9.preheader.us.epil
for.cond9.preheader.us.epil: ; preds = %for.cond6.for.end15_crit_edge.loopexit.unr-lcssa, %for.cond9.preheader.us.epil
%storemerge42.us.epil = phi i64 [ %inc14.us.epil, %for.cond9.preheader.us.epil ], [ %storemerge42.us.unr, %for.cond6.for.end15_crit_edge.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond9.preheader.us.epil ], [ 0, %for.cond6.for.end15_crit_edge.loopexit.unr-lcssa ]
%18 = mul nuw nsw i64 %storemerge42.us.epil, 168
%scevgep.epil = getelementptr i8, ptr @vis, i64 %18
tail call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 0, i64 %8, i1 false), !tbaa !5
%inc14.us.epil = add nuw nsw i64 %storemerge42.us.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond6.for.end15_crit_edge, label %for.cond9.preheader.us.epil, !llvm.loop !11
for.cond6.for.end15_crit_edge: ; preds = %for.cond6.for.end15_crit_edge.loopexit.unr-lcssa, %for.cond9.preheader.us.epil, %for.cond9.preheader.lr.ph
%.us-phi = phi i64 [ 0, %for.cond9.preheader.lr.ph ], [ %7, %for.cond9.preheader.us.epil ], [ %7, %for.cond6.for.end15_crit_edge.loopexit.unr-lcssa ]
store i64 %.us-phi, ptr @k, align 8, !tbaa !5
br label %for.end15
for.end15: ; preds = %for.cond6.for.end15_crit_edge, %for.body5
%storemerge.lcssa = phi i64 [ %6, %for.cond6.for.end15_crit_edge ], [ 0, %for.body5 ]
store i64 %storemerge.lcssa, ptr @l, align 8, !tbaa !5
tail call void @dfs(i64 noundef %i.048, i64 noundef %j.046)
%19 = load i64, ptr @ans, align 8, !tbaa !5
%20 = load i64, ptr @n, align 8, !tbaa !5
%21 = load i64, ptr @m, align 8
%mul = mul nsw i64 %21, %20
%cmp16.not = icmp eq i64 %19, %mul
%inc18 = add nuw nsw i64 %j.046, 1
%cmp4 = icmp slt i64 %inc18, %21
%or.cond = select i1 %cmp16.not, i1 %cmp4, i1 false
br i1 %or.cond, label %for.body5, label %for.end19, !llvm.loop !13
for.end19: ; preds = %for.end15, %for.cond3.preheader.for.end19_crit_edge
%mul20.pre-phi = phi i64 [ %.pre53, %for.cond3.preheader.for.end19_crit_edge ], [ %mul, %for.end15 ]
%22 = phi i64 [ %4, %for.cond3.preheader.for.end19_crit_edge ], [ %20, %for.end15 ]
%23 = phi i64 [ %5, %for.cond3.preheader.for.end19_crit_edge ], [ %21, %for.end15 ]
%24 = phi i64 [ %.pre, %for.cond3.preheader.for.end19_crit_edge ], [ %19, %for.end15 ]
%cmp21.not = icmp eq i64 %24, %mul20.pre-phi
%inc25 = add nuw nsw i64 %i.048, 1
%cmp = icmp slt i64 %inc25, %22
%or.cond58 = select i1 %cmp21.not, i1 %cmp, i1 false
br i1 %or.cond58, label %for.cond3.preheader, label %for.end26, !llvm.loop !14
for.end26: ; preds = %for.end19, %for.cond3.preheader.lr.ph.split.us, %entry.for.end26_crit_edge
%mul27.pre-phi = phi i64 [ %.pre54, %entry.for.end26_crit_edge ], [ %mul20.us, %for.cond3.preheader.lr.ph.split.us ], [ %mul20.pre-phi, %for.end19 ]
%25 = phi i64 [ %.pre51, %entry.for.end26_crit_edge ], [ %3, %for.cond3.preheader.lr.ph.split.us ], [ %24, %for.end19 ]
%cmp28 = icmp eq i64 %25, %mul27.pre-phi
%str.4.str = select i1 %cmp28, ptr @str.4, ptr @str
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @dfs(i64 noundef %i, i64 noundef %j) local_unnamed_addr #2 {
entry:
%cmp4.not = icmp eq i64 %j, 0
%add = add nsw i64 %j, 1
%sub = add nsw i64 %j, -1
%arrayidx28 = getelementptr inbounds [21 x i8], ptr @c, i64 0, i64 %j
br i1 %cmp4.not, label %tailrecurse.us.preheader, label %tailrecurse
tailrecurse.us.preheader: ; preds = %entry
%.pre90 = load i64, ptr @ans, align 8, !tbaa !5
br label %tailrecurse.us
tailrecurse.us: ; preds = %tailrecurse.us.backedge, %tailrecurse.us.preheader
%0 = phi i64 [ %.pre90, %tailrecurse.us.preheader ], [ %4, %tailrecurse.us.backedge ]
%i.tr.us = phi i64 [ %i, %tailrecurse.us.preheader ], [ %i.tr.us.be, %tailrecurse.us.backedge ]
%arrayidx1.us = getelementptr inbounds [21 x [21 x i64]], ptr @vis, i64 0, i64 %i.tr.us, i64 0
store i64 1, ptr %arrayidx1.us, align 8, !tbaa !5
%inc.us = add nsw i64 %0, 1
store i64 %inc.us, ptr @ans, align 8, !tbaa !5
%arrayidx2.us = getelementptr inbounds [21 x i8], ptr @r, i64 0, i64 %i.tr.us
%1 = load i8, ptr %arrayidx2.us, align 1, !tbaa !16
%cmp14.us = icmp ne i8 %1, 62
%2 = load i64, ptr @m, align 8
%cmp18.not.us = icmp eq i64 %2, 1
%or.cond = select i1 %cmp14.us, i1 true, i1 %cmp18.not.us
br i1 %or.cond, label %if.end27.us, label %land.lhs.true20.us
land.lhs.true20.us: ; preds = %tailrecurse.us
%arrayidx22.us = getelementptr inbounds [21 x [21 x i64]], ptr @vis, i64 0, i64 %i.tr.us, i64 %add
%3 = load i64, ptr %arrayidx22.us, align 8, !tbaa !5
%cmp23.us = icmp eq i64 %3, 0
br i1 %cmp23.us, label %if.then25.us, label %if.end27.us
if.then25.us: ; preds = %land.lhs.true20.us
tail call void @dfs(i64 noundef %i.tr.us, i64 noundef %add)
%.pre = load i64, ptr @ans, align 8, !tbaa !5
br label %if.end27.us
if.end27.us: ; preds = %if.then25.us, %land.lhs.true20.us, %tailrecurse.us
%4 = phi i64 [ %.pre, %if.then25.us ], [ %inc.us, %land.lhs.true20.us ], [ %inc.us, %tailrecurse.us ]
%5 = load i8, ptr %arrayidx28, align 1, !tbaa !16
%cmp30.us = icmp eq i8 %5, 94
%cmp33.us = icmp ne i64 %i.tr.us, 0
%or.cond62.us = and i1 %cmp33.us, %cmp30.us
br i1 %or.cond62.us, label %land.lhs.true35.us, label %if.else43.us
if.else43.us: ; preds = %if.end27.us
%cmp46.us = icmp eq i8 %5, 118
br i1 %cmp46.us, label %land.lhs.true48.us, label %if.end61
land.lhs.true48.us: ; preds = %if.else43.us
%6 = load i64, ptr @n, align 8, !tbaa !5
%sub49.us = add nsw i64 %6, -1
%cmp50.not.us = icmp eq i64 %sub49.us, %i.tr.us
br i1 %cmp50.not.us, label %if.end61, label %land.lhs.true52.us
land.lhs.true52.us: ; preds = %land.lhs.true48.us
%add53.us = add nsw i64 %i.tr.us, 1
%arrayidx55.us = getelementptr inbounds [21 x [21 x i64]], ptr @vis, i64 0, i64 %add53.us, i64 0
%7 = load i64, ptr %arrayidx55.us, align 8, !tbaa !5
%cmp56.us = icmp eq i64 %7, 0
br i1 %cmp56.us, label %tailrecurse.us.backedge, label %if.end61
land.lhs.true35.us: ; preds = %if.end27.us
%sub36.us = add nsw i64 %i.tr.us, -1
%arrayidx38.us = getelementptr inbounds [21 x [21 x i64]], ptr @vis, i64 0, i64 %sub36.us, i64 0
%8 = load i64, ptr %arrayidx38.us, align 8, !tbaa !5
%cmp39.us = icmp eq i64 %8, 0
br i1 %cmp39.us, label %tailrecurse.us.backedge, label %if.end61
tailrecurse.us.backedge: ; preds = %land.lhs.true35.us, %land.lhs.true52.us
%i.tr.us.be = phi i64 [ %sub36.us, %land.lhs.true35.us ], [ %add53.us, %land.lhs.true52.us ]
br label %tailrecurse.us
tailrecurse: ; preds = %entry, %tailrecurse.backedge
%i.tr = phi i64 [ %i.tr.be, %tailrecurse.backedge ], [ %i, %entry ]
%arrayidx1 = getelementptr inbounds [21 x [21 x i64]], ptr @vis, i64 0, i64 %i.tr, i64 %j
store i64 1, ptr %arrayidx1, align 8, !tbaa !5
%9 = load i64, ptr @ans, align 8, !tbaa !5
%inc = add nsw i64 %9, 1
store i64 %inc, ptr @ans, align 8, !tbaa !5
%arrayidx2 = getelementptr inbounds [21 x i8], ptr @r, i64 0, i64 %i.tr
%10 = load i8, ptr %arrayidx2, align 1, !tbaa !16
switch i8 %10, label %if.end27 [
i8 60, label %land.lhs.true6
i8 62, label %land.lhs.true16
]
land.lhs.true6: ; preds = %tailrecurse
%arrayidx8 = getelementptr inbounds [21 x [21 x i64]], ptr @vis, i64 0, i64 %i.tr, i64 %sub
%11 = load i64, ptr %arrayidx8, align 8, !tbaa !5
%cmp9 = icmp eq i64 %11, 0
br i1 %cmp9, label %if.end27.sink.split, label %if.end27
land.lhs.true16: ; preds = %tailrecurse
%12 = load i64, ptr @m, align 8, !tbaa !5
%sub17 = add nsw i64 %12, -1
%cmp18.not = icmp eq i64 %sub17, %j
br i1 %cmp18.not, label %if.end27, label %land.lhs.true20
land.lhs.true20: ; preds = %land.lhs.true16
%arrayidx22 = getelementptr inbounds [21 x [21 x i64]], ptr @vis, i64 0, i64 %i.tr, i64 %add
%13 = load i64, ptr %arrayidx22, align 8, !tbaa !5
%cmp23 = icmp eq i64 %13, 0
br i1 %cmp23, label %if.end27.sink.split, label %if.end27
if.end27.sink.split: ; preds = %land.lhs.true20, %land.lhs.true6
%add.sink = phi i64 [ %sub, %land.lhs.true6 ], [ %add, %land.lhs.true20 ]
tail call void @dfs(i64 noundef %i.tr, i64 noundef %add.sink)
br label %if.end27
if.end27: ; preds = %if.end27.sink.split, %tailrecurse, %land.lhs.true6, %land.lhs.true16, %land.lhs.true20
%14 = load i8, ptr %arrayidx28, align 1, !tbaa !16
%cmp30 = icmp eq i8 %14, 94
%cmp33 = icmp ne i64 %i.tr, 0
%or.cond62 = and i1 %cmp33, %cmp30
br i1 %or.cond62, label %land.lhs.true35, label %if.else43
land.lhs.true35: ; preds = %if.end27
%sub36 = add nsw i64 %i.tr, -1
%arrayidx38 = getelementptr inbounds [21 x [21 x i64]], ptr @vis, i64 0, i64 %sub36, i64 %j
%15 = load i64, ptr %arrayidx38, align 8, !tbaa !5
%cmp39 = icmp eq i64 %15, 0
br i1 %cmp39, label %tailrecurse.backedge, label %if.end61
tailrecurse.backedge: ; preds = %land.lhs.true35, %land.lhs.true52
%i.tr.be = phi i64 [ %sub36, %land.lhs.true35 ], [ %add53, %land.lhs.true52 ]
br label %tailrecurse
if.else43: ; preds = %if.end27
%cmp46 = icmp eq i8 %14, 118
br i1 %cmp46, label %land.lhs.true48, label %if.end61
land.lhs.true48: ; preds = %if.else43
%16 = load i64, ptr @n, align 8, !tbaa !5
%sub49 = add nsw i64 %16, -1
%cmp50.not = icmp eq i64 %sub49, %i.tr
br i1 %cmp50.not, label %if.end61, label %land.lhs.true52
land.lhs.true52: ; preds = %land.lhs.true48
%add53 = add nsw i64 %i.tr, 1
%arrayidx55 = getelementptr inbounds [21 x [21 x i64]], ptr @vis, i64 0, i64 %add53, i64 %j
%17 = load i64, ptr %arrayidx55, align 8, !tbaa !5
%cmp56 = icmp eq i64 %17, 0
br i1 %cmp56, label %tailrecurse.backedge, label %if.end61
if.end61: ; preds = %land.lhs.true52, %land.lhs.true48, %if.else43, %land.lhs.true35, %if.else43.us, %land.lhs.true48.us, %land.lhs.true52.us, %land.lhs.true35.us
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = !{!7, !7, i64 0}
|
#include<stdio.h>
int main(void){
int s,a=0,i;
for(i=0;i<10;i++){
scanf("%d",&s);
a+=s;
}
printf("%d\n",a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272653/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272653/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i32, ptr %s, align 4, !tbaa !5
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%1 = load i32, ptr %s, align 4, !tbaa !5
%add.1 = add nsw i32 %1, %0
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%2 = load i32, ptr %s, align 4, !tbaa !5
%add.2 = add nsw i32 %2, %add.1
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%3 = load i32, ptr %s, align 4, !tbaa !5
%add.3 = add nsw i32 %3, %add.2
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%4 = load i32, ptr %s, align 4, !tbaa !5
%add.4 = add nsw i32 %4, %add.3
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%5 = load i32, ptr %s, align 4, !tbaa !5
%add.5 = add nsw i32 %5, %add.4
%call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%6 = load i32, ptr %s, align 4, !tbaa !5
%add.6 = add nsw i32 %6, %add.5
%call.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%7 = load i32, ptr %s, align 4, !tbaa !5
%add.7 = add nsw i32 %7, %add.6
%call.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%8 = load i32, ptr %s, align 4, !tbaa !5
%add.8 = add nsw i32 %8, %add.7
%call.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%9 = load i32, ptr %s, align 4, !tbaa !5
%add.9 = add nsw i32 %9, %add.8
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.9)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int
main (
int argc,
char *argv[ ]
)
{
int res = 0;
int i;
for ( i = 0; i < 10; ++i )
{
int d;
scanf ( "%d", &d );
res += d;
}
printf ( "%d\n", res );
return ( EXIT_SUCCESS );
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272703/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272703/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%0 = load i32, ptr %d, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%1 = load i32, ptr %d, align 4, !tbaa !5
%add.1 = add nsw i32 %1, %0
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%2 = load i32, ptr %d, align 4, !tbaa !5
%add.2 = add nsw i32 %2, %add.1
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%3 = load i32, ptr %d, align 4, !tbaa !5
%add.3 = add nsw i32 %3, %add.2
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%4 = load i32, ptr %d, align 4, !tbaa !5
%add.4 = add nsw i32 %4, %add.3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%5 = load i32, ptr %d, align 4, !tbaa !5
%add.5 = add nsw i32 %5, %add.4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%6 = load i32, ptr %d, align 4, !tbaa !5
%add.6 = add nsw i32 %6, %add.5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%7 = load i32, ptr %d, align 4, !tbaa !5
%add.7 = add nsw i32 %7, %add.6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%8 = load i32, ptr %d, align 4, !tbaa !5
%add.8 = add nsw i32 %8, %add.7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%9 = load i32, ptr %d, align 4, !tbaa !5
%add.9 = add nsw i32 %9, %add.8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.9)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.