Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> int main() { int t, n; scanf("%d", &t); while(t--){ scanf("%d", &n); printf("%d\n", n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26523/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26523/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: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #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 %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec3 = add nsw i32 %0, -1 store i32 %dec3, ptr %t, align 4, !tbaa !5 %tobool.not4 = icmp eq i32 %0, 0 br i1 %tobool.not4, 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 %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) %2 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 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 %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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 i,j,x,y,s,max; while(1){ scanf("%d%d%d",&x,&y,&s); if(x==0&&y==0&&s==0)break; max=0; for(i=1;i<=s;i++){ for(j=i;j<=s;j++){ if(j*(100+x)/100==(s-(i*(100+x)/100))){ if((i*(100+y)/100)+(j*(100+y)/100)>max){ max=(i*(100+y)/100)+(j*(100+y)/100); break; } } } } printf("%d\n",max); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265273/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265273/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%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: %x = alloca i32, align 4 %y = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 %call50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %s) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp51 = icmp eq i32 %0, 0 %1 = load i32, ptr %y, align 4 %cmp152 = icmp eq i32 %1, 0 %or.cond53 = select i1 %cmp51, i1 %cmp152, i1 false %2 = load i32, ptr %s, align 4 %cmp354 = icmp eq i32 %2, 0 %or.cond3555 = select i1 %or.cond53, i1 %cmp354, i1 false br i1 %or.cond3555, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end33 %3 = phi i32 [ %8, %for.end33 ], [ %2, %entry ] %4 = phi i32 [ %7, %for.end33 ], [ %1, %entry ] %5 = phi i32 [ %6, %for.end33 ], [ %0, %entry ] %cmp4.not47 = icmp slt i32 %3, 1 br i1 %cmp4.not47, label %for.end33, label %for.cond5.preheader.lr.ph for.cond5.preheader.lr.ph: ; preds = %for.cond.preheader %add13 = add nsw i32 %4, 100 %add = add nsw i32 %5, 100 br label %for.cond5.preheader for.cond5.preheader: ; preds = %for.cond5.preheader.lr.ph, %for.inc31 %max.049 = phi i32 [ 0, %for.cond5.preheader.lr.ph ], [ %max.1, %for.inc31 ] %i.048 = phi i32 [ 1, %for.cond5.preheader.lr.ph ], [ %inc32, %for.inc31 ] %mul14 = mul nsw i32 %i.048, %add13 %div15 = sdiv i32 %mul14, 100 %mul9 = mul nsw i32 %i.048, %add %div10.neg = sdiv i32 %mul9, -100 %sub = add i32 %div10.neg, %3 br label %for.body7 for.body7: ; preds = %for.cond5.preheader, %for.inc %j.046 = phi i32 [ %i.048, %for.cond5.preheader ], [ %inc, %for.inc ] %mul = mul nsw i32 %j.046, %add %div = sdiv i32 %mul, 100 %cmp11 = icmp eq i32 %div, %sub br i1 %cmp11, label %if.then12, label %for.inc if.then12: ; preds = %for.body7 %mul17 = mul nsw i32 %j.046, %add13 %div18 = sdiv i32 %mul17, 100 %add19 = add nsw i32 %div18, %div15 %cmp20 = icmp sgt i32 %add19, %max.049 br i1 %cmp20, label %for.inc31, label %for.inc for.inc: ; preds = %for.body7, %if.then12 %inc = add nuw nsw i32 %j.046, 1 %cmp6.not.not = icmp slt i32 %j.046, %3 br i1 %cmp6.not.not, label %for.body7, label %for.inc31, !llvm.loop !9 for.inc31: ; preds = %if.then12, %for.inc %max.1 = phi i32 [ %max.049, %for.inc ], [ %add19, %if.then12 ] %inc32 = add nuw i32 %i.048, 1 %exitcond.not = icmp eq i32 %i.048, %3 br i1 %exitcond.not, label %for.end33, label %for.cond5.preheader, !llvm.loop !11 for.end33: ; preds = %for.inc31, %for.cond.preheader %max.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %max.1, %for.inc31 ] %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %s) %6 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp eq i32 %6, 0 %7 = load i32, ptr %y, align 4 %cmp1 = icmp eq i32 %7, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %8 = load i32, ptr %s, align 4 %cmp3 = icmp eq i32 %8, 0 %or.cond35 = select i1 %or.cond, i1 %cmp3, i1 false br i1 %or.cond35, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end33, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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"} !11 = distinct !{!11, !10}
// AOJ 1192: Tax Rate Changed // 2017.9.14 bal4u@uu // 2017.12.22 #include <stdio.h> char buf[15], *p; int in() { int n = 0; while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf); p++; return n; } int main() { int x, y, s, p1, p2, t, ans; while (fgets(p=buf, 15, stdin) && *p != '0') { x = in(), y = in(), s = in(); ans = 0; for (p1 = 1; p1 < s; p1++) for (p2 = p1; p2 < s; p2++) { t = p1 + p2 + (p1*x)/100 + (p2*x)/100; if (t > s) break; if (t != s) continue; t = p1 + p2 + (p1*y)/100 + (p2*y)/100; if (t > ans) ans = t; } printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265316/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265316/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" @p = dso_local local_unnamed_addr global ptr null, align 8 @buf = dso_local global [15 x i8] zeroinitializer, align 1 @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i32 @in() local_unnamed_addr #0 { entry: %p.promoted = load ptr, ptr @p, align 8, !tbaa !5 %0 = load i8, ptr %p.promoted, align 1, !tbaa !9 %cmp9 = icmp sgt i8 %0, 47 br i1 %cmp9, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %n.011 = phi i32 [ %add4, %while.body ], [ 0, %entry ] %incdec.ptr810 = phi ptr [ %incdec.ptr, %while.body ], [ %p.promoted, %entry ] %add = mul i32 %n.011, 10 %incdec.ptr = getelementptr inbounds i8, ptr %incdec.ptr810, i64 1 store ptr %incdec.ptr, ptr @p, align 8, !tbaa !5 %1 = load i8, ptr %incdec.ptr810, align 1, !tbaa !9 %2 = and i8 %1, 15 %and = zext i8 %2 to i32 %add4 = add nsw i32 %add, %and %3 = load i8, ptr %incdec.ptr, align 1, !tbaa !9 %cmp = icmp sgt i8 %3, 47 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !10 while.end: ; preds = %while.body, %entry %n.0.lcssa = phi i32 [ 0, %entry ], [ %add4, %while.body ] %.lcssa = phi ptr [ %p.promoted, %entry ], [ %incdec.ptr, %while.body ] %incdec.ptr5 = getelementptr inbounds i8, ptr %.lcssa, i64 1 store ptr %incdec.ptr5, ptr @p, align 8, !tbaa !5 ret i32 %n.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: store ptr @buf, ptr @p, align 8, !tbaa !5 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call89 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 15, ptr noundef %0) %tobool.not90 = icmp eq ptr %call89, null br i1 %tobool.not90, label %while.end, label %land.rhs land.rhs: ; preds = %entry, %for.end34 %1 = load ptr, ptr @p, align 8, !tbaa !5 %2 = load i8, ptr %1, align 1, !tbaa !9 %cmp.not = icmp eq i8 %2, 48 br i1 %cmp.not, label %while.end, label %while.body while.body: ; preds = %land.rhs %cmp9.i = icmp sgt i8 %2, 47 br i1 %cmp9.i, label %while.body.i, label %in.exit while.body.i: ; preds = %while.body, %while.body.i %n.011.i = phi i32 [ %add4.i, %while.body.i ], [ 0, %while.body ] %incdec.ptr810.i = phi ptr [ %incdec.ptr.i, %while.body.i ], [ %1, %while.body ] %add.i = mul i32 %n.011.i, 10 %incdec.ptr.i = getelementptr inbounds i8, ptr %incdec.ptr810.i, i64 1 store ptr %incdec.ptr.i, ptr @p, align 8, !tbaa !5 %3 = load i8, ptr %incdec.ptr810.i, align 1, !tbaa !9 %4 = and i8 %3, 15 %and.i = zext i8 %4 to i32 %add4.i = add nsw i32 %add.i, %and.i %5 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !9 %cmp.i = icmp sgt i8 %5, 47 br i1 %cmp.i, label %while.body.i, label %in.exit, !llvm.loop !10 in.exit: ; preds = %while.body.i, %while.body %n.0.lcssa.i = phi i32 [ 0, %while.body ], [ %add4.i, %while.body.i ] %.lcssa.i = phi ptr [ %1, %while.body ], [ %incdec.ptr.i, %while.body.i ] %incdec.ptr5.i = getelementptr inbounds i8, ptr %.lcssa.i, i64 1 store ptr %incdec.ptr5.i, ptr @p, align 8, !tbaa !5 %6 = load i8, ptr %incdec.ptr5.i, align 1, !tbaa !9 %cmp9.i57 = icmp sgt i8 %6, 47 br i1 %cmp9.i57, label %while.body.i61, label %in.exit69 while.body.i61: ; preds = %in.exit, %while.body.i61 %n.011.i62 = phi i32 [ %add4.i67, %while.body.i61 ], [ 0, %in.exit ] %incdec.ptr810.i63 = phi ptr [ %incdec.ptr.i65, %while.body.i61 ], [ %incdec.ptr5.i, %in.exit ] %add.i64 = mul i32 %n.011.i62, 10 %incdec.ptr.i65 = getelementptr inbounds i8, ptr %incdec.ptr810.i63, i64 1 store ptr %incdec.ptr.i65, ptr @p, align 8, !tbaa !5 %7 = load i8, ptr %incdec.ptr810.i63, align 1, !tbaa !9 %8 = and i8 %7, 15 %and.i66 = zext i8 %8 to i32 %add4.i67 = add nsw i32 %add.i64, %and.i66 %9 = load i8, ptr %incdec.ptr.i65, align 1, !tbaa !9 %cmp.i68 = icmp sgt i8 %9, 47 br i1 %cmp.i68, label %while.body.i61, label %in.exit69, !llvm.loop !10 in.exit69: ; preds = %while.body.i61, %in.exit %n.0.lcssa.i58 = phi i32 [ 0, %in.exit ], [ %add4.i67, %while.body.i61 ] %10 = phi ptr [ %.lcssa.i, %in.exit ], [ %incdec.ptr810.i63, %while.body.i61 ] %incdec.ptr5.i60 = getelementptr inbounds i8, ptr %10, i64 2 store ptr %incdec.ptr5.i60, ptr @p, align 8, !tbaa !5 %11 = load i8, ptr %incdec.ptr5.i60, align 1, !tbaa !9 %cmp9.i71 = icmp sgt i8 %11, 47 br i1 %cmp9.i71, label %while.body.i75, label %in.exit83.thread in.exit83.thread: ; preds = %in.exit69 %incdec.ptr5.i7493 = getelementptr inbounds i8, ptr %10, i64 3 store ptr %incdec.ptr5.i7493, ptr @p, align 8, !tbaa !5 br label %for.end34 while.body.i75: ; preds = %in.exit69, %while.body.i75 %n.011.i76 = phi i32 [ %add4.i81, %while.body.i75 ], [ 0, %in.exit69 ] %incdec.ptr810.i77 = phi ptr [ %incdec.ptr.i79, %while.body.i75 ], [ %incdec.ptr5.i60, %in.exit69 ] %add.i78 = mul i32 %n.011.i76, 10 %incdec.ptr.i79 = getelementptr inbounds i8, ptr %incdec.ptr810.i77, i64 1 store ptr %incdec.ptr.i79, ptr @p, align 8, !tbaa !5 %12 = load i8, ptr %incdec.ptr810.i77, align 1, !tbaa !9 %13 = and i8 %12, 15 %and.i80 = zext i8 %13 to i32 %add4.i81 = add nsw i32 %add.i78, %and.i80 %14 = load i8, ptr %incdec.ptr.i79, align 1, !tbaa !9 %cmp.i82 = icmp sgt i8 %14, 47 br i1 %cmp.i82, label %while.body.i75, label %in.exit83, !llvm.loop !10 in.exit83: ; preds = %while.body.i75 %incdec.ptr5.i74 = getelementptr inbounds i8, ptr %incdec.ptr810.i77, i64 2 store ptr %incdec.ptr5.i74, ptr @p, align 8, !tbaa !5 %cmp586 = icmp sgt i32 %add4.i81, 1 br i1 %cmp586, label %for.cond7.preheader, label %for.end34 for.cond7.preheader: ; preds = %in.exit83, %for.inc32 %ans.088 = phi i32 [ %ans.1.lcssa, %for.inc32 ], [ 0, %in.exit83 ] %p1.087 = phi i32 [ %inc33, %for.inc32 ], [ 1, %in.exit83 ] %mul = mul nsw i32 %p1.087, %n.0.lcssa.i %div = sdiv i32 %mul, 100 %mul22 = mul nsw i32 %p1.087, %n.0.lcssa.i58 %div23 = sdiv i32 %mul22, 100 br label %for.body10 for.body10: ; preds = %for.cond7.preheader, %for.inc %ans.185 = phi i32 [ %ans.088, %for.cond7.preheader ], [ %ans.2, %for.inc ] %p2.084 = phi i32 [ %p1.087, %for.cond7.preheader ], [ %inc, %for.inc ] %add = add nuw nsw i32 %p2.084, %p1.087 %add11 = add nsw i32 %add, %div %mul12 = mul nsw i32 %p2.084, %n.0.lcssa.i %div13 = sdiv i32 %mul12, 100 %add14 = add nsw i32 %add11, %div13 %cmp15 = icmp sgt i32 %add14, %add4.i81 br i1 %cmp15, label %for.inc32, label %if.end if.end: ; preds = %for.body10 %cmp17.not = icmp eq i32 %add14, %add4.i81 br i1 %cmp17.not, label %if.end20, label %for.inc if.end20: ; preds = %if.end %add24 = add nsw i32 %add, %div23 %mul25 = mul nsw i32 %p2.084, %n.0.lcssa.i58 %div26 = sdiv i32 %mul25, 100 %add27 = add nsw i32 %add24, %div26 %spec.select = tail call i32 @llvm.smax.i32(i32 %add27, i32 %ans.185) br label %for.inc for.inc: ; preds = %if.end20, %if.end %ans.2 = phi i32 [ %ans.185, %if.end ], [ %spec.select, %if.end20 ] %inc = add nuw nsw i32 %p2.084, 1 %cmp8 = icmp slt i32 %inc, %add4.i81 br i1 %cmp8, label %for.body10, label %for.inc32, !llvm.loop !12 for.inc32: ; preds = %for.inc, %for.body10 %ans.1.lcssa = phi i32 [ %ans.2, %for.inc ], [ %ans.185, %for.body10 ] %inc33 = add nuw nsw i32 %p1.087, 1 %exitcond.not = icmp eq i32 %inc33, %add4.i81 br i1 %exitcond.not, label %for.end34, label %for.cond7.preheader, !llvm.loop !13 for.end34: ; preds = %for.inc32, %in.exit83.thread, %in.exit83 %ans.0.lcssa = phi i32 [ 0, %in.exit83 ], [ 0, %in.exit83.thread ], [ %ans.1.lcssa, %for.inc32 ] %call35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa) store ptr @buf, ptr @p, align 8, !tbaa !5 %15 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 15, ptr noundef %15) %tobool.not = icmp eq ptr %call, null br i1 %tobool.not, label %while.end, label %land.rhs, !llvm.loop !14 while.end: ; preds = %land.rhs, %for.end34, %entry ret i32 0 } ; 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: 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 = { 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 = { 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) } !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"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11} !14 = distinct !{!14, !11}
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<stdbool.h> #include<assert.h> typedef long long ll; typedef long double ld; #define rep(i,l,r)for(ll i=(l);i<(r);i++) #define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k)) #define rrep(i,l,r)for(ll i=(l);i>=(r);i--) #define INF (1LL<<60) #define MOD1 1000000007 #define MOD2 998244353 #define MAX_N (1 << 17) #define YES printf("Yes\n") #define NO printf("No\n") #define PN printf("\n") #define charsize 100005 //10^5+5 #define PI 3.141592653589793238 void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;} void cin(ll *n){ scanf("%lld",&(*n)); } ll max2(ll a,ll b){return a>=b?a:b;} ll min2(ll a,ll b){return a>=b?b:a;} ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;} ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;} ll minn(ll n, ll a[]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;} ll maxn(ll n, ll a[]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;} ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;} double POW_d(double a, double b){double c=1;rep(i,0,b) c*=a;return c;} ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} ll mod_MOD1(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;} ll mod_p(ll n ,ll p){n+= n<0?((-n)/p+1)*p:0; return n%=p;} ll change_into_num(char s[] , ll len, ll p){ return !p ? 0 : POW(10,p-1)*(s[len-p]-'0') + change_into_num(s,len,p-1); } void lr_lower( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } void lr_upper( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } int cmp_lower( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a>=b ? 1 : 0 ) : ( a>b ? 1 : 0 ) ; } int cmp_upper( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a<=b ? 1 : 0 ) : ( a<b ? 1 : 0 ) ; } // return smallest p which meets a[p]==val :1 >=:2 >:3 ll lower_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_lower(&l,&r,a[ (l+r)/2 ],val,type); return cmp_lower(a[l],val,type) ? l : cmp_lower(a[r],val,type) ? r : -1; } // return biggest p which meets a[p]==val :1 <=:2 <:3 ll upper_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_upper(&l,&r,a[ (l+r)/2 ],val,type); return cmp_upper(a[r],val,type) ? r : cmp_upper(a[l],val,type) ? l : -1; } // count i which meets ai==x ll count(ll a[], int l, int r, ll x){ int p = lower_bound(a,l,r,x,1); return p==-1 ? 0 : upper_bound(a,p,r,x,1)-p+1; } ll *factors[2] , fac_cnt=0; ll factor_pre(ll x){ rep(i,0,2){ factors[i] = realloc( factors[i] , sizeof(ll) ); factors[i][i?fac_cnt++:fac_cnt]=i?0:2; } repp(i,3,x+1,2) rep(j,0,fac_cnt) if( !(i%factors[0][j]) ){break;} else if(POW(factors[0][j],2)>i){ rep(k,0,2){ factors[k] = realloc( factors[k] , sizeof(ll)*( fac_cnt +1 ) ); factors[k][k?fac_cnt++:fac_cnt]=k?0:i; } break; } return 0; } ll factor(ll n, ll is_update){ rep(i,0,fac_cnt){ ll cnt=0; rep(j,0,1){ while( ( cnt+= n %factors[0][i]==0 ? 1 : 0 ) && (n/=factors[0][i]) %factors[0][i]==0 ) continue;} factors[1][i]= is_update ? cnt : max2(factors[1][i],cnt); if( factors[1][i]*factors[1][i] > n ) break; } return n; } ll judge_prime(ll n){ rep(i,0,fac_cnt){ if(n<factors[0][i]*factors[0][i] || n==factors[0][i]) break; else if(n%factors[0][i]==0) n/=n; } return n==1?0:1; } int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;} int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;} int cmp_string( const void * a , const void * b ) { return strcmp( (char *)a , (char *)b ); } // qsort((void*)s,n,sizeof(s[0]),int_sort ); int cmp_char(const void * a, const void * b) { return *(char *)a - *(char *)b;} void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);} void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);} void sort_string(int n,int size,char s[][size]){ qsort( (void*)s , n , sizeof(s[0]) , cmp_string ); } void sort_char(char *s){ qsort( (void *)s , strlen(s) , sizeof(char) , cmp_char ); } ll unique_string(ll n ,ll size, char s[][size]){ ll ans=1; rep(i,1,n) if( strcmp(s[i],s[i-1]) ) ans++; return ans; } ll unique_num(ll n , ll a[]){ ll ans=1; rep(i,1,n) if( a[i]!=a[i-1] ) ans++; return ans; } typedef struct{ ll a , b;}fr; int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;} int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;} void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);} void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);} ll n,ave; ll x[100]; ll dp[55][55][2510]; int main(void){ // fgets(s,sizeof(s),stdin); // char ; ll ans=0; cin(&n); cin(&ave); // scanf("%s",); rep(i,0,n){ cin(&x[i]); } dp[0][0][0]=1; dp[0][1][x[0]]=1; rep(i,1,n){ rep(j,0,n+1){ rep(k,0,x[i]){ dp[i][j][k]+=dp[i-1][j][k]; } rep(k,x[i],n*ave+1){ dp[i][j][k]+=dp[i-1][j][k]+(j?dp[i-1][j-1][k-x[i]]:0); } } } rep(i,1,n+1){ ans+=dp[n-1][i][i*ave]; } // rep(i,0,n){ // rep(j,0,n+1){ // rep(k,0,n*ave+1){ // printf("%lld ",dp[i][j][k]); // } // PN; // } // PN; // } printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265374/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265374/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 @fac_cnt = dso_local local_unnamed_addr global i64 0, align 8 @factors = dso_local local_unnamed_addr global [2 x ptr] zeroinitializer, align 16 @n = dso_local global i64 0, align 8 @ave = dso_local global i64 0, align 8 @x = dso_local global [100 x i64] zeroinitializer, align 16 @dp = dso_local local_unnamed_addr global [55 x [55 x [2510 x i64]]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\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 %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @cin(ptr noundef %n) local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n) ret void } ; 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) uwtable define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #3 { entry: %cmp.not = icmp sgt i64 %a, %b %cmp1.not = icmp sgt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #3 { entry: %cmp.not = icmp slt i64 %a, %b %cmp1.not = icmp slt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #4 { entry: %cmp4 = icmp sgt i64 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -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> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.05.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader9, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ] %b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smin.i64(i64 %b.05, i64 %6) %inc = add nuw nsw i64 %i.06, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #4 { entry: %cmp4 = icmp sgt i64 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -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> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.05.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader9, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ] %b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %b.05, i64 %6) %inc = add nuw nsw i64 %i.06, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 { entry: %cmp3 = icmp sgt i64 %b, 0 br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %c.04.epil, %a %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.cond.cleanup, label %for.body.epil, !llvm.loop !16 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %c.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %c.04, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %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.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local double @POW_d(double noundef %a, double noundef %b) local_unnamed_addr #5 { entry: %cmp4 = fcmp ogt double %b, 0.000000e+00 br i1 %cmp4, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %c.0.lcssa = phi double [ 1.000000e+00, %entry ], [ %mul, %for.body ] ret double %c.0.lcssa for.body: ; preds = %entry, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %c.05 = phi double [ %mul, %for.body ], [ 1.000000e+00, %entry ] %mul = fmul double %c.05, %a %inc = add nuw nsw i64 %i.06, 1 %conv = sitofp i64 %inc to double %cmp = fcmp olt double %conv, %b br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 { entry: %tobool.not4 = icmp eq i64 %b, 0 br i1 %tobool.not4, label %cond.end, label %cond.true cond.true: ; preds = %entry, %cond.true %b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.end: ; preds = %cond.true, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ] ret i64 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 { entry: %tobool.not4.i = icmp eq i64 %b, 0 br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i cond.true.i: ; preds = %entry, %cond.true.i %b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i gcd.exit: ; preds = %cond.true.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ] %div = sdiv i64 %a, %a.tr.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_MOD1(i64 noundef %n) local_unnamed_addr #6 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %n.nonneg = sub i64 0, %n %0 = urem i64 %n.nonneg, 1000000007 %1 = add nsw i64 %0, %n %mul = sub i64 1000000007, %1 br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, 1000000007 ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_p(i64 noundef %n, i64 noundef %p) local_unnamed_addr #6 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %div7 = sdiv i64 %n, %p %add = sub i64 1, %div7 %mul = mul nsw i64 %add, %p br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, %p ret i64 %rem } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @change_into_num(ptr nocapture noundef readonly %s, i64 noundef %len, i64 noundef %p) local_unnamed_addr #7 { entry: %tobool.not11 = icmp eq i64 %p, 0 br i1 %tobool.not11, label %cond.end, label %cond.false.preheader cond.false.preheader: ; preds = %entry %0 = add i64 %p, -2 br label %cond.false cond.false: ; preds = %cond.false.preheader, %POW.exit %indvar = phi i64 [ 0, %cond.false.preheader ], [ %indvar.next, %POW.exit ] %p.tr13 = phi i64 [ %p, %cond.false.preheader ], [ %sub, %POW.exit ] %accumulator.tr12 = phi i64 [ 0, %cond.false.preheader ], [ %add, %POW.exit ] %1 = xor i64 %indvar, -1 %2 = add i64 %1, %p %sub = add nsw i64 %p.tr13, -1 %cmp3.i = icmp sgt i64 %p.tr13, 1 br i1 %cmp3.i, label %for.body.i.preheader, label %POW.exit for.body.i.preheader: ; preds = %cond.false %3 = sub i64 %0, %indvar %xtraiter = and i64 %2, 7 %4 = icmp ult i64 %3, 7 br i1 %4, label %POW.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %2, -8 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %c.04.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul.i.7, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.7, %for.body.i ] %mul.i.7 = mul i64 %c.04.i, 100000000 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %POW.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !18 POW.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %mul.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %c.04.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %POW.exit, label %for.body.i.epil for.body.i.epil: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil %c.04.i.epil = phi i64 [ %mul.i.epil, %for.body.i.epil ], [ %c.04.i.unr, %POW.exit.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %POW.exit.loopexit.unr-lcssa ] %mul.i.epil = mul nsw i64 %c.04.i.epil, 10 %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 %POW.exit, label %for.body.i.epil, !llvm.loop !20 POW.exit: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil, %cond.false %c.0.lcssa.i = phi i64 [ 1, %cond.false ], [ %mul.i.lcssa.ph, %POW.exit.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body.i.epil ] %sub1 = sub nsw i64 %len, %p.tr13 %arrayidx = getelementptr inbounds i8, ptr %s, i64 %sub1 %5 = load i8, ptr %arrayidx, align 1, !tbaa !21 %conv = sext i8 %5 to i64 %sub2 = add nsw i64 %conv, -48 %mul = mul nsw i64 %sub2, %c.0.lcssa.i %add = add nsw i64 %mul, %accumulator.tr12 %tobool.not = icmp eq i64 %sub, 0 %indvar.next = add i64 %indvar, 1 br i1 %tobool.not, label %cond.end, label %cond.false cond.end: ; preds = %POW.exit, %entry %accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %POW.exit ] ret i64 %accumulator.tr.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_lower(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !22 %1 = load i32, ptr %r, align 4, !tbaa !22 %add = add nsw i32 %1, %0 %div = sdiv i32 %add, 2 %cmp1 = icmp slt i64 %am, %val %l.r = select i1 %cmp1, ptr %l, ptr %r %cmp6.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp6.not, ptr %r, ptr %l %l.sink = select i1 %cmp, ptr %l.r, ptr %r.l store i32 %div, ptr %l.sink, align 4, !tbaa !22 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_upper(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !22 %1 = load i32, ptr %r, align 4, !tbaa !22 %add3 = add nsw i32 %1, %0 %div4 = sdiv i32 %add3, 2 %cmp1.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp1.not, ptr %r, ptr %l %cmp6 = icmp slt i64 %am, %val %l.r = select i1 %cmp6, ptr %l, ptr %r %l.sink = select i1 %cmp, ptr %r.l, ptr %l.r store i32 %div4, ptr %l.sink, align 4, !tbaa !22 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_lower(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #6 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sge i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp sgt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_upper(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #6 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sle i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp slt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #7 { entry: %sub34 = sub nsw i32 %r, %l %cmp35 = icmp sgt i32 %sub34, 1 br i1 %cmp35, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select51, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.i.us = icmp slt i64 %0, %val %spec.select = select i1 %cmp1.i.us, i32 %div.us, i32 %l.addr.0 %spec.select51 = select i1 %cmp1.i.us, i32 %r.addr.0, i32 %div.us %sub.us = sub nsw i32 %spec.select51, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !24 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select53, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.not.i = icmp sgt i64 %1, %val %spec.select52 = select i1 %cmp6.not.i, i32 %l.addr.2, i32 %div %spec.select53 = select i1 %cmp6.not.i, i32 %div, i32 %r.addr.2 %sub = sub nsw i32 %spec.select53, %spec.select52 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !24 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select51, %while.body.us ], [ %spec.select53, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select52, %while.body ] %idxprom1 = sext i32 %l.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_lower.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i17 = icmp eq i64 %2, %val br i1 %cmp1.i17, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom345 = sext i32 %r.addr.0..lcssa to i64 %arrayidx446 = getelementptr inbounds i64, ptr %a, i64 %idxprom345 %3 = load i64, ptr %arrayidx446, align 8, !tbaa !5 %cmp1.i23 = icmp eq i64 %3, %val br label %cmp_lower.exit26 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp slt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread47, label %cond.end9 cond.false.thread47: ; preds = %cond.true3.i %idxprom348 = sext i32 %r.addr.0..lcssa to i64 %arrayidx449 = getelementptr inbounds i64, ptr %a, i64 %idxprom348 %4 = load i64, ptr %arrayidx449, align 8, !tbaa !5 %cmp4.not.i19 = icmp sge i64 %4, %val br label %cmp_lower.exit26 cmp_lower.exit: ; preds = %while.end %cmp7.i = icmp sgt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_lower.exit %idxprom3 = sext i32 %r.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i25 = icmp sgt i64 %5, %val br label %cmp_lower.exit26 cmp_lower.exit26: ; preds = %cond.false.thread, %cond.false.thread47, %cond.false %cond11.in.i20 = phi i1 [ %cmp1.i23, %cond.false.thread ], [ %cmp4.not.i19, %cond.false.thread47 ], [ %cmp7.i25, %cond.false ] %6 = sext i32 %r.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i20, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_lower.exit, %cmp_lower.exit26 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_lower.exit ], [ %.pre, %cmp_lower.exit26 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @upper_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #7 { entry: %sub33 = sub nsw i32 %r, %l %cmp34 = icmp sgt i32 %sub33, 1 br i1 %cmp34, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select50, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.not.i.us = icmp sgt i64 %0, %val %spec.select = select i1 %cmp1.not.i.us, i32 %l.addr.0, i32 %div.us %spec.select50 = select i1 %cmp1.not.i.us, i32 %div.us, i32 %r.addr.0 %sub.us = sub nsw i32 %spec.select50, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !25 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select51, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.i = icmp slt i64 %1, %val %spec.select51 = select i1 %cmp6.i, i32 %div, i32 %l.addr.2 %spec.select52 = select i1 %cmp6.i, i32 %r.addr.2, i32 %div %sub = sub nsw i32 %spec.select52, %spec.select51 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !25 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select50, %while.body.us ], [ %spec.select52, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select51, %while.body ] %idxprom1 = sext i32 %r.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_upper.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i = icmp eq i64 %2, %val br i1 %cmp1.i, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom344 = sext i32 %l.addr.0..lcssa to i64 %arrayidx445 = getelementptr inbounds i64, ptr %a, i64 %idxprom344 %3 = load i64, ptr %arrayidx445, align 8, !tbaa !5 %cmp1.i22 = icmp eq i64 %3, %val br label %cmp_upper.exit25 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp sgt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread46, label %cond.end9 cond.false.thread46: ; preds = %cond.true3.i %idxprom347 = sext i32 %l.addr.0..lcssa to i64 %arrayidx448 = getelementptr inbounds i64, ptr %a, i64 %idxprom347 %4 = load i64, ptr %arrayidx448, align 8, !tbaa !5 %cmp4.not.i18 = icmp sle i64 %4, %val br label %cmp_upper.exit25 cmp_upper.exit: ; preds = %while.end %cmp7.i = icmp slt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_upper.exit %idxprom3 = sext i32 %l.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i24 = icmp slt i64 %5, %val br label %cmp_upper.exit25 cmp_upper.exit25: ; preds = %cond.false.thread, %cond.false.thread46, %cond.false %cond11.in.i19 = phi i1 [ %cmp1.i22, %cond.false.thread ], [ %cmp4.not.i18, %cond.false.thread46 ], [ %cmp7.i24, %cond.false ] %6 = sext i32 %l.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i19, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_upper.exit, %cmp_upper.exit25 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_upper.exit ], [ %.pre, %cmp_upper.exit25 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @count(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %x) local_unnamed_addr #7 { entry: %sub34.i = sub nsw i32 %r, %l %cmp35.i = icmp sgt i32 %sub34.i, 1 br i1 %cmp35.i, label %while.body.us.i, label %while.end.i while.body.us.i: ; preds = %entry, %while.body.us.i %l.addr.0.i = phi i32 [ %spec.select.i, %while.body.us.i ], [ %l, %entry ] %r.addr.0.i = phi i32 [ %spec.select51.i, %while.body.us.i ], [ %r, %entry ] %add.us.i = add nsw i32 %r.addr.0.i, %l.addr.0.i %div.us.i = sdiv i32 %add.us.i, 2 %idxprom.us.i = sext i32 %div.us.i to i64 %arrayidx.us.i = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i %0 = load i64, ptr %arrayidx.us.i, align 8, !tbaa !5 %cmp1.i.us.i = icmp slt i64 %0, %x %spec.select.i = select i1 %cmp1.i.us.i, i32 %div.us.i, i32 %l.addr.0.i %spec.select51.i = select i1 %cmp1.i.us.i, i32 %r.addr.0.i, i32 %div.us.i %sub.us.i = sub nsw i32 %spec.select51.i, %spec.select.i %cmp.us.i = icmp sgt i32 %sub.us.i, 1 br i1 %cmp.us.i, label %while.body.us.i, label %while.end.i, !llvm.loop !24 while.end.i: ; preds = %while.body.us.i, %entry %r.addr.0..lcssa.i = phi i32 [ %r, %entry ], [ %spec.select51.i, %while.body.us.i ] %l.addr.0..lcssa.i = phi i32 [ %l, %entry ], [ %spec.select.i, %while.body.us.i ] %idxprom1.i = sext i32 %l.addr.0..lcssa.i to i64 %arrayidx2.i = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i %1 = load i64, ptr %arrayidx2.i, align 8, !tbaa !5 %cmp1.i17.i = icmp eq i64 %1, %x br i1 %cmp1.i17.i, label %lower_bound.exit, label %cond.false.thread.i cond.false.thread.i: ; preds = %while.end.i %idxprom345.i = sext i32 %r.addr.0..lcssa.i to i64 %arrayidx446.i = getelementptr inbounds i64, ptr %a, i64 %idxprom345.i %2 = load i64, ptr %arrayidx446.i, align 8, !tbaa !5 %cmp1.i23.i = icmp eq i64 %2, %x %.pre.i = select i1 %cmp1.i23.i, i64 %idxprom345.i, i64 -1 br label %lower_bound.exit lower_bound.exit: ; preds = %while.end.i, %cond.false.thread.i %conv.pre-phi.i = phi i64 [ %.pre.i, %cond.false.thread.i ], [ %idxprom1.i, %while.end.i ] %conv = trunc i64 %conv.pre-phi.i to i32 %cmp = icmp eq i32 %conv, -1 br i1 %cmp, label %cond.end, label %cond.false cond.false: ; preds = %lower_bound.exit %sub33.i = sub nsw i32 %r, %conv %cmp34.i = icmp sgt i32 %sub33.i, 1 br i1 %cmp34.i, label %while.body.us.i18, label %while.end.i9 while.body.us.i18: ; preds = %cond.false, %while.body.us.i18 %l.addr.0.i19 = phi i32 [ %spec.select.i25, %while.body.us.i18 ], [ %conv, %cond.false ] %r.addr.0.i20 = phi i32 [ %spec.select50.i, %while.body.us.i18 ], [ %r, %cond.false ] %add.us.i21 = add nsw i32 %r.addr.0.i20, %l.addr.0.i19 %div.us.i22 = sdiv i32 %add.us.i21, 2 %idxprom.us.i23 = sext i32 %div.us.i22 to i64 %arrayidx.us.i24 = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i23 %3 = load i64, ptr %arrayidx.us.i24, align 8, !tbaa !5 %cmp1.not.i.us.i = icmp sgt i64 %3, %x %spec.select.i25 = select i1 %cmp1.not.i.us.i, i32 %l.addr.0.i19, i32 %div.us.i22 %spec.select50.i = select i1 %cmp1.not.i.us.i, i32 %div.us.i22, i32 %r.addr.0.i20 %sub.us.i26 = sub nsw i32 %spec.select50.i, %spec.select.i25 %cmp.us.i27 = icmp sgt i32 %sub.us.i26, 1 br i1 %cmp.us.i27, label %while.body.us.i18, label %while.end.i9, !llvm.loop !25 while.end.i9: ; preds = %while.body.us.i18, %cond.false %r.addr.0..lcssa.i10 = phi i32 [ %r, %cond.false ], [ %spec.select50.i, %while.body.us.i18 ] %l.addr.0..lcssa.i11 = phi i32 [ %conv, %cond.false ], [ %spec.select.i25, %while.body.us.i18 ] %idxprom1.i12 = sext i32 %r.addr.0..lcssa.i10 to i64 %arrayidx2.i13 = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i12 %4 = load i64, ptr %arrayidx2.i13, align 8, !tbaa !5 %cmp1.i.i = icmp eq i64 %4, %x br i1 %cmp1.i.i, label %upper_bound.exit, label %cond.false.thread.i14 cond.false.thread.i14: ; preds = %while.end.i9 %idxprom344.i = sext i32 %l.addr.0..lcssa.i11 to i64 %arrayidx445.i = getelementptr inbounds i64, ptr %a, i64 %idxprom344.i %5 = load i64, ptr %arrayidx445.i, align 8, !tbaa !5 %cmp1.i22.i = icmp eq i64 %5, %x %.pre.i15 = select i1 %cmp1.i22.i, i64 %idxprom344.i, i64 -1 br label %upper_bound.exit upper_bound.exit: ; preds = %while.end.i9, %cond.false.thread.i14 %conv.pre-phi.i16 = phi i64 [ %.pre.i15, %cond.false.thread.i14 ], [ %idxprom1.i12, %while.end.i9 ] %reass.sub = sub nsw i64 %conv.pre-phi.i16, %conv.pre-phi.i %add = add nsw i64 %reass.sub, 1 br label %cond.end cond.end: ; preds = %lower_bound.exit, %upper_bound.exit %cond = phi i64 [ %add, %upper_bound.exit ], [ 0, %lower_bound.exit ] ret i64 %cond } ; Function Attrs: nounwind uwtable define dso_local i64 @factor_pre(i64 noundef %x) local_unnamed_addr #9 { cond.end.1: %0 = load ptr, ptr @factors, align 16, !tbaa !26 %call = tail call dereferenceable_or_null(8) ptr @realloc(ptr noundef %0, i64 noundef 8) #19 store ptr %call, ptr @factors, align 16, !tbaa !26 %1 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx5 = getelementptr inbounds i64, ptr %call, i64 %1 store i64 2, ptr %arrayidx5, align 8, !tbaa !5 %2 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !26 %call.1 = tail call dereferenceable_or_null(8) ptr @realloc(ptr noundef %2, i64 noundef 8) #19 store ptr %call.1, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !26 %3 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %inc.1 = add nsw i64 %3, 1 store i64 %inc.1, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx5.1 = getelementptr inbounds i64, ptr %call.1, i64 %3 store i64 0, ptr %arrayidx5.1, align 8, !tbaa !5 %cmp9.not82 = icmp sgt i64 %x, 2 %4 = icmp sgt i64 %3, -1 %or.cond = and i1 %cmp9.not82, %4 br i1 %or.cond, label %for.cond13.preheader, label %for.cond.cleanup11 for.cond13.preheader: ; preds = %cond.end.1, %cleanup %5 = phi i64 [ %11, %cleanup ], [ %inc.1, %cond.end.1 ] %i7.083 = phi i64 [ %add55, %cleanup ], [ 3, %cond.end.1 ] %cmp1479 = icmp sgt i64 %5, 0 br i1 %cmp1479, label %for.body17.lr.ph, label %cleanup for.body17.lr.ph: ; preds = %for.cond13.preheader %6 = load ptr, ptr @factors, align 16, !tbaa !26 br label %for.body17 for.cond.cleanup11: ; preds = %cleanup, %cond.end.1 ret i64 0 for.cond13: ; preds = %for.body.i.preheader %inc52 = add nuw nsw i64 %j.080, 1 %exitcond.not = icmp eq i64 %inc52, %5 br i1 %exitcond.not, label %cleanup, label %for.body17, !llvm.loop !28 for.body17: ; preds = %for.body17.lr.ph, %for.cond13 %j.080 = phi i64 [ 0, %for.body17.lr.ph ], [ %inc52, %for.cond13 ] %arrayidx18 = getelementptr inbounds i64, ptr %6, i64 %j.080 %7 = load i64, ptr %arrayidx18, align 8, !tbaa !5 %rem = srem i64 %i7.083, %7 %tobool19.not = icmp eq i64 %rem, 0 br i1 %tobool19.not, label %cleanup, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body17 %mul.i.1 = mul nsw i64 %7, %7 %cmp22 = icmp ugt i64 %mul.i.1, %i7.083 br i1 %cmp22, label %cond.end44.1, label %for.cond13 cond.end44.1: ; preds = %for.body.i.preheader %add31 = shl i64 %5, 3 %mul = add i64 %add31, 8 %call32 = tail call ptr @realloc(ptr noundef nonnull %6, i64 noundef %mul) #19 store ptr %call32, ptr @factors, align 16, !tbaa !26 %8 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx46 = getelementptr inbounds i64, ptr %call32, i64 %8 store i64 %i7.083, ptr %arrayidx46, align 8, !tbaa !5 %9 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !26 %add31.1 = shl i64 %8, 3 %mul.1 = add i64 %add31.1, 8 %call32.1 = tail call ptr @realloc(ptr noundef %9, i64 noundef %mul.1) #19 store ptr %call32.1, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !26 %10 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %inc42.1 = add nsw i64 %10, 1 store i64 %inc42.1, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx46.1 = getelementptr inbounds i64, ptr %call32.1, i64 %10 store i64 0, ptr %arrayidx46.1, align 8, !tbaa !5 br label %cleanup cleanup: ; preds = %for.cond13, %for.body17, %cond.end44.1, %for.cond13.preheader %11 = phi i64 [ %inc42.1, %cond.end44.1 ], [ %5, %for.cond13.preheader ], [ %5, %for.body17 ], [ %5, %for.cond13 ] %add55 = add nuw nsw i64 %i7.083, 2 %cmp9.not = icmp sgt i64 %add55, %x br i1 %cmp9.not, label %for.cond.cleanup11, label %for.cond13.preheader, !llvm.loop !29 } ; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #10 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i64 @factor(i64 noundef %n, i64 noundef %is_update) local_unnamed_addr #11 { entry: %0 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp41 = icmp sgt i64 %0, 0 br i1 %cmp41, label %for.cond1.preheader.lr.ph, label %cleanup21 for.cond1.preheader.lr.ph: ; preds = %entry %1 = load ptr, ptr @factors, align 16, !tbaa !26 %tobool11.not = icmp eq i64 %is_update, 0 %2 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8 br i1 %tobool11.not, label %for.cond1.preheader.us, label %for.cond1.preheader for.cond1.preheader.us: ; preds = %for.cond1.preheader.lr.ph, %for.inc.us %i.043.us = phi i64 [ %inc20.us, %for.inc.us ], [ 0, %for.cond1.preheader.lr.ph ] %n.addr.042.us = phi i64 [ %n.addr.3.us, %for.inc.us ], [ %n, %for.cond1.preheader.lr.ph ] %arrayidx.us = getelementptr inbounds i64, ptr %1, i64 %i.043.us %3 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 br label %while.cond.us while.cond.us: ; preds = %for.cond1.preheader.us, %land.rhs.us %n.addr.2.us = phi i64 [ %div.us, %land.rhs.us ], [ %n.addr.042.us, %for.cond1.preheader.us ] %cnt.1.us = phi i64 [ %add.us, %land.rhs.us ], [ 0, %for.cond1.preheader.us ] %rem.us = srem i64 %n.addr.2.us, %3 %div.us = sdiv i64 %n.addr.2.us, %3 %cmp5.us = icmp eq i64 %rem.us, 0 %conv.us = zext i1 %cmp5.us to i64 %add.us = add nuw nsw i64 %cnt.1.us, %conv.us %tobool.not.us = icmp eq i64 %add.us, 0 br i1 %tobool.not.us, label %for.inc.us, label %land.rhs.us land.rhs.us: ; preds = %while.cond.us %rem8.us = srem i64 %div.us, %3 %cmp9.us = icmp eq i64 %rem8.us, 0 br i1 %cmp9.us, label %while.cond.us, label %for.inc.us, !llvm.loop !31 for.inc.us: ; preds = %land.rhs.us, %while.cond.us %n.addr.3.us = phi i64 [ %div.us, %land.rhs.us ], [ %n.addr.2.us, %while.cond.us ] %arrayidx12.us = getelementptr inbounds i64, ptr %2, i64 %i.043.us %4 = load i64, ptr %arrayidx12.us, align 8, !tbaa !5 %cond.i.us = tail call i64 @llvm.smax.i64(i64 %4, i64 %add.us) store i64 %cond.i.us, ptr %arrayidx12.us, align 8, !tbaa !5 %mul.us = mul nsw i64 %cond.i.us, %cond.i.us %cmp17.not.us = icmp sle i64 %mul.us, %n.addr.3.us %inc20.us = add nuw nsw i64 %i.043.us, 1 %5 = load i64, ptr @fac_cnt, align 8 %cmp.us = icmp slt i64 %inc20.us, %5 %or.cond = select i1 %cmp17.not.us, i1 %cmp.us, i1 false br i1 %or.cond, label %for.cond1.preheader.us, label %cleanup21, !llvm.loop !32 for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc %i.043 = phi i64 [ %inc20, %for.inc ], [ 0, %for.cond1.preheader.lr.ph ] %n.addr.042 = phi i64 [ %n.addr.3, %for.inc ], [ %n, %for.cond1.preheader.lr.ph ] %arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.043 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 br label %while.cond while.cond: ; preds = %for.cond1.preheader, %land.rhs %n.addr.2 = phi i64 [ %div, %land.rhs ], [ %n.addr.042, %for.cond1.preheader ] %cnt.1 = phi i64 [ %add, %land.rhs ], [ 0, %for.cond1.preheader ] %rem = srem i64 %n.addr.2, %6 %div = sdiv i64 %n.addr.2, %6 %cmp5 = icmp eq i64 %rem, 0 %conv = zext i1 %cmp5 to i64 %add = add nuw nsw i64 %cnt.1, %conv %tobool.not = icmp eq i64 %add, 0 br i1 %tobool.not, label %for.inc, label %land.rhs land.rhs: ; preds = %while.cond %rem8 = srem i64 %div, %6 %cmp9 = icmp eq i64 %rem8, 0 br i1 %cmp9, label %while.cond, label %for.inc, !llvm.loop !31 for.inc: ; preds = %land.rhs, %while.cond %n.addr.3 = phi i64 [ %div, %land.rhs ], [ %n.addr.2, %while.cond ] %arrayidx14 = getelementptr inbounds i64, ptr %2, i64 %i.043 store i64 %add, ptr %arrayidx14, align 8, !tbaa !5 %mul = mul nsw i64 %add, %add %cmp17.not = icmp sle i64 %mul, %n.addr.3 %inc20 = add nuw nsw i64 %i.043, 1 %7 = load i64, ptr @fac_cnt, align 8 %cmp = icmp slt i64 %inc20, %7 %or.cond46 = select i1 %cmp17.not, i1 %cmp, i1 false br i1 %or.cond46, label %for.cond1.preheader, label %cleanup21, !llvm.loop !32 cleanup21: ; preds = %for.inc, %for.inc.us, %entry %n.addr.4 = phi i64 [ %n, %entry ], [ %n.addr.3.us, %for.inc.us ], [ %n.addr.3, %for.inc ] ret i64 %n.addr.4 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i64 @judge_prime(i64 noundef %n) local_unnamed_addr #12 { entry: %0 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp20 = icmp sgt i64 %0, 0 br i1 %cmp20, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %entry %1 = load ptr, ptr @factors, align 16, !tbaa !26 br label %for.body for.body: ; preds = %for.body.lr.ph, %if.else %i.022 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %if.else ] %n.addr.021 = phi i64 [ %n, %for.body.lr.ph ], [ %spec.select, %if.else ] %arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.022 %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %mul = mul nsw i64 %2, %2 %cmp2 = icmp slt i64 %n.addr.021, %mul %cmp4 = icmp eq i64 %n.addr.021, %2 %or.cond = or i1 %cmp4, %cmp2 br i1 %or.cond, label %cleanup, label %if.else if.else: ; preds = %for.body %rem = srem i64 %n.addr.021, %2 %cmp6 = icmp eq i64 %rem, 0 %spec.select = select i1 %cmp6, i64 1, i64 %n.addr.021 %inc = add nuw nsw i64 %i.022, 1 %exitcond.not = icmp eq i64 %inc, %0 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !33 cleanup: ; preds = %if.else, %for.body, %entry %n.addr.0.lcssa = phi i64 [ %n, %entry ], [ %n.addr.021, %for.body ], [ %spec.select, %if.else ] %cmp9 = icmp ne i64 %n.addr.0.lcssa, 1 %conv = zext i1 %cmp9 to i64 ret i64 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = sext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_string(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #14 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #20 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #15 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i8, ptr %a, align 1, !tbaa !21 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !21 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #21 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #16 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #21 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_string(i32 noundef %n, i32 noundef %size, ptr noundef %s) local_unnamed_addr #1 { entry: %0 = zext i32 %size to i64 %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %s, i64 noundef %conv, i64 noundef %0, ptr noundef nonnull @cmp_string) #21 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_char(ptr noundef %s) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #20 tail call void @qsort(ptr noundef %s, i64 noundef %call, i64 noundef 1, ptr noundef nonnull @cmp_char) #21 ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #15 ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @unique_string(i64 noundef %n, i64 noundef %size, ptr nocapture noundef readonly %s) local_unnamed_addr #17 { entry: %cmp8 = icmp sgt i64 %n, 1 br i1 %cmp8, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %entry, %for.body %i.010 = phi i64 [ %inc2, %for.body ], [ 1, %entry ] %ans.09 = phi i64 [ %spec.select, %for.body ], [ 1, %entry ] %0 = mul nsw i64 %i.010, %size %arrayidx = getelementptr inbounds i8, ptr %s, i64 %0 %sub = add nsw i64 %i.010, -1 %1 = mul nsw i64 %sub, %size %arrayidx1 = getelementptr inbounds i8, ptr %s, i64 %1 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx1) #20 %tobool.not = icmp ne i32 %call, 0 %inc = zext i1 %tobool.not to i64 %spec.select = add nuw nsw i64 %ans.09, %inc %inc2 = add nuw nsw i64 %i.010, 1 %exitcond.not = icmp eq i64 %inc2, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !34 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @unique_num(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #7 { entry: %cmp9 = icmp sgt i64 %n, 1 br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %0 = add i64 %n, -1 %min.iters.check = icmp ult i64 %n, 5 br i1 %min.iters.check, label %for.body.preheader16, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %0, -4 %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.phi = phi <2 x i64> [ <i64 1, i64 0>, %vector.ph ], [ %9, %vector.body ] %vec.phi12 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds i64, ptr %a, i64 %offset.idx %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i64, ptr %1, i64 2 %wide.load13 = load <2 x i64>, ptr %2, align 8, !tbaa !5 %3 = getelementptr i64, ptr %1, i64 -1 %wide.load14 = load <2 x i64>, ptr %3, align 8, !tbaa !5 %4 = getelementptr i64, ptr %1, i64 1 %wide.load15 = load <2 x i64>, ptr %4, align 8, !tbaa !5 %5 = icmp ne <2 x i64> %wide.load, %wide.load14 %6 = icmp ne <2 x i64> %wide.load13, %wide.load15 %7 = zext <2 x i1> %5 to <2 x i64> %8 = zext <2 x i1> %6 to <2 x i64> %9 = add <2 x i64> %vec.phi, %7 %10 = add <2 x i64> %vec.phi12, %8 %index.next = add nuw i64 %index, 4 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !35 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %10, %9 %12 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %0, %n.vec br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader16 for.body.preheader16: ; preds = %for.body.preheader, %middle.block %i.011.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] %ans.010.ph = phi i64 [ 1, %for.body.preheader ], [ %12, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %for.body.preheader16, %for.body %i.011 = phi i64 [ %inc3, %for.body ], [ %i.011.ph, %for.body.preheader16 ] %ans.010 = phi i64 [ %spec.select, %for.body ], [ %ans.010.ph, %for.body.preheader16 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.011 %13 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx1 = getelementptr i64, ptr %arrayidx, i64 -1 %14 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %cmp2.not = icmp ne i64 %13, %14 %inc = zext i1 %cmp2.not to i64 %spec.select = add nuw nsw i64 %ans.010, %inc %inc3 = add nuw nsw i64 %i.011, 1 %exitcond.not = icmp eq i64 %inc3, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !36 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #13 { entry: %0 = load i64, ptr %p, align 8, !tbaa !37 %1 = load i64, ptr %q, align 8, !tbaa !37 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #13 { entry: %0 = load i64, ptr %q, align 8, !tbaa !37 %1 = load i64, ptr %p, align 8, !tbaa !37 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #21 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #21 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call.i = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %call.i102 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @ave) %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp105 = icmp sgt i64 %0, 0 br i1 %cmp105, label %for.body, label %for.cond59.preheader.thread for.cond59.preheader.thread: ; preds = %entry store i64 1, ptr @dp, align 16, !tbaa !5 %1 = load i64, ptr @x, align 16, !tbaa !5 %arrayidx1135 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 0, i64 1, i64 %1 store i64 1, ptr %arrayidx1135, align 8, !tbaa !5 br label %for.cond.cleanup62 for.cond.cleanup: ; preds = %for.body store i64 1, ptr @dp, align 16, !tbaa !5 %2 = load i64, ptr @x, align 16, !tbaa !5 %arrayidx1 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 0, i64 1, i64 %2 store i64 1, ptr %arrayidx1, align 8, !tbaa !5 %cmp4115 = icmp sgt i64 %14, 1 br i1 %cmp4115, label %for.cond7.preheader.preheader, label %for.cond59.preheader for.cond7.preheader.preheader: ; preds = %for.cond.cleanup %3 = load i64, ptr @ave, align 8 %mul = mul i64 %3, %14 %4 = add i64 %mul, 1 %5 = shl i64 %3, 3 %6 = mul i64 %5, %14 %7 = add i64 %6, -20072 %8 = add i64 %mul, 1 %9 = add i64 %mul, 1 %10 = getelementptr i8, ptr @dp, i64 %6 %11 = getelementptr i8, ptr %10, i64 1104408 %12 = getelementptr i8, ptr @dp, i64 %6 %13 = getelementptr i8, ptr %12, i64 8 br label %for.cond7.preheader for.body: ; preds = %entry, %for.body %i.0106 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i64], ptr @x, i64 0, i64 %i.0106 %call.i103 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.0106, 1 %14 = load i64, ptr @n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %14 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !39 for.cond7.preheader: ; preds = %for.cond7.preheader.preheader, %for.cond7.for.cond.cleanup9_crit_edge %indvar = phi i64 [ 0, %for.cond7.preheader.preheader ], [ %indvar.next, %for.cond7.for.cond.cleanup9_crit_edge ] %i2.0116 = phi i64 [ 1, %for.cond7.preheader.preheader ], [ %inc56, %for.cond7.for.cond.cleanup9_crit_edge ] %15 = mul i64 %indvar, 1104400 %arrayidx12 = getelementptr inbounds [100 x i64], ptr @x, i64 0, i64 %i2.0116 %16 = load i64, ptr %arrayidx12, align 8, !tbaa !5 %cmp13107 = icmp sgt i64 %16, 0 %sub = add nsw i64 %i2.0116, -1 %cmp30.not110 = icmp sgt i64 %16, %mul br i1 %cmp30.not110, label %for.cond11.preheader.lr.ph.split.us, label %for.cond11.preheader.preheader for.cond11.preheader.preheader: ; preds = %for.cond7.preheader %17 = add i64 %7, %15 %18 = sub i64 %4, %16 %19 = shl i64 %16, 3 %20 = sub i64 %17, %19 %21 = sub i64 %8, %16 %gep = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 1104400), i64 %15 %22 = getelementptr i8, ptr %gep, i64 %19 %23 = getelementptr i8, ptr %11, i64 %15 %24 = getelementptr i8, ptr @dp, i64 %15 %25 = getelementptr i8, ptr %24, i64 %19 %26 = getelementptr i8, ptr %13, i64 %15 %gep203 = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 -20080), i64 %15 %27 = getelementptr i8, ptr @dp, i64 %20 %min.iters.check184 = icmp eq i64 %16, 1 %n.vec187 = and i64 %16, -2 %cmp.n189 = icmp eq i64 %16, %n.vec187 %min.iters.check168 = icmp ult i64 %21, 8 %bound0 = icmp ult ptr %22, %26 %bound1 = icmp ult ptr %25, %23 %found.conflict = and i1 %bound0, %bound1 %bound0163 = icmp ult ptr %22, %27 %bound1164 = icmp ult ptr %gep203, %23 %found.conflict165 = and i1 %bound0163, %bound1164 %conflict.rdx = or i1 %found.conflict, %found.conflict165 %n.vec171 = and i64 %21, -2 %ind.end172 = add i64 %16, %n.vec171 %cmp.n174 = icmp eq i64 %21, %n.vec171 %min.iters.check147 = icmp ult i64 %18, 2 %n.vec150 = and i64 %18, -2 %ind.end = add i64 %16, %n.vec150 %cmp.n152 = icmp eq i64 %18, %n.vec150 br label %for.cond11.preheader for.cond11.preheader.lr.ph.split.us: ; preds = %for.cond7.preheader br i1 %cmp13107, label %for.cond11.preheader.us.us.preheader, label %for.cond7.for.cond.cleanup9_crit_edge for.cond11.preheader.us.us.preheader: ; preds = %for.cond11.preheader.lr.ph.split.us %min.iters.check = icmp ult i64 %16, 2 %n.vec = and i64 %16, -2 %cmp.n = icmp eq i64 %16, %n.vec br label %for.cond11.preheader.us.us for.cond11.preheader.us.us: ; preds = %for.cond11.preheader.us.us.preheader, %for.cond11.for.cond28.preheader_crit_edge.us.us %j.0113.us.us = phi i64 [ %inc53.us.us, %for.cond11.for.cond28.preheader_crit_edge.us.us ], [ 0, %for.cond11.preheader.us.us.preheader ] br i1 %min.iters.check, label %for.body15.us.us.preheader, label %vector.body vector.body: ; preds = %for.cond11.preheader.us.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond11.preheader.us.us ] %28 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %j.0113.us.us, i64 %index %wide.load = load <2 x i64>, ptr %28, align 16, !tbaa !5 %29 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %i2.0116, i64 %j.0113.us.us, i64 %index %wide.load144 = load <2 x i64>, ptr %29, align 16, !tbaa !5 %30 = add nsw <2 x i64> %wide.load144, %wide.load store <2 x i64> %30, ptr %29, align 16, !tbaa !5 %index.next = add nuw i64 %index, 2 %31 = icmp eq i64 %index.next, %n.vec br i1 %31, label %middle.block, label %vector.body, !llvm.loop !40 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond11.for.cond28.preheader_crit_edge.us.us, label %for.body15.us.us.preheader for.body15.us.us.preheader: ; preds = %for.cond11.preheader.us.us, %middle.block %k.0108.us.us.ph = phi i64 [ 0, %for.cond11.preheader.us.us ], [ %n.vec, %middle.block ] br label %for.body15.us.us for.body15.us.us: ; preds = %for.body15.us.us.preheader, %for.body15.us.us %k.0108.us.us = phi i64 [ %inc24.us.us, %for.body15.us.us ], [ %k.0108.us.us.ph, %for.body15.us.us.preheader ] %arrayidx18.us.us = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %j.0113.us.us, i64 %k.0108.us.us %32 = load i64, ptr %arrayidx18.us.us, align 8, !tbaa !5 %arrayidx21.us.us = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %i2.0116, i64 %j.0113.us.us, i64 %k.0108.us.us %33 = load i64, ptr %arrayidx21.us.us, align 8, !tbaa !5 %add22.us.us = add nsw i64 %33, %32 store i64 %add22.us.us, ptr %arrayidx21.us.us, align 8, !tbaa !5 %inc24.us.us = add nuw nsw i64 %k.0108.us.us, 1 %exitcond130.not = icmp eq i64 %inc24.us.us, %16 br i1 %exitcond130.not, label %for.cond11.for.cond28.preheader_crit_edge.us.us, label %for.body15.us.us, !llvm.loop !41 for.cond11.for.cond28.preheader_crit_edge.us.us: ; preds = %for.body15.us.us, %middle.block %inc53.us.us = add nuw i64 %j.0113.us.us, 1 %exitcond131.not = icmp eq i64 %j.0113.us.us, %14 br i1 %exitcond131.not, label %for.cond7.for.cond.cleanup9_crit_edge, label %for.cond11.preheader.us.us, !llvm.loop !42 for.cond59.preheader: ; preds = %for.cond7.for.cond.cleanup9_crit_edge, %for.cond.cleanup %cmp61.not119 = icmp slt i64 %14, 1 br i1 %cmp61.not119, label %for.cond.cleanup62, label %for.body63.lr.ph for.body63.lr.ph: ; preds = %for.cond59.preheader %sub64 = add nsw i64 %14, -1 %34 = load i64, ptr @ave, align 8, !tbaa !5 %xtraiter200 = and i64 %14, 3 %35 = icmp ult i64 %14, 4 br i1 %35, label %for.cond.cleanup62.loopexit.unr-lcssa, label %for.body63.lr.ph.new for.body63.lr.ph.new: ; preds = %for.body63.lr.ph %unroll_iter = and i64 %14, -4 br label %for.body63 for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.cond28.for.cond.cleanup31_crit_edge %j.0113 = phi i64 [ %inc53, %for.cond28.for.cond.cleanup31_crit_edge ], [ 0, %for.cond11.preheader.preheader ] br i1 %cmp13107, label %for.body15.preheader, label %for.cond28.preheader for.body15.preheader: ; preds = %for.cond11.preheader br i1 %min.iters.check184, label %for.body15.preheader198, label %vector.body190 vector.body190: ; preds = %for.body15.preheader, %vector.body190 %index191 = phi i64 [ %index.next194, %vector.body190 ], [ 0, %for.body15.preheader ] %36 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %j.0113, i64 %index191 %wide.load192 = load <2 x i64>, ptr %36, align 16, !tbaa !5 %37 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %i2.0116, i64 %j.0113, i64 %index191 %wide.load193 = load <2 x i64>, ptr %37, align 16, !tbaa !5 %38 = add nsw <2 x i64> %wide.load193, %wide.load192 store <2 x i64> %38, ptr %37, align 16, !tbaa !5 %index.next194 = add nuw i64 %index191, 2 %39 = icmp eq i64 %index.next194, %n.vec187 br i1 %39, label %middle.block182, label %vector.body190, !llvm.loop !43 middle.block182: ; preds = %vector.body190 br i1 %cmp.n189, label %for.cond28.preheader, label %for.body15.preheader198 for.body15.preheader198: ; preds = %for.body15.preheader, %middle.block182 %k.0108.ph = phi i64 [ 0, %for.body15.preheader ], [ %n.vec187, %middle.block182 ] br label %for.body15 for.cond7.for.cond.cleanup9_crit_edge: ; preds = %for.cond28.for.cond.cleanup31_crit_edge, %for.cond11.for.cond28.preheader_crit_edge.us.us, %for.cond11.preheader.lr.ph.split.us %inc56 = add nuw nsw i64 %i2.0116, 1 %exitcond132.not = icmp eq i64 %inc56, %14 %indvar.next = add i64 %indvar, 1 br i1 %exitcond132.not, label %for.cond59.preheader, label %for.cond7.preheader, !llvm.loop !44 for.cond28.preheader: ; preds = %for.body15, %middle.block182, %for.cond11.preheader %tobool.not = icmp eq i64 %j.0113, 0 %sub39 = add nsw i64 %j.0113, -1 br i1 %tobool.not, label %for.body32.us.preheader, label %for.body32.preheader for.body32.preheader: ; preds = %for.cond28.preheader %brmerge = select i1 %min.iters.check168, i1 true, i1 %conflict.rdx br i1 %brmerge, label %for.body32.preheader196, label %vector.body175 vector.body175: ; preds = %for.body32.preheader, %vector.body175 %index176 = phi i64 [ %index.next181, %vector.body175 ], [ 0, %for.body32.preheader ] %offset.idx177 = add i64 %16, %index176 %40 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %j.0113, i64 %offset.idx177 %wide.load178 = load <2 x i64>, ptr %40, align 8, !tbaa !5, !alias.scope !45 %41 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %sub39, i64 %index176 %wide.load179 = load <2 x i64>, ptr %41, align 16, !tbaa !5, !alias.scope !48 %42 = add nsw <2 x i64> %wide.load179, %wide.load178 %43 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %i2.0116, i64 %j.0113, i64 %offset.idx177 %wide.load180 = load <2 x i64>, ptr %43, align 8, !tbaa !5, !alias.scope !50, !noalias !52 %44 = add nsw <2 x i64> %42, %wide.load180 store <2 x i64> %44, ptr %43, align 8, !tbaa !5, !alias.scope !50, !noalias !52 %index.next181 = add nuw i64 %index176, 2 %45 = icmp eq i64 %index.next181, %n.vec171 br i1 %45, label %middle.block166, label %vector.body175, !llvm.loop !53 middle.block166: ; preds = %vector.body175 br i1 %cmp.n174, label %for.cond28.for.cond.cleanup31_crit_edge, label %for.body32.preheader196 for.body32.preheader196: ; preds = %for.body32.preheader, %middle.block166 %k26.0111.ph = phi i64 [ %16, %for.body32.preheader ], [ %ind.end172, %middle.block166 ] %46 = sub i64 %9, %k26.0111.ph %xtraiter = and i64 %46, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body32.prol.loopexit, label %for.body32.prol for.body32.prol: ; preds = %for.body32.preheader196 %arrayidx36.prol = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %j.0113, i64 %k26.0111.ph %47 = load i64, ptr %arrayidx36.prol, align 8, !tbaa !5 %sub42.prol = sub nsw i64 %k26.0111.ph, %16 %arrayidx43.prol = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %sub39, i64 %sub42.prol %48 = load i64, ptr %arrayidx43.prol, align 8, !tbaa !5 %add44.prol = add nsw i64 %48, %47 %arrayidx47.prol = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %i2.0116, i64 %j.0113, i64 %k26.0111.ph %49 = load i64, ptr %arrayidx47.prol, align 8, !tbaa !5 %add48.prol = add nsw i64 %add44.prol, %49 store i64 %add48.prol, ptr %arrayidx47.prol, align 8, !tbaa !5 %inc50.prol = add i64 %k26.0111.ph, 1 br label %for.body32.prol.loopexit for.body32.prol.loopexit: ; preds = %for.body32.prol, %for.body32.preheader196 %k26.0111.unr = phi i64 [ %k26.0111.ph, %for.body32.preheader196 ], [ %inc50.prol, %for.body32.prol ] %50 = icmp eq i64 %mul, %k26.0111.ph br i1 %50, label %for.cond28.for.cond.cleanup31_crit_edge, label %for.body32 for.body32.us.preheader: ; preds = %for.cond28.preheader br i1 %min.iters.check147, label %for.body32.us.preheader195, label %vector.body153 vector.body153: ; preds = %for.body32.us.preheader, %vector.body153 %index154 = phi i64 [ %index.next157, %vector.body153 ], [ 0, %for.body32.us.preheader ] %offset.idx = add i64 %16, %index154 %51 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 0, i64 %offset.idx %wide.load155 = load <2 x i64>, ptr %51, align 8, !tbaa !5 %52 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %i2.0116, i64 0, i64 %offset.idx %wide.load156 = load <2 x i64>, ptr %52, align 8, !tbaa !5 %53 = add nsw <2 x i64> %wide.load155, %wide.load156 store <2 x i64> %53, ptr %52, align 8, !tbaa !5 %index.next157 = add nuw i64 %index154, 2 %54 = icmp eq i64 %index.next157, %n.vec150 br i1 %54, label %middle.block145, label %vector.body153, !llvm.loop !54 middle.block145: ; preds = %vector.body153 br i1 %cmp.n152, label %for.cond28.for.cond.cleanup31_crit_edge, label %for.body32.us.preheader195 for.body32.us.preheader195: ; preds = %for.body32.us.preheader, %middle.block145 %k26.0111.us.ph = phi i64 [ %16, %for.body32.us.preheader ], [ %ind.end, %middle.block145 ] br label %for.body32.us for.body32.us: ; preds = %for.body32.us.preheader195, %for.body32.us %k26.0111.us = phi i64 [ %inc50.us, %for.body32.us ], [ %k26.0111.us.ph, %for.body32.us.preheader195 ] %arrayidx36.us = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 0, i64 %k26.0111.us %55 = load i64, ptr %arrayidx36.us, align 8, !tbaa !5 %arrayidx47.us = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %i2.0116, i64 0, i64 %k26.0111.us %56 = load i64, ptr %arrayidx47.us, align 8, !tbaa !5 %add48.us = add nsw i64 %55, %56 store i64 %add48.us, ptr %arrayidx47.us, align 8, !tbaa !5 %inc50.us = add i64 %k26.0111.us, 1 %exitcond128.not = icmp eq i64 %k26.0111.us, %mul br i1 %exitcond128.not, label %for.cond28.for.cond.cleanup31_crit_edge, label %for.body32.us, !llvm.loop !55 for.body15: ; preds = %for.body15.preheader198, %for.body15 %k.0108 = phi i64 [ %inc24, %for.body15 ], [ %k.0108.ph, %for.body15.preheader198 ] %arrayidx18 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %j.0113, i64 %k.0108 %57 = load i64, ptr %arrayidx18, align 8, !tbaa !5 %arrayidx21 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %i2.0116, i64 %j.0113, i64 %k.0108 %58 = load i64, ptr %arrayidx21, align 8, !tbaa !5 %add22 = add nsw i64 %58, %57 store i64 %add22, ptr %arrayidx21, align 8, !tbaa !5 %inc24 = add nuw nsw i64 %k.0108, 1 %exitcond.not = icmp eq i64 %inc24, %16 br i1 %exitcond.not, label %for.cond28.preheader, label %for.body15, !llvm.loop !56 for.cond28.for.cond.cleanup31_crit_edge: ; preds = %for.body32.prol.loopexit, %for.body32, %for.body32.us, %middle.block166, %middle.block145 %inc53 = add nuw i64 %j.0113, 1 %exitcond129.not = icmp eq i64 %j.0113, %14 br i1 %exitcond129.not, label %for.cond7.for.cond.cleanup9_crit_edge, label %for.cond11.preheader, !llvm.loop !42 for.body32: ; preds = %for.body32.prol.loopexit, %for.body32 %k26.0111 = phi i64 [ %inc50.1, %for.body32 ], [ %k26.0111.unr, %for.body32.prol.loopexit ] %arrayidx36 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %j.0113, i64 %k26.0111 %59 = load i64, ptr %arrayidx36, align 8, !tbaa !5 %sub42 = sub nsw i64 %k26.0111, %16 %arrayidx43 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %sub39, i64 %sub42 %60 = load i64, ptr %arrayidx43, align 8, !tbaa !5 %add44 = add nsw i64 %60, %59 %arrayidx47 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %i2.0116, i64 %j.0113, i64 %k26.0111 %61 = load i64, ptr %arrayidx47, align 8, !tbaa !5 %add48 = add nsw i64 %add44, %61 store i64 %add48, ptr %arrayidx47, align 8, !tbaa !5 %inc50 = add i64 %k26.0111, 1 %arrayidx36.1 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %j.0113, i64 %inc50 %62 = load i64, ptr %arrayidx36.1, align 8, !tbaa !5 %sub42.1 = sub nsw i64 %inc50, %16 %arrayidx43.1 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub, i64 %sub39, i64 %sub42.1 %63 = load i64, ptr %arrayidx43.1, align 8, !tbaa !5 %add44.1 = add nsw i64 %63, %62 %arrayidx47.1 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %i2.0116, i64 %j.0113, i64 %inc50 %64 = load i64, ptr %arrayidx47.1, align 8, !tbaa !5 %add48.1 = add nsw i64 %add44.1, %64 store i64 %add48.1, ptr %arrayidx47.1, align 8, !tbaa !5 %inc50.1 = add i64 %k26.0111, 2 %exitcond127.not.1 = icmp eq i64 %inc50, %mul br i1 %exitcond127.not.1, label %for.cond28.for.cond.cleanup31_crit_edge, label %for.body32, !llvm.loop !57 for.cond.cleanup62.loopexit.unr-lcssa: ; preds = %for.body63, %for.body63.lr.ph %add69.lcssa.ph = phi i64 [ undef, %for.body63.lr.ph ], [ %add69.3, %for.body63 ] %i58.0121.unr = phi i64 [ 1, %for.body63.lr.ph ], [ %inc71.3, %for.body63 ] %ans.0120.unr = phi i64 [ 0, %for.body63.lr.ph ], [ %add69.3, %for.body63 ] %lcmp.mod201.not = icmp eq i64 %xtraiter200, 0 br i1 %lcmp.mod201.not, label %for.cond.cleanup62, label %for.body63.epil for.body63.epil: ; preds = %for.cond.cleanup62.loopexit.unr-lcssa, %for.body63.epil %i58.0121.epil = phi i64 [ %inc71.epil, %for.body63.epil ], [ %i58.0121.unr, %for.cond.cleanup62.loopexit.unr-lcssa ] %ans.0120.epil = phi i64 [ %add69.epil, %for.body63.epil ], [ %ans.0120.unr, %for.cond.cleanup62.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body63.epil ], [ 0, %for.cond.cleanup62.loopexit.unr-lcssa ] %mul67.epil = mul nsw i64 %34, %i58.0121.epil %arrayidx68.epil = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub64, i64 %i58.0121.epil, i64 %mul67.epil %65 = load i64, ptr %arrayidx68.epil, align 8, !tbaa !5 %add69.epil = add nsw i64 %65, %ans.0120.epil %inc71.epil = add nuw i64 %i58.0121.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter200 br i1 %epil.iter.cmp.not, label %for.cond.cleanup62, label %for.body63.epil, !llvm.loop !58 for.cond.cleanup62: ; preds = %for.cond.cleanup62.loopexit.unr-lcssa, %for.body63.epil, %for.cond59.preheader.thread, %for.cond59.preheader %ans.0.lcssa = phi i64 [ 0, %for.cond59.preheader ], [ 0, %for.cond59.preheader.thread ], [ %add69.lcssa.ph, %for.cond.cleanup62.loopexit.unr-lcssa ], [ %add69.epil, %for.body63.epil ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa) ret i32 0 for.body63: ; preds = %for.body63, %for.body63.lr.ph.new %i58.0121 = phi i64 [ 1, %for.body63.lr.ph.new ], [ %inc71.3, %for.body63 ] %ans.0120 = phi i64 [ 0, %for.body63.lr.ph.new ], [ %add69.3, %for.body63 ] %niter = phi i64 [ 0, %for.body63.lr.ph.new ], [ %niter.next.3, %for.body63 ] %mul67 = mul nsw i64 %34, %i58.0121 %arrayidx68 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub64, i64 %i58.0121, i64 %mul67 %66 = load i64, ptr %arrayidx68, align 8, !tbaa !5 %add69 = add nsw i64 %66, %ans.0120 %inc71 = add nuw nsw i64 %i58.0121, 1 %mul67.1 = mul nsw i64 %34, %inc71 %arrayidx68.1 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub64, i64 %inc71, i64 %mul67.1 %67 = load i64, ptr %arrayidx68.1, align 8, !tbaa !5 %add69.1 = add nsw i64 %67, %add69 %inc71.1 = add nuw nsw i64 %i58.0121, 2 %mul67.2 = mul nsw i64 %34, %inc71.1 %arrayidx68.2 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub64, i64 %inc71.1, i64 %mul67.2 %68 = load i64, ptr %arrayidx68.2, align 8, !tbaa !5 %add69.2 = add nsw i64 %68, %add69.1 %inc71.2 = add nuw i64 %i58.0121, 3 %mul67.3 = mul nsw i64 %34, %inc71.2 %arrayidx68.3 = getelementptr inbounds [55 x [55 x [2510 x i64]]], ptr @dp, i64 0, i64 %sub64, i64 %inc71.2, i64 %mul67.3 %69 = load i64, ptr %arrayidx68.3, align 8, !tbaa !5 %add69.3 = add nsw i64 %69, %add69.2 %inc71.3 = add nuw i64 %i58.0121, 4 %niter.next.3 = add nuw i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond.cleanup62.loopexit.unr-lcssa, label %for.body63, !llvm.loop !59 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #18 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 = { 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 = { 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) 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: 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 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 #6 = { 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 #7 = { 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 #8 = { mustprogress nofree norecurse nosync nounwind willreturn 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 #9 = { 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 #10 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 #11 = { 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 #12 = { nofree norecurse nosync nounwind 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 #13 = { 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 #14 = { mustprogress nofree 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 #15 = { 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 #16 = { 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 #17 = { nofree 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 #18 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #19 = { nounwind allocsize(1) } attributes #20 = { nounwind willreturn memory(read) } attributes #21 = { 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, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !17} !21 = !{!7, !7, i64 0} !22 = !{!23, !23, i64 0} !23 = !{!"int", !7, i64 0} !24 = distinct !{!24, !10} !25 = distinct !{!25, !10} !26 = !{!27, !27, i64 0} !27 = !{!"any pointer", !7, i64 0} !28 = distinct !{!28, !10} !29 = distinct !{!29, !10, !30} !30 = !{!"llvm.loop.unswitch.partial.disable"} !31 = distinct !{!31, !10} !32 = distinct !{!32, !10} !33 = distinct !{!33, !10} !34 = distinct !{!34, !10} !35 = distinct !{!35, !10, !11, !12} !36 = distinct !{!36, !10, !12, !11} !37 = !{!38, !6, i64 0} !38 = !{!"", !6, i64 0, !6, i64 8} !39 = distinct !{!39, !10} !40 = distinct !{!40, !10, !11, !12} !41 = distinct !{!41, !10, !12, !11} !42 = distinct !{!42, !10} !43 = distinct !{!43, !10, !11, !12} !44 = distinct !{!44, !10} !45 = !{!46} !46 = distinct !{!46, !47} !47 = distinct !{!47, !"LVerDomain"} !48 = !{!49} !49 = distinct !{!49, !47} !50 = !{!51} !51 = distinct !{!51, !47} !52 = !{!46, !49} !53 = distinct !{!53, !10, !11, !12} !54 = distinct !{!54, !10, !11, !12} !55 = distinct !{!55, !10, !12, !11} !56 = distinct !{!56, !10, !12, !11} !57 = distinct !{!57, !10, !11} !58 = distinct !{!58, !17} !59 = distinct !{!59, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> void swap (int *x, int *y) { int temp; temp = *x; *x = *y; *y = temp; } int gcd(int a,int b){ if(a<b){ swap(&a,&b); } if(b==0){ return a; } int r=a%b; while(r!=0){ a = b; b = r; r = (a%b); } return b; } /* クイックソート */ int dn(const void*a,const void*b){return*(int*)b-*(int*)a;} int modpow(int a,int n,int mod){ int ans=1; while(n>0){ if(n & 1){ ans=ans*a%mod; } a=a*a%mod; n/=2; } return ans; } int max(int a,int b){ if(a<b){ return b; } else{ return a; } } int min(int a,int b){ if(a<b){ return a; } else{ return b; } } void chmax(int *a,int b){ if(*a < b){ *a = b; } return; } void chmin(int *a,int b){ if(*a > b){ *a =b; } return; } int main(void){ char s[100010]; int c[26]; scanf("%s",s); int l=strlen(s); for(int i=0;i<26;i++){ c[i]=0; } for(int i=0;i<l;i++){ c[s[i]-'a']++; } for(int i=0;i<26;i++){ if(c[i]==0){ printf("%c\n",i+'a'); return 0; } } printf("None\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265417/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265417/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 [4 x i8] c"%c\0A\00", align 1 @str = private unnamed_addr constant [5 x i8] c"None\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 store i32 %1, ptr %x, align 4, !tbaa !5 store i32 %0, ptr %y, align 4, !tbaa !5 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(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %spec.select = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %spec.select14 = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %cmp1 = icmp eq i32 %spec.select14, 0 br i1 %cmp1, label %return, label %if.end3 if.end3: ; preds = %entry %rem = srem i32 %spec.select, %spec.select14 %cmp4.not15 = icmp eq i32 %rem, 0 br i1 %cmp4.not15, label %return, label %while.body while.body: ; preds = %if.end3, %while.body %r.017 = phi i32 [ %rem5, %while.body ], [ %rem, %if.end3 ] %b.addr.116 = phi i32 [ %r.017, %while.body ], [ %spec.select14, %if.end3 ] %rem5 = srem i32 %b.addr.116, %r.017 %cmp4.not = icmp eq i32 %rem5, 0 br i1 %cmp4.not, label %return, label %while.body, !llvm.loop !9 return: ; preds = %while.body, %if.end3, %entry %retval.0.in.sroa.speculated = phi i32 [ %spec.select, %entry ], [ %spec.select14, %if.end3 ], [ %r.017, %while.body ] ret i32 %retval.0.in.sroa.speculated } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dn(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @modpow(i32 noundef %a, i32 noundef %n, i32 noundef %mod) local_unnamed_addr #4 { entry: %cmp10 = icmp sgt i32 %n, 0 br i1 %cmp10, label %while.body, label %while.end while.body: ; preds = %entry, %if.end %ans.013 = phi i32 [ %ans.1, %if.end ], [ 1, %entry ] %a.addr.012 = phi i32 [ %rem2, %if.end ], [ %a, %entry ] %n.addr.011 = phi i32 [ %div9, %if.end ], [ %n, %entry ] %and = and i32 %n.addr.011, 1 %tobool.not = icmp eq i32 %and, 0 br i1 %tobool.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul nsw i32 %ans.013, %a.addr.012 %rem = srem i32 %mul, %mod br label %if.end if.end: ; preds = %if.then, %while.body %ans.1 = phi i32 [ %rem, %if.then ], [ %ans.013, %while.body ] %mul1 = mul nsw i32 %a.addr.012, %a.addr.012 %rem2 = srem i32 %mul1, %mod %div9 = lshr i32 %n.addr.011, 1 %cmp.not = icmp ult i32 %n.addr.011, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %if.end, %entry %ans.0.lcssa = phi i32 [ 1, %entry ], [ %ans.1, %if.end ] ret i32 %ans.0.lcssa } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #5 { entry: %b.a = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %b.a } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #5 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @chmax(ptr nocapture noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %b br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %b, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @chmin(ptr nocapture noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %b br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %b, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %s = alloca [100010 x i8], align 16 %c = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 100010, ptr nonnull %s) #12 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %c) #12 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #13 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %c, i8 0, i64 104, i1 false), !tbaa !5 %conv = trunc i64 %call2 to i32 %cmp646 = icmp sgt i32 %conv, 0 br i1 %cmp646, label %for.body9.preheader, label %if.then for.body9.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 %xtraiter = and i64 %call2, 1 %0 = icmp eq i64 %wide.trip.count, 1 br i1 %0, label %for.cond20.preheader.unr-lcssa, label %for.body9.preheader.new for.body9.preheader.new: ; preds = %for.body9.preheader %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body9 for.cond20.preheader.unr-lcssa: ; preds = %for.body9, %for.body9.preheader %indvars.iv.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next.1, %for.body9 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond20.preheader, label %for.body9.epil for.body9.epil: ; preds = %for.cond20.preheader.unr-lcssa %arrayidx11.epil = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv.unr %1 = load i8, ptr %arrayidx11.epil, align 1, !tbaa !12 %conv12.epil = sext i8 %1 to i64 %sub.epil = add nsw i64 %conv12.epil, -97 %arrayidx14.epil = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %sub.epil %2 = load i32, ptr %arrayidx14.epil, align 4, !tbaa !5 %inc15.epil = add nsw i32 %2, 1 store i32 %inc15.epil, ptr %arrayidx14.epil, align 4, !tbaa !5 br label %for.cond20.preheader for.cond20.preheader: ; preds = %for.cond20.preheader.unr-lcssa, %for.body9.epil %.pre = load i32, ptr %c, align 16, !tbaa !5 %3 = icmp eq i32 %.pre, 0 br i1 %3, label %if.then, label %for.inc30 for.body9: ; preds = %for.body9, %for.body9.preheader.new %indvars.iv = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next.1, %for.body9 ] %niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.1, %for.body9 ] %arrayidx11 = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv %4 = load i8, ptr %arrayidx11, align 2, !tbaa !12 %conv12 = sext i8 %4 to i64 %sub = add nsw i64 %conv12, -97 %arrayidx14 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %sub %5 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %inc15 = add nsw i32 %5, 1 store i32 %inc15, ptr %arrayidx14, align 4, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx11.1 = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv.next %6 = load i8, ptr %arrayidx11.1, align 1, !tbaa !12 %conv12.1 = sext i8 %6 to i64 %sub.1 = add nsw i64 %conv12.1, -97 %arrayidx14.1 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %sub.1 %7 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5 %inc15.1 = add nsw i32 %7, 1 store i32 %inc15.1, ptr %arrayidx14.1, align 4, !tbaa !5 %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.cond20.preheader.unr-lcssa, label %for.body9, !llvm.loop !13 if.then: ; preds = %entry, %for.inc30.24, %for.inc30.23, %for.inc30.22, %for.inc30.21, %for.inc30.20, %for.inc30.19, %for.inc30.18, %for.inc30.17, %for.inc30.16, %for.inc30.15, %for.inc30.14, %for.inc30.13, %for.inc30.12, %for.inc30.11, %for.inc30.10, %for.inc30.9, %for.inc30.8, %for.inc30.7, %for.inc30.6, %for.inc30.5, %for.inc30.4, %for.inc30.3, %for.inc30.2, %for.inc30.1, %for.inc30, %for.cond20.preheader %i19.048.lcssa.wide = phi i32 [ 97, %for.cond20.preheader ], [ 98, %for.inc30 ], [ 99, %for.inc30.1 ], [ 100, %for.inc30.2 ], [ 101, %for.inc30.3 ], [ 102, %for.inc30.4 ], [ 103, %for.inc30.5 ], [ 104, %for.inc30.6 ], [ 105, %for.inc30.7 ], [ 106, %for.inc30.8 ], [ 107, %for.inc30.9 ], [ 108, %for.inc30.10 ], [ 109, %for.inc30.11 ], [ 110, %for.inc30.12 ], [ 111, %for.inc30.13 ], [ 112, %for.inc30.14 ], [ 113, %for.inc30.15 ], [ 114, %for.inc30.16 ], [ 115, %for.inc30.17 ], [ 116, %for.inc30.18 ], [ 117, %for.inc30.19 ], [ 118, %for.inc30.20 ], [ 119, %for.inc30.21 ], [ 120, %for.inc30.22 ], [ 121, %for.inc30.23 ], [ 122, %for.inc30.24 ], [ 97, %entry ] %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i19.048.lcssa.wide) br label %cleanup34 for.inc30: ; preds = %for.cond20.preheader %arrayidx26.1 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 1 %8 = load i32, ptr %arrayidx26.1, align 4, !tbaa !5 %cmp27.1 = icmp eq i32 %8, 0 br i1 %cmp27.1, label %if.then, label %for.inc30.1 for.inc30.1: ; preds = %for.inc30 %arrayidx26.2 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 2 %9 = load i32, ptr %arrayidx26.2, align 8, !tbaa !5 %cmp27.2 = icmp eq i32 %9, 0 br i1 %cmp27.2, label %if.then, label %for.inc30.2 for.inc30.2: ; preds = %for.inc30.1 %arrayidx26.3 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 3 %10 = load i32, ptr %arrayidx26.3, align 4, !tbaa !5 %cmp27.3 = icmp eq i32 %10, 0 br i1 %cmp27.3, label %if.then, label %for.inc30.3 for.inc30.3: ; preds = %for.inc30.2 %arrayidx26.4 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 4 %11 = load i32, ptr %arrayidx26.4, align 16, !tbaa !5 %cmp27.4 = icmp eq i32 %11, 0 br i1 %cmp27.4, label %if.then, label %for.inc30.4 for.inc30.4: ; preds = %for.inc30.3 %arrayidx26.5 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 5 %12 = load i32, ptr %arrayidx26.5, align 4, !tbaa !5 %cmp27.5 = icmp eq i32 %12, 0 br i1 %cmp27.5, label %if.then, label %for.inc30.5 for.inc30.5: ; preds = %for.inc30.4 %arrayidx26.6 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 6 %13 = load i32, ptr %arrayidx26.6, align 8, !tbaa !5 %cmp27.6 = icmp eq i32 %13, 0 br i1 %cmp27.6, label %if.then, label %for.inc30.6 for.inc30.6: ; preds = %for.inc30.5 %arrayidx26.7 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 7 %14 = load i32, ptr %arrayidx26.7, align 4, !tbaa !5 %cmp27.7 = icmp eq i32 %14, 0 br i1 %cmp27.7, label %if.then, label %for.inc30.7 for.inc30.7: ; preds = %for.inc30.6 %arrayidx26.8 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 8 %15 = load i32, ptr %arrayidx26.8, align 16, !tbaa !5 %cmp27.8 = icmp eq i32 %15, 0 br i1 %cmp27.8, label %if.then, label %for.inc30.8 for.inc30.8: ; preds = %for.inc30.7 %arrayidx26.9 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 9 %16 = load i32, ptr %arrayidx26.9, align 4, !tbaa !5 %cmp27.9 = icmp eq i32 %16, 0 br i1 %cmp27.9, label %if.then, label %for.inc30.9 for.inc30.9: ; preds = %for.inc30.8 %arrayidx26.10 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 10 %17 = load i32, ptr %arrayidx26.10, align 8, !tbaa !5 %cmp27.10 = icmp eq i32 %17, 0 br i1 %cmp27.10, label %if.then, label %for.inc30.10 for.inc30.10: ; preds = %for.inc30.9 %arrayidx26.11 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 11 %18 = load i32, ptr %arrayidx26.11, align 4, !tbaa !5 %cmp27.11 = icmp eq i32 %18, 0 br i1 %cmp27.11, label %if.then, label %for.inc30.11 for.inc30.11: ; preds = %for.inc30.10 %arrayidx26.12 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 12 %19 = load i32, ptr %arrayidx26.12, align 16, !tbaa !5 %cmp27.12 = icmp eq i32 %19, 0 br i1 %cmp27.12, label %if.then, label %for.inc30.12 for.inc30.12: ; preds = %for.inc30.11 %arrayidx26.13 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 13 %20 = load i32, ptr %arrayidx26.13, align 4, !tbaa !5 %cmp27.13 = icmp eq i32 %20, 0 br i1 %cmp27.13, label %if.then, label %for.inc30.13 for.inc30.13: ; preds = %for.inc30.12 %arrayidx26.14 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 14 %21 = load i32, ptr %arrayidx26.14, align 8, !tbaa !5 %cmp27.14 = icmp eq i32 %21, 0 br i1 %cmp27.14, label %if.then, label %for.inc30.14 for.inc30.14: ; preds = %for.inc30.13 %arrayidx26.15 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 15 %22 = load i32, ptr %arrayidx26.15, align 4, !tbaa !5 %cmp27.15 = icmp eq i32 %22, 0 br i1 %cmp27.15, label %if.then, label %for.inc30.15 for.inc30.15: ; preds = %for.inc30.14 %arrayidx26.16 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 16 %23 = load i32, ptr %arrayidx26.16, align 16, !tbaa !5 %cmp27.16 = icmp eq i32 %23, 0 br i1 %cmp27.16, label %if.then, label %for.inc30.16 for.inc30.16: ; preds = %for.inc30.15 %arrayidx26.17 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 17 %24 = load i32, ptr %arrayidx26.17, align 4, !tbaa !5 %cmp27.17 = icmp eq i32 %24, 0 br i1 %cmp27.17, label %if.then, label %for.inc30.17 for.inc30.17: ; preds = %for.inc30.16 %arrayidx26.18 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 18 %25 = load i32, ptr %arrayidx26.18, align 8, !tbaa !5 %cmp27.18 = icmp eq i32 %25, 0 br i1 %cmp27.18, label %if.then, label %for.inc30.18 for.inc30.18: ; preds = %for.inc30.17 %arrayidx26.19 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 19 %26 = load i32, ptr %arrayidx26.19, align 4, !tbaa !5 %cmp27.19 = icmp eq i32 %26, 0 br i1 %cmp27.19, label %if.then, label %for.inc30.19 for.inc30.19: ; preds = %for.inc30.18 %arrayidx26.20 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 20 %27 = load i32, ptr %arrayidx26.20, align 16, !tbaa !5 %cmp27.20 = icmp eq i32 %27, 0 br i1 %cmp27.20, label %if.then, label %for.inc30.20 for.inc30.20: ; preds = %for.inc30.19 %arrayidx26.21 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 21 %28 = load i32, ptr %arrayidx26.21, align 4, !tbaa !5 %cmp27.21 = icmp eq i32 %28, 0 br i1 %cmp27.21, label %if.then, label %for.inc30.21 for.inc30.21: ; preds = %for.inc30.20 %arrayidx26.22 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 22 %29 = load i32, ptr %arrayidx26.22, align 8, !tbaa !5 %cmp27.22 = icmp eq i32 %29, 0 br i1 %cmp27.22, label %if.then, label %for.inc30.22 for.inc30.22: ; preds = %for.inc30.21 %arrayidx26.23 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 23 %30 = load i32, ptr %arrayidx26.23, align 4, !tbaa !5 %cmp27.23 = icmp eq i32 %30, 0 br i1 %cmp27.23, label %if.then, label %for.inc30.23 for.inc30.23: ; preds = %for.inc30.22 %arrayidx26.24 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 24 %31 = load i32, ptr %arrayidx26.24, align 16, !tbaa !5 %cmp27.24 = icmp eq i32 %31, 0 br i1 %cmp27.24, label %if.then, label %for.inc30.24 for.inc30.24: ; preds = %for.inc30.23 %arrayidx26.25 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 25 %32 = load i32, ptr %arrayidx26.25, align 4, !tbaa !5 %cmp27.25 = icmp eq i32 %32, 0 br i1 %cmp27.25, label %if.then, label %for.inc30.25 for.inc30.25: ; preds = %for.inc30.24 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup34 cleanup34: ; preds = %if.then, %for.inc30.25 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %c) #12 call void @llvm.lifetime.end.p0(i64 100010, ptr nonnull %s) #12 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #8 ; 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 #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #10 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #11 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 = { nofree 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 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 #4 = { 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 #5 = { 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 #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 = { 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 #9 = { nofree nounwind } attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #11 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #12 = { nounwind } attributes #13 = { 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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = !{!7, !7, i64 0} !13 = distinct !{!13, !10}
#include <stdio.h> #include <stdlib.h> // a=97 int main(void) { char s[100001]; int x, i = 0; int bool[27] = {}; //配列の初期化 scanf("%s", s); while (s[i] != '\0') { x = (int)s[i] - 97; bool[x] = 1; i++; } for (i = 0; i < 27; i++) { if (bool[i] == 0) { if (i < 26) { printf("%c\n", 'a' + i); break; } else { printf("None\n"); break; } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265460/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265460/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 [4 x i8] c"%c\0A\00", align 1 @str = private unnamed_addr constant [5 x i8] c"None\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100001 x i8], align 16 %bool = alloca [27 x i32], align 16 call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 108, ptr nonnull %bool) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(108) %bool, i8 0, i64 108, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not27 = icmp eq i8 %0, 0 br i1 %cmp.not27, label %if.then15, label %while.body for.cond.preheader: ; preds = %while.body %.pre = load i32, ptr %bool, align 16, !tbaa !8 %cmp11 = icmp eq i32 %.pre, 0 br i1 %cmp11, label %if.then15, label %for.inc while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %1 = phi i8 [ %2, %while.body ], [ %0, %entry ] %conv = sext i8 %1 to i64 %sub = add nsw i64 %conv, -97 %arrayidx6 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 %sub store i32 1, ptr %arrayidx6, align 4, !tbaa !8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %2, 0 br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !10 if.then15: ; preds = %entry, %for.cond.preheader, %for.inc, %for.inc.1, %for.inc.2, %for.inc.3, %for.inc.4, %for.inc.5, %for.inc.6, %for.inc.7, %for.inc.8, %for.inc.9, %for.inc.10, %for.inc.11, %for.inc.12, %for.inc.13, %for.inc.14, %for.inc.15, %for.inc.16, %for.inc.17, %for.inc.18, %for.inc.19, %for.inc.20, %for.inc.21, %for.inc.22, %for.inc.23, %for.inc.24 %i.129.lcssa.wide.ph = phi i32 [ 122, %for.inc.24 ], [ 121, %for.inc.23 ], [ 120, %for.inc.22 ], [ 119, %for.inc.21 ], [ 118, %for.inc.20 ], [ 117, %for.inc.19 ], [ 116, %for.inc.18 ], [ 115, %for.inc.17 ], [ 114, %for.inc.16 ], [ 113, %for.inc.15 ], [ 112, %for.inc.14 ], [ 111, %for.inc.13 ], [ 110, %for.inc.12 ], [ 109, %for.inc.11 ], [ 108, %for.inc.10 ], [ 107, %for.inc.9 ], [ 106, %for.inc.8 ], [ 105, %for.inc.7 ], [ 104, %for.inc.6 ], [ 103, %for.inc.5 ], [ 102, %for.inc.4 ], [ 101, %for.inc.3 ], [ 100, %for.inc.2 ], [ 99, %for.inc.1 ], [ 98, %for.inc ], [ 97, %for.cond.preheader ], [ 97, %entry ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.129.lcssa.wide.ph) br label %for.end if.else: ; preds = %for.inc.25 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.end for.inc: ; preds = %for.cond.preheader %arrayidx10.1 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 1 %3 = load i32, ptr %arrayidx10.1, align 4, !tbaa !8 %cmp11.1 = icmp eq i32 %3, 0 br i1 %cmp11.1, label %if.then15, label %for.inc.1 for.inc.1: ; preds = %for.inc %arrayidx10.2 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 2 %4 = load i32, ptr %arrayidx10.2, align 8, !tbaa !8 %cmp11.2 = icmp eq i32 %4, 0 br i1 %cmp11.2, label %if.then15, label %for.inc.2 for.inc.2: ; preds = %for.inc.1 %arrayidx10.3 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 3 %5 = load i32, ptr %arrayidx10.3, align 4, !tbaa !8 %cmp11.3 = icmp eq i32 %5, 0 br i1 %cmp11.3, label %if.then15, label %for.inc.3 for.inc.3: ; preds = %for.inc.2 %arrayidx10.4 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 4 %6 = load i32, ptr %arrayidx10.4, align 16, !tbaa !8 %cmp11.4 = icmp eq i32 %6, 0 br i1 %cmp11.4, label %if.then15, label %for.inc.4 for.inc.4: ; preds = %for.inc.3 %arrayidx10.5 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 5 %7 = load i32, ptr %arrayidx10.5, align 4, !tbaa !8 %cmp11.5 = icmp eq i32 %7, 0 br i1 %cmp11.5, label %if.then15, label %for.inc.5 for.inc.5: ; preds = %for.inc.4 %arrayidx10.6 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 6 %8 = load i32, ptr %arrayidx10.6, align 8, !tbaa !8 %cmp11.6 = icmp eq i32 %8, 0 br i1 %cmp11.6, label %if.then15, label %for.inc.6 for.inc.6: ; preds = %for.inc.5 %arrayidx10.7 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 7 %9 = load i32, ptr %arrayidx10.7, align 4, !tbaa !8 %cmp11.7 = icmp eq i32 %9, 0 br i1 %cmp11.7, label %if.then15, label %for.inc.7 for.inc.7: ; preds = %for.inc.6 %arrayidx10.8 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 8 %10 = load i32, ptr %arrayidx10.8, align 16, !tbaa !8 %cmp11.8 = icmp eq i32 %10, 0 br i1 %cmp11.8, label %if.then15, label %for.inc.8 for.inc.8: ; preds = %for.inc.7 %arrayidx10.9 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 9 %11 = load i32, ptr %arrayidx10.9, align 4, !tbaa !8 %cmp11.9 = icmp eq i32 %11, 0 br i1 %cmp11.9, label %if.then15, label %for.inc.9 for.inc.9: ; preds = %for.inc.8 %arrayidx10.10 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 10 %12 = load i32, ptr %arrayidx10.10, align 8, !tbaa !8 %cmp11.10 = icmp eq i32 %12, 0 br i1 %cmp11.10, label %if.then15, label %for.inc.10 for.inc.10: ; preds = %for.inc.9 %arrayidx10.11 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 11 %13 = load i32, ptr %arrayidx10.11, align 4, !tbaa !8 %cmp11.11 = icmp eq i32 %13, 0 br i1 %cmp11.11, label %if.then15, label %for.inc.11 for.inc.11: ; preds = %for.inc.10 %arrayidx10.12 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 12 %14 = load i32, ptr %arrayidx10.12, align 16, !tbaa !8 %cmp11.12 = icmp eq i32 %14, 0 br i1 %cmp11.12, label %if.then15, label %for.inc.12 for.inc.12: ; preds = %for.inc.11 %arrayidx10.13 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 13 %15 = load i32, ptr %arrayidx10.13, align 4, !tbaa !8 %cmp11.13 = icmp eq i32 %15, 0 br i1 %cmp11.13, label %if.then15, label %for.inc.13 for.inc.13: ; preds = %for.inc.12 %arrayidx10.14 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 14 %16 = load i32, ptr %arrayidx10.14, align 8, !tbaa !8 %cmp11.14 = icmp eq i32 %16, 0 br i1 %cmp11.14, label %if.then15, label %for.inc.14 for.inc.14: ; preds = %for.inc.13 %arrayidx10.15 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 15 %17 = load i32, ptr %arrayidx10.15, align 4, !tbaa !8 %cmp11.15 = icmp eq i32 %17, 0 br i1 %cmp11.15, label %if.then15, label %for.inc.15 for.inc.15: ; preds = %for.inc.14 %arrayidx10.16 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 16 %18 = load i32, ptr %arrayidx10.16, align 16, !tbaa !8 %cmp11.16 = icmp eq i32 %18, 0 br i1 %cmp11.16, label %if.then15, label %for.inc.16 for.inc.16: ; preds = %for.inc.15 %arrayidx10.17 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 17 %19 = load i32, ptr %arrayidx10.17, align 4, !tbaa !8 %cmp11.17 = icmp eq i32 %19, 0 br i1 %cmp11.17, label %if.then15, label %for.inc.17 for.inc.17: ; preds = %for.inc.16 %arrayidx10.18 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 18 %20 = load i32, ptr %arrayidx10.18, align 8, !tbaa !8 %cmp11.18 = icmp eq i32 %20, 0 br i1 %cmp11.18, label %if.then15, label %for.inc.18 for.inc.18: ; preds = %for.inc.17 %arrayidx10.19 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 19 %21 = load i32, ptr %arrayidx10.19, align 4, !tbaa !8 %cmp11.19 = icmp eq i32 %21, 0 br i1 %cmp11.19, label %if.then15, label %for.inc.19 for.inc.19: ; preds = %for.inc.18 %arrayidx10.20 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 20 %22 = load i32, ptr %arrayidx10.20, align 16, !tbaa !8 %cmp11.20 = icmp eq i32 %22, 0 br i1 %cmp11.20, label %if.then15, label %for.inc.20 for.inc.20: ; preds = %for.inc.19 %arrayidx10.21 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 21 %23 = load i32, ptr %arrayidx10.21, align 4, !tbaa !8 %cmp11.21 = icmp eq i32 %23, 0 br i1 %cmp11.21, label %if.then15, label %for.inc.21 for.inc.21: ; preds = %for.inc.20 %arrayidx10.22 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 22 %24 = load i32, ptr %arrayidx10.22, align 8, !tbaa !8 %cmp11.22 = icmp eq i32 %24, 0 br i1 %cmp11.22, label %if.then15, label %for.inc.22 for.inc.22: ; preds = %for.inc.21 %arrayidx10.23 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 23 %25 = load i32, ptr %arrayidx10.23, align 4, !tbaa !8 %cmp11.23 = icmp eq i32 %25, 0 br i1 %cmp11.23, label %if.then15, label %for.inc.23 for.inc.23: ; preds = %for.inc.22 %arrayidx10.24 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 24 %26 = load i32, ptr %arrayidx10.24, align 16, !tbaa !8 %cmp11.24 = icmp eq i32 %26, 0 br i1 %cmp11.24, label %if.then15, label %for.inc.24 for.inc.24: ; preds = %for.inc.23 %arrayidx10.25 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 25 %27 = load i32, ptr %arrayidx10.25, align 4, !tbaa !8 %cmp11.25 = icmp eq i32 %27, 0 br i1 %cmp11.25, label %if.then15, label %for.inc.25 for.inc.25: ; preds = %for.inc.24 %arrayidx10.26 = getelementptr inbounds [27 x i32], ptr %bool, i64 0, i64 26 %28 = load i32, ptr %arrayidx10.26, align 8, !tbaa !8 %cmp11.26 = icmp eq i32 %28, 0 br i1 %cmp11.26, label %if.else, label %for.end for.end: ; preds = %for.inc.25, %if.else, %if.then15 call void @llvm.lifetime.end.p0(i64 108, ptr nonnull %bool) #5 call void @llvm.lifetime.end.p0(i64 100001, 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: 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 @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 = { 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 = { 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 = !{!"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"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <time.h> #define _CRT_SECURE_NO_WARNINGS #define TLong long long int main(int argc, char const *argv[]){ int alphabet[259] = { 0 }; char str[100007]; scanf("%s",str); for (int i = 0; i < strlen(str); ++i) ++alphabet[(int)str[i]]; for (int i = 'a'; i <= 'z'; ++i) { if(alphabet[i] == 0){ printf("%c\n", i); return 0; } } printf("None\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265503/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265503/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 [4 x i8] c"%c\0A\00", align 1 @str = private unnamed_addr constant [5 x i8] c"None\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: %alphabet = alloca [259 x i32], align 16 %str = alloca [100007 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1036, ptr nonnull %alphabet) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1036) %alphabet, i8 0, i64 1036, i1 false) call void @llvm.lifetime.start.p0(i64 100007, ptr nonnull %str) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #7 %cmp31.not = icmp eq i64 %call2, 0 br i1 %cmp31.not, label %if.then, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call2, 3 %0 = icmp ult i64 %call2, 4 br i1 %0, label %for.cond9.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %call2, -4 br label %for.body for.cond9.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %arrayidx.epil = getelementptr inbounds [100007 x i8], ptr %str, i64 0, i64 %indvars.iv.epil %1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 %idxprom5.epil = sext i8 %1 to i64 %arrayidx6.epil = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 %idxprom5.epil %2 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !8 %inc.epil = add nsw i32 %2, 1 store i32 %inc.epil, ptr %arrayidx6.epil, align 4, !tbaa !8 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.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.cond9.preheader, label %for.body.epil, !llvm.loop !10 for.cond9.preheader: ; preds = %for.body.epil, %for.cond9.preheader.unr-lcssa %arrayidx15.phi.trans.insert = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 97 %.pre = load i32, ptr %arrayidx15.phi.trans.insert, align 4, !tbaa !8 %3 = icmp eq i32 %.pre, 0 br i1 %3, label %if.then, label %for.inc19 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds [100007 x i8], ptr %str, i64 0, i64 %indvars.iv %4 = load i8, ptr %arrayidx, align 4, !tbaa !5 %idxprom5 = sext i8 %4 to i64 %arrayidx6 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 %idxprom5 %5 = load i32, ptr %arrayidx6, align 4, !tbaa !8 %inc = add nsw i32 %5, 1 store i32 %inc, ptr %arrayidx6, align 4, !tbaa !8 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [100007 x i8], ptr %str, i64 0, i64 %indvars.iv.next %6 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %idxprom5.1 = sext i8 %6 to i64 %arrayidx6.1 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 %idxprom5.1 %7 = load i32, ptr %arrayidx6.1, align 4, !tbaa !8 %inc.1 = add nsw i32 %7, 1 store i32 %inc.1, ptr %arrayidx6.1, align 4, !tbaa !8 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [100007 x i8], ptr %str, i64 0, i64 %indvars.iv.next.1 %8 = load i8, ptr %arrayidx.2, align 2, !tbaa !5 %idxprom5.2 = sext i8 %8 to i64 %arrayidx6.2 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 %idxprom5.2 %9 = load i32, ptr %arrayidx6.2, align 4, !tbaa !8 %inc.2 = add nsw i32 %9, 1 store i32 %inc.2, ptr %arrayidx6.2, align 4, !tbaa !8 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [100007 x i8], ptr %str, i64 0, i64 %indvars.iv.next.2 %10 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %idxprom5.3 = sext i8 %10 to i64 %arrayidx6.3 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 %idxprom5.3 %11 = load i32, ptr %arrayidx6.3, align 4, !tbaa !8 %inc.3 = add nsw i32 %11, 1 store i32 %inc.3, ptr %arrayidx6.3, align 4, !tbaa !8 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 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.cond9.preheader.unr-lcssa, label %for.body, !llvm.loop !12 if.then: ; preds = %entry, %for.inc19.24, %for.inc19.23, %for.inc19.22, %for.inc19.21, %for.inc19.20, %for.inc19.19, %for.inc19.18, %for.inc19.17, %for.inc19.16, %for.inc19.15, %for.inc19.14, %for.inc19.13, %for.inc19.12, %for.inc19.11, %for.inc19.10, %for.inc19.9, %for.inc19.8, %for.inc19.7, %for.inc19.6, %for.inc19.5, %for.inc19.4, %for.inc19.3, %for.inc19.2, %for.inc19.1, %for.inc19, %for.cond9.preheader %i8.034.lcssa.wide = phi i32 [ 97, %for.cond9.preheader ], [ 98, %for.inc19 ], [ 99, %for.inc19.1 ], [ 100, %for.inc19.2 ], [ 101, %for.inc19.3 ], [ 102, %for.inc19.4 ], [ 103, %for.inc19.5 ], [ 104, %for.inc19.6 ], [ 105, %for.inc19.7 ], [ 106, %for.inc19.8 ], [ 107, %for.inc19.9 ], [ 108, %for.inc19.10 ], [ 109, %for.inc19.11 ], [ 110, %for.inc19.12 ], [ 111, %for.inc19.13 ], [ 112, %for.inc19.14 ], [ 113, %for.inc19.15 ], [ 114, %for.inc19.16 ], [ 115, %for.inc19.17 ], [ 116, %for.inc19.18 ], [ 117, %for.inc19.19 ], [ 118, %for.inc19.20 ], [ 119, %for.inc19.21 ], [ 120, %for.inc19.22 ], [ 121, %for.inc19.23 ], [ 122, %for.inc19.24 ], [ 97, %entry ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i8.034.lcssa.wide) br label %cleanup23 for.inc19: ; preds = %for.cond9.preheader %arrayidx15.1 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 98 %12 = load i32, ptr %arrayidx15.1, align 8, !tbaa !8 %cmp16.1 = icmp eq i32 %12, 0 br i1 %cmp16.1, label %if.then, label %for.inc19.1 for.inc19.1: ; preds = %for.inc19 %arrayidx15.2 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 99 %13 = load i32, ptr %arrayidx15.2, align 4, !tbaa !8 %cmp16.2 = icmp eq i32 %13, 0 br i1 %cmp16.2, label %if.then, label %for.inc19.2 for.inc19.2: ; preds = %for.inc19.1 %arrayidx15.3 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 100 %14 = load i32, ptr %arrayidx15.3, align 16, !tbaa !8 %cmp16.3 = icmp eq i32 %14, 0 br i1 %cmp16.3, label %if.then, label %for.inc19.3 for.inc19.3: ; preds = %for.inc19.2 %arrayidx15.4 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 101 %15 = load i32, ptr %arrayidx15.4, align 4, !tbaa !8 %cmp16.4 = icmp eq i32 %15, 0 br i1 %cmp16.4, label %if.then, label %for.inc19.4 for.inc19.4: ; preds = %for.inc19.3 %arrayidx15.5 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 102 %16 = load i32, ptr %arrayidx15.5, align 8, !tbaa !8 %cmp16.5 = icmp eq i32 %16, 0 br i1 %cmp16.5, label %if.then, label %for.inc19.5 for.inc19.5: ; preds = %for.inc19.4 %arrayidx15.6 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 103 %17 = load i32, ptr %arrayidx15.6, align 4, !tbaa !8 %cmp16.6 = icmp eq i32 %17, 0 br i1 %cmp16.6, label %if.then, label %for.inc19.6 for.inc19.6: ; preds = %for.inc19.5 %arrayidx15.7 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 104 %18 = load i32, ptr %arrayidx15.7, align 16, !tbaa !8 %cmp16.7 = icmp eq i32 %18, 0 br i1 %cmp16.7, label %if.then, label %for.inc19.7 for.inc19.7: ; preds = %for.inc19.6 %arrayidx15.8 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 105 %19 = load i32, ptr %arrayidx15.8, align 4, !tbaa !8 %cmp16.8 = icmp eq i32 %19, 0 br i1 %cmp16.8, label %if.then, label %for.inc19.8 for.inc19.8: ; preds = %for.inc19.7 %arrayidx15.9 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 106 %20 = load i32, ptr %arrayidx15.9, align 8, !tbaa !8 %cmp16.9 = icmp eq i32 %20, 0 br i1 %cmp16.9, label %if.then, label %for.inc19.9 for.inc19.9: ; preds = %for.inc19.8 %arrayidx15.10 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 107 %21 = load i32, ptr %arrayidx15.10, align 4, !tbaa !8 %cmp16.10 = icmp eq i32 %21, 0 br i1 %cmp16.10, label %if.then, label %for.inc19.10 for.inc19.10: ; preds = %for.inc19.9 %arrayidx15.11 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 108 %22 = load i32, ptr %arrayidx15.11, align 16, !tbaa !8 %cmp16.11 = icmp eq i32 %22, 0 br i1 %cmp16.11, label %if.then, label %for.inc19.11 for.inc19.11: ; preds = %for.inc19.10 %arrayidx15.12 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 109 %23 = load i32, ptr %arrayidx15.12, align 4, !tbaa !8 %cmp16.12 = icmp eq i32 %23, 0 br i1 %cmp16.12, label %if.then, label %for.inc19.12 for.inc19.12: ; preds = %for.inc19.11 %arrayidx15.13 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 110 %24 = load i32, ptr %arrayidx15.13, align 8, !tbaa !8 %cmp16.13 = icmp eq i32 %24, 0 br i1 %cmp16.13, label %if.then, label %for.inc19.13 for.inc19.13: ; preds = %for.inc19.12 %arrayidx15.14 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 111 %25 = load i32, ptr %arrayidx15.14, align 4, !tbaa !8 %cmp16.14 = icmp eq i32 %25, 0 br i1 %cmp16.14, label %if.then, label %for.inc19.14 for.inc19.14: ; preds = %for.inc19.13 %arrayidx15.15 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 112 %26 = load i32, ptr %arrayidx15.15, align 16, !tbaa !8 %cmp16.15 = icmp eq i32 %26, 0 br i1 %cmp16.15, label %if.then, label %for.inc19.15 for.inc19.15: ; preds = %for.inc19.14 %arrayidx15.16 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 113 %27 = load i32, ptr %arrayidx15.16, align 4, !tbaa !8 %cmp16.16 = icmp eq i32 %27, 0 br i1 %cmp16.16, label %if.then, label %for.inc19.16 for.inc19.16: ; preds = %for.inc19.15 %arrayidx15.17 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 114 %28 = load i32, ptr %arrayidx15.17, align 8, !tbaa !8 %cmp16.17 = icmp eq i32 %28, 0 br i1 %cmp16.17, label %if.then, label %for.inc19.17 for.inc19.17: ; preds = %for.inc19.16 %arrayidx15.18 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 115 %29 = load i32, ptr %arrayidx15.18, align 4, !tbaa !8 %cmp16.18 = icmp eq i32 %29, 0 br i1 %cmp16.18, label %if.then, label %for.inc19.18 for.inc19.18: ; preds = %for.inc19.17 %arrayidx15.19 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 116 %30 = load i32, ptr %arrayidx15.19, align 16, !tbaa !8 %cmp16.19 = icmp eq i32 %30, 0 br i1 %cmp16.19, label %if.then, label %for.inc19.19 for.inc19.19: ; preds = %for.inc19.18 %arrayidx15.20 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 117 %31 = load i32, ptr %arrayidx15.20, align 4, !tbaa !8 %cmp16.20 = icmp eq i32 %31, 0 br i1 %cmp16.20, label %if.then, label %for.inc19.20 for.inc19.20: ; preds = %for.inc19.19 %arrayidx15.21 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 118 %32 = load i32, ptr %arrayidx15.21, align 8, !tbaa !8 %cmp16.21 = icmp eq i32 %32, 0 br i1 %cmp16.21, label %if.then, label %for.inc19.21 for.inc19.21: ; preds = %for.inc19.20 %arrayidx15.22 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 119 %33 = load i32, ptr %arrayidx15.22, align 4, !tbaa !8 %cmp16.22 = icmp eq i32 %33, 0 br i1 %cmp16.22, label %if.then, label %for.inc19.22 for.inc19.22: ; preds = %for.inc19.21 %arrayidx15.23 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 120 %34 = load i32, ptr %arrayidx15.23, align 16, !tbaa !8 %cmp16.23 = icmp eq i32 %34, 0 br i1 %cmp16.23, label %if.then, label %for.inc19.23 for.inc19.23: ; preds = %for.inc19.22 %arrayidx15.24 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 121 %35 = load i32, ptr %arrayidx15.24, align 4, !tbaa !8 %cmp16.24 = icmp eq i32 %35, 0 br i1 %cmp16.24, label %if.then, label %for.inc19.24 for.inc19.24: ; preds = %for.inc19.23 %arrayidx15.25 = getelementptr inbounds [259 x i32], ptr %alphabet, i64 0, i64 122 %36 = load i32, ptr %arrayidx15.25, align 8, !tbaa !8 %cmp16.25 = icmp eq i32 %36, 0 br i1 %cmp16.25, label %if.then, label %for.inc19.25 for.inc19.25: ; preds = %for.inc19.24 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup23 cleanup23: ; preds = %if.then, %for.inc19.25 call void @llvm.lifetime.end.p0(i64 100007, ptr nonnull %str) #6 call void @llvm.lifetime.end.p0(i64 1036, ptr nonnull %alphabet) #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: 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 nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; 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 = { 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 = { 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 #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { 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.unroll.disable"} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <ctype.h> #include <limits.h> #define inf (INT_MAX-1) #define INF 9223372036854775807 #define sq(n) ((n)*(n)) #define rep(i,n) for(i=0;i<n;i++) #define rev(i,n) for(i=n-1;i>=0;i--) #define sort(a,n) qsort(a,n,sizeof(TYPE),cmp) #define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r); #define chsort(s,n) qsort(s,n,sizeof(char),cmp) #define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r); #define TYPE int #define MEMSET(a) memset(a,0,sizeof(a)) const int mod=(int)1e09+7; int in(void){ int i;scanf("%d",&i); return i; } long long llin(void){ long long i;scanf("%lld",&i); return i; } double din(void){ double i;scanf("%lf",&i); return i; } void chin(char s[]){ scanf("%s",s); } void print(int a){ printf("%d\n",a); } void llprint(long long a){ printf("%lld\n",a); } void dprint(double a){ printf("%.10f\n",a); } void print2(int a,int b){ printf("%d %d\n",a,b); } long long max(long long a,long long b){ return a>b?a:b; } long long min(long long a,long long b){ return a<b?a:b; } long long llabs(long long a){ return a>0?a:-a; } double dmax(double a,double b){ return a>b?a:b; } int cmp(const void *a,const void *b){ return *(TYPE *)a-*(TYPE *)b; } int cmp_r(const void *a,const void *b){ return *(TYPE *)b-*(TYPE *)a; } int char_cmp(const void *a,const void *b){ return strcmp((char *)a,(char *)b); } int char_cmp_r(const void *a,const void *b){ return strcmp((char *)b,(char *)a); } void swap(int *a,int *b){ int t=*a; *a=*b; *b=t; } int main(void){ int i,f[300]={}; char s[100010]; chin(s); rep(i,strlen(s))f[s[i]]++; for(i='a';i<='z';i++){ if(!f[i]){ putchar(i); return 0; } } puts("None"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265547/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265547/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" @mod = dso_local local_unnamed_addr constant i32 1000000007, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1 @.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 @.str.8 = private unnamed_addr constant [5 x i8] c"None\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @in() local_unnamed_addr #0 { entry: %i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %0 = load i32, ptr %i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #11 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 uwtable define dso_local i64 @llin() local_unnamed_addr #0 { entry: %i = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i) %0 = load i64, ptr %i, align 8, !tbaa !9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11 ret i64 %0 } ; Function Attrs: nofree nounwind uwtable define dso_local double @din() local_unnamed_addr #0 { entry: %i = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i) %0 = load double, ptr %i, align 8, !tbaa !11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11 ret double %0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @chin(ptr noundef %s) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %s) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %a) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @llprint(i64 noundef %a) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %a) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @dprint(double noundef %a) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %a) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %a, i32 noundef %b) ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llabs(i64 noundef %a) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true) ret i64 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dmax(double noundef %a, double noundef %b) local_unnamed_addr #4 { entry: %cmp = fcmp ogt double %a, %b %cond = select i1 %cmp, double %a, double %b ret double %cond } ; 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 #5 { 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 norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @char_cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #12 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @char_cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #12 ret i32 %call } ; 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 #8 { 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 #0 { entry: %f = alloca [300 x i32], align 16 %s = alloca [100010 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %f) #11 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1200) %f, i8 0, i64 1200, i1 false) call void @llvm.lifetime.start.p0(i64 100010, ptr nonnull %s) #11 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %s) %call = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #12 %cmp27.not = icmp eq i64 %call, 0 br i1 %cmp27.not, label %if.then, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 3 %0 = icmp ult i64 %call, 4 br i1 %0, label %for.cond6.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %call, -4 br label %for.body for.cond6.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond6.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond6.preheader.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond6.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond6.preheader.unr-lcssa ] %arrayidx.epil = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv.epil %1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !13 %idxprom3.epil = sext i8 %1 to i64 %arrayidx4.epil = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 %idxprom3.epil %2 = load i32, ptr %arrayidx4.epil, align 4, !tbaa !5 %inc.epil = add nsw i32 %2, 1 store i32 %inc.epil, ptr %arrayidx4.epil, align 4, !tbaa !5 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.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.preheader, label %for.body.epil, !llvm.loop !14 for.cond6.preheader: ; preds = %for.body.epil, %for.cond6.preheader.unr-lcssa %arrayidx11.phi.trans.insert = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 97 %.pre = load i32, ptr %arrayidx11.phi.trans.insert, align 4, !tbaa !5 %3 = icmp eq i32 %.pre, 0 br i1 %3, label %if.then, label %for.inc13 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv %4 = load i8, ptr %arrayidx, align 4, !tbaa !13 %idxprom3 = sext i8 %4 to i64 %arrayidx4 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 %idxprom3 %5 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %inc = add nsw i32 %5, 1 store i32 %inc, ptr %arrayidx4, align 4, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv.next %6 = load i8, ptr %arrayidx.1, align 1, !tbaa !13 %idxprom3.1 = sext i8 %6 to i64 %arrayidx4.1 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 %idxprom3.1 %7 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5 %inc.1 = add nsw i32 %7, 1 store i32 %inc.1, ptr %arrayidx4.1, align 4, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv.next.1 %8 = load i8, ptr %arrayidx.2, align 2, !tbaa !13 %idxprom3.2 = sext i8 %8 to i64 %arrayidx4.2 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 %idxprom3.2 %9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5 %inc.2 = add nsw i32 %9, 1 store i32 %inc.2, ptr %arrayidx4.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv.next.2 %10 = load i8, ptr %arrayidx.3, align 1, !tbaa !13 %idxprom3.3 = sext i8 %10 to i64 %arrayidx4.3 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 %idxprom3.3 %11 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5 %inc.3 = add nsw i32 %11, 1 store i32 %inc.3, ptr %arrayidx4.3, align 4, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 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.cond6.preheader.unr-lcssa, label %for.body, !llvm.loop !16 if.then: ; preds = %entry, %for.inc13.24, %for.inc13.23, %for.inc13.22, %for.inc13.21, %for.inc13.20, %for.inc13.19, %for.inc13.18, %for.inc13.17, %for.inc13.16, %for.inc13.15, %for.inc13.14, %for.inc13.13, %for.inc13.12, %for.inc13.11, %for.inc13.10, %for.inc13.9, %for.inc13.8, %for.inc13.7, %for.inc13.6, %for.inc13.5, %for.inc13.4, %for.inc13.3, %for.inc13.2, %for.inc13.1, %for.inc13, %for.cond6.preheader %i.130.lcssa.wide = phi i32 [ 97, %for.cond6.preheader ], [ 98, %for.inc13 ], [ 99, %for.inc13.1 ], [ 100, %for.inc13.2 ], [ 101, %for.inc13.3 ], [ 102, %for.inc13.4 ], [ 103, %for.inc13.5 ], [ 104, %for.inc13.6 ], [ 105, %for.inc13.7 ], [ 106, %for.inc13.8 ], [ 107, %for.inc13.9 ], [ 108, %for.inc13.10 ], [ 109, %for.inc13.11 ], [ 110, %for.inc13.12 ], [ 111, %for.inc13.13 ], [ 112, %for.inc13.14 ], [ 113, %for.inc13.15 ], [ 114, %for.inc13.16 ], [ 115, %for.inc13.17 ], [ 116, %for.inc13.18 ], [ 117, %for.inc13.19 ], [ 118, %for.inc13.20 ], [ 119, %for.inc13.21 ], [ 120, %for.inc13.22 ], [ 121, %for.inc13.23 ], [ 122, %for.inc13.24 ], [ 97, %entry ] %12 = load ptr, ptr @stdout, align 8, !tbaa !18 %call.i25 = call i32 @putc(i32 noundef %i.130.lcssa.wide, ptr noundef %12) br label %cleanup for.inc13: ; preds = %for.cond6.preheader %arrayidx11.1 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 98 %13 = load i32, ptr %arrayidx11.1, align 8, !tbaa !5 %tobool.not.1 = icmp eq i32 %13, 0 br i1 %tobool.not.1, label %if.then, label %for.inc13.1 for.inc13.1: ; preds = %for.inc13 %arrayidx11.2 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 99 %14 = load i32, ptr %arrayidx11.2, align 4, !tbaa !5 %tobool.not.2 = icmp eq i32 %14, 0 br i1 %tobool.not.2, label %if.then, label %for.inc13.2 for.inc13.2: ; preds = %for.inc13.1 %arrayidx11.3 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 100 %15 = load i32, ptr %arrayidx11.3, align 16, !tbaa !5 %tobool.not.3 = icmp eq i32 %15, 0 br i1 %tobool.not.3, label %if.then, label %for.inc13.3 for.inc13.3: ; preds = %for.inc13.2 %arrayidx11.4 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 101 %16 = load i32, ptr %arrayidx11.4, align 4, !tbaa !5 %tobool.not.4 = icmp eq i32 %16, 0 br i1 %tobool.not.4, label %if.then, label %for.inc13.4 for.inc13.4: ; preds = %for.inc13.3 %arrayidx11.5 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 102 %17 = load i32, ptr %arrayidx11.5, align 8, !tbaa !5 %tobool.not.5 = icmp eq i32 %17, 0 br i1 %tobool.not.5, label %if.then, label %for.inc13.5 for.inc13.5: ; preds = %for.inc13.4 %arrayidx11.6 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 103 %18 = load i32, ptr %arrayidx11.6, align 4, !tbaa !5 %tobool.not.6 = icmp eq i32 %18, 0 br i1 %tobool.not.6, label %if.then, label %for.inc13.6 for.inc13.6: ; preds = %for.inc13.5 %arrayidx11.7 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 104 %19 = load i32, ptr %arrayidx11.7, align 16, !tbaa !5 %tobool.not.7 = icmp eq i32 %19, 0 br i1 %tobool.not.7, label %if.then, label %for.inc13.7 for.inc13.7: ; preds = %for.inc13.6 %arrayidx11.8 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 105 %20 = load i32, ptr %arrayidx11.8, align 4, !tbaa !5 %tobool.not.8 = icmp eq i32 %20, 0 br i1 %tobool.not.8, label %if.then, label %for.inc13.8 for.inc13.8: ; preds = %for.inc13.7 %arrayidx11.9 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 106 %21 = load i32, ptr %arrayidx11.9, align 8, !tbaa !5 %tobool.not.9 = icmp eq i32 %21, 0 br i1 %tobool.not.9, label %if.then, label %for.inc13.9 for.inc13.9: ; preds = %for.inc13.8 %arrayidx11.10 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 107 %22 = load i32, ptr %arrayidx11.10, align 4, !tbaa !5 %tobool.not.10 = icmp eq i32 %22, 0 br i1 %tobool.not.10, label %if.then, label %for.inc13.10 for.inc13.10: ; preds = %for.inc13.9 %arrayidx11.11 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 108 %23 = load i32, ptr %arrayidx11.11, align 16, !tbaa !5 %tobool.not.11 = icmp eq i32 %23, 0 br i1 %tobool.not.11, label %if.then, label %for.inc13.11 for.inc13.11: ; preds = %for.inc13.10 %arrayidx11.12 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 109 %24 = load i32, ptr %arrayidx11.12, align 4, !tbaa !5 %tobool.not.12 = icmp eq i32 %24, 0 br i1 %tobool.not.12, label %if.then, label %for.inc13.12 for.inc13.12: ; preds = %for.inc13.11 %arrayidx11.13 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 110 %25 = load i32, ptr %arrayidx11.13, align 8, !tbaa !5 %tobool.not.13 = icmp eq i32 %25, 0 br i1 %tobool.not.13, label %if.then, label %for.inc13.13 for.inc13.13: ; preds = %for.inc13.12 %arrayidx11.14 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 111 %26 = load i32, ptr %arrayidx11.14, align 4, !tbaa !5 %tobool.not.14 = icmp eq i32 %26, 0 br i1 %tobool.not.14, label %if.then, label %for.inc13.14 for.inc13.14: ; preds = %for.inc13.13 %arrayidx11.15 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 112 %27 = load i32, ptr %arrayidx11.15, align 16, !tbaa !5 %tobool.not.15 = icmp eq i32 %27, 0 br i1 %tobool.not.15, label %if.then, label %for.inc13.15 for.inc13.15: ; preds = %for.inc13.14 %arrayidx11.16 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 113 %28 = load i32, ptr %arrayidx11.16, align 4, !tbaa !5 %tobool.not.16 = icmp eq i32 %28, 0 br i1 %tobool.not.16, label %if.then, label %for.inc13.16 for.inc13.16: ; preds = %for.inc13.15 %arrayidx11.17 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 114 %29 = load i32, ptr %arrayidx11.17, align 8, !tbaa !5 %tobool.not.17 = icmp eq i32 %29, 0 br i1 %tobool.not.17, label %if.then, label %for.inc13.17 for.inc13.17: ; preds = %for.inc13.16 %arrayidx11.18 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 115 %30 = load i32, ptr %arrayidx11.18, align 4, !tbaa !5 %tobool.not.18 = icmp eq i32 %30, 0 br i1 %tobool.not.18, label %if.then, label %for.inc13.18 for.inc13.18: ; preds = %for.inc13.17 %arrayidx11.19 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 116 %31 = load i32, ptr %arrayidx11.19, align 16, !tbaa !5 %tobool.not.19 = icmp eq i32 %31, 0 br i1 %tobool.not.19, label %if.then, label %for.inc13.19 for.inc13.19: ; preds = %for.inc13.18 %arrayidx11.20 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 117 %32 = load i32, ptr %arrayidx11.20, align 4, !tbaa !5 %tobool.not.20 = icmp eq i32 %32, 0 br i1 %tobool.not.20, label %if.then, label %for.inc13.20 for.inc13.20: ; preds = %for.inc13.19 %arrayidx11.21 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 118 %33 = load i32, ptr %arrayidx11.21, align 8, !tbaa !5 %tobool.not.21 = icmp eq i32 %33, 0 br i1 %tobool.not.21, label %if.then, label %for.inc13.21 for.inc13.21: ; preds = %for.inc13.20 %arrayidx11.22 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 119 %34 = load i32, ptr %arrayidx11.22, align 4, !tbaa !5 %tobool.not.22 = icmp eq i32 %34, 0 br i1 %tobool.not.22, label %if.then, label %for.inc13.22 for.inc13.22: ; preds = %for.inc13.21 %arrayidx11.23 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 120 %35 = load i32, ptr %arrayidx11.23, align 16, !tbaa !5 %tobool.not.23 = icmp eq i32 %35, 0 br i1 %tobool.not.23, label %if.then, label %for.inc13.23 for.inc13.23: ; preds = %for.inc13.22 %arrayidx11.24 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 121 %36 = load i32, ptr %arrayidx11.24, align 4, !tbaa !5 %tobool.not.24 = icmp eq i32 %36, 0 br i1 %tobool.not.24, label %if.then, label %for.inc13.24 for.inc13.24: ; preds = %for.inc13.23 %arrayidx11.25 = getelementptr inbounds [300 x i32], ptr %f, i64 0, i64 122 %37 = load i32, ptr %arrayidx11.25, align 8, !tbaa !5 %tobool.not.25 = icmp eq i32 %37, 0 br i1 %tobool.not.25, label %if.then, label %for.inc13.25 for.inc13.25: ; preds = %for.inc13.24 %call16 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.8) br label %cleanup cleanup: ; preds = %for.inc13.25, %if.then call void @llvm.lifetime.end.p0(i64 100010, ptr nonnull %s) #11 call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %f) #11 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) #9 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @puts(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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #10 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) 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 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 #5 = { 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 #6 = { mustprogress nofree 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 #7 = { 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 #8 = { 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 #9 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #11 = { nounwind } attributes #12 = { 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 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = !{!12, !12, i64 0} !12 = !{!"double", !7, i64 0} !13 = !{!7, !7, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.mustprogress"} !18 = !{!19, !19, i64 0} !19 = !{!"any pointer", !7, i64 0}
#include<stdio.h> int main(void) { char s[100000]; scanf("%s", s); int i; for (i = 0; s[i] != '\0'; i++) ; int j; for (j = 0; j < i; j++) if (s[j] == 'a') break; if (j == i) { printf("a"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'b') break; if (j == i) { printf("b"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'c') break; if (j == i) { printf("c"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'd') break; if (j == i) { printf("d"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'e') break; if (j == i) { printf("e"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'f') break; if (j == i) { printf("f"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'g') break; if (j == i) { printf("g"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'h') break; if (j == i) { printf("h"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'i') break; if (j == i) { printf("i"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'j') break; if (j == i) { printf("j"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'k') break; if (j == i) { printf("k"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'l') break; if (j == i) { printf("l"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'm') break; if (j == i) { printf("m"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'n') break; if (j == i) { printf("n"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'o') break; if (j == i) { printf("o"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'p') break; if (j == i) { printf("p"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'q') break; if (j == i) { printf("q"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'r') break; if (j == i) { printf("r"); return 0; } for (j = 0; j < i; j++) if (s[j] == 's') break; if (j == i) { printf("s"); return 0; } for (j = 0; j < i; j++) if (s[j] == 't') break; if (j == i) { printf("t"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'u') break; if (j == i) { printf("u"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'v') break; if (j == i) { printf("v"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'w') break; if (j == i) { printf("w"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'x') break; if (j == i) { printf("x"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'y') break; if (j == i) { printf("y"); return 0; } for (j = 0; j < i; j++) if (s[j] == 'z') break; if (j == i) { printf("z"); return 0; } printf("None"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265604/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265604/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.27 = private unnamed_addr constant [5 x i8] c"None\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) br label %for.cond for.cond: ; preds = %for.cond, %entry %indvars.iv784 = phi i32 [ %indvars.iv.next785, %for.cond ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %0, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next785 = add nuw i32 %indvars.iv784, 1 br i1 %cmp.not, label %for.cond2.preheader, label %for.cond, !llvm.loop !8 for.cond2.preheader: ; preds = %for.cond %1 = trunc i64 %indvars.iv to i32 %cmp3678.not = icmp eq i32 %1, 0 br i1 %cmp3678.not, label %if.then16, label %for.body5.preheader for.body5.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %indvars.iv784 to i64 br label %for.body5 for.body5: ; preds = %for.body5.preheader, %for.inc11 %indvars.iv782 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next783, %for.inc11 ] %arrayidx7 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv782 %2 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %cmp9 = icmp eq i8 %2, 97 br i1 %cmp9, label %for.end13.split.loop.exit987, label %for.inc11 for.inc11: ; preds = %for.body5 %indvars.iv.next783 = add nuw nsw i64 %indvars.iv782, 1 %exitcond.not = icmp eq i64 %indvars.iv.next783, %wide.trip.count br i1 %exitcond.not, label %for.end13, label %for.body5, !llvm.loop !10 for.end13.split.loop.exit987: ; preds = %for.body5 %3 = trunc i64 %indvars.iv782 to i32 br label %for.end13 for.end13: ; preds = %for.inc11, %for.end13.split.loop.exit987 %j.0.lcssa = phi i32 [ %3, %for.end13.split.loop.exit987 ], [ %indvars.iv784, %for.inc11 ] %cmp14 = icmp eq i32 %j.0.lcssa, %1 br i1 %cmp14, label %if.then16, label %for.cond19.preheader for.cond19.preheader: ; preds = %for.end13 br i1 %cmp3678.not, label %if.then35, label %for.body22.preheader for.body22.preheader: ; preds = %for.cond19.preheader %wide.trip.count791 = zext i32 %indvars.iv784 to i64 br label %for.body22 if.then16: ; preds = %for.cond2.preheader, %for.end13 %putchar677 = call i32 @putchar(i32 97) br label %cleanup for.body22: ; preds = %for.body22.preheader, %for.inc30 %indvars.iv787 = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next788, %for.inc30 ] %arrayidx24 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv787 %4 = load i8, ptr %arrayidx24, align 1, !tbaa !5 %cmp26 = icmp eq i8 %4, 98 br i1 %cmp26, label %for.end32.split.loop.exit989, label %for.inc30 for.inc30: ; preds = %for.body22 %indvars.iv.next788 = add nuw nsw i64 %indvars.iv787, 1 %exitcond792.not = icmp eq i64 %indvars.iv.next788, %wide.trip.count791 br i1 %exitcond792.not, label %for.end32, label %for.body22, !llvm.loop !11 for.end32.split.loop.exit989: ; preds = %for.body22 %5 = trunc i64 %indvars.iv787 to i32 br label %for.end32 for.end32: ; preds = %for.inc30, %for.end32.split.loop.exit989 %j.1.lcssa = phi i32 [ %5, %for.end32.split.loop.exit989 ], [ %indvars.iv784, %for.inc30 ] %cmp33 = icmp eq i32 %j.1.lcssa, %1 br i1 %cmp33, label %if.then35, label %for.cond38.preheader for.cond38.preheader: ; preds = %for.end32 br i1 %cmp3678.not, label %if.then54, label %for.body41.preheader for.body41.preheader: ; preds = %for.cond38.preheader %wide.trip.count797 = zext i32 %indvars.iv784 to i64 br label %for.body41 if.then35: ; preds = %for.cond19.preheader, %for.end32 %putchar676 = call i32 @putchar(i32 98) br label %cleanup for.body41: ; preds = %for.body41.preheader, %for.inc49 %indvars.iv793 = phi i64 [ 0, %for.body41.preheader ], [ %indvars.iv.next794, %for.inc49 ] %arrayidx43 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv793 %6 = load i8, ptr %arrayidx43, align 1, !tbaa !5 %cmp45 = icmp eq i8 %6, 99 br i1 %cmp45, label %for.end51.split.loop.exit991, label %for.inc49 for.inc49: ; preds = %for.body41 %indvars.iv.next794 = add nuw nsw i64 %indvars.iv793, 1 %exitcond798.not = icmp eq i64 %indvars.iv.next794, %wide.trip.count797 br i1 %exitcond798.not, label %for.end51, label %for.body41, !llvm.loop !12 for.end51.split.loop.exit991: ; preds = %for.body41 %7 = trunc i64 %indvars.iv793 to i32 br label %for.end51 for.end51: ; preds = %for.inc49, %for.end51.split.loop.exit991 %j.2.lcssa = phi i32 [ %7, %for.end51.split.loop.exit991 ], [ %indvars.iv784, %for.inc49 ] %cmp52 = icmp eq i32 %j.2.lcssa, %1 br i1 %cmp52, label %if.then54, label %for.cond57.preheader for.cond57.preheader: ; preds = %for.end51 br i1 %cmp3678.not, label %if.then73, label %for.body60.preheader for.body60.preheader: ; preds = %for.cond57.preheader %wide.trip.count803 = zext i32 %indvars.iv784 to i64 br label %for.body60 if.then54: ; preds = %for.cond38.preheader, %for.end51 %putchar675 = call i32 @putchar(i32 99) br label %cleanup for.body60: ; preds = %for.body60.preheader, %for.inc68 %indvars.iv799 = phi i64 [ 0, %for.body60.preheader ], [ %indvars.iv.next800, %for.inc68 ] %arrayidx62 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv799 %8 = load i8, ptr %arrayidx62, align 1, !tbaa !5 %cmp64 = icmp eq i8 %8, 100 br i1 %cmp64, label %for.end70.split.loop.exit993, label %for.inc68 for.inc68: ; preds = %for.body60 %indvars.iv.next800 = add nuw nsw i64 %indvars.iv799, 1 %exitcond804.not = icmp eq i64 %indvars.iv.next800, %wide.trip.count803 br i1 %exitcond804.not, label %for.end70, label %for.body60, !llvm.loop !13 for.end70.split.loop.exit993: ; preds = %for.body60 %9 = trunc i64 %indvars.iv799 to i32 br label %for.end70 for.end70: ; preds = %for.inc68, %for.end70.split.loop.exit993 %j.3.lcssa = phi i32 [ %9, %for.end70.split.loop.exit993 ], [ %indvars.iv784, %for.inc68 ] %cmp71 = icmp eq i32 %j.3.lcssa, %1 br i1 %cmp71, label %if.then73, label %for.cond76.preheader for.cond76.preheader: ; preds = %for.end70 br i1 %cmp3678.not, label %if.then92, label %for.body79.preheader for.body79.preheader: ; preds = %for.cond76.preheader %wide.trip.count809 = zext i32 %indvars.iv784 to i64 br label %for.body79 if.then73: ; preds = %for.cond57.preheader, %for.end70 %putchar674 = call i32 @putchar(i32 100) br label %cleanup for.body79: ; preds = %for.body79.preheader, %for.inc87 %indvars.iv805 = phi i64 [ 0, %for.body79.preheader ], [ %indvars.iv.next806, %for.inc87 ] %arrayidx81 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv805 %10 = load i8, ptr %arrayidx81, align 1, !tbaa !5 %cmp83 = icmp eq i8 %10, 101 br i1 %cmp83, label %for.end89.split.loop.exit995, label %for.inc87 for.inc87: ; preds = %for.body79 %indvars.iv.next806 = add nuw nsw i64 %indvars.iv805, 1 %exitcond810.not = icmp eq i64 %indvars.iv.next806, %wide.trip.count809 br i1 %exitcond810.not, label %for.end89, label %for.body79, !llvm.loop !14 for.end89.split.loop.exit995: ; preds = %for.body79 %11 = trunc i64 %indvars.iv805 to i32 br label %for.end89 for.end89: ; preds = %for.inc87, %for.end89.split.loop.exit995 %j.4.lcssa = phi i32 [ %11, %for.end89.split.loop.exit995 ], [ %indvars.iv784, %for.inc87 ] %cmp90 = icmp eq i32 %j.4.lcssa, %1 br i1 %cmp90, label %if.then92, label %for.cond95.preheader for.cond95.preheader: ; preds = %for.end89 br i1 %cmp3678.not, label %if.then111, label %for.body98.preheader for.body98.preheader: ; preds = %for.cond95.preheader %wide.trip.count815 = zext i32 %indvars.iv784 to i64 br label %for.body98 if.then92: ; preds = %for.cond76.preheader, %for.end89 %putchar673 = call i32 @putchar(i32 101) br label %cleanup for.body98: ; preds = %for.body98.preheader, %for.inc106 %indvars.iv811 = phi i64 [ 0, %for.body98.preheader ], [ %indvars.iv.next812, %for.inc106 ] %arrayidx100 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv811 %12 = load i8, ptr %arrayidx100, align 1, !tbaa !5 %cmp102 = icmp eq i8 %12, 102 br i1 %cmp102, label %for.end108.split.loop.exit997, label %for.inc106 for.inc106: ; preds = %for.body98 %indvars.iv.next812 = add nuw nsw i64 %indvars.iv811, 1 %exitcond816.not = icmp eq i64 %indvars.iv.next812, %wide.trip.count815 br i1 %exitcond816.not, label %for.end108, label %for.body98, !llvm.loop !15 for.end108.split.loop.exit997: ; preds = %for.body98 %13 = trunc i64 %indvars.iv811 to i32 br label %for.end108 for.end108: ; preds = %for.inc106, %for.end108.split.loop.exit997 %j.5.lcssa = phi i32 [ %13, %for.end108.split.loop.exit997 ], [ %indvars.iv784, %for.inc106 ] %cmp109 = icmp eq i32 %j.5.lcssa, %1 br i1 %cmp109, label %if.then111, label %for.cond114.preheader for.cond114.preheader: ; preds = %for.end108 br i1 %cmp3678.not, label %if.then130, label %for.body117.preheader for.body117.preheader: ; preds = %for.cond114.preheader %wide.trip.count821 = zext i32 %indvars.iv784 to i64 br label %for.body117 if.then111: ; preds = %for.cond95.preheader, %for.end108 %putchar672 = call i32 @putchar(i32 102) br label %cleanup for.body117: ; preds = %for.body117.preheader, %for.inc125 %indvars.iv817 = phi i64 [ 0, %for.body117.preheader ], [ %indvars.iv.next818, %for.inc125 ] %arrayidx119 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv817 %14 = load i8, ptr %arrayidx119, align 1, !tbaa !5 %cmp121 = icmp eq i8 %14, 103 br i1 %cmp121, label %for.end127.split.loop.exit999, label %for.inc125 for.inc125: ; preds = %for.body117 %indvars.iv.next818 = add nuw nsw i64 %indvars.iv817, 1 %exitcond822.not = icmp eq i64 %indvars.iv.next818, %wide.trip.count821 br i1 %exitcond822.not, label %for.end127, label %for.body117, !llvm.loop !16 for.end127.split.loop.exit999: ; preds = %for.body117 %15 = trunc i64 %indvars.iv817 to i32 br label %for.end127 for.end127: ; preds = %for.inc125, %for.end127.split.loop.exit999 %j.6.lcssa = phi i32 [ %15, %for.end127.split.loop.exit999 ], [ %indvars.iv784, %for.inc125 ] %cmp128 = icmp eq i32 %j.6.lcssa, %1 br i1 %cmp128, label %if.then130, label %for.cond133.preheader for.cond133.preheader: ; preds = %for.end127 br i1 %cmp3678.not, label %if.then149, label %for.body136.preheader for.body136.preheader: ; preds = %for.cond133.preheader %wide.trip.count827 = zext i32 %indvars.iv784 to i64 br label %for.body136 if.then130: ; preds = %for.cond114.preheader, %for.end127 %putchar671 = call i32 @putchar(i32 103) br label %cleanup for.body136: ; preds = %for.body136.preheader, %for.inc144 %indvars.iv823 = phi i64 [ 0, %for.body136.preheader ], [ %indvars.iv.next824, %for.inc144 ] %arrayidx138 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv823 %16 = load i8, ptr %arrayidx138, align 1, !tbaa !5 %cmp140 = icmp eq i8 %16, 104 br i1 %cmp140, label %for.end146.split.loop.exit1001, label %for.inc144 for.inc144: ; preds = %for.body136 %indvars.iv.next824 = add nuw nsw i64 %indvars.iv823, 1 %exitcond828.not = icmp eq i64 %indvars.iv.next824, %wide.trip.count827 br i1 %exitcond828.not, label %for.end146, label %for.body136, !llvm.loop !17 for.end146.split.loop.exit1001: ; preds = %for.body136 %17 = trunc i64 %indvars.iv823 to i32 br label %for.end146 for.end146: ; preds = %for.inc144, %for.end146.split.loop.exit1001 %j.7.lcssa = phi i32 [ %17, %for.end146.split.loop.exit1001 ], [ %indvars.iv784, %for.inc144 ] %cmp147 = icmp eq i32 %j.7.lcssa, %1 br i1 %cmp147, label %if.then149, label %for.cond152.preheader for.cond152.preheader: ; preds = %for.end146 br i1 %cmp3678.not, label %if.then168, label %for.body155.preheader for.body155.preheader: ; preds = %for.cond152.preheader %wide.trip.count833 = zext i32 %indvars.iv784 to i64 br label %for.body155 if.then149: ; preds = %for.cond133.preheader, %for.end146 %putchar670 = call i32 @putchar(i32 104) br label %cleanup for.body155: ; preds = %for.body155.preheader, %for.inc163 %indvars.iv829 = phi i64 [ 0, %for.body155.preheader ], [ %indvars.iv.next830, %for.inc163 ] %arrayidx157 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv829 %18 = load i8, ptr %arrayidx157, align 1, !tbaa !5 %cmp159 = icmp eq i8 %18, 105 br i1 %cmp159, label %for.end165.split.loop.exit1003, label %for.inc163 for.inc163: ; preds = %for.body155 %indvars.iv.next830 = add nuw nsw i64 %indvars.iv829, 1 %exitcond834.not = icmp eq i64 %indvars.iv.next830, %wide.trip.count833 br i1 %exitcond834.not, label %for.end165, label %for.body155, !llvm.loop !18 for.end165.split.loop.exit1003: ; preds = %for.body155 %19 = trunc i64 %indvars.iv829 to i32 br label %for.end165 for.end165: ; preds = %for.inc163, %for.end165.split.loop.exit1003 %j.8.lcssa = phi i32 [ %19, %for.end165.split.loop.exit1003 ], [ %indvars.iv784, %for.inc163 ] %cmp166 = icmp eq i32 %j.8.lcssa, %1 br i1 %cmp166, label %if.then168, label %for.cond171.preheader for.cond171.preheader: ; preds = %for.end165 br i1 %cmp3678.not, label %if.then187, label %for.body174.preheader for.body174.preheader: ; preds = %for.cond171.preheader %wide.trip.count839 = zext i32 %indvars.iv784 to i64 br label %for.body174 if.then168: ; preds = %for.cond152.preheader, %for.end165 %putchar669 = call i32 @putchar(i32 105) br label %cleanup for.body174: ; preds = %for.body174.preheader, %for.inc182 %indvars.iv835 = phi i64 [ 0, %for.body174.preheader ], [ %indvars.iv.next836, %for.inc182 ] %arrayidx176 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv835 %20 = load i8, ptr %arrayidx176, align 1, !tbaa !5 %cmp178 = icmp eq i8 %20, 106 br i1 %cmp178, label %for.end184.split.loop.exit1005, label %for.inc182 for.inc182: ; preds = %for.body174 %indvars.iv.next836 = add nuw nsw i64 %indvars.iv835, 1 %exitcond840.not = icmp eq i64 %indvars.iv.next836, %wide.trip.count839 br i1 %exitcond840.not, label %for.end184, label %for.body174, !llvm.loop !19 for.end184.split.loop.exit1005: ; preds = %for.body174 %21 = trunc i64 %indvars.iv835 to i32 br label %for.end184 for.end184: ; preds = %for.inc182, %for.end184.split.loop.exit1005 %j.9.lcssa = phi i32 [ %21, %for.end184.split.loop.exit1005 ], [ %indvars.iv784, %for.inc182 ] %cmp185 = icmp eq i32 %j.9.lcssa, %1 br i1 %cmp185, label %if.then187, label %for.cond190.preheader for.cond190.preheader: ; preds = %for.end184 br i1 %cmp3678.not, label %if.then206, label %for.body193.preheader for.body193.preheader: ; preds = %for.cond190.preheader %wide.trip.count845 = zext i32 %indvars.iv784 to i64 br label %for.body193 if.then187: ; preds = %for.cond171.preheader, %for.end184 %putchar668 = call i32 @putchar(i32 106) br label %cleanup for.body193: ; preds = %for.body193.preheader, %for.inc201 %indvars.iv841 = phi i64 [ 0, %for.body193.preheader ], [ %indvars.iv.next842, %for.inc201 ] %arrayidx195 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv841 %22 = load i8, ptr %arrayidx195, align 1, !tbaa !5 %cmp197 = icmp eq i8 %22, 107 br i1 %cmp197, label %for.end203.split.loop.exit1007, label %for.inc201 for.inc201: ; preds = %for.body193 %indvars.iv.next842 = add nuw nsw i64 %indvars.iv841, 1 %exitcond846.not = icmp eq i64 %indvars.iv.next842, %wide.trip.count845 br i1 %exitcond846.not, label %for.end203, label %for.body193, !llvm.loop !20 for.end203.split.loop.exit1007: ; preds = %for.body193 %23 = trunc i64 %indvars.iv841 to i32 br label %for.end203 for.end203: ; preds = %for.inc201, %for.end203.split.loop.exit1007 %j.10.lcssa = phi i32 [ %23, %for.end203.split.loop.exit1007 ], [ %indvars.iv784, %for.inc201 ] %cmp204 = icmp eq i32 %j.10.lcssa, %1 br i1 %cmp204, label %if.then206, label %for.cond209.preheader for.cond209.preheader: ; preds = %for.end203 br i1 %cmp3678.not, label %if.then225, label %for.body212.preheader for.body212.preheader: ; preds = %for.cond209.preheader %wide.trip.count851 = zext i32 %indvars.iv784 to i64 br label %for.body212 if.then206: ; preds = %for.cond190.preheader, %for.end203 %putchar667 = call i32 @putchar(i32 107) br label %cleanup for.body212: ; preds = %for.body212.preheader, %for.inc220 %indvars.iv847 = phi i64 [ 0, %for.body212.preheader ], [ %indvars.iv.next848, %for.inc220 ] %arrayidx214 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv847 %24 = load i8, ptr %arrayidx214, align 1, !tbaa !5 %cmp216 = icmp eq i8 %24, 108 br i1 %cmp216, label %for.end222.split.loop.exit1009, label %for.inc220 for.inc220: ; preds = %for.body212 %indvars.iv.next848 = add nuw nsw i64 %indvars.iv847, 1 %exitcond852.not = icmp eq i64 %indvars.iv.next848, %wide.trip.count851 br i1 %exitcond852.not, label %for.end222, label %for.body212, !llvm.loop !21 for.end222.split.loop.exit1009: ; preds = %for.body212 %25 = trunc i64 %indvars.iv847 to i32 br label %for.end222 for.end222: ; preds = %for.inc220, %for.end222.split.loop.exit1009 %j.11.lcssa = phi i32 [ %25, %for.end222.split.loop.exit1009 ], [ %indvars.iv784, %for.inc220 ] %cmp223 = icmp eq i32 %j.11.lcssa, %1 br i1 %cmp223, label %if.then225, label %for.cond228.preheader for.cond228.preheader: ; preds = %for.end222 br i1 %cmp3678.not, label %if.then244, label %for.body231.preheader for.body231.preheader: ; preds = %for.cond228.preheader %wide.trip.count857 = zext i32 %indvars.iv784 to i64 br label %for.body231 if.then225: ; preds = %for.cond209.preheader, %for.end222 %putchar666 = call i32 @putchar(i32 108) br label %cleanup for.body231: ; preds = %for.body231.preheader, %for.inc239 %indvars.iv853 = phi i64 [ 0, %for.body231.preheader ], [ %indvars.iv.next854, %for.inc239 ] %arrayidx233 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv853 %26 = load i8, ptr %arrayidx233, align 1, !tbaa !5 %cmp235 = icmp eq i8 %26, 109 br i1 %cmp235, label %for.end241.split.loop.exit1011, label %for.inc239 for.inc239: ; preds = %for.body231 %indvars.iv.next854 = add nuw nsw i64 %indvars.iv853, 1 %exitcond858.not = icmp eq i64 %indvars.iv.next854, %wide.trip.count857 br i1 %exitcond858.not, label %for.end241, label %for.body231, !llvm.loop !22 for.end241.split.loop.exit1011: ; preds = %for.body231 %27 = trunc i64 %indvars.iv853 to i32 br label %for.end241 for.end241: ; preds = %for.inc239, %for.end241.split.loop.exit1011 %j.12.lcssa = phi i32 [ %27, %for.end241.split.loop.exit1011 ], [ %indvars.iv784, %for.inc239 ] %cmp242 = icmp eq i32 %j.12.lcssa, %1 br i1 %cmp242, label %if.then244, label %for.cond247.preheader for.cond247.preheader: ; preds = %for.end241 br i1 %cmp3678.not, label %if.then263, label %for.body250.preheader for.body250.preheader: ; preds = %for.cond247.preheader %wide.trip.count863 = zext i32 %indvars.iv784 to i64 br label %for.body250 if.then244: ; preds = %for.cond228.preheader, %for.end241 %putchar665 = call i32 @putchar(i32 109) br label %cleanup for.body250: ; preds = %for.body250.preheader, %for.inc258 %indvars.iv859 = phi i64 [ 0, %for.body250.preheader ], [ %indvars.iv.next860, %for.inc258 ] %arrayidx252 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv859 %28 = load i8, ptr %arrayidx252, align 1, !tbaa !5 %cmp254 = icmp eq i8 %28, 110 br i1 %cmp254, label %for.end260.split.loop.exit1013, label %for.inc258 for.inc258: ; preds = %for.body250 %indvars.iv.next860 = add nuw nsw i64 %indvars.iv859, 1 %exitcond864.not = icmp eq i64 %indvars.iv.next860, %wide.trip.count863 br i1 %exitcond864.not, label %for.end260, label %for.body250, !llvm.loop !23 for.end260.split.loop.exit1013: ; preds = %for.body250 %29 = trunc i64 %indvars.iv859 to i32 br label %for.end260 for.end260: ; preds = %for.inc258, %for.end260.split.loop.exit1013 %j.13.lcssa = phi i32 [ %29, %for.end260.split.loop.exit1013 ], [ %indvars.iv784, %for.inc258 ] %cmp261 = icmp eq i32 %j.13.lcssa, %1 br i1 %cmp261, label %if.then263, label %for.cond266.preheader for.cond266.preheader: ; preds = %for.end260 br i1 %cmp3678.not, label %if.then282, label %for.body269.preheader for.body269.preheader: ; preds = %for.cond266.preheader %wide.trip.count869 = zext i32 %indvars.iv784 to i64 br label %for.body269 if.then263: ; preds = %for.cond247.preheader, %for.end260 %putchar664 = call i32 @putchar(i32 110) br label %cleanup for.body269: ; preds = %for.body269.preheader, %for.inc277 %indvars.iv865 = phi i64 [ 0, %for.body269.preheader ], [ %indvars.iv.next866, %for.inc277 ] %arrayidx271 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv865 %30 = load i8, ptr %arrayidx271, align 1, !tbaa !5 %cmp273 = icmp eq i8 %30, 111 br i1 %cmp273, label %for.end279.split.loop.exit1015, label %for.inc277 for.inc277: ; preds = %for.body269 %indvars.iv.next866 = add nuw nsw i64 %indvars.iv865, 1 %exitcond870.not = icmp eq i64 %indvars.iv.next866, %wide.trip.count869 br i1 %exitcond870.not, label %for.end279, label %for.body269, !llvm.loop !24 for.end279.split.loop.exit1015: ; preds = %for.body269 %31 = trunc i64 %indvars.iv865 to i32 br label %for.end279 for.end279: ; preds = %for.inc277, %for.end279.split.loop.exit1015 %j.14.lcssa = phi i32 [ %31, %for.end279.split.loop.exit1015 ], [ %indvars.iv784, %for.inc277 ] %cmp280 = icmp eq i32 %j.14.lcssa, %1 br i1 %cmp280, label %if.then282, label %for.cond285.preheader for.cond285.preheader: ; preds = %for.end279 br i1 %cmp3678.not, label %if.then301, label %for.body288.preheader for.body288.preheader: ; preds = %for.cond285.preheader %wide.trip.count875 = zext i32 %indvars.iv784 to i64 br label %for.body288 if.then282: ; preds = %for.cond266.preheader, %for.end279 %putchar663 = call i32 @putchar(i32 111) br label %cleanup for.body288: ; preds = %for.body288.preheader, %for.inc296 %indvars.iv871 = phi i64 [ 0, %for.body288.preheader ], [ %indvars.iv.next872, %for.inc296 ] %arrayidx290 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv871 %32 = load i8, ptr %arrayidx290, align 1, !tbaa !5 %cmp292 = icmp eq i8 %32, 112 br i1 %cmp292, label %for.end298.split.loop.exit1017, label %for.inc296 for.inc296: ; preds = %for.body288 %indvars.iv.next872 = add nuw nsw i64 %indvars.iv871, 1 %exitcond876.not = icmp eq i64 %indvars.iv.next872, %wide.trip.count875 br i1 %exitcond876.not, label %for.end298, label %for.body288, !llvm.loop !25 for.end298.split.loop.exit1017: ; preds = %for.body288 %33 = trunc i64 %indvars.iv871 to i32 br label %for.end298 for.end298: ; preds = %for.inc296, %for.end298.split.loop.exit1017 %j.15.lcssa = phi i32 [ %33, %for.end298.split.loop.exit1017 ], [ %indvars.iv784, %for.inc296 ] %cmp299 = icmp eq i32 %j.15.lcssa, %1 br i1 %cmp299, label %if.then301, label %for.cond304.preheader for.cond304.preheader: ; preds = %for.end298 br i1 %cmp3678.not, label %if.then320, label %for.body307.preheader for.body307.preheader: ; preds = %for.cond304.preheader %wide.trip.count881 = zext i32 %indvars.iv784 to i64 br label %for.body307 if.then301: ; preds = %for.cond285.preheader, %for.end298 %putchar662 = call i32 @putchar(i32 112) br label %cleanup for.body307: ; preds = %for.body307.preheader, %for.inc315 %indvars.iv877 = phi i64 [ 0, %for.body307.preheader ], [ %indvars.iv.next878, %for.inc315 ] %arrayidx309 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv877 %34 = load i8, ptr %arrayidx309, align 1, !tbaa !5 %cmp311 = icmp eq i8 %34, 113 br i1 %cmp311, label %for.end317.split.loop.exit1019, label %for.inc315 for.inc315: ; preds = %for.body307 %indvars.iv.next878 = add nuw nsw i64 %indvars.iv877, 1 %exitcond882.not = icmp eq i64 %indvars.iv.next878, %wide.trip.count881 br i1 %exitcond882.not, label %for.end317, label %for.body307, !llvm.loop !26 for.end317.split.loop.exit1019: ; preds = %for.body307 %35 = trunc i64 %indvars.iv877 to i32 br label %for.end317 for.end317: ; preds = %for.inc315, %for.end317.split.loop.exit1019 %j.16.lcssa = phi i32 [ %35, %for.end317.split.loop.exit1019 ], [ %indvars.iv784, %for.inc315 ] %cmp318 = icmp eq i32 %j.16.lcssa, %1 br i1 %cmp318, label %if.then320, label %for.cond323.preheader for.cond323.preheader: ; preds = %for.end317 br i1 %cmp3678.not, label %if.then339, label %for.body326.preheader for.body326.preheader: ; preds = %for.cond323.preheader %wide.trip.count887 = zext i32 %indvars.iv784 to i64 br label %for.body326 if.then320: ; preds = %for.cond304.preheader, %for.end317 %putchar661 = call i32 @putchar(i32 113) br label %cleanup for.body326: ; preds = %for.body326.preheader, %for.inc334 %indvars.iv883 = phi i64 [ 0, %for.body326.preheader ], [ %indvars.iv.next884, %for.inc334 ] %arrayidx328 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv883 %36 = load i8, ptr %arrayidx328, align 1, !tbaa !5 %cmp330 = icmp eq i8 %36, 114 br i1 %cmp330, label %for.end336.split.loop.exit1021, label %for.inc334 for.inc334: ; preds = %for.body326 %indvars.iv.next884 = add nuw nsw i64 %indvars.iv883, 1 %exitcond888.not = icmp eq i64 %indvars.iv.next884, %wide.trip.count887 br i1 %exitcond888.not, label %for.end336, label %for.body326, !llvm.loop !27 for.end336.split.loop.exit1021: ; preds = %for.body326 %37 = trunc i64 %indvars.iv883 to i32 br label %for.end336 for.end336: ; preds = %for.inc334, %for.end336.split.loop.exit1021 %j.17.lcssa = phi i32 [ %37, %for.end336.split.loop.exit1021 ], [ %indvars.iv784, %for.inc334 ] %cmp337 = icmp eq i32 %j.17.lcssa, %1 br i1 %cmp337, label %if.then339, label %for.cond342.preheader for.cond342.preheader: ; preds = %for.end336 br i1 %cmp3678.not, label %if.then358, label %for.body345.preheader for.body345.preheader: ; preds = %for.cond342.preheader %wide.trip.count893 = zext i32 %indvars.iv784 to i64 br label %for.body345 if.then339: ; preds = %for.cond323.preheader, %for.end336 %putchar660 = call i32 @putchar(i32 114) br label %cleanup for.body345: ; preds = %for.body345.preheader, %for.inc353 %indvars.iv889 = phi i64 [ 0, %for.body345.preheader ], [ %indvars.iv.next890, %for.inc353 ] %arrayidx347 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv889 %38 = load i8, ptr %arrayidx347, align 1, !tbaa !5 %cmp349 = icmp eq i8 %38, 115 br i1 %cmp349, label %for.end355.split.loop.exit1023, label %for.inc353 for.inc353: ; preds = %for.body345 %indvars.iv.next890 = add nuw nsw i64 %indvars.iv889, 1 %exitcond894.not = icmp eq i64 %indvars.iv.next890, %wide.trip.count893 br i1 %exitcond894.not, label %for.end355, label %for.body345, !llvm.loop !28 for.end355.split.loop.exit1023: ; preds = %for.body345 %39 = trunc i64 %indvars.iv889 to i32 br label %for.end355 for.end355: ; preds = %for.inc353, %for.end355.split.loop.exit1023 %j.18.lcssa = phi i32 [ %39, %for.end355.split.loop.exit1023 ], [ %indvars.iv784, %for.inc353 ] %cmp356 = icmp eq i32 %j.18.lcssa, %1 br i1 %cmp356, label %if.then358, label %for.cond361.preheader for.cond361.preheader: ; preds = %for.end355 br i1 %cmp3678.not, label %if.then377, label %for.body364.preheader for.body364.preheader: ; preds = %for.cond361.preheader %wide.trip.count899 = zext i32 %indvars.iv784 to i64 br label %for.body364 if.then358: ; preds = %for.cond342.preheader, %for.end355 %putchar659 = call i32 @putchar(i32 115) br label %cleanup for.body364: ; preds = %for.body364.preheader, %for.inc372 %indvars.iv895 = phi i64 [ 0, %for.body364.preheader ], [ %indvars.iv.next896, %for.inc372 ] %arrayidx366 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv895 %40 = load i8, ptr %arrayidx366, align 1, !tbaa !5 %cmp368 = icmp eq i8 %40, 116 br i1 %cmp368, label %for.end374.split.loop.exit1025, label %for.inc372 for.inc372: ; preds = %for.body364 %indvars.iv.next896 = add nuw nsw i64 %indvars.iv895, 1 %exitcond900.not = icmp eq i64 %indvars.iv.next896, %wide.trip.count899 br i1 %exitcond900.not, label %for.end374, label %for.body364, !llvm.loop !29 for.end374.split.loop.exit1025: ; preds = %for.body364 %41 = trunc i64 %indvars.iv895 to i32 br label %for.end374 for.end374: ; preds = %for.inc372, %for.end374.split.loop.exit1025 %j.19.lcssa = phi i32 [ %41, %for.end374.split.loop.exit1025 ], [ %indvars.iv784, %for.inc372 ] %cmp375 = icmp eq i32 %j.19.lcssa, %1 br i1 %cmp375, label %if.then377, label %for.cond380.preheader for.cond380.preheader: ; preds = %for.end374 br i1 %cmp3678.not, label %if.then396, label %for.body383.preheader for.body383.preheader: ; preds = %for.cond380.preheader %wide.trip.count905 = zext i32 %indvars.iv784 to i64 br label %for.body383 if.then377: ; preds = %for.cond361.preheader, %for.end374 %putchar658 = call i32 @putchar(i32 116) br label %cleanup for.body383: ; preds = %for.body383.preheader, %for.inc391 %indvars.iv901 = phi i64 [ 0, %for.body383.preheader ], [ %indvars.iv.next902, %for.inc391 ] %arrayidx385 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv901 %42 = load i8, ptr %arrayidx385, align 1, !tbaa !5 %cmp387 = icmp eq i8 %42, 117 br i1 %cmp387, label %for.end393.split.loop.exit1027, label %for.inc391 for.inc391: ; preds = %for.body383 %indvars.iv.next902 = add nuw nsw i64 %indvars.iv901, 1 %exitcond906.not = icmp eq i64 %indvars.iv.next902, %wide.trip.count905 br i1 %exitcond906.not, label %for.end393, label %for.body383, !llvm.loop !30 for.end393.split.loop.exit1027: ; preds = %for.body383 %43 = trunc i64 %indvars.iv901 to i32 br label %for.end393 for.end393: ; preds = %for.inc391, %for.end393.split.loop.exit1027 %j.20.lcssa = phi i32 [ %43, %for.end393.split.loop.exit1027 ], [ %indvars.iv784, %for.inc391 ] %cmp394 = icmp eq i32 %j.20.lcssa, %1 br i1 %cmp394, label %if.then396, label %for.cond399.preheader for.cond399.preheader: ; preds = %for.end393 br i1 %cmp3678.not, label %if.then415, label %for.body402.preheader for.body402.preheader: ; preds = %for.cond399.preheader %wide.trip.count911 = zext i32 %indvars.iv784 to i64 br label %for.body402 if.then396: ; preds = %for.cond380.preheader, %for.end393 %putchar657 = call i32 @putchar(i32 117) br label %cleanup for.body402: ; preds = %for.body402.preheader, %for.inc410 %indvars.iv907 = phi i64 [ 0, %for.body402.preheader ], [ %indvars.iv.next908, %for.inc410 ] %arrayidx404 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv907 %44 = load i8, ptr %arrayidx404, align 1, !tbaa !5 %cmp406 = icmp eq i8 %44, 118 br i1 %cmp406, label %for.end412.split.loop.exit1029, label %for.inc410 for.inc410: ; preds = %for.body402 %indvars.iv.next908 = add nuw nsw i64 %indvars.iv907, 1 %exitcond912.not = icmp eq i64 %indvars.iv.next908, %wide.trip.count911 br i1 %exitcond912.not, label %for.end412, label %for.body402, !llvm.loop !31 for.end412.split.loop.exit1029: ; preds = %for.body402 %45 = trunc i64 %indvars.iv907 to i32 br label %for.end412 for.end412: ; preds = %for.inc410, %for.end412.split.loop.exit1029 %j.21.lcssa = phi i32 [ %45, %for.end412.split.loop.exit1029 ], [ %indvars.iv784, %for.inc410 ] %cmp413 = icmp eq i32 %j.21.lcssa, %1 br i1 %cmp413, label %if.then415, label %for.cond418.preheader for.cond418.preheader: ; preds = %for.end412 br i1 %cmp3678.not, label %if.then434, label %for.body421.preheader for.body421.preheader: ; preds = %for.cond418.preheader %wide.trip.count917 = zext i32 %indvars.iv784 to i64 br label %for.body421 if.then415: ; preds = %for.cond399.preheader, %for.end412 %putchar656 = call i32 @putchar(i32 118) br label %cleanup for.body421: ; preds = %for.body421.preheader, %for.inc429 %indvars.iv913 = phi i64 [ 0, %for.body421.preheader ], [ %indvars.iv.next914, %for.inc429 ] %arrayidx423 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv913 %46 = load i8, ptr %arrayidx423, align 1, !tbaa !5 %cmp425 = icmp eq i8 %46, 119 br i1 %cmp425, label %for.end431.split.loop.exit1031, label %for.inc429 for.inc429: ; preds = %for.body421 %indvars.iv.next914 = add nuw nsw i64 %indvars.iv913, 1 %exitcond918.not = icmp eq i64 %indvars.iv.next914, %wide.trip.count917 br i1 %exitcond918.not, label %for.end431, label %for.body421, !llvm.loop !32 for.end431.split.loop.exit1031: ; preds = %for.body421 %47 = trunc i64 %indvars.iv913 to i32 br label %for.end431 for.end431: ; preds = %for.inc429, %for.end431.split.loop.exit1031 %j.22.lcssa = phi i32 [ %47, %for.end431.split.loop.exit1031 ], [ %indvars.iv784, %for.inc429 ] %cmp432 = icmp eq i32 %j.22.lcssa, %1 br i1 %cmp432, label %if.then434, label %for.cond437.preheader for.cond437.preheader: ; preds = %for.end431 br i1 %cmp3678.not, label %if.then453, label %for.body440.preheader for.body440.preheader: ; preds = %for.cond437.preheader %wide.trip.count923 = zext i32 %indvars.iv784 to i64 br label %for.body440 if.then434: ; preds = %for.cond418.preheader, %for.end431 %putchar655 = call i32 @putchar(i32 119) br label %cleanup for.body440: ; preds = %for.body440.preheader, %for.inc448 %indvars.iv919 = phi i64 [ 0, %for.body440.preheader ], [ %indvars.iv.next920, %for.inc448 ] %arrayidx442 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv919 %48 = load i8, ptr %arrayidx442, align 1, !tbaa !5 %cmp444 = icmp eq i8 %48, 120 br i1 %cmp444, label %for.end450.split.loop.exit1033, label %for.inc448 for.inc448: ; preds = %for.body440 %indvars.iv.next920 = add nuw nsw i64 %indvars.iv919, 1 %exitcond924.not = icmp eq i64 %indvars.iv.next920, %wide.trip.count923 br i1 %exitcond924.not, label %for.end450, label %for.body440, !llvm.loop !33 for.end450.split.loop.exit1033: ; preds = %for.body440 %49 = trunc i64 %indvars.iv919 to i32 br label %for.end450 for.end450: ; preds = %for.inc448, %for.end450.split.loop.exit1033 %j.23.lcssa = phi i32 [ %49, %for.end450.split.loop.exit1033 ], [ %indvars.iv784, %for.inc448 ] %cmp451 = icmp eq i32 %j.23.lcssa, %1 br i1 %cmp451, label %if.then453, label %for.cond456.preheader for.cond456.preheader: ; preds = %for.end450 br i1 %cmp3678.not, label %if.then472, label %for.body459.preheader for.body459.preheader: ; preds = %for.cond456.preheader %wide.trip.count929 = zext i32 %indvars.iv784 to i64 br label %for.body459 if.then453: ; preds = %for.cond437.preheader, %for.end450 %putchar654 = call i32 @putchar(i32 120) br label %cleanup for.body459: ; preds = %for.body459.preheader, %for.inc467 %indvars.iv925 = phi i64 [ 0, %for.body459.preheader ], [ %indvars.iv.next926, %for.inc467 ] %arrayidx461 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv925 %50 = load i8, ptr %arrayidx461, align 1, !tbaa !5 %cmp463 = icmp eq i8 %50, 121 br i1 %cmp463, label %for.end469.split.loop.exit1035, label %for.inc467 for.inc467: ; preds = %for.body459 %indvars.iv.next926 = add nuw nsw i64 %indvars.iv925, 1 %exitcond930.not = icmp eq i64 %indvars.iv.next926, %wide.trip.count929 br i1 %exitcond930.not, label %for.end469, label %for.body459, !llvm.loop !34 for.end469.split.loop.exit1035: ; preds = %for.body459 %51 = trunc i64 %indvars.iv925 to i32 br label %for.end469 for.end469: ; preds = %for.inc467, %for.end469.split.loop.exit1035 %j.24.lcssa = phi i32 [ %51, %for.end469.split.loop.exit1035 ], [ %indvars.iv784, %for.inc467 ] %cmp470 = icmp eq i32 %j.24.lcssa, %1 br i1 %cmp470, label %if.then472, label %for.cond475.preheader for.cond475.preheader: ; preds = %for.end469 br i1 %cmp3678.not, label %for.end488, label %for.body478.preheader for.body478.preheader: ; preds = %for.cond475.preheader %wide.trip.count935 = zext i32 %indvars.iv784 to i64 br label %for.body478 if.then472: ; preds = %for.cond456.preheader, %for.end469 %putchar653 = call i32 @putchar(i32 121) br label %cleanup for.body478: ; preds = %for.body478.preheader, %for.inc486 %indvars.iv931 = phi i64 [ 0, %for.body478.preheader ], [ %indvars.iv.next932, %for.inc486 ] %arrayidx480 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv931 %52 = load i8, ptr %arrayidx480, align 1, !tbaa !5 %cmp482 = icmp eq i8 %52, 122 br i1 %cmp482, label %for.end488.loopexit.split.loop.exit, label %for.inc486 for.inc486: ; preds = %for.body478 %indvars.iv.next932 = add nuw nsw i64 %indvars.iv931, 1 %exitcond936.not = icmp eq i64 %indvars.iv.next932, %wide.trip.count935 br i1 %exitcond936.not, label %for.end488, label %for.body478, !llvm.loop !35 for.end488.loopexit.split.loop.exit: ; preds = %for.body478 %53 = trunc i64 %indvars.iv931 to i32 br label %for.end488 for.end488: ; preds = %for.inc486, %for.end488.loopexit.split.loop.exit, %for.cond475.preheader %j.25.lcssa = phi i32 [ 0, %for.cond475.preheader ], [ %53, %for.end488.loopexit.split.loop.exit ], [ %indvars.iv784, %for.inc486 ] %cmp489 = icmp eq i32 %j.25.lcssa, %1 br i1 %cmp489, label %if.then491, label %if.end493 if.then491: ; preds = %for.end488 %putchar = call i32 @putchar(i32 122) br label %cleanup if.end493: ; preds = %for.end488 %call494 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27) br label %cleanup cleanup: ; preds = %if.end493, %if.then491, %if.then472, %if.then453, %if.then434, %if.then415, %if.then396, %if.then377, %if.then358, %if.then339, %if.then320, %if.then301, %if.then282, %if.then263, %if.then244, %if.then225, %if.then206, %if.then187, %if.then168, %if.then149, %if.then130, %if.then111, %if.then92, %if.then73, %if.then54, %if.then35, %if.then16 call void @llvm.lifetime.end.p0(i64 100000, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = distinct !{!12, !9} !13 = distinct !{!13, !9} !14 = distinct !{!14, !9} !15 = distinct !{!15, !9} !16 = distinct !{!16, !9} !17 = distinct !{!17, !9} !18 = distinct !{!18, !9} !19 = distinct !{!19, !9} !20 = distinct !{!20, !9} !21 = distinct !{!21, !9} !22 = distinct !{!22, !9} !23 = distinct !{!23, !9} !24 = distinct !{!24, !9} !25 = distinct !{!25, !9} !26 = distinct !{!26, !9} !27 = distinct !{!27, !9} !28 = distinct !{!28, !9} !29 = distinct !{!29, !9} !30 = distinct !{!30, !9} !31 = distinct !{!31, !9} !32 = distinct !{!32, !9} !33 = distinct !{!33, !9} !34 = distinct !{!34, !9} !35 = distinct !{!35, !9}
// AOJ Volume 1 Problem 0160 Delivery Fee #include <stdio.h> int main(void) { int n; int x, y, h, w; int size; int fee; int total_fee; int i; while (1){ scanf("%d", &n); if (n == 0){ break; } total_fee = 0; for (i = 0; i < n; i++){ scanf("%d%d%d%d", &x, &y, &h, &w); size = x + y + h; fee = -1; if (size <= 60){ fee = 600; } else if (size <= 80){ fee = 800; } else if (size <= 100){ fee = 1000; } else if (size <= 120){ fee = 1200; } else if (size <= 140){ fee = 1400; } else if (size <= 160){ fee = 1600; } if (fee != -1){ if (w <= 2){ if (fee < 600) fee = 600; } else if (w <= 5){ if (fee < 800) fee = 800; } else if (w <= 10){ if (fee < 1000) fee = 1000; } else if (w <= 15){ if (fee < 1200) fee = 1200; } else if (w <= 20){ if (fee < 1400) fee = 1400; } else if (w <= 25){ if (fee < 1600) fee = 1600; } else { fee = -1; } } if (fee != -1){ total_fee += fee; } } printf("%d\n", total_fee); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265655/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265655/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"%d%d%d%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 %x = alloca i32, align 4 %y = alloca i32, align 4 %h = alloca i32, align 4 %w = 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 %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3 %call115 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp116 = icmp eq i32 %0, 0 br i1 %cmp116, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %8, %for.end ], [ %0, %entry ] %cmp1112 = icmp sgt i32 %1, 0 br i1 %cmp1112, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.cond %i.0114 = phi i32 [ %inc, %for.cond ], [ 0, %for.cond.preheader ] %total_fee.0113 = phi i32 [ %6, %for.cond ], [ 0, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %h, ptr noundef nonnull %w) %2 = load i32, ptr %x, align 4, !tbaa !5 %3 = load i32, ptr %y, align 4, !tbaa !5 %add = add nsw i32 %3, %2 %4 = load i32, ptr %h, align 4, !tbaa !5 %add3 = add nsw i32 %add, %4 %cmp4 = icmp slt i32 %add3, 61 br i1 %cmp4, label %if.then27, label %if.else if.else: ; preds = %for.body %cmp6 = icmp ult i32 %add3, 81 br i1 %cmp6, label %if.then27, label %if.else8 if.else8: ; preds = %if.else %cmp9 = icmp ult i32 %add3, 101 br i1 %cmp9, label %if.then27, label %if.else11 if.else11: ; preds = %if.else8 %cmp12 = icmp ult i32 %add3, 121 br i1 %cmp12, label %if.then27, label %if.else14 if.else14: ; preds = %if.else11 %cmp15 = icmp ult i32 %add3, 141 br i1 %cmp15, label %if.then27, label %if.else17 if.else17: ; preds = %if.else14 %cmp18 = icmp ult i32 %add3, 161 br i1 %cmp18, label %if.then27, label %for.cond if.then27: ; preds = %if.else17, %for.body, %if.else, %if.else8, %if.else11, %if.else14 %cmp54.ph = phi i32 [ 1400, %if.else14 ], [ 1400, %if.else11 ], [ 1400, %if.else8 ], [ 1400, %if.else ], [ 1400, %for.body ], [ 1600, %if.else17 ] %cmp48.ph = phi i32 [ 1400, %if.else14 ], [ 1200, %if.else11 ], [ 1200, %if.else8 ], [ 1200, %if.else ], [ 1200, %for.body ], [ 1600, %if.else17 ] %cmp42.ph = phi i32 [ 1400, %if.else14 ], [ 1200, %if.else11 ], [ 1000, %if.else8 ], [ 1000, %if.else ], [ 1000, %for.body ], [ 1600, %if.else17 ] %cmp36.ph = phi i32 [ 1400, %if.else14 ], [ 1200, %if.else11 ], [ 1000, %if.else8 ], [ 800, %if.else ], [ 800, %for.body ], [ 1600, %if.else17 ] %fee.0.ph = phi i32 [ 1400, %if.else14 ], [ 1200, %if.else11 ], [ 1000, %if.else8 ], [ 800, %if.else ], [ 600, %for.body ], [ 1600, %if.else17 ] %5 = load i32, ptr %w, align 4, !tbaa !5 %cmp28 = icmp slt i32 %5, 3 br i1 %cmp28, label %if.end70.thread, label %if.else33 if.else33: ; preds = %if.then27 %cmp34 = icmp ult i32 %5, 6 br i1 %cmp34, label %if.end70.thread, label %if.else39 if.else39: ; preds = %if.else33 %cmp40 = icmp ult i32 %5, 11 br i1 %cmp40, label %if.end70.thread, label %if.else45 if.else45: ; preds = %if.else39 %cmp46 = icmp ult i32 %5, 16 br i1 %cmp46, label %if.end70.thread, label %if.else51 if.else51: ; preds = %if.else45 %cmp52 = icmp ult i32 %5, 21 br i1 %cmp52, label %if.end70.thread, label %if.else57 if.else57: ; preds = %if.else51 %cmp58 = icmp ult i32 %5, 26 br i1 %cmp58, label %if.end70.thread, label %for.cond if.end70.thread: ; preds = %if.then27, %if.else33, %if.else39, %if.else45, %if.else51, %if.else57 %fee.1.ph = phi i32 [ %cmp54.ph, %if.else51 ], [ %cmp48.ph, %if.else45 ], [ %cmp42.ph, %if.else39 ], [ %cmp36.ph, %if.else33 ], [ 1600, %if.else57 ], [ %fee.0.ph, %if.then27 ] %add73110 = add nsw i32 %fee.1.ph, %total_fee.0113 br label %for.cond for.cond: ; preds = %if.else57, %if.else17, %if.end70.thread %6 = phi i32 [ %add73110, %if.end70.thread ], [ %total_fee.0113, %if.else17 ], [ %total_fee.0113, %if.else57 ] %inc = add nuw nsw i32 %i.0114, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp1 = icmp slt i32 %inc, %7 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.cond, %for.cond.preheader %total_fee.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %6, %for.cond ] %call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %total_fee.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %8, 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 %w) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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> #include <math.h> #include <stdlib.h> #define MAX 100 int main(void) { int n, i; double x[MAX], y[MAX], a[MAX]; double P1, P2, P3, P4; P1 = P2 = P3 = 0; scanf("%d", &n); for(i=0; i<n; ++i) { scanf("%lf", &x[i]); } for(i=0; i<n; ++i) { scanf("%lf", &y[i]); } for(i=0; i<n; ++i) { a[i] = abs(x[i] - y[i]); P1 += a[i]; P2 += pow(a[i], 2); P3 += pow(a[i], 3); } P4 = a[0]; for(i=1; i<n; ++i) { if(P4 < a[i]) P4 = a[i]; } printf("%f\n%f\n%f\n%f\n", P1, sqrt(P2), cbrt(P3), P4); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265712/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265712/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"%lf\00", align 1 @.str.2 = private unnamed_addr constant [13 x i8] c"%f\0A%f\0A%f\0A%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca [100 x double], align 16 %y = alloca [100 x double], align 16 %a = alloca [100 x double], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %x) #7 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %y) #7 call void @llvm.lifetime.start.p0(i64 800, 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 %cmp72 = icmp sgt i32 %0, 0 call void @llvm.assume(i1 %cmp72) br label %for.body for.cond2.preheader: ; preds = %for.body %cmp374 = icmp sgt i32 %1, 0 call void @llvm.assume(i1 %cmp374) br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x double], ptr %x, 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 %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.cond2.preheader, !llvm.loop !9 for.cond11.preheader: ; preds = %for.body4 %cmp1276 = icmp sgt i32 %3, 0 call void @llvm.assume(i1 %cmp1276) br label %for.body13 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv90 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp3 = icmp slt i64 %indvars.iv.next91, %4 br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !11 for.body13: ; preds = %for.cond11.preheader, %for.body13 %indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body13 ], [ 0, %for.cond11.preheader ] %P3.080 = phi double [ %add30, %for.body13 ], [ 0.000000e+00, %for.cond11.preheader ] %P2.079 = phi double [ %add26, %for.body13 ], [ 0.000000e+00, %for.cond11.preheader ] %P1.078 = phi double [ %add, %for.body13 ], [ 0.000000e+00, %for.cond11.preheader ] %arrayidx15 = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv93 %5 = load double, ptr %arrayidx15, align 8, !tbaa !12 %arrayidx17 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv93 %6 = load double, ptr %arrayidx17, align 8, !tbaa !12 %sub = fsub double %5, %6 %conv = fptosi double %sub to i32 %7 = call i32 @llvm.abs.i32(i32 %conv, i1 true) %conv18 = sitofp i32 %7 to double %arrayidx20 = getelementptr inbounds [100 x double], ptr %a, i64 0, i64 %indvars.iv93 store double %conv18, ptr %arrayidx20, align 8, !tbaa !12 %add = fadd double %P1.078, %conv18 %square = fmul double %conv18, %conv18 %add26 = fadd double %P2.079, %square %call29 = call double @pow(double noundef %conv18, double noundef 3.000000e+00) #7 %add30 = fadd double %P3.080, %call29 %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp12 = icmp slt i64 %indvars.iv.next94, %9 br i1 %cmp12, label %for.body13, label %for.end33, !llvm.loop !14 for.end33: ; preds = %for.body13 %.pre = load double, ptr %a, align 16, !tbaa !12 %cmp3684 = icmp sgt i32 %8, 1 br i1 %cmp3684, label %for.body38.preheader, label %for.end47 for.body38.preheader: ; preds = %for.end33 %wide.trip.count = zext i32 %8 to i64 %10 = add nsw i64 %wide.trip.count, -1 %11 = add nsw i64 %wide.trip.count, -2 %xtraiter = and i64 %10, 3 %12 = icmp ult i64 %11, 3 br i1 %12, label %for.end47.loopexit.unr-lcssa, label %for.body38.preheader.new for.body38.preheader.new: ; preds = %for.body38.preheader %unroll_iter = and i64 %10, -4 br label %for.body38 for.body38: ; preds = %for.body38, %for.body38.preheader.new %indvars.iv96 = phi i64 [ 1, %for.body38.preheader.new ], [ %indvars.iv.next97.3, %for.body38 ] %P4.086 = phi double [ %.pre, %for.body38.preheader.new ], [ %P4.1.3, %for.body38 ] %niter = phi i64 [ 0, %for.body38.preheader.new ], [ %niter.next.3, %for.body38 ] %arrayidx40 = getelementptr inbounds [100 x double], ptr %a, i64 0, i64 %indvars.iv96 %13 = load double, ptr %arrayidx40, align 8, !tbaa !12 %cmp41 = fcmp olt double %P4.086, %13 %P4.1 = select i1 %cmp41, double %13, double %P4.086 %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1 %arrayidx40.1 = getelementptr inbounds [100 x double], ptr %a, i64 0, i64 %indvars.iv.next97 %14 = load double, ptr %arrayidx40.1, align 8, !tbaa !12 %cmp41.1 = fcmp olt double %P4.1, %14 %P4.1.1 = select i1 %cmp41.1, double %14, double %P4.1 %indvars.iv.next97.1 = add nuw nsw i64 %indvars.iv96, 2 %arrayidx40.2 = getelementptr inbounds [100 x double], ptr %a, i64 0, i64 %indvars.iv.next97.1 %15 = load double, ptr %arrayidx40.2, align 8, !tbaa !12 %cmp41.2 = fcmp olt double %P4.1.1, %15 %P4.1.2 = select i1 %cmp41.2, double %15, double %P4.1.1 %indvars.iv.next97.2 = add nuw nsw i64 %indvars.iv96, 3 %arrayidx40.3 = getelementptr inbounds [100 x double], ptr %a, i64 0, i64 %indvars.iv.next97.2 %16 = load double, ptr %arrayidx40.3, align 8, !tbaa !12 %cmp41.3 = fcmp olt double %P4.1.2, %16 %P4.1.3 = select i1 %cmp41.3, double %16, double %P4.1.2 %indvars.iv.next97.3 = add nuw nsw i64 %indvars.iv96, 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.end47.loopexit.unr-lcssa, label %for.body38, !llvm.loop !15 for.end47.loopexit.unr-lcssa: ; preds = %for.body38, %for.body38.preheader %P4.1.lcssa.ph = phi double [ undef, %for.body38.preheader ], [ %P4.1.3, %for.body38 ] %indvars.iv96.unr = phi i64 [ 1, %for.body38.preheader ], [ %indvars.iv.next97.3, %for.body38 ] %P4.086.unr = phi double [ %.pre, %for.body38.preheader ], [ %P4.1.3, %for.body38 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end47, label %for.body38.epil for.body38.epil: ; preds = %for.end47.loopexit.unr-lcssa, %for.body38.epil %indvars.iv96.epil = phi i64 [ %indvars.iv.next97.epil, %for.body38.epil ], [ %indvars.iv96.unr, %for.end47.loopexit.unr-lcssa ] %P4.086.epil = phi double [ %P4.1.epil, %for.body38.epil ], [ %P4.086.unr, %for.end47.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body38.epil ], [ 0, %for.end47.loopexit.unr-lcssa ] %arrayidx40.epil = getelementptr inbounds [100 x double], ptr %a, i64 0, i64 %indvars.iv96.epil %17 = load double, ptr %arrayidx40.epil, align 8, !tbaa !12 %cmp41.epil = fcmp olt double %P4.086.epil, %17 %P4.1.epil = select i1 %cmp41.epil, double %17, double %P4.086.epil %indvars.iv.next97.epil = add nuw nsw i64 %indvars.iv96.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.end47, label %for.body38.epil, !llvm.loop !16 for.end47: ; preds = %for.end47.loopexit.unr-lcssa, %for.body38.epil, %for.end33 %P4.0.lcssa = phi double [ %.pre, %for.end33 ], [ %P4.1.lcssa.ph, %for.end47.loopexit.unr-lcssa ], [ %P4.1.epil, %for.body38.epil ] %call48 = call double @sqrt(double noundef %add26) #7 %call49 = call double @cbrt(double noundef %add30) #8 %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %add, double noundef %call48, double noundef %call49, double noundef %P4.0.lcssa) call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %y) #7 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %x) #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 nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare double @cbrt(double noundef) local_unnamed_addr #5 ; 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 willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #6 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 = { 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 = { 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 #6 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #7 = { nounwind } attributes #8 = { 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 = !{!"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, !13, i64 0} !13 = !{!"double", !7, i64 0} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> #include <math.h> #include <stdlib.h> void dis_man(int nx[],int ny[],int n){ int i; double dis1=0,dis2=0,dis3=0; for(i=0;i<n;i++){ dis1 += abs(nx[i] - ny[i]); dis2 += pow((nx[i]-ny[i]),2); dis3 += pow(abs((nx[i]-ny[i])),3); } dis2 = sqrt(dis2); dis3 = cbrt(dis3); printf("%lf\n%lf\n%lf\n", dis1,dis2,dis3); } void dis_che(int nx[],int ny[], int n){ int i; double dis=0; for(i=0;i<n;i++){ dis = (dis > abs(nx[i]-ny[i])) ? dis : abs(nx[i]-ny[i]); } printf("%lf\n",dis); } int main(void){ int nx[101] = {},ny[101]={},n,i; scanf("%d", &n); for(i=0;i<n;i++) scanf("%d",&nx[i]); for(i=0;i<n;i++) scanf("%d",&ny[i]); dis_man(nx,ny,n); dis_che(nx,ny,n); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265770/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265770/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 [13 x i8] c"%lf\0A%lf\0A%lf\0A\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @dis_man(ptr nocapture noundef readonly %nx, ptr nocapture noundef readonly %ny, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp37 = icmp sgt i32 %n, 0 br i1 %cmp37, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %dis3.041 = phi double [ 0.000000e+00, %for.body.preheader ], [ %add17, %for.body ] %dis2.040 = phi double [ 0.000000e+00, %for.body.preheader ], [ %add9, %for.body ] %dis1.039 = phi double [ 0.000000e+00, %for.body.preheader ], [ %add, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %nx, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %ny, i64 %indvars.iv %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = tail call i32 @llvm.abs.i32(i32 %sub, i1 true) %conv = sitofp i32 %2 to double %add = fadd double %dis1.039, %conv %conv8 = sitofp i32 %sub to double %square = fmul double %conv8, %conv8 %add9 = fadd double %dis2.040, %square %call16 = tail call double @pow(double noundef %conv, double noundef 3.000000e+00) #7 %add17 = fadd double %dis3.041, %call16 %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 !9 for.end: ; preds = %for.body, %entry %dis1.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ] %dis2.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add9, %for.body ] %dis3.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add17, %for.body ] %call18 = tail call double @sqrt(double noundef %dis2.0.lcssa) #7 %call19 = tail call double @cbrt(double noundef %dis3.0.lcssa) #8 %call20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %dis1.0.lcssa, double noundef %call18, double noundef %call19) 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 speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare double @cbrt(double noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; 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 void @dis_che(ptr nocapture noundef readonly %nx, ptr nocapture noundef readonly %ny, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp20 = icmp sgt i32 %n, 0 br i1 %cmp20, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %n, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %dis.022 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %dis.0.conv.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %nx, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %ny, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %3 = tail call i32 @llvm.abs.i32(i32 %sub, i1 true) %conv = sitofp i32 %3 to double %cmp3 = fcmp ogt double %dis.022, %conv %dis.0.conv = select i1 %cmp3, double %dis.022, double %conv %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %nx, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx2.1 = getelementptr inbounds i32, ptr %ny, i64 %indvars.iv.next %5 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %4, %5 %6 = tail call i32 @llvm.abs.i32(i32 %sub.1, i1 true) %conv.1 = sitofp i32 %6 to double %cmp3.1 = fcmp ogt double %dis.0.conv, %conv.1 %dis.0.conv.1 = select i1 %cmp3.1, double %dis.0.conv, double %conv.1 %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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !11 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %dis.0.conv.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %dis.0.conv.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %dis.022.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %dis.0.conv.1, %for.body ] %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.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %nx, i64 %indvars.iv.unr %7 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %arrayidx2.epil = getelementptr inbounds i32, ptr %ny, i64 %indvars.iv.unr %8 = load i32, ptr %arrayidx2.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %7, %8 %9 = tail call i32 @llvm.abs.i32(i32 %sub.epil, i1 true) %conv.epil = sitofp i32 %9 to double %cmp3.epil = fcmp ogt double %dis.022.unr, %conv.epil %dis.0.conv.epil = select i1 %cmp3.epil, double %dis.022.unr, double %conv.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %dis.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %dis.0.conv.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %dis.0.conv.epil, %for.body.epil ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %dis.0.lcssa) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %nx = alloca [101 x i32], align 16 %ny = alloca [101 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %nx) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) %nx, i8 0, i64 404, i1 false) call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %ny) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) %ny, i8 0, i64 404, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp30 = icmp sgt i32 %0, 0 br i1 %cmp30, label %for.body, label %dis_man.exit for.cond2.preheader: ; preds = %for.body %cmp332 = icmp sgt i32 %1, 0 br i1 %cmp332, label %for.body4, label %dis_man.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x i32], ptr %nx, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx) %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.cond2.preheader, !llvm.loop !12 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [101 x i32], ptr %ny, i64 0, i64 %indvars.iv37 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx6) %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1 %.pr = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %.pr to i64 %cmp3 = icmp slt i64 %indvars.iv.next38, %3 br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !13 for.end10: ; preds = %for.body4 %cmp37.i = icmp sgt i32 %.pr, 0 br i1 %cmp37.i, label %for.body.preheader.i, label %dis_man.exit for.body.preheader.i: ; preds = %for.end10 %wide.trip.count.i = zext i32 %.pr 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 ] %dis3.041.i = phi double [ 0.000000e+00, %for.body.preheader.i ], [ %add17.i, %for.body.i ] %dis2.040.i = phi double [ 0.000000e+00, %for.body.preheader.i ], [ %add9.i, %for.body.i ] %dis1.039.i = phi double [ 0.000000e+00, %for.body.preheader.i ], [ %add.i, %for.body.i ] %arrayidx.i = getelementptr inbounds i32, ptr %nx, i64 %indvars.iv.i %4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %arrayidx2.i = getelementptr inbounds i32, ptr %ny, i64 %indvars.iv.i %5 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %sub.i = sub nsw i32 %4, %5 %6 = call i32 @llvm.abs.i32(i32 %sub.i, i1 true) %conv.i = sitofp i32 %6 to double %add.i = fadd double %dis1.039.i, %conv.i %conv8.i = sitofp i32 %sub.i to double %square.i = fmul double %conv8.i, %conv8.i %add9.i = fadd double %dis2.040.i, %square.i %call16.i = call double @pow(double noundef %conv.i, double noundef 3.000000e+00) #7 %add17.i = fadd double %dis3.041.i, %call16.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 %dis_man.exit, label %for.body.i, !llvm.loop !9 dis_man.exit: ; preds = %for.body.i, %entry, %for.cond2.preheader, %for.end10 %dis1.0.lcssa.i = phi double [ 0.000000e+00, %for.end10 ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add.i, %for.body.i ] %dis2.0.lcssa.i = phi double [ 0.000000e+00, %for.end10 ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add9.i, %for.body.i ] %dis3.0.lcssa.i = phi double [ 0.000000e+00, %for.end10 ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add17.i, %for.body.i ] %call18.i = call double @sqrt(double noundef %dis2.0.lcssa.i) #7 %call19.i = call double @cbrt(double noundef %dis3.0.lcssa.i) #8 %call20.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %dis1.0.lcssa.i, double noundef %call18.i, double noundef %call19.i) %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp20.i = icmp sgt i32 %7, 0 br i1 %cmp20.i, label %for.body.preheader.i19, label %dis_che.exit for.body.preheader.i19: ; preds = %dis_man.exit %wide.trip.count.i20 = zext i32 %7 to i64 %xtraiter = and i64 %wide.trip.count.i20, 1 %8 = icmp eq i32 %7, 1 br i1 %8, label %dis_che.exit.loopexit.unr-lcssa, label %for.body.preheader.i19.new for.body.preheader.i19.new: ; preds = %for.body.preheader.i19 %unroll_iter = and i64 %wide.trip.count.i20, 4294967294 br label %for.body.i21 for.body.i21: ; preds = %for.body.i21, %for.body.preheader.i19.new %indvars.iv.i22 = phi i64 [ 0, %for.body.preheader.i19.new ], [ %indvars.iv.next.i27.1, %for.body.i21 ] %dis.022.i = phi double [ 0.000000e+00, %for.body.preheader.i19.new ], [ %dis.0.conv.i.1, %for.body.i21 ] %niter = phi i64 [ 0, %for.body.preheader.i19.new ], [ %niter.next.1, %for.body.i21 ] %arrayidx.i23 = getelementptr inbounds i32, ptr %nx, i64 %indvars.iv.i22 %9 = load i32, ptr %arrayidx.i23, align 8, !tbaa !5 %arrayidx2.i24 = getelementptr inbounds i32, ptr %ny, i64 %indvars.iv.i22 %10 = load i32, ptr %arrayidx2.i24, align 8, !tbaa !5 %sub.i25 = sub nsw i32 %9, %10 %11 = call i32 @llvm.abs.i32(i32 %sub.i25, i1 true) %conv.i26 = sitofp i32 %11 to double %cmp3.i = fcmp ogt double %dis.022.i, %conv.i26 %dis.0.conv.i = select i1 %cmp3.i, double %dis.022.i, double %conv.i26 %indvars.iv.next.i27 = or i64 %indvars.iv.i22, 1 %arrayidx.i23.1 = getelementptr inbounds i32, ptr %nx, i64 %indvars.iv.next.i27 %12 = load i32, ptr %arrayidx.i23.1, align 4, !tbaa !5 %arrayidx2.i24.1 = getelementptr inbounds i32, ptr %ny, i64 %indvars.iv.next.i27 %13 = load i32, ptr %arrayidx2.i24.1, align 4, !tbaa !5 %sub.i25.1 = sub nsw i32 %12, %13 %14 = call i32 @llvm.abs.i32(i32 %sub.i25.1, i1 true) %conv.i26.1 = sitofp i32 %14 to double %cmp3.i.1 = fcmp ogt double %dis.0.conv.i, %conv.i26.1 %dis.0.conv.i.1 = select i1 %cmp3.i.1, double %dis.0.conv.i, double %conv.i26.1 %indvars.iv.next.i27.1 = add nuw nsw i64 %indvars.iv.i22, 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 %dis_che.exit.loopexit.unr-lcssa, label %for.body.i21, !llvm.loop !11 dis_che.exit.loopexit.unr-lcssa: ; preds = %for.body.i21, %for.body.preheader.i19 %dis.0.conv.i.lcssa.ph = phi double [ undef, %for.body.preheader.i19 ], [ %dis.0.conv.i.1, %for.body.i21 ] %indvars.iv.i22.unr = phi i64 [ 0, %for.body.preheader.i19 ], [ %indvars.iv.next.i27.1, %for.body.i21 ] %dis.022.i.unr = phi double [ 0.000000e+00, %for.body.preheader.i19 ], [ %dis.0.conv.i.1, %for.body.i21 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %dis_che.exit, label %for.body.i21.epil for.body.i21.epil: ; preds = %dis_che.exit.loopexit.unr-lcssa %arrayidx.i23.epil = getelementptr inbounds i32, ptr %nx, i64 %indvars.iv.i22.unr %15 = load i32, ptr %arrayidx.i23.epil, align 4, !tbaa !5 %arrayidx2.i24.epil = getelementptr inbounds i32, ptr %ny, i64 %indvars.iv.i22.unr %16 = load i32, ptr %arrayidx2.i24.epil, align 4, !tbaa !5 %sub.i25.epil = sub nsw i32 %15, %16 %17 = call i32 @llvm.abs.i32(i32 %sub.i25.epil, i1 true) %conv.i26.epil = sitofp i32 %17 to double %cmp3.i.epil = fcmp ogt double %dis.022.i.unr, %conv.i26.epil %dis.0.conv.i.epil = select i1 %cmp3.i.epil, double %dis.022.i.unr, double %conv.i26.epil br label %dis_che.exit dis_che.exit: ; preds = %for.body.i21.epil, %dis_che.exit.loopexit.unr-lcssa, %dis_man.exit %dis.0.lcssa.i = phi double [ 0.000000e+00, %dis_man.exit ], [ %dis.0.conv.i.lcssa.ph, %dis_che.exit.loopexit.unr-lcssa ], [ %dis.0.conv.i.epil, %for.body.i21.epil ] %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %dis.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %ny) #7 call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %nx) #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) #6 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #3 = { 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 #4 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nounwind } attributes #8 = { 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 = !{!"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}
#include <stdio.h> #include <math.h> int main(void) { int n, i; double x[1000] = {0}; double y[1000] = {0}; double p1, p2, p3, pinf; double tmp; scanf("%d", &n); for (i = 0; i < n; ++i) { scanf("%lf", &x[i]); } for (i = 0; i < n; ++i) { scanf("%lf", &y[i]); } p1 = p2 = p3 = pinf = 0; for (i = 0; i < n; ++i) { tmp = fabsl(x[i] - y[i]); p1 += tmp; p2 += powl(tmp, 2); p3 += powl(tmp, 3); if (tmp > pinf) pinf = tmp; } printf("%f\n", p1); printf("%f\n", sqrt(p2)); printf("%f\n", cbrt(p3)); printf("%f\n", pinf); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265835/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265835/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"%lf\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca [1000 x double], align 16 %y = alloca [1000 x double], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %x) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) %x, i8 0, i64 8000, i1 false) call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %y) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) %y, i8 0, i64 8000, 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 %cmp57 = icmp sgt i32 %0, 0 br i1 %cmp57, label %for.body, label %for.end33 for.cond2.preheader: ; preds = %for.body %1 = icmp sgt i32 %2, 0 br i1 %1, label %for.body4, label %for.end33 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x double], ptr %x, 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 %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.cond2.preheader, !llvm.loop !9 for.cond11.preheader: ; preds = %for.body4 %4 = icmp sgt i32 %5, 0 br i1 %4, label %for.body13, label %for.end33 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [1000 x double], ptr %y, i64 0, i64 %indvars.iv71 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp3 = icmp slt i64 %indvars.iv.next72, %6 br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !11 for.body13: ; preds = %for.cond11.preheader, %for.body13 %indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body13 ], [ 0, %for.cond11.preheader ] %pinf.065 = phi double [ %pinf.1, %for.body13 ], [ 0.000000e+00, %for.cond11.preheader ] %p3.064 = phi double [ %conv28, %for.body13 ], [ 0.000000e+00, %for.cond11.preheader ] %p2.063 = phi double [ %conv23, %for.body13 ], [ 0.000000e+00, %for.cond11.preheader ] %p1.062 = phi double [ %add, %for.body13 ], [ 0.000000e+00, %for.cond11.preheader ] %arrayidx15 = getelementptr inbounds [1000 x double], ptr %x, i64 0, i64 %indvars.iv74 %7 = load double, ptr %arrayidx15, align 8, !tbaa !12 %arrayidx17 = getelementptr inbounds [1000 x double], ptr %y, i64 0, i64 %indvars.iv74 %8 = load double, ptr %arrayidx17, align 8, !tbaa !12 %sub = fsub double %7, %8 %9 = call double @llvm.fabs.f64(double %sub) %add = fadd double %p1.062, %9 %conv19 = fpext double %9 to x86_fp80 %square = fmul x86_fp80 %conv19, %conv19 %conv21 = fpext double %p2.063 to x86_fp80 %add22 = fadd x86_fp80 %square, %conv21 %conv23 = fptrunc x86_fp80 %add22 to double %call25 = call x86_fp80 @powl(x86_fp80 noundef %conv19, x86_fp80 noundef 0xK4000C000000000000000) #7 %conv26 = fpext double %p3.064 to x86_fp80 %add27 = fadd x86_fp80 %call25, %conv26 %conv28 = fptrunc x86_fp80 %add27 to double %cmp29 = fcmp ogt double %9, %pinf.065 %pinf.1 = select i1 %cmp29, double %9, double %pinf.065 %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp12 = icmp slt i64 %indvars.iv.next75, %11 br i1 %cmp12, label %for.body13, label %for.end33, !llvm.loop !14 for.end33: ; preds = %for.body13, %entry, %for.cond2.preheader, %for.cond11.preheader %p1.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add, %for.body13 ] %p2.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %conv23, %for.body13 ] %p3.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %conv28, %for.body13 ] %pinf.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %pinf.1, %for.body13 ] %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %p1.0.lcssa) %call35 = call double @sqrt(double noundef %p2.0.lcssa) #7 %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %call35) %call37 = call double @cbrt(double noundef %p3.0.lcssa) #8 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %call37) %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %pinf.0.lcssa) call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %y) #7 call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %x) #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: 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 nofree nounwind willreturn memory(write) declare x86_fp80 @powl(x86_fp80 noundef, x86_fp80 noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare double @cbrt(double noundef) local_unnamed_addr #5 ; 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.fabs.f64(double) #6 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 = { 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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } attributes #8 = { 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 = !{!"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, !13, i64 0} !13 = !{!"double", !7, i64 0} !14 = distinct !{!14, !10}
#include<stdio.h> #include<stdlib.h> int main() { int t; scanf("%d",&t); while(t--) { int m; scanf("%d",&m); int mt[m][m]; for(int i=0;i<m;i++) { for(int j=0;j<m;j++) { mt[i][j]=0; } } for(int i=0;i<m;i++) { for(int j=0;j<m;j++) { mt[i][i]=1; if(i<m-1) mt[i][i+1]=1; } if(i==m-1) mt[i][0]=1; } for(int i=0;i<m;i++) { for(int j=0;j<m;j++) { printf("%d ",mt[i][j]); } printf("\n"); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26590/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26590/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 \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %m = 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 %dec100 = add nsw i32 %0, -1 store i32 %dec100, ptr %t, align 4, !tbaa !5 %tobool.not101 = icmp eq i32 %0, 0 br i1 %tobool.not101, label %while.end, label %while.body while.body: ; preds = %entry, %for.cond.cleanup46 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %1 = load i32, ptr %m, align 4, !tbaa !5 %2 = zext i32 %1 to i64 %3 = call ptr @llvm.stacksave.p0() %4 = mul nuw i64 %2, %2 %vla = alloca i32, i64 %4, align 16 %5 = load i32, ptr %m, align 4, !tbaa !5 %cmp84 = icmp sgt i32 %5, 0 br i1 %cmp84, label %for.cond2.preheader.us.preheader, label %for.cond.cleanup46 for.cond2.preheader.us.preheader: ; preds = %while.body %6 = shl nuw nsw i64 %2, 2 %7 = zext i32 %5 to i64 %8 = shl nuw nsw i64 %7, 2 %xtraiter = and i64 %7, 7 %9 = icmp ult i32 %5, 8 br i1 %9, label %for.cond12.preheader.unr-lcssa, label %for.cond2.preheader.us.preheader.new for.cond2.preheader.us.preheader.new: ; preds = %for.cond2.preheader.us.preheader %unroll_iter = and i64 %7, 4294967288 br label %for.cond2.preheader.us for.cond2.preheader.us: ; preds = %for.cond2.preheader.us, %for.cond2.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond2.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond2.preheader.us ] %niter = phi i64 [ 0, %for.cond2.preheader.us.preheader.new ], [ %niter.next.7, %for.cond2.preheader.us ] %10 = mul nuw nsw i64 %6, %indvar %scevgep = getelementptr i8, ptr %vla, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %8, i1 false), !tbaa !5 %indvar.next = or i64 %indvar, 1 %11 = mul nuw nsw i64 %6, %indvar.next %scevgep.1 = getelementptr i8, ptr %vla, i64 %11 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.1, i8 0, i64 %8, i1 false), !tbaa !5 %indvar.next.1 = or i64 %indvar, 2 %12 = mul nuw nsw i64 %6, %indvar.next.1 %scevgep.2 = getelementptr i8, ptr %vla, i64 %12 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.2, i8 0, i64 %8, i1 false), !tbaa !5 %indvar.next.2 = or i64 %indvar, 3 %13 = mul nuw nsw i64 %6, %indvar.next.2 %scevgep.3 = getelementptr i8, ptr %vla, i64 %13 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.3, i8 0, i64 %8, i1 false), !tbaa !5 %indvar.next.3 = or i64 %indvar, 4 %14 = mul nuw nsw i64 %6, %indvar.next.3 %scevgep.4 = getelementptr i8, ptr %vla, i64 %14 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.4, i8 0, i64 %8, i1 false), !tbaa !5 %indvar.next.4 = or i64 %indvar, 5 %15 = mul nuw nsw i64 %6, %indvar.next.4 %scevgep.5 = getelementptr i8, ptr %vla, i64 %15 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.5, i8 0, i64 %8, i1 false), !tbaa !5 %indvar.next.5 = or i64 %indvar, 6 %16 = mul nuw nsw i64 %6, %indvar.next.5 %scevgep.6 = getelementptr i8, ptr %vla, i64 %16 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.6, i8 0, i64 %8, i1 false), !tbaa !5 %indvar.next.6 = or i64 %indvar, 7 %17 = mul nuw nsw i64 %6, %indvar.next.6 %scevgep.7 = getelementptr i8, ptr %vla, i64 %17 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.7, i8 0, i64 %8, i1 false), !tbaa !5 %indvar.next.7 = add nuw nsw i64 %indvar, 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.cond12.preheader.unr-lcssa, label %for.cond2.preheader.us, !llvm.loop !9 for.cond12.preheader.unr-lcssa: ; preds = %for.cond2.preheader.us, %for.cond2.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond2.preheader.us.preheader ], [ %indvar.next.7, %for.cond2.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond12.preheader, label %for.cond2.preheader.us.epil for.cond2.preheader.us.epil: ; preds = %for.cond12.preheader.unr-lcssa, %for.cond2.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond2.preheader.us.epil ], [ %indvar.unr, %for.cond12.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond2.preheader.us.epil ], [ 0, %for.cond12.preheader.unr-lcssa ] %18 = mul nuw nsw i64 %6, %indvar.epil %scevgep.epil = getelementptr i8, ptr %vla, i64 %18 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 0, i64 %8, i1 false), !tbaa !5 %indvar.next.epil = add nuw nsw i64 %indvar.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.cond12.preheader, label %for.cond2.preheader.us.epil, !llvm.loop !11 for.cond12.preheader: ; preds = %for.cond2.preheader.us.epil, %for.cond12.preheader.unr-lcssa br i1 %cmp84, label %for.cond17.preheader.lr.ph, label %for.cond.cleanup46 for.cond17.preheader.lr.ph: ; preds = %for.cond12.preheader %sub = add nsw i32 %5, -1 %19 = zext i32 %sub to i64 %20 = zext i32 %sub to i64 %21 = mul nuw nsw i64 %19, %2 %arrayidx37.us = getelementptr inbounds i32, ptr %vla, i64 %21 %xtraiter115 = and i64 %7, 1 %22 = icmp eq i32 %5, 1 br i1 %22, label %for.cond44.preheader.unr-lcssa, label %for.cond17.preheader.lr.ph.new for.cond17.preheader.lr.ph.new: ; preds = %for.cond17.preheader.lr.ph %unroll_iter118 = and i64 %7, 4294967294 br label %for.cond17.preheader.us for.cond17.preheader.us: ; preds = %for.inc40.us.1, %for.cond17.preheader.lr.ph.new %indvars.iv = phi i64 [ 0, %for.cond17.preheader.lr.ph.new ], [ %indvars.iv.next.1, %for.inc40.us.1 ] %niter119 = phi i64 [ 0, %for.cond17.preheader.lr.ph.new ], [ %niter119.next.1, %for.inc40.us.1 ] %23 = mul nuw nsw i64 %indvars.iv, %2 %arrayidx22.us = getelementptr inbounds i32, ptr %vla, i64 %23 %arrayidx24.us = getelementptr inbounds i32, ptr %arrayidx22.us, i64 %indvars.iv %cmp25.us = icmp ult i64 %indvars.iv, %20 br i1 %cmp25.us, label %for.body20.lr.ph.split.us.us, label %for.cond17.for.cond.cleanup19_crit_edge.us if.then35.us: ; preds = %for.cond17.for.cond.cleanup19_crit_edge.us store i32 1, ptr %arrayidx37.us, align 4, !tbaa !5 br label %for.inc40.us for.inc40.us: ; preds = %if.then35.us, %for.cond17.for.cond.cleanup19_crit_edge.us %indvars.iv.next = or i64 %indvars.iv, 1 %24 = mul nuw nsw i64 %indvars.iv.next, %2 %arrayidx22.us.1 = getelementptr inbounds i32, ptr %vla, i64 %24 %arrayidx24.us.1 = getelementptr inbounds i32, ptr %arrayidx22.us.1, i64 %indvars.iv.next %cmp25.us.1 = icmp ult i64 %indvars.iv.next, %20 br i1 %cmp25.us.1, label %for.body20.lr.ph.split.us.us.1, label %for.cond17.for.cond.cleanup19_crit_edge.us.1 for.body20.lr.ph.split.us.us.1: ; preds = %for.inc40.us %25 = getelementptr i32, ptr %arrayidx22.us.1, i64 %indvars.iv.next %arrayidx29.us.1 = getelementptr i32, ptr %25, i64 1 store i32 1, ptr %arrayidx29.us.1, align 4, !tbaa !5 br label %for.cond17.for.cond.cleanup19_crit_edge.us.1 for.cond17.for.cond.cleanup19_crit_edge.us.1: ; preds = %for.body20.lr.ph.split.us.us.1, %for.inc40.us store i32 1, ptr %arrayidx24.us.1, align 4, !tbaa !5 %cmp34.us.1 = icmp eq i64 %indvars.iv.next, %19 br i1 %cmp34.us.1, label %if.then35.us.1, label %for.inc40.us.1 if.then35.us.1: ; preds = %for.cond17.for.cond.cleanup19_crit_edge.us.1 store i32 1, ptr %arrayidx37.us, align 4, !tbaa !5 br label %for.inc40.us.1 for.inc40.us.1: ; preds = %if.then35.us.1, %for.cond17.for.cond.cleanup19_crit_edge.us.1 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter119.next.1 = add i64 %niter119, 2 %niter119.ncmp.1 = icmp eq i64 %niter119.next.1, %unroll_iter118 br i1 %niter119.ncmp.1, label %for.cond44.preheader.unr-lcssa, label %for.cond17.preheader.us, !llvm.loop !13 for.cond17.for.cond.cleanup19_crit_edge.us: ; preds = %for.cond17.preheader.us, %for.body20.lr.ph.split.us.us store i32 1, ptr %arrayidx24.us, align 8, !tbaa !5 %cmp34.us = icmp eq i64 %indvars.iv, %19 br i1 %cmp34.us, label %if.then35.us, label %for.inc40.us for.body20.lr.ph.split.us.us: ; preds = %for.cond17.preheader.us %26 = getelementptr i32, ptr %arrayidx22.us, i64 %indvars.iv %arrayidx29.us = getelementptr i32, ptr %26, i64 1 store i32 1, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.cond17.for.cond.cleanup19_crit_edge.us for.cond44.preheader.unr-lcssa: ; preds = %for.inc40.us.1, %for.cond17.preheader.lr.ph %indvars.iv.unr = phi i64 [ 0, %for.cond17.preheader.lr.ph ], [ %indvars.iv.next.1, %for.inc40.us.1 ] %lcmp.mod117.not = icmp eq i64 %xtraiter115, 0 br i1 %lcmp.mod117.not, label %for.cond44.preheader, label %for.cond17.preheader.us.epil for.cond17.preheader.us.epil: ; preds = %for.cond44.preheader.unr-lcssa %27 = mul nuw nsw i64 %indvars.iv.unr, %2 %arrayidx22.us.epil = getelementptr inbounds i32, ptr %vla, i64 %27 %arrayidx24.us.epil = getelementptr inbounds i32, ptr %arrayidx22.us.epil, i64 %indvars.iv.unr %cmp25.us.epil = icmp ult i64 %indvars.iv.unr, %20 br i1 %cmp25.us.epil, label %for.body20.lr.ph.split.us.us.epil, label %for.cond17.for.cond.cleanup19_crit_edge.us.epil for.body20.lr.ph.split.us.us.epil: ; preds = %for.cond17.preheader.us.epil %28 = getelementptr i32, ptr %arrayidx22.us.epil, i64 %indvars.iv.unr %arrayidx29.us.epil = getelementptr i32, ptr %28, i64 1 store i32 1, ptr %arrayidx29.us.epil, align 4, !tbaa !5 br label %for.cond17.for.cond.cleanup19_crit_edge.us.epil for.cond17.for.cond.cleanup19_crit_edge.us.epil: ; preds = %for.body20.lr.ph.split.us.us.epil, %for.cond17.preheader.us.epil store i32 1, ptr %arrayidx24.us.epil, align 4, !tbaa !5 %cmp34.us.epil = icmp eq i64 %indvars.iv.unr, %19 br i1 %cmp34.us.epil, label %if.then35.us.epil, label %for.cond44.preheader if.then35.us.epil: ; preds = %for.cond17.for.cond.cleanup19_crit_edge.us.epil store i32 1, ptr %arrayidx37.us, align 4, !tbaa !5 br label %for.cond44.preheader for.cond44.preheader: ; preds = %for.cond17.for.cond.cleanup19_crit_edge.us.epil, %if.then35.us.epil, %for.cond44.preheader.unr-lcssa br i1 %cmp84, label %for.cond49.preheader, label %for.cond.cleanup46 for.cond49.preheader: ; preds = %for.cond44.preheader, %for.cond.cleanup51 %29 = phi i32 [ %32, %for.cond.cleanup51 ], [ %5, %for.cond44.preheader ] %indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.cond.cleanup51 ], [ 0, %for.cond44.preheader ] %cmp5096 = icmp sgt i32 %29, 0 br i1 %cmp5096, label %for.body52.lr.ph, label %for.cond.cleanup51 for.body52.lr.ph: ; preds = %for.cond49.preheader %30 = mul nuw nsw i64 %indvars.iv112, %2 %arrayidx54 = getelementptr inbounds i32, ptr %vla, i64 %30 br label %for.body52 for.cond.cleanup46: ; preds = %for.cond.cleanup51, %while.body, %for.cond12.preheader, %for.cond44.preheader call void @llvm.stackrestore.p0(ptr %3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 %31 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %31, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %31, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14 for.cond.cleanup51: ; preds = %for.body52, %for.cond49.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1 %32 = load i32, ptr %m, align 4, !tbaa !5 %33 = sext i32 %32 to i64 %cmp45 = icmp slt i64 %indvars.iv.next113, %33 br i1 %cmp45, label %for.cond49.preheader, label %for.cond.cleanup46, !llvm.loop !15 for.body52: ; preds = %for.body52.lr.ph, %for.body52 %indvars.iv109 = phi i64 [ 0, %for.body52.lr.ph ], [ %indvars.iv.next110, %for.body52 ] %arrayidx56 = getelementptr inbounds i32, ptr %arrayidx54, i64 %indvars.iv109 %34 = load i32, ptr %arrayidx56, align 4, !tbaa !5 %call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %34) %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1 %35 = load i32, ptr %m, align 4, !tbaa !5 %36 = sext i32 %35 to i64 %cmp50 = icmp slt i64 %indvars.iv.next110, %36 br i1 %cmp50, label %for.body52, label %for.cond.cleanup51, !llvm.loop !16 while.end: ; preds = %for.cond.cleanup46, %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: 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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nounwind willreturn memory(argmem: write) } 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, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include <stdio.h> #include <math.h> int main() { int i; int n; scanf("%d", &n); int x[n], y[n]; for( i = 0; i < n; ++i ) scanf("%d", &x[i]); for( i = 0; i < n; ++i ) scanf("%d", &y[i]); int p; double D; for( p = 1; p < 4; ++p ){ D = 0; for( i = 0; i < n; ++i ) D += (double)(pow(fabs(x[i] - y[i]), p)); D = (double)pow(D, 1.0/p); printf("%lf\n", D); } D = 0; for( i = 0; i < n; ++i ){ double tmp = (double)(fabs(x[i] - y[i])); D = D < tmp ? tmp : D; } printf("%lf\n", D); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265950/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265950/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"%lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { 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 !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 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %cmp71 = icmp sgt i32 %3, 0 br i1 %cmp71, label %for.body, label %for.end26 for.cond3.preheader: ; preds = %for.body %5 = icmp sgt i32 %6, 0 br i1 %5, label %for.body5, label %for.end26 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %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) %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.cond3.preheader, !llvm.loop !9 for.cond12.preheader: ; preds = %for.body5 %8 = icmp sgt i32 %9, 0 br i1 %8, label %for.body17.lr.ph, label %for.end26 for.body5: ; preds = %for.cond3.preheader, %for.body5 %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx7 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv84 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp4 = icmp slt i64 %indvars.iv.next85, %10 br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !11 for.body17.lr.ph: ; preds = %for.cond12.preheader %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = call i32 @llvm.smax.i32(i32 %11, i32 1) %smax = zext i32 %12 to i64 %xtraiter = and i64 %smax, 1 %13 = icmp slt i32 %11, 2 br i1 %13, label %for.end26.loopexit.unr-lcssa, label %for.body17.lr.ph.new for.body17.lr.ph.new: ; preds = %for.body17.lr.ph %unroll_iter = and i64 %smax, 2147483646 br label %for.body17 for.body36.preheader: ; preds = %for.end26.2 %wide.trip.count = zext i32 %40 to i64 %xtraiter115 = and i64 %wide.trip.count, 1 %14 = icmp eq i32 %40, 1 br i1 %14, label %for.end47.loopexit.unr-lcssa, label %for.body36.preheader.new for.body36.preheader.new: ; preds = %for.body36.preheader %unroll_iter118 = and i64 %wide.trip.count, 4294967294 br label %for.body36 for.body17: ; preds = %for.body17, %for.body17.lr.ph.new %indvars.iv87 = phi i64 [ 0, %for.body17.lr.ph.new ], [ %indvars.iv.next88.1106, %for.body17 ] %D.077 = phi double [ 0.000000e+00, %for.body17.lr.ph.new ], [ %add.1105, %for.body17 ] %niter = phi i64 [ 0, %for.body17.lr.ph.new ], [ %niter.next.1, %for.body17 ] %arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87 %15 = load i32, ptr %arrayidx19, align 8, !tbaa !5 %arrayidx21 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv87 %16 = load i32, ptr %arrayidx21, align 8, !tbaa !5 %sub = sub nsw i32 %15, %16 %conv = sitofp i32 %sub to double %17 = call double @llvm.fabs.f64(double %conv) %add = fadd double %D.077, %17 %indvars.iv.next88 = or i64 %indvars.iv87, 1 %arrayidx19.1101 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next88 %18 = load i32, ptr %arrayidx19.1101, align 4, !tbaa !5 %arrayidx21.1102 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next88 %19 = load i32, ptr %arrayidx21.1102, align 4, !tbaa !5 %sub.1103 = sub nsw i32 %18, %19 %conv.1104 = sitofp i32 %sub.1103 to double %20 = call double @llvm.fabs.f64(double %conv.1104) %add.1105 = fadd double %add, %20 %indvars.iv.next88.1106 = add nuw nsw i64 %indvars.iv87, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1.not, label %for.end26.loopexit.unr-lcssa, label %for.body17, !llvm.loop !12 for.end26.loopexit.unr-lcssa: ; preds = %for.body17, %for.body17.lr.ph %add.lcssa.ph = phi double [ undef, %for.body17.lr.ph ], [ %add.1105, %for.body17 ] %indvars.iv87.unr = phi i64 [ 0, %for.body17.lr.ph ], [ %indvars.iv.next88.1106, %for.body17 ] %D.077.unr = phi double [ 0.000000e+00, %for.body17.lr.ph ], [ %add.1105, %for.body17 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end26, label %for.body17.epil for.body17.epil: ; preds = %for.end26.loopexit.unr-lcssa %arrayidx19.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87.unr %21 = load i32, ptr %arrayidx19.epil, align 4, !tbaa !5 %arrayidx21.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv87.unr %22 = load i32, ptr %arrayidx21.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %21, %22 %conv.epil = sitofp i32 %sub.epil to double %23 = call double @llvm.fabs.f64(double %conv.epil) %add.epil = fadd double %D.077.unr, %23 br label %for.end26 for.end26: ; preds = %for.body17.epil, %for.end26.loopexit.unr-lcssa, %entry, %for.cond3.preheader, %for.cond12.preheader %D.0.lcssa = phi double [ 0.000000e+00, %for.cond12.preheader ], [ 0.000000e+00, %for.cond3.preheader ], [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end26.loopexit.unr-lcssa ], [ %add.epil, %for.body17.epil ] %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %D.0.lcssa) %24 = load i32, ptr %n, align 4, !tbaa !5 %cmp1675.1 = icmp sgt i32 %24, 0 br i1 %cmp1675.1, label %for.body17.lr.ph.1, label %for.end26.1 for.body17.lr.ph.1: ; preds = %for.end26 %25 = load i32, ptr %n, align 4, !tbaa !5 %26 = call i32 @llvm.smax.i32(i32 %25, i32 1) %smax109 = zext i32 %26 to i64 %xtraiter110 = and i64 %smax109, 1 %27 = icmp slt i32 %25, 2 br i1 %27, label %for.end26.1.loopexit.unr-lcssa, label %for.body17.lr.ph.1.new for.body17.lr.ph.1.new: ; preds = %for.body17.lr.ph.1 %unroll_iter113 = and i64 %smax109, 2147483646 br label %for.body17.1 for.body17.1: ; preds = %for.body17.1, %for.body17.lr.ph.1.new %indvars.iv87.1 = phi i64 [ 0, %for.body17.lr.ph.1.new ], [ %indvars.iv.next88.1.1, %for.body17.1 ] %D.077.1 = phi double [ 0.000000e+00, %for.body17.lr.ph.1.new ], [ %add.1.1, %for.body17.1 ] %niter114 = phi i64 [ 0, %for.body17.lr.ph.1.new ], [ %niter114.next.1, %for.body17.1 ] %arrayidx19.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87.1 %28 = load i32, ptr %arrayidx19.1, align 8, !tbaa !5 %arrayidx21.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv87.1 %29 = load i32, ptr %arrayidx21.1, align 8, !tbaa !5 %sub.1 = sub nsw i32 %28, %29 %conv.1 = sitofp i32 %sub.1 to double %square = fmul double %conv.1, %conv.1 %add.1 = fadd double %D.077.1, %square %indvars.iv.next88.1 = or i64 %indvars.iv87.1, 1 %arrayidx19.1.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next88.1 %30 = load i32, ptr %arrayidx19.1.1, align 4, !tbaa !5 %arrayidx21.1.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next88.1 %31 = load i32, ptr %arrayidx21.1.1, align 4, !tbaa !5 %sub.1.1 = sub nsw i32 %30, %31 %conv.1.1 = sitofp i32 %sub.1.1 to double %square.1 = fmul double %conv.1.1, %conv.1.1 %add.1.1 = fadd double %add.1, %square.1 %indvars.iv.next88.1.1 = add nuw nsw i64 %indvars.iv87.1, 2 %niter114.next.1 = add i64 %niter114, 2 %niter114.ncmp.1.not = icmp eq i64 %niter114.next.1, %unroll_iter113 br i1 %niter114.ncmp.1.not, label %for.end26.1.loopexit.unr-lcssa, label %for.body17.1, !llvm.loop !12 for.end26.1.loopexit.unr-lcssa: ; preds = %for.body17.1, %for.body17.lr.ph.1 %add.1.lcssa.ph = phi double [ undef, %for.body17.lr.ph.1 ], [ %add.1.1, %for.body17.1 ] %indvars.iv87.1.unr = phi i64 [ 0, %for.body17.lr.ph.1 ], [ %indvars.iv.next88.1.1, %for.body17.1 ] %D.077.1.unr = phi double [ 0.000000e+00, %for.body17.lr.ph.1 ], [ %add.1.1, %for.body17.1 ] %lcmp.mod111.not = icmp eq i64 %xtraiter110, 0 br i1 %lcmp.mod111.not, label %for.end26.1, label %for.body17.1.epil for.body17.1.epil: ; preds = %for.end26.1.loopexit.unr-lcssa %arrayidx19.1.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87.1.unr %32 = load i32, ptr %arrayidx19.1.epil, align 4, !tbaa !5 %arrayidx21.1.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv87.1.unr %33 = load i32, ptr %arrayidx21.1.epil, align 4, !tbaa !5 %sub.1.epil = sub nsw i32 %32, %33 %conv.1.epil = sitofp i32 %sub.1.epil to double %square.epil = fmul double %conv.1.epil, %conv.1.epil %add.1.epil = fadd double %D.077.1.unr, %square.epil br label %for.end26.1 for.end26.1: ; preds = %for.body17.1.epil, %for.end26.1.loopexit.unr-lcssa, %for.end26 %D.0.lcssa.1 = phi double [ 0.000000e+00, %for.end26 ], [ %add.1.lcssa.ph, %for.end26.1.loopexit.unr-lcssa ], [ %add.1.epil, %for.body17.1.epil ] %call28.1 = call double @pow(double noundef %D.0.lcssa.1, double noundef 5.000000e-01) #7 %call29.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call28.1) %34 = load i32, ptr %n, align 4, !tbaa !5 %cmp1675.2 = icmp sgt i32 %34, 0 br i1 %cmp1675.2, label %for.body17.2, label %for.end26.2 for.body17.2: ; preds = %for.end26.1, %for.body17.2 %indvars.iv87.2 = phi i64 [ %indvars.iv.next88.2, %for.body17.2 ], [ 0, %for.end26.1 ] %D.077.2 = phi double [ %add.2, %for.body17.2 ], [ 0.000000e+00, %for.end26.1 ] %arrayidx19.2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87.2 %35 = load i32, ptr %arrayidx19.2, align 4, !tbaa !5 %arrayidx21.2 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv87.2 %36 = load i32, ptr %arrayidx21.2, align 4, !tbaa !5 %sub.2 = sub nsw i32 %35, %36 %conv.2 = sitofp i32 %sub.2 to double %37 = call double @llvm.fabs.f64(double %conv.2) %call23.2 = call double @pow(double noundef %37, double noundef 3.000000e+00) #7 %add.2 = fadd double %D.077.2, %call23.2 %indvars.iv.next88.2 = add nuw nsw i64 %indvars.iv87.2, 1 %38 = load i32, ptr %n, align 4, !tbaa !5 %39 = sext i32 %38 to i64 %cmp16.2 = icmp slt i64 %indvars.iv.next88.2, %39 br i1 %cmp16.2, label %for.body17.2, label %for.end26.2, !llvm.loop !12 for.end26.2: ; preds = %for.body17.2, %for.end26.1 %D.0.lcssa.2 = phi double [ 0.000000e+00, %for.end26.1 ], [ %add.2, %for.body17.2 ] %call28.2 = call double @pow(double noundef %D.0.lcssa.2, double noundef 0x3FD5555555555555) #7 %call29.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call28.2) %40 = load i32, ptr %n, align 4, !tbaa !5 %cmp3479 = icmp sgt i32 %40, 0 br i1 %cmp3479, label %for.body36.preheader, label %for.end47 for.body36: ; preds = %for.body36, %for.body36.preheader.new %indvars.iv90 = phi i64 [ 0, %for.body36.preheader.new ], [ %indvars.iv.next91.1, %for.body36 ] %D.181 = phi double [ 0.000000e+00, %for.body36.preheader.new ], [ %cond.1, %for.body36 ] %niter119 = phi i64 [ 0, %for.body36.preheader.new ], [ %niter119.next.1, %for.body36 ] %arrayidx38 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv90 %41 = load i32, ptr %arrayidx38, align 8, !tbaa !5 %arrayidx40 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv90 %42 = load i32, ptr %arrayidx40, align 8, !tbaa !5 %sub41 = sub nsw i32 %41, %42 %conv42 = sitofp i32 %sub41 to double %43 = call double @llvm.fabs.f64(double %conv42) %cmp43 = fcmp olt double %D.181, %43 %cond = select i1 %cmp43, double %43, double %D.181 %indvars.iv.next91 = or i64 %indvars.iv90, 1 %arrayidx38.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next91 %44 = load i32, ptr %arrayidx38.1, align 4, !tbaa !5 %arrayidx40.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next91 %45 = load i32, ptr %arrayidx40.1, align 4, !tbaa !5 %sub41.1 = sub nsw i32 %44, %45 %conv42.1 = sitofp i32 %sub41.1 to double %46 = call double @llvm.fabs.f64(double %conv42.1) %cmp43.1 = fcmp olt double %cond, %46 %cond.1 = select i1 %cmp43.1, double %46, double %cond %indvars.iv.next91.1 = add nuw nsw i64 %indvars.iv90, 2 %niter119.next.1 = add i64 %niter119, 2 %niter119.ncmp.1 = icmp eq i64 %niter119.next.1, %unroll_iter118 br i1 %niter119.ncmp.1, label %for.end47.loopexit.unr-lcssa, label %for.body36, !llvm.loop !13 for.end47.loopexit.unr-lcssa: ; preds = %for.body36, %for.body36.preheader %cond.lcssa.ph = phi double [ undef, %for.body36.preheader ], [ %cond.1, %for.body36 ] %indvars.iv90.unr = phi i64 [ 0, %for.body36.preheader ], [ %indvars.iv.next91.1, %for.body36 ] %D.181.unr = phi double [ 0.000000e+00, %for.body36.preheader ], [ %cond.1, %for.body36 ] %lcmp.mod116.not = icmp eq i64 %xtraiter115, 0 br i1 %lcmp.mod116.not, label %for.end47, label %for.body36.epil for.body36.epil: ; preds = %for.end47.loopexit.unr-lcssa %arrayidx38.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv90.unr %47 = load i32, ptr %arrayidx38.epil, align 4, !tbaa !5 %arrayidx40.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv90.unr %48 = load i32, ptr %arrayidx40.epil, align 4, !tbaa !5 %sub41.epil = sub nsw i32 %47, %48 %conv42.epil = sitofp i32 %sub41.epil to double %49 = call double @llvm.fabs.f64(double %conv42.epil) %cmp43.epil = fcmp olt double %D.181.unr, %49 %cond.epil = select i1 %cmp43.epil, double %49, double %D.181.unr br label %for.end47 for.end47: ; preds = %for.body36.epil, %for.end47.loopexit.unr-lcssa, %for.end26.2 %D.1.lcssa = phi double [ 0.000000e+00, %for.end26.2 ], [ %cond.lcssa.ph, %for.end47.loopexit.unr-lcssa ], [ %cond.epil, %for.body36.epil ] %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %D.1.lcssa) call void @llvm.stackrestore.p0(ptr %2) 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 nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #5 ; 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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> #include<math.h> void p1(int x[],int y[],int n) { int i; double D=0,num; for(i=0;i<n;i++) { num=x[i]-y[i]; if(num<0) num=-num; D+=num; } printf("%f\n",D); } void p2(int x[],int y[],int n) { int i; double D=0,num; for(i=0;i<n;i++) { num=(x[i]-y[i])*(x[i]-y[i]); D+=num; } D=sqrt(D); printf("%f\n",D); } void p3(int x[],int y[],int n) { int i; double D=0,num; for(i=0;i<n;i++) { num=x[i]-y[i]; if(num<0) num=-num; num=num*num*num; D+=num; } D=pow(D,1.0/3); printf("%f\n",D); } void p_inf(int x[],int y[],int n) { int i; double num,max=0; for(i=0;i<n;i++) { num=x[i]-y[i]; if(num<0) num=-num; if(num>max) max=num; } printf("%f\n",max); } int main(void) { int n,i,j,p; scanf("%d",&n); int x[n],y[n]; for(i=0;i<n;i++) scanf("%d",&x[i]); for(i=0;i<n;i++) scanf("%d",&y[i]); p1(x,y,n); p2(x,y,n); p3(x,y,n); p_inf(x,y,n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266007/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266007/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"%f\0A\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 void @p1(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp11 = icmp sgt i32 %n, 0 br i1 %cmp11, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %n, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %D.013 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %add.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %conv = sitofp i32 %sub to double %cmp3 = icmp slt i32 %sub, 0 %fneg = fneg double %conv %num.0 = select i1 %cmp3, double %fneg, double %conv %add = fadd double %D.013, %num.0 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %3, %4 %conv.1 = sitofp i32 %sub.1 to double %cmp3.1 = icmp slt i32 %sub.1, 0 %fneg.1 = fneg double %conv.1 %num.0.1 = select i1 %cmp3.1, double %fneg.1, double %conv.1 %add.1 = fadd double %add, %num.0.1 %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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %add.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %add.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %D.013.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %add.1, %for.body ] %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.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.unr %5 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %arrayidx2.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.unr %6 = load i32, ptr %arrayidx2.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %5, %6 %conv.epil = sitofp i32 %sub.epil to double %cmp3.epil = icmp slt i32 %sub.epil, 0 %fneg.epil = fneg double %conv.epil %num.0.epil = select i1 %cmp3.epil, double %fneg.epil, double %conv.epil %add.epil = fadd double %D.013.unr, %num.0.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %D.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %D.0.lcssa) 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 void @p2(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp18 = icmp sgt i32 %n, 0 br i1 %cmp18, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %n, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %D.019 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %add.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %mul = mul nsw i32 %sub, %sub %conv = sitofp i32 %mul to double %add = fadd double %D.019, %conv %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %3, %4 %mul.1 = mul nsw i32 %sub.1, %sub.1 %conv.1 = sitofp i32 %mul.1 to double %add.1 = fadd double %add, %conv.1 %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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !11 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %add.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %add.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %D.019.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %add.1, %for.body ] %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.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.unr %5 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %arrayidx2.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.unr %6 = load i32, ptr %arrayidx2.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %5, %6 %mul.epil = mul nsw i32 %sub.epil, %sub.epil %conv.epil = sitofp i32 %mul.epil to double %add.epil = fadd double %D.019.unr, %conv.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %D.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ] %call = tail call double @sqrt(double noundef %D.0.lcssa) #5 %call8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %call) ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local void @p3(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp17 = icmp sgt i32 %n, 0 br i1 %cmp17, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %n, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %D.019 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %add.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %conv = sitofp i32 %sub to double %cmp3 = icmp slt i32 %sub, 0 %fneg = fneg double %conv %num.0 = select i1 %cmp3, double %fneg, double %conv %mul = fmul double %num.0, %num.0 %mul5 = fmul double %num.0, %mul %add = fadd double %D.019, %mul5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %3, %4 %conv.1 = sitofp i32 %sub.1 to double %cmp3.1 = icmp slt i32 %sub.1, 0 %fneg.1 = fneg double %conv.1 %num.0.1 = select i1 %cmp3.1, double %fneg.1, double %conv.1 %mul.1 = fmul double %num.0.1, %num.0.1 %mul5.1 = fmul double %num.0.1, %mul.1 %add.1 = fadd double %add, %mul5.1 %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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !12 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %add.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %add.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %D.019.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %add.1, %for.body ] %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.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.unr %5 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %arrayidx2.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.unr %6 = load i32, ptr %arrayidx2.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %5, %6 %conv.epil = sitofp i32 %sub.epil to double %cmp3.epil = icmp slt i32 %sub.epil, 0 %fneg.epil = fneg double %conv.epil %num.0.epil = select i1 %cmp3.epil, double %fneg.epil, double %conv.epil %mul.epil = fmul double %num.0.epil, %num.0.epil %mul5.epil = fmul double %num.0.epil, %mul.epil %add.epil = fadd double %D.019.unr, %mul5.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %D.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ] %call = tail call double @pow(double noundef %D.0.lcssa, double noundef 0x3FD5555555555555) #5 %call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %call) ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local void @p_inf(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp16 = icmp sgt i32 %n, 0 br i1 %cmp16, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %max.018 = phi double [ 0.000000e+00, %for.body.preheader ], [ %max.1, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %conv = sitofp i32 %sub to double %cmp3 = icmp slt i32 %sub, 0 %fneg = fneg double %conv %num.0 = select i1 %cmp3, double %fneg, double %conv %cmp5 = fcmp ogt double %num.0, %max.018 %max.1 = select i1 %cmp5, double %num.0, double %max.018 %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, %entry %max.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %max.1, %for.body ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %max.0.lcssa) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, 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 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %cmp63 = icmp sgt i32 %3, 0 br i1 %cmp63, label %for.body, label %p1.exit for.cond3.preheader: ; preds = %for.body %cmp465 = icmp sgt i32 %5, 0 br i1 %cmp465, label %for.body5, label %p1.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = 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 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !14 for.body5: ; preds = %for.cond3.preheader, %for.body5 %indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx7 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv70 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7) %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %.pr = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %.pr to i64 %cmp4 = icmp slt i64 %indvars.iv.next71, %7 br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !15 for.end11: ; preds = %for.body5 %cmp11.i = icmp sgt i32 %.pr, 0 br i1 %cmp11.i, label %for.body.preheader.i, label %p1.exit for.body.preheader.i: ; preds = %for.end11 %wide.trip.count.i = zext i32 %.pr to i64 %xtraiter = and i64 %wide.trip.count.i, 1 %8 = icmp eq i32 %.pr, 1 br i1 %8, label %p1.exit.loopexit.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = and i64 %wide.trip.count.i, 4294967294 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.body.i ] %D.013.i = phi double [ 0.000000e+00, %for.body.preheader.i.new ], [ %add.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ] %arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i %9 = load i32, ptr %arrayidx.i, align 8, !tbaa !5 %arrayidx2.i = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.i %10 = load i32, ptr %arrayidx2.i, align 8, !tbaa !5 %sub.i = sub nsw i32 %9, %10 %conv.i = sitofp i32 %sub.i to double %cmp3.i = icmp slt i32 %sub.i, 0 %fneg.i = fneg double %conv.i %num.0.i = select i1 %cmp3.i, double %fneg.i, double %conv.i %add.i = fadd double %D.013.i, %num.0.i %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next.i %11 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5 %arrayidx2.i.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next.i %12 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5 %sub.i.1 = sub nsw i32 %11, %12 %conv.i.1 = sitofp i32 %sub.i.1 to double %cmp3.i.1 = icmp slt i32 %sub.i.1, 0 %fneg.i.1 = fneg double %conv.i.1 %num.0.i.1 = select i1 %cmp3.i.1, double %fneg.i.1, double %conv.i.1 %add.i.1 = fadd double %add.i, %num.0.i.1 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 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 %p1.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !9 p1.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i %add.i.lcssa.ph = phi double [ undef, %for.body.preheader.i ], [ %add.i.1, %for.body.i ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.body.i ] %D.013.i.unr = phi double [ 0.000000e+00, %for.body.preheader.i ], [ %add.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %p1.exit, label %for.body.i.epil for.body.i.epil: ; preds = %p1.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i.unr %13 = load i32, ptr %arrayidx.i.epil, align 4, !tbaa !5 %arrayidx2.i.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.i.unr %14 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5 %sub.i.epil = sub nsw i32 %13, %14 %conv.i.epil = sitofp i32 %sub.i.epil to double %cmp3.i.epil = icmp slt i32 %sub.i.epil, 0 %fneg.i.epil = fneg double %conv.i.epil %num.0.i.epil = select i1 %cmp3.i.epil, double %fneg.i.epil, double %conv.i.epil %add.i.epil = fadd double %D.013.i.unr, %num.0.i.epil br label %p1.exit p1.exit: ; preds = %for.body.i.epil, %p1.exit.loopexit.unr-lcssa, %entry, %for.cond3.preheader, %for.end11 %D.0.lcssa.i = phi double [ 0.000000e+00, %for.end11 ], [ 0.000000e+00, %for.cond3.preheader ], [ 0.000000e+00, %entry ], [ %add.i.lcssa.ph, %p1.exit.loopexit.unr-lcssa ], [ %add.i.epil, %for.body.i.epil ] %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %D.0.lcssa.i) %15 = load i32, ptr %n, align 4, !tbaa !5 %cmp18.i = icmp sgt i32 %15, 0 br i1 %cmp18.i, label %for.body.preheader.i19, label %p2.exit for.body.preheader.i19: ; preds = %p1.exit %wide.trip.count.i20 = zext i32 %15 to i64 %xtraiter78 = and i64 %wide.trip.count.i20, 1 %16 = icmp eq i32 %15, 1 br i1 %16, label %p2.exit.loopexit.unr-lcssa, label %for.body.preheader.i19.new for.body.preheader.i19.new: ; preds = %for.body.preheader.i19 %unroll_iter81 = and i64 %wide.trip.count.i20, 4294967294 br label %for.body.i21 for.body.i21: ; preds = %for.body.i21, %for.body.preheader.i19.new %indvars.iv.i22 = phi i64 [ 0, %for.body.preheader.i19.new ], [ %indvars.iv.next.i28.1, %for.body.i21 ] %D.019.i = phi double [ 0.000000e+00, %for.body.preheader.i19.new ], [ %add.i27.1, %for.body.i21 ] %niter82 = phi i64 [ 0, %for.body.preheader.i19.new ], [ %niter82.next.1, %for.body.i21 ] %arrayidx.i23 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i22 %17 = load i32, ptr %arrayidx.i23, align 8, !tbaa !5 %arrayidx2.i24 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.i22 %18 = load i32, ptr %arrayidx2.i24, align 8, !tbaa !5 %sub.i25 = sub nsw i32 %17, %18 %mul.i = mul nsw i32 %sub.i25, %sub.i25 %conv.i26 = sitofp i32 %mul.i to double %add.i27 = fadd double %D.019.i, %conv.i26 %indvars.iv.next.i28 = or i64 %indvars.iv.i22, 1 %arrayidx.i23.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next.i28 %19 = load i32, ptr %arrayidx.i23.1, align 4, !tbaa !5 %arrayidx2.i24.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next.i28 %20 = load i32, ptr %arrayidx2.i24.1, align 4, !tbaa !5 %sub.i25.1 = sub nsw i32 %19, %20 %mul.i.1 = mul nsw i32 %sub.i25.1, %sub.i25.1 %conv.i26.1 = sitofp i32 %mul.i.1 to double %add.i27.1 = fadd double %add.i27, %conv.i26.1 %indvars.iv.next.i28.1 = add nuw nsw i64 %indvars.iv.i22, 2 %niter82.next.1 = add i64 %niter82, 2 %niter82.ncmp.1 = icmp eq i64 %niter82.next.1, %unroll_iter81 br i1 %niter82.ncmp.1, label %p2.exit.loopexit.unr-lcssa, label %for.body.i21, !llvm.loop !11 p2.exit.loopexit.unr-lcssa: ; preds = %for.body.i21, %for.body.preheader.i19 %add.i27.lcssa.ph = phi double [ undef, %for.body.preheader.i19 ], [ %add.i27.1, %for.body.i21 ] %indvars.iv.i22.unr = phi i64 [ 0, %for.body.preheader.i19 ], [ %indvars.iv.next.i28.1, %for.body.i21 ] %D.019.i.unr = phi double [ 0.000000e+00, %for.body.preheader.i19 ], [ %add.i27.1, %for.body.i21 ] %lcmp.mod79.not = icmp eq i64 %xtraiter78, 0 br i1 %lcmp.mod79.not, label %p2.exit, label %for.body.i21.epil for.body.i21.epil: ; preds = %p2.exit.loopexit.unr-lcssa %arrayidx.i23.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i22.unr %21 = load i32, ptr %arrayidx.i23.epil, align 4, !tbaa !5 %arrayidx2.i24.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.i22.unr %22 = load i32, ptr %arrayidx2.i24.epil, align 4, !tbaa !5 %sub.i25.epil = sub nsw i32 %21, %22 %mul.i.epil = mul nsw i32 %sub.i25.epil, %sub.i25.epil %conv.i26.epil = sitofp i32 %mul.i.epil to double %add.i27.epil = fadd double %D.019.i.unr, %conv.i26.epil br label %p2.exit p2.exit: ; preds = %for.body.i21.epil, %p2.exit.loopexit.unr-lcssa, %p1.exit %D.0.lcssa.i17 = phi double [ 0.000000e+00, %p1.exit ], [ %add.i27.lcssa.ph, %p2.exit.loopexit.unr-lcssa ], [ %add.i27.epil, %for.body.i21.epil ] %call.i18 = call double @sqrt(double noundef %D.0.lcssa.i17) #5 %call8.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %call.i18) %23 = load i32, ptr %n, align 4, !tbaa !5 %cmp17.i = icmp sgt i32 %23, 0 br i1 %cmp17.i, label %for.body.preheader.i32, label %p3.exit for.body.preheader.i32: ; preds = %p2.exit %wide.trip.count.i33 = zext i32 %23 to i64 %xtraiter83 = and i64 %wide.trip.count.i33, 1 %24 = icmp eq i32 %23, 1 br i1 %24, label %p3.exit.loopexit.unr-lcssa, label %for.body.preheader.i32.new for.body.preheader.i32.new: ; preds = %for.body.preheader.i32 %unroll_iter86 = and i64 %wide.trip.count.i33, 4294967294 br label %for.body.i34 for.body.i34: ; preds = %for.body.i34, %for.body.preheader.i32.new %indvars.iv.i35 = phi i64 [ 0, %for.body.preheader.i32.new ], [ %indvars.iv.next.i46.1, %for.body.i34 ] %D.019.i36 = phi double [ 0.000000e+00, %for.body.preheader.i32.new ], [ %add.i45.1, %for.body.i34 ] %niter87 = phi i64 [ 0, %for.body.preheader.i32.new ], [ %niter87.next.1, %for.body.i34 ] %arrayidx.i37 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i35 %25 = load i32, ptr %arrayidx.i37, align 8, !tbaa !5 %arrayidx2.i38 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.i35 %26 = load i32, ptr %arrayidx2.i38, align 8, !tbaa !5 %sub.i39 = sub nsw i32 %25, %26 %conv.i40 = sitofp i32 %sub.i39 to double %cmp3.i41 = icmp slt i32 %sub.i39, 0 %fneg.i42 = fneg double %conv.i40 %num.0.i43 = select i1 %cmp3.i41, double %fneg.i42, double %conv.i40 %mul.i44 = fmul double %num.0.i43, %num.0.i43 %mul5.i = fmul double %num.0.i43, %mul.i44 %add.i45 = fadd double %D.019.i36, %mul5.i %indvars.iv.next.i46 = or i64 %indvars.iv.i35, 1 %arrayidx.i37.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next.i46 %27 = load i32, ptr %arrayidx.i37.1, align 4, !tbaa !5 %arrayidx2.i38.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next.i46 %28 = load i32, ptr %arrayidx2.i38.1, align 4, !tbaa !5 %sub.i39.1 = sub nsw i32 %27, %28 %conv.i40.1 = sitofp i32 %sub.i39.1 to double %cmp3.i41.1 = icmp slt i32 %sub.i39.1, 0 %fneg.i42.1 = fneg double %conv.i40.1 %num.0.i43.1 = select i1 %cmp3.i41.1, double %fneg.i42.1, double %conv.i40.1 %mul.i44.1 = fmul double %num.0.i43.1, %num.0.i43.1 %mul5.i.1 = fmul double %num.0.i43.1, %mul.i44.1 %add.i45.1 = fadd double %add.i45, %mul5.i.1 %indvars.iv.next.i46.1 = add nuw nsw i64 %indvars.iv.i35, 2 %niter87.next.1 = add i64 %niter87, 2 %niter87.ncmp.1 = icmp eq i64 %niter87.next.1, %unroll_iter86 br i1 %niter87.ncmp.1, label %p3.exit.loopexit.unr-lcssa, label %for.body.i34, !llvm.loop !12 p3.exit.loopexit.unr-lcssa: ; preds = %for.body.i34, %for.body.preheader.i32 %add.i45.lcssa.ph = phi double [ undef, %for.body.preheader.i32 ], [ %add.i45.1, %for.body.i34 ] %indvars.iv.i35.unr = phi i64 [ 0, %for.body.preheader.i32 ], [ %indvars.iv.next.i46.1, %for.body.i34 ] %D.019.i36.unr = phi double [ 0.000000e+00, %for.body.preheader.i32 ], [ %add.i45.1, %for.body.i34 ] %lcmp.mod84.not = icmp eq i64 %xtraiter83, 0 br i1 %lcmp.mod84.not, label %p3.exit, label %for.body.i34.epil for.body.i34.epil: ; preds = %p3.exit.loopexit.unr-lcssa %arrayidx.i37.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i35.unr %29 = load i32, ptr %arrayidx.i37.epil, align 4, !tbaa !5 %arrayidx2.i38.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.i35.unr %30 = load i32, ptr %arrayidx2.i38.epil, align 4, !tbaa !5 %sub.i39.epil = sub nsw i32 %29, %30 %conv.i40.epil = sitofp i32 %sub.i39.epil to double %cmp3.i41.epil = icmp slt i32 %sub.i39.epil, 0 %fneg.i42.epil = fneg double %conv.i40.epil %num.0.i43.epil = select i1 %cmp3.i41.epil, double %fneg.i42.epil, double %conv.i40.epil %mul.i44.epil = fmul double %num.0.i43.epil, %num.0.i43.epil %mul5.i.epil = fmul double %num.0.i43.epil, %mul.i44.epil %add.i45.epil = fadd double %D.019.i36.unr, %mul5.i.epil br label %p3.exit p3.exit: ; preds = %for.body.i34.epil, %p3.exit.loopexit.unr-lcssa, %p2.exit %D.0.lcssa.i30 = phi double [ 0.000000e+00, %p2.exit ], [ %add.i45.lcssa.ph, %p3.exit.loopexit.unr-lcssa ], [ %add.i45.epil, %for.body.i34.epil ] %call.i31 = call double @pow(double noundef %D.0.lcssa.i30, double noundef 0x3FD5555555555555) #5 %call6.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %call.i31) %31 = load i32, ptr %n, align 4, !tbaa !5 %cmp16.i = icmp sgt i32 %31, 0 br i1 %cmp16.i, label %for.body.preheader.i49, label %p_inf.exit for.body.preheader.i49: ; preds = %p3.exit %wide.trip.count.i50 = zext i32 %31 to i64 br label %for.body.i51 for.body.i51: ; preds = %for.body.i51, %for.body.preheader.i49 %indvars.iv.i52 = phi i64 [ 0, %for.body.preheader.i49 ], [ %indvars.iv.next.i60, %for.body.i51 ] %max.018.i = phi double [ 0.000000e+00, %for.body.preheader.i49 ], [ %max.1.i, %for.body.i51 ] %arrayidx.i53 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i52 %32 = load i32, ptr %arrayidx.i53, align 4, !tbaa !5 %arrayidx2.i54 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.i52 %33 = load i32, ptr %arrayidx2.i54, align 4, !tbaa !5 %sub.i55 = sub nsw i32 %32, %33 %conv.i56 = sitofp i32 %sub.i55 to double %cmp3.i57 = icmp slt i32 %sub.i55, 0 %fneg.i58 = fneg double %conv.i56 %num.0.i59 = select i1 %cmp3.i57, double %fneg.i58, double %conv.i56 %cmp5.i = fcmp ogt double %num.0.i59, %max.018.i %max.1.i = select i1 %cmp5.i, double %num.0.i59, double %max.018.i %indvars.iv.next.i60 = add nuw nsw i64 %indvars.iv.i52, 1 %exitcond.not.i61 = icmp eq i64 %indvars.iv.next.i60, %wide.trip.count.i50 br i1 %exitcond.not.i61, label %p_inf.exit, label %for.body.i51, !llvm.loop !13 p_inf.exit: ; preds = %for.body.i51, %p3.exit %max.0.lcssa.i = phi double [ 0.000000e+00, %p3.exit ], [ %max.1.i, %for.body.i51 ] %call.i48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %max.0.lcssa.i) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; 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() #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #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(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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn } 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} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> #include <math.h> int main() { double d1,d2,d3,d4; int i,j,k,l,n; double x[1020] = {0}; double y[1020] = {0}; double z[1020] = {0}; double o,p,q,max; max = -1; o=0; p=0; q=0; d1 = 0; d2 = 0; d3 = 0; d4 = 0; scanf("%d",&n); for(i=0; i<n; i++) { scanf("%lf",&x[i]); } for(i=0; i<n; i++) { scanf("%lf",&y[i]); } for(i=0; i<n;i++) { o = (x[i] - y[i]) * (x[i] - y[i]); p = (x[i] - y[i]) * (x[i] - y[i]) * (x[i] - y[i]); p = p*p; p = sqrt(p); d3 = d3 + p; d2 = d2+o; d1 = d1 + sqrt(o); if(max < sqrt(o)) { max = sqrt(o); } } d2 = pow(d2,1.0/2); d3 = pow(d3,1.0/3); d4 = max; printf("%.11lf\n%.11lf\n%.11lf\n%.11lf\n" ,d1,d2,d3,d4); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266065/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266065/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"%lf\00", align 1 @.str.2 = private unnamed_addr constant [29 x i8] c"%.11lf\0A%.11lf\0A%.11lf\0A%.11lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca [1020 x double], align 16 %y = alloca [1020 x double], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 8160, ptr nonnull %x) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8160) %x, i8 0, i64 8160, i1 false) call void @llvm.lifetime.start.p0(i64 8160, ptr nonnull %y) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8160) %y, i8 0, i64 8160, 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 %cmp86 = icmp sgt i32 %0, 0 br i1 %cmp86, label %for.body, label %for.end50 for.cond2.preheader: ; preds = %for.body %cmp388 = icmp sgt i32 %1, 0 br i1 %cmp388, label %for.body4, label %for.end50 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1020 x double], ptr %x, 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 %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.cond2.preheader, !llvm.loop !9 for.cond11.preheader: ; preds = %for.body4 %cmp1290 = icmp sgt i32 %3, 0 br i1 %cmp1290, label %for.body13.preheader, label %for.end50 for.body13.preheader: ; preds = %for.cond11.preheader %wide.trip.count = zext i32 %3 to i64 br label %for.body13 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [1020 x double], ptr %y, i64 0, i64 %indvars.iv100 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp3 = icmp slt i64 %indvars.iv.next101, %4 br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !11 for.body13: ; preds = %for.body13.preheader, %for.body13 %indvars.iv103 = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next104, %for.body13 ] %max.095 = phi double [ -1.000000e+00, %for.body13.preheader ], [ %max.1, %for.body13 ] %d1.094 = phi double [ 0.000000e+00, %for.body13.preheader ], [ %add44, %for.body13 ] %d2.093 = phi double [ 0.000000e+00, %for.body13.preheader ], [ %add42, %for.body13 ] %d3.092 = phi double [ 0.000000e+00, %for.body13.preheader ], [ %add, %for.body13 ] %arrayidx15 = getelementptr inbounds [1020 x double], ptr %x, i64 0, i64 %indvars.iv103 %5 = load double, ptr %arrayidx15, align 8, !tbaa !12 %arrayidx17 = getelementptr inbounds [1020 x double], ptr %y, i64 0, i64 %indvars.iv103 %6 = load double, ptr %arrayidx17, align 8, !tbaa !12 %sub = fsub double %5, %6 %mul = fmul double %sub, %sub %mul39 = fmul double %sub, %mul %mul40 = fmul double %mul39, %mul39 %sqrt84 = call double @llvm.sqrt.f64(double %mul40) %add = fadd double %d3.092, %sqrt84 %add42 = fadd double %d2.093, %mul %sqrt83 = call double @llvm.sqrt.f64(double %mul) %add44 = fadd double %d1.094, %sqrt83 %cmp46 = fcmp olt double %max.095, %sqrt83 %max.1 = select i1 %cmp46, double %sqrt83, double %max.095 %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1 %exitcond.not = icmp eq i64 %indvars.iv.next104, %wide.trip.count br i1 %exitcond.not, label %for.end50, label %for.body13, !llvm.loop !14 for.end50: ; preds = %for.body13, %entry, %for.cond2.preheader, %for.cond11.preheader %d3.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add, %for.body13 ] %d2.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add42, %for.body13 ] %d1.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add44, %for.body13 ] %max.0.lcssa = phi double [ -1.000000e+00, %for.cond11.preheader ], [ -1.000000e+00, %for.cond2.preheader ], [ -1.000000e+00, %entry ], [ %max.1, %for.body13 ] %call51 = call double @pow(double noundef %d2.0.lcssa, double noundef 5.000000e-01) #6 %call52 = call double @pow(double noundef %d3.0.lcssa, double noundef 0x3FD5555555555555) #6 %call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %d1.0.lcssa, double noundef %call51, double noundef %call52, double noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 8160, ptr nonnull %y) #6 call void @llvm.lifetime.end.p0(i64 8160, ptr nonnull %x) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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: 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 nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #4 ; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.sqrt.f64(double) #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 = { 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 = { 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 = { 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 = !{!13, !13, i64 0} !13 = !{!"double", !7, i64 0} !14 = distinct !{!14, !10}
#include<stdio.h> #include<math.h> int main(void){ int n,i; double man=0,yu2=0,yu3,che=0; scanf("%d",&n); int x[n],y[n]; for(i=0;i<n;i++){ scanf("%d",&x[i]); } for(i=0;i<n;i++){ scanf("%d",&y[i]); } for(i=0;i<n;i++){//マンハッタン距離 if(x[i]>y[i]){ man+=x[i]-y[i]; } else{ man+=y[i]-x[i]; } } for(i=0;i<n;i++){//ユークリッド2 if(x[i]>y[i]){ yu2+=(x[i]-y[i])*(x[i]-y[i]); } else{ yu2+=(y[i]-x[i])*(y[i]-x[i]); } } yu2=sqrt(yu2); for(i=0;i<n;i++){//ユークリッド3 if(x[i]>y[i]){ yu3+=(x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]); } else{ yu3+=(y[i]-x[i])*(y[i]-x[i])*(y[i]-x[i]); } } yu3=pow(yu3,1.0/3.0); for(i=0;i<n;i++){//チェビシェフ距離 if(x[i]>y[i]){ if(che<x[i]-y[i]) che=x[i]-y[i]; } else{ if(che<y[i]-x[i]) che=y[i]-x[i]; } } printf("%lf\n%lf\n%lf\n%lf\n",man,yu2,yu3,che); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266115/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266115/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 [17 x i8] c"%lf\0A%lf\0A%lf\0A%lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { 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 !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 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %cmp257 = icmp sgt i32 %3, 0 br i1 %cmp257, label %for.body, label %for.end74 for.cond3.preheader: ; preds = %for.body %cmp4259 = icmp sgt i32 %5, 0 br i1 %cmp4259, label %for.body5, label %for.end74 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %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) %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.cond3.preheader, !llvm.loop !9 for.cond12.preheader: ; preds = %for.body5 %cmp13261 = icmp sgt i32 %9, 0 br i1 %cmp13261, label %for.body14.preheader, label %for.end74 for.body14.preheader: ; preds = %for.cond12.preheader %wide.trip.count = zext i32 %9 to i64 %7 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %wide.trip.count, 1 %8 = icmp eq i64 %7, 0 br i1 %8, label %for.cond34.preheader.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.body5: ; preds = %for.cond3.preheader, %for.body5 %indvars.iv279 = phi i64 [ %indvars.iv.next280, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx7 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv279 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %indvars.iv.next280 = add nuw nsw i64 %indvars.iv279, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp4 = icmp slt i64 %indvars.iv.next280, %10 br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !11 for.cond34.preheader.unr-lcssa: ; preds = %for.body14, %for.body14.preheader %man.1.lcssa.ph = phi double [ undef, %for.body14.preheader ], [ %man.1.1, %for.body14 ] %indvars.iv282.unr = phi i64 [ 0, %for.body14.preheader ], [ %indvars.iv.next283.1, %for.body14 ] %man.0262.unr = phi double [ 0.000000e+00, %for.body14.preheader ], [ %man.1.1, %for.body14 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond34.preheader, label %for.body14.epil for.body14.epil: ; preds = %for.cond34.preheader.unr-lcssa %arrayidx16.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv282.unr %11 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5 %arrayidx18.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv282.unr %12 = load i32, ptr %arrayidx18.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %11, %12 %conv.pn.in.epil = call i32 @llvm.abs.i32(i32 %sub.epil, i1 true) %conv.pn.epil = sitofp i32 %conv.pn.in.epil to double %man.1.epil = fadd double %man.0262.unr, %conv.pn.epil br label %for.cond34.preheader for.cond34.preheader: ; preds = %for.cond34.preheader.unr-lcssa, %for.body14.epil %man.1.lcssa = phi double [ %man.1.lcssa.ph, %for.cond34.preheader.unr-lcssa ], [ %man.1.epil, %for.body14.epil ] br i1 %cmp13261, label %for.body37.preheader, label %for.end74 for.body37.preheader: ; preds = %for.cond34.preheader %wide.trip.count288 = zext i32 %9 to i64 %xtraiter315 = and i64 %wide.trip.count288, 1 %13 = icmp eq i64 %7, 0 br i1 %13, label %for.end74.loopexit.unr-lcssa, label %for.body37.preheader.new for.body37.preheader.new: ; preds = %for.body37.preheader %unroll_iter318 = and i64 %wide.trip.count288, 4294967294 br label %for.body37 for.body14: ; preds = %for.body14, %for.body14.preheader.new %indvars.iv282 = phi i64 [ 0, %for.body14.preheader.new ], [ %indvars.iv.next283.1, %for.body14 ] %man.0262 = phi double [ 0.000000e+00, %for.body14.preheader.new ], [ %man.1.1, %for.body14 ] %niter = phi i64 [ 0, %for.body14.preheader.new ], [ %niter.next.1, %for.body14 ] %arrayidx16 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv282 %14 = load i32, ptr %arrayidx16, align 8, !tbaa !5 %arrayidx18 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv282 %15 = load i32, ptr %arrayidx18, align 8, !tbaa !5 %sub = sub nsw i32 %14, %15 %conv.pn.in = call i32 @llvm.abs.i32(i32 %sub, i1 true) %conv.pn = sitofp i32 %conv.pn.in to double %man.1 = fadd double %man.0262, %conv.pn %indvars.iv.next283 = or i64 %indvars.iv282, 1 %arrayidx16.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next283 %16 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5 %arrayidx18.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next283 %17 = load i32, ptr %arrayidx18.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %16, %17 %conv.pn.in.1 = call i32 @llvm.abs.i32(i32 %sub.1, i1 true) %conv.pn.1 = sitofp i32 %conv.pn.in.1 to double %man.1.1 = fadd double %man.1, %conv.pn.1 %indvars.iv.next283.1 = add nuw nsw i64 %indvars.iv282, 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.cond34.preheader.unr-lcssa, label %for.body14, !llvm.loop !12 for.body37: ; preds = %for.body37, %for.body37.preheader.new %indvars.iv285 = phi i64 [ 0, %for.body37.preheader.new ], [ %indvars.iv.next286.1, %for.body37 ] %yu2.0266 = phi double [ 0.000000e+00, %for.body37.preheader.new ], [ %yu2.1.1, %for.body37 ] %niter319 = phi i64 [ 0, %for.body37.preheader.new ], [ %niter319.next.1, %for.body37 ] %arrayidx39 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv285 %18 = load i32, ptr %arrayidx39, align 8, !tbaa !5 %arrayidx41 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv285 %19 = load i32, ptr %arrayidx41, align 8, !tbaa !5 %cmp42 = icmp sgt i32 %18, %19 %sub49 = sub nsw i32 %18, %19 %mul = mul nsw i32 %sub49, %sub49 %sub62 = sub nsw i32 %19, %18 %mul68 = mul nsw i32 %sub62, %sub62 %conv55.pn.in = select i1 %cmp42, i32 %mul, i32 %mul68 %conv55.pn = sitofp i32 %conv55.pn.in to double %yu2.1 = fadd double %yu2.0266, %conv55.pn %indvars.iv.next286 = or i64 %indvars.iv285, 1 %arrayidx39.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next286 %20 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx41.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next286 %21 = load i32, ptr %arrayidx41.1, align 4, !tbaa !5 %cmp42.1 = icmp sgt i32 %20, %21 %sub49.1 = sub nsw i32 %20, %21 %mul.1 = mul nsw i32 %sub49.1, %sub49.1 %sub62.1 = sub nsw i32 %21, %20 %mul68.1 = mul nsw i32 %sub62.1, %sub62.1 %conv55.pn.in.1 = select i1 %cmp42.1, i32 %mul.1, i32 %mul68.1 %conv55.pn.1 = sitofp i32 %conv55.pn.in.1 to double %yu2.1.1 = fadd double %yu2.1, %conv55.pn.1 %indvars.iv.next286.1 = add nuw nsw i64 %indvars.iv285, 2 %niter319.next.1 = add i64 %niter319, 2 %niter319.ncmp.1 = icmp eq i64 %niter319.next.1, %unroll_iter318 br i1 %niter319.ncmp.1, label %for.end74.loopexit.unr-lcssa, label %for.body37, !llvm.loop !13 for.end74.loopexit.unr-lcssa: ; preds = %for.body37, %for.body37.preheader %yu2.1.lcssa.ph = phi double [ undef, %for.body37.preheader ], [ %yu2.1.1, %for.body37 ] %indvars.iv285.unr = phi i64 [ 0, %for.body37.preheader ], [ %indvars.iv.next286.1, %for.body37 ] %yu2.0266.unr = phi double [ 0.000000e+00, %for.body37.preheader ], [ %yu2.1.1, %for.body37 ] %lcmp.mod316.not = icmp eq i64 %xtraiter315, 0 br i1 %lcmp.mod316.not, label %for.end74, label %for.body37.epil for.body37.epil: ; preds = %for.end74.loopexit.unr-lcssa %arrayidx39.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv285.unr %22 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx41.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv285.unr %23 = load i32, ptr %arrayidx41.epil, align 4, !tbaa !5 %cmp42.epil = icmp sgt i32 %22, %23 %sub49.epil = sub nsw i32 %22, %23 %mul.epil = mul nsw i32 %sub49.epil, %sub49.epil %sub62.epil = sub nsw i32 %23, %22 %mul68.epil = mul nsw i32 %sub62.epil, %sub62.epil %conv55.pn.in.epil = select i1 %cmp42.epil, i32 %mul.epil, i32 %mul68.epil %conv55.pn.epil = sitofp i32 %conv55.pn.in.epil to double %yu2.1.epil = fadd double %yu2.0266.unr, %conv55.pn.epil br label %for.end74 for.end74: ; preds = %for.body37.epil, %for.end74.loopexit.unr-lcssa, %for.cond12.preheader, %entry, %for.cond3.preheader, %for.cond34.preheader %man.0.lcssa308 = phi double [ %man.1.lcssa, %for.cond34.preheader ], [ 0.000000e+00, %for.cond3.preheader ], [ 0.000000e+00, %entry ], [ 0.000000e+00, %for.cond12.preheader ], [ %man.1.lcssa, %for.end74.loopexit.unr-lcssa ], [ %man.1.lcssa, %for.body37.epil ] %yu2.0.lcssa = phi double [ 0.000000e+00, %for.cond34.preheader ], [ 0.000000e+00, %for.cond3.preheader ], [ 0.000000e+00, %entry ], [ 0.000000e+00, %for.cond12.preheader ], [ %yu2.1.lcssa.ph, %for.end74.loopexit.unr-lcssa ], [ %yu2.1.epil, %for.body37.epil ] %call75 = call double @sqrt(double noundef %yu2.0.lcssa) #7 %24 = load i32, ptr %n, align 4, !tbaa !5 %cmp77269 = icmp sgt i32 %24, 0 call void @llvm.assume(i1 %cmp77269) %wide.trip.count293 = zext i32 %24 to i64 br label %for.body79 for.body79: ; preds = %for.end74, %for.inc127 %indvars.iv290 = phi i64 [ 0, %for.end74 ], [ %indvars.iv.next291, %for.inc127 ] %yu3.0270 = phi double [ undef, %for.end74 ], [ %yu3.1, %for.inc127 ] %arrayidx81 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv290 %25 = load i32, ptr %arrayidx81, align 4, !tbaa !5 %arrayidx83 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv290 %26 = load i32, ptr %arrayidx83, align 4, !tbaa !5 %cmp84 = icmp sgt i32 %25, %26 br i1 %cmp84, label %if.then86, label %if.else106 if.then86: ; preds = %for.body79 %sub91 = sub nsw i32 %25, %26 %mul97 = mul nsw i32 %sub91, %sub91 %mul103 = mul nsw i32 %mul97, %sub91 br label %for.inc127 if.else106: ; preds = %for.body79 %sub111 = sub nsw i32 %26, %25 %mul117 = mul nsw i32 %sub111, %sub111 %mul123 = mul nsw i32 %mul117, %sub111 br label %for.inc127 for.inc127: ; preds = %if.then86, %if.else106 %conv104.pn.in = phi i32 [ %mul103, %if.then86 ], [ %mul123, %if.else106 ] %conv104.pn = sitofp i32 %conv104.pn.in to double %yu3.1 = fadd double %yu3.0270, %conv104.pn %indvars.iv.next291 = add nuw nsw i64 %indvars.iv290, 1 %exitcond294.not = icmp eq i64 %indvars.iv.next291, %wide.trip.count293 br i1 %exitcond294.not, label %for.end129, label %for.body79, !llvm.loop !14 for.end129: ; preds = %for.inc127 %call130 = call double @pow(double noundef %yu3.1, double noundef 0x3FD5555555555555) #7 %27 = load i32, ptr %n, align 4, !tbaa !5 %cmp132273 = icmp sgt i32 %27, 0 br i1 %cmp132273, label %for.body134.preheader, label %for.end178 for.body134.preheader: ; preds = %for.end129 %wide.trip.count298 = zext i32 %27 to i64 br label %for.body134 for.body134: ; preds = %for.body134.preheader, %for.inc176 %indvars.iv295 = phi i64 [ 0, %for.body134.preheader ], [ %indvars.iv.next296, %for.inc176 ] %che.0274 = phi double [ 0.000000e+00, %for.body134.preheader ], [ %che.1, %for.inc176 ] %arrayidx136 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv295 %28 = load i32, ptr %arrayidx136, align 4, !tbaa !5 %arrayidx138 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv295 %29 = load i32, ptr %arrayidx138, align 4, !tbaa !5 %cmp139 = icmp sgt i32 %28, %29 br i1 %cmp139, label %if.then141, label %if.else158 if.then141: ; preds = %for.body134 %sub146 = sub nsw i32 %28, %29 %conv147 = sitofp i32 %sub146 to double %cmp148 = fcmp olt double %che.0274, %conv147 br i1 %cmp148, label %if.then150, label %for.inc176 if.then150: ; preds = %if.then141 br label %for.inc176 if.else158: ; preds = %for.body134 %sub163 = sub nsw i32 %29, %28 %conv164 = sitofp i32 %sub163 to double %cmp165 = fcmp olt double %che.0274, %conv164 br i1 %cmp165, label %if.then167, label %for.inc176 if.then167: ; preds = %if.else158 br label %for.inc176 for.inc176: ; preds = %if.then150, %if.then141, %if.then167, %if.else158 %che.1 = phi double [ %conv147, %if.then150 ], [ %che.0274, %if.then141 ], [ %conv164, %if.then167 ], [ %che.0274, %if.else158 ] %indvars.iv.next296 = add nuw nsw i64 %indvars.iv295, 1 %exitcond299.not = icmp eq i64 %indvars.iv.next296, %wide.trip.count298 br i1 %exitcond299.not, label %for.end178, label %for.body134, !llvm.loop !15 for.end178: ; preds = %for.inc176, %for.end129 %che.0.lcssa = phi double [ 0.000000e+00, %for.end129 ], [ %che.1, %for.inc176 ] %call179 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %man.0.lcssa308, double noundef %call75, double noundef %call130, double noundef %che.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) 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 nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #4 ; 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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #6 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } 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.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() { int i,j=0; char a[10000]; scanf("%s",a); for(i=0;i<4;i++) { if(a[i]=='2') j++; } printf("%d\n",j); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266159/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266159/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 [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 [10000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load <4 x i8>, ptr %a, align 16, !tbaa !5 %1 = icmp eq <4 x i8> %0, <i8 50, i8 50, i8 50, i8 50> %2 = bitcast <4 x i1> %1 to i4 %3 = call i4 @llvm.ctpop.i4(i4 %2), !range !8 %4 = zext i4 %3 to i32 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) call void @llvm.lifetime.end.p0(i64 10000, 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: 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 i4 @llvm.ctpop.i4(i4) #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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{i4 0, i4 5}
#include<stdio.h> int main (){ int n,a,b,c,d,e; scanf("%d",&n); a=n/1000; b=(n-(a*1000))/100; c=(n-(a*1000)-(b*100))/10; d=(n-(a*1000)-(b*100)-(c*10)); e=0; if(a==2){ e++; } if(b==2){ e++; } if(c==2){ e++; } if(d==2){ e++; } printf("%d\n",e); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266201/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266201/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 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 %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %.fr = freeze i32 %0 %1 = srem i32 %.fr, 1000 %.lhs.trunc = trunc i32 %1 to i16 %2 = srem i16 %.lhs.trunc, 100 %.lhs.trunc40 = trunc i16 %2 to i8 %3 = srem i8 %.lhs.trunc40, 10 %.off = add i32 %.fr, -2000 %cmp = icmp ult i32 %.off, 1000 %spec.select = zext i1 %cmp to i32 %.off36 = add nsw i32 %1, -200 %cmp13 = icmp ult i32 %.off36, 100 %inc15 = select i1 %cmp, i32 2, i32 1 %e.1 = select i1 %cmp13, i32 %inc15, i32 %spec.select %narrow = add nsw i16 %2, -20 %cmp17 = icmp ult i16 %narrow, 10 %inc19 = zext i1 %cmp17 to i32 %e.2 = add nuw nsw i32 %e.1, %inc19 %cmp21 = icmp eq i8 %3, 2 %inc23 = zext i1 %cmp21 to i32 %e.3 = add nuw nsw i32 %e.2, %inc23 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %e.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"}
#include <stdio.h> int main(){ char s[5]; int i,n; scanf("%s",s); for (n=i=0;i<4;i++) if (s[i]=='2') n++; printf("%d\n",n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266245/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266245/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 [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 [5 x i8], align 4 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load <4 x i8>, ptr %s, align 4, !tbaa !5 %1 = icmp eq <4 x i8> %0, <i8 50, i8 50, i8 50, i8 50> %2 = bitcast <4 x i1> %1 to i4 %3 = call i4 @llvm.ctpop.i4(i4 %2), !range !8 %4 = zext i4 %3 to i32 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) call void @llvm.lifetime.end.p0(i64 5, 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i4 @llvm.ctpop.i4(i4) #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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{i4 0, i4 5}
#include<stdio.h> int ab(int x){ if(x<0)return -x; return x; } int main(){ int H,W,D; scanf("%d%d%d",&H,&W,&D); int pos[H*W+1]; int d[H*W+1]; for(int i=0;i<H*W;i++){ int A; scanf("%d",&A); pos[A]=i; } for(int i=1;i<=H*W;i++)d[i]=0; for(int i=1;i<=H*W-D;i++){ int x1=pos[i]/W,y1=pos[i]%W; int x2=pos[i+D]/W,y2=pos[i+D]%W; d[i+D]=d[i]+ab(x1-x2)+ab(y1-y2); } int Q; scanf("%d",&Q); int L[Q],R[Q],ans[Q]; for(int i=0;i<Q;i++){ scanf("%d%d",&L[i],&R[i]); ans[i]=d[R[i]]-d[L[i]]; } for(int i=0;i<Q;i++)printf("%d\n",ans[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266289/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266289/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%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.3 = 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 @ab(i32 noundef %x) local_unnamed_addr #0 { entry: %retval.0 = tail call i32 @llvm.abs.i32(i32 %x, i1 true) ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 %D = alloca i32, align 4 %A = alloca i32, align 4 %Q = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W, ptr noundef nonnull %D) %0 = load i32, ptr %H, align 4, !tbaa !5 %1 = load i32, ptr %W, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %add = add nsw i32 %mul, 1 %2 = zext i32 %add to i64 %3 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %2, align 16 %4 = load i32, ptr %H, align 4, !tbaa !5 %5 = load i32, ptr %W, align 4, !tbaa !5 %mul1 = mul nsw i32 %5, %4 %add2 = add nsw i32 %mul1, 1 %6 = zext i32 %add2 to i64 %vla3 = alloca i32, i64 %6, align 16 %cmp109 = icmp sgt i32 %mul1, 0 br i1 %cmp109, label %for.body, label %for.cond18.preheader for.cond7.preheader: ; preds = %for.body %cmp9.not112 = icmp slt i32 %mul4, 1 br i1 %cmp9.not112, label %for.cond18.preheader, label %for.body11.preheader for.body11.preheader: ; preds = %for.cond7.preheader %scevgep = getelementptr i8, ptr %vla3, i64 4 %7 = zext i32 %mul4 to i64 %8 = shl nuw nsw i64 %7, 2 call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %8, i1 false), !tbaa !5 br label %for.cond18.preheader for.body: ; preds = %entry, %for.body %i.0110 = phi i32 [ %inc, %for.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #7 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A) %9 = load i32, ptr %A, align 4, !tbaa !5 %idxprom = sext i32 %9 to i64 %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %idxprom store i32 %i.0110, ptr %arrayidx, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #7 %inc = add nuw nsw i32 %i.0110, 1 %10 = load i32, ptr %H, align 4, !tbaa !5 %11 = load i32, ptr %W, align 4, !tbaa !5 %mul4 = mul nsw i32 %11, %10 %cmp = icmp slt i32 %inc, %mul4 br i1 %cmp, label %for.body, label %for.cond7.preheader, !llvm.loop !9 for.cond18.preheader: ; preds = %entry, %for.body11.preheader, %for.cond7.preheader %mul4.lcssa135 = phi i32 [ %mul4, %for.body11.preheader ], [ %mul4, %for.cond7.preheader ], [ %mul1, %entry ] %.lcssa134 = phi i32 [ %11, %for.body11.preheader ], [ %11, %for.cond7.preheader ], [ %5, %entry ] %12 = load i32, ptr %D, align 4, !tbaa !5 %cmp20.not114.not = icmp sgt i32 %mul4.lcssa135, %12 br i1 %cmp20.not114.not, label %for.body22.preheader, label %for.cond.cleanup21 for.body22.preheader: ; preds = %for.cond18.preheader %13 = sext i32 %12 to i64 %14 = add i32 %mul4.lcssa135, 1 %15 = sub i32 %14, %12 %wide.trip.count = zext i32 %15 to i64 br label %for.body22 for.cond.cleanup21: ; preds = %for.body22, %for.cond18.preheader call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Q) #7 %call49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %Q) %16 = load i32, ptr %Q, align 4, !tbaa !5 %17 = zext i32 %16 to i64 %vla50 = alloca i32, i64 %17, align 16 %vla51 = alloca i32, i64 %17, align 16 %vla52 = alloca i32, i64 %17, align 16 %cmp55116 = icmp sgt i32 %16, 0 br i1 %cmp55116, label %for.body57, label %for.cond.cleanup80 for.body22: ; preds = %for.body22.preheader, %for.body22 %indvars.iv = phi i64 [ 1, %for.body22.preheader ], [ %indvars.iv.next, %for.body22 ] %arrayidx24 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %18 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %div = sdiv i32 %18, %.lcssa134 %rem = srem i32 %18, %.lcssa134 %19 = add nsw i64 %indvars.iv, %13 %arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %19 %20 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %div30 = sdiv i32 %20, %.lcssa134 %rem34 = srem i32 %20, %.lcssa134 %arrayidx36 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv %21 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %sub37 = sub nsw i32 %div, %div30 %retval.0.i = call i32 @llvm.abs.i32(i32 %sub37, i1 true) %add39 = add nsw i32 %21, %retval.0.i %sub40 = sub nsw i32 %rem, %rem34 %retval.0.i107 = call i32 @llvm.abs.i32(i32 %sub40, i1 true) %add42 = add nsw i32 %add39, %retval.0.i107 %arrayidx45 = getelementptr inbounds i32, ptr %vla3, i64 %19 store i32 %add42, ptr %arrayidx45, 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.cond.cleanup21, label %for.body22, !llvm.loop !11 for.cond78.preheader: ; preds = %for.body57 %22 = icmp sgt i32 %27, 0 br i1 %22, label %for.body81, label %for.cond.cleanup80 for.body57: ; preds = %for.cond.cleanup21, %for.body57 %indvars.iv125 = phi i64 [ %indvars.iv.next126, %for.body57 ], [ 0, %for.cond.cleanup21 ] %arrayidx59 = getelementptr inbounds i32, ptr %vla50, i64 %indvars.iv125 %arrayidx61 = getelementptr inbounds i32, ptr %vla51, i64 %indvars.iv125 %call62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx59, ptr noundef nonnull %arrayidx61) %23 = load i32, ptr %arrayidx61, align 4, !tbaa !5 %idxprom65 = sext i32 %23 to i64 %arrayidx66 = getelementptr inbounds i32, ptr %vla3, i64 %idxprom65 %24 = load i32, ptr %arrayidx66, align 4, !tbaa !5 %25 = load i32, ptr %arrayidx59, align 4, !tbaa !5 %idxprom69 = sext i32 %25 to i64 %arrayidx70 = getelementptr inbounds i32, ptr %vla3, i64 %idxprom69 %26 = load i32, ptr %arrayidx70, align 4, !tbaa !5 %sub71 = sub nsw i32 %24, %26 %arrayidx73 = getelementptr inbounds i32, ptr %vla52, i64 %indvars.iv125 store i32 %sub71, ptr %arrayidx73, align 4, !tbaa !5 %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1 %27 = load i32, ptr %Q, align 4, !tbaa !5 %28 = sext i32 %27 to i64 %cmp55 = icmp slt i64 %indvars.iv.next126, %28 br i1 %cmp55, label %for.body57, label %for.cond78.preheader, !llvm.loop !12 for.cond.cleanup80: ; preds = %for.body81, %for.cond.cleanup21, %for.cond78.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Q) #7 call void @llvm.stackrestore.p0(ptr %3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #7 ret i32 0 for.body81: ; preds = %for.cond78.preheader, %for.body81 %indvars.iv128 = phi i64 [ %indvars.iv.next129, %for.body81 ], [ 0, %for.cond78.preheader ] %arrayidx83 = getelementptr inbounds i32, ptr %vla52, i64 %indvars.iv128 %29 = load i32, ptr %arrayidx83, align 4, !tbaa !5 %call84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %29) %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1 %30 = load i32, ptr %Q, align 4, !tbaa !5 %31 = sext i32 %30 to i64 %cmp79 = icmp slt i64 %indvars.iv.next129, %31 br i1 %cmp79, label %for.body81, label %for.cond.cleanup80, !llvm.loop !13 } ; 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 i32 @llvm.abs.i32(i32, i1 immarg) #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 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 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> #include<limits.h> #define rep(i,begin,end) for(int i=begin; i<end; i++) #define revrep(i,begin,end) for(int i=begin; i>end; i--) #define lld long long int int main(){ int n; scanf("%d", &n); int c[n], s[n], f[n]; rep(i, 1, n){ scanf("%d %d %d", &c[i], &s[i], &f[i]); } rep(i, 1, n){ int ans = s[i] + c[i]; rep(j, i+1, n){ int buf = s[j]; while(buf < ans){ buf += f[j]; } ans += (buf - ans) + c[j]; } printf("%d\n", ans); } printf("0"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266346/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266346/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"%d %d %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 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 %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 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %vla2 = alloca i32, i64 %4, align 16 %cmp57 = icmp sgt i32 %3, 1 br i1 %cmp57, label %for.body, label %for.cond.cleanup11 for.cond9.preheader: ; preds = %for.body %cmp1065 = icmp sgt i32 %5, 1 br i1 %cmp1065, label %for.body12, label %for.cond.cleanup11 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 %arrayidx4 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv %arrayidx6 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx6) %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.cond9.preheader, !llvm.loop !9 for.cond.cleanup11: ; preds = %for.cond.cleanup20, %entry, %for.cond9.preheader %putchar = call i32 @putchar(i32 48) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body12: ; preds = %for.cond9.preheader, %for.cond.cleanup20 %indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.cond.cleanup20 ], [ 1, %for.cond9.preheader ] %indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.cond.cleanup20 ], [ 2, %for.cond9.preheader ] %7 = phi i32 [ %11, %for.cond.cleanup20 ], [ %5, %for.cond9.preheader ] %arrayidx14 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv73 %8 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv73 %9 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %add = add nsw i32 %9, %8 %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %10 = sext i32 %7 to i64 %cmp1961 = icmp slt i64 %indvars.iv.next74, %10 br i1 %cmp1961, label %for.body21.preheader, label %for.cond.cleanup20 for.body21.preheader: ; preds = %for.body12 %wide.trip.count = zext i32 %7 to i64 br label %for.body21 for.cond.cleanup20: ; preds = %while.end, %for.body12 %ans.0.lcssa = phi i32 [ %add, %for.body12 ], [ %add31, %while.end ] %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp10 = icmp slt i64 %indvars.iv.next74, %12 %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1 br i1 %cmp10, label %for.body12, label %for.cond.cleanup11, !llvm.loop !11 for.body21: ; preds = %for.body21.preheader, %while.end %indvars.iv70 = phi i64 [ %indvars.iv68, %for.body21.preheader ], [ %indvars.iv.next71, %while.end ] %ans.062 = phi i32 [ %add, %for.body21.preheader ], [ %add31, %while.end ] %arrayidx23 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv70 %13 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %cmp2459 = icmp slt i32 %13, %ans.062 br i1 %cmp2459, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %for.body21 %arrayidx26 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv70 %14 = load i32, ptr %arrayidx26, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %buf.060 = phi i32 [ %13, %while.body.lr.ph ], [ %add27, %while.body ] %add27 = add nsw i32 %14, %buf.060 %cmp24 = icmp slt i32 %add27, %ans.062 br i1 %cmp24, label %while.body, label %while.end, !llvm.loop !12 while.end: ; preds = %while.body, %for.body21 %buf.0.lcssa = phi i32 [ %13, %for.body21 ], [ %add27, %while.body ] %arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv70 %15 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %add31 = add i32 %15, %buf.0.lcssa %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 %for.cond.cleanup20, label %for.body21, !llvm.loop !13 } ; 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: 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: 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 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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main(void) { int t,i; scanf("%d",&t); for(i=0;i<t;i++) { int n,m,j; scanf("%d %d",&n,&m); int array[n],sum=0; for(j=0;j<n;j++) { scanf("%d",&array[j]); sum=sum+array[j]; } if(sum==m) { printf("YES\n"); } else { printf("NO\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26639/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26639/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 = 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: %t = alloca i32, align 4 %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %0, 0 br i1 %cmp23, label %for.body, label %for.end13 for.body: ; preds = %entry, %for.end %i.024 = phi i32 [ %inc12, %for.end ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %m) %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 %cmp320 = icmp sgt i32 %4, 0 br i1 %cmp320, label %for.body4, label %for.end for.body4: ; preds = %for.body, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body ] %sum.022 = phi i32 [ %add, %for.body4 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %5 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %5, %sum.022 %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 %cmp3 = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body4, %for.body %sum.0.lcssa = phi i32 [ 0, %for.body ], [ %add, %for.body4 ] %8 = load i32, ptr %m, align 4, !tbaa !5 %cmp8 = icmp eq i32 %sum.0.lcssa, %8 %str.4.str = select i1 %cmp8, ptr @str.4, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) call void @llvm.stackrestore.p0(ptr %3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 %inc12 = add nuw nsw i32 %i.024, 1 %9 = load i32, ptr %t, align 4, !tbaa !5 %cmp = icmp slt i32 %inc12, %9 br i1 %cmp, label %for.body, label %for.end13, !llvm.loop !11 for.end13: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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 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"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void) { int h,w,i,j,masu[50+1][50+1],m[50+1][50+1]; char c[50+1][50+1]; scanf("%d %d",&h,&w); for(i=0;i<h;i++) { scanf("%s",c[i]); } for(i=0;i<h;i++) { for(j=0;j<w;j++) { //scanf(" %c",&c); masu[i][j]=c[i][j]-'0'; m[i][j]=1000; } } m[0][0]=0; for(i=0;i<h;i++) { for(j=0;j<w;j++) { if(m[i][j]+masu[i][j+1]<m[i][j+1]) { m[i][j+1]=m[i][j]+masu[i][j+1]; // printf("m=[%d][%d]=%d\n",i,j+1,m[i][j+1]); } if(m[i][j]+masu[i+1][j]<m[i+1][j]) { m[i+1][j]=m[i][j]+masu[i+1][j]; // printf("m=[%d][%d]=%d\n",i+1,j,m[i+1][j]); } } } printf("%d\n",m[h-1][w-1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266432/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266432/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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 %masu = alloca [51 x [51 x i32]], align 16 %m = alloca [51 x [51 x i32]], align 16 %c = alloca [51 x [51 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 10404, ptr nonnull %masu) #4 call void @llvm.lifetime.start.p0(i64 10404, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 2601, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp154 = icmp sgt i32 %0, 0 br i1 %cmp154, label %for.body, label %for.cond2.preheader.thread for.cond2.preheader.thread: ; preds = %entry %.pre186.pre189 = load i32, ptr %w, align 4, !tbaa !5 br label %for.end25.thread for.cond2.preheader: ; preds = %for.body %cmp3158 = icmp sgt i32 %13, 0 %.pre186.pre = load i32, ptr %w, align 4, !tbaa !5 br i1 %cmp3158, label %for.cond5.preheader.lr.ph, label %for.end25.thread for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader %cmp6156 = icmp sgt i32 %.pre186.pre, 0 br i1 %cmp6156, label %for.cond5.preheader.us.preheader, label %for.cond32.preheader.lr.ph.thread for.cond32.preheader.lr.ph.thread: ; preds = %for.cond5.preheader.lr.ph store i32 0, ptr %m, align 16, !tbaa !5 br label %for.end106 for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph %wide.trip.count174 = zext i32 %13 to i64 %wide.trip.count = zext i32 %.pre186.pre to i64 %min.iters.check = icmp ult i32 %.pre186.pre, 8 %n.vec = and i64 %wide.trip.count, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br label %for.cond5.preheader.us for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc23_crit_edge.us %indvars.iv171 = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvars.iv.next172, %for.cond5.for.inc23_crit_edge.us ] br i1 %min.iters.check, label %for.body7.us.preheader, label %vector.body vector.body: ; preds = %for.cond5.preheader.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond5.preheader.us ] %1 = getelementptr inbounds [51 x [51 x i8]], ptr %c, i64 0, i64 %indvars.iv171, i64 %index %wide.load = load <4 x i8>, ptr %1, align 1, !tbaa !9 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load209 = load <4 x i8>, ptr %2, align 1, !tbaa !9 %3 = sext <4 x i8> %wide.load to <4 x i32> %4 = sext <4 x i8> %wide.load209 to <4 x i32> %5 = add nsw <4 x i32> %3, <i32 -48, i32 -48, i32 -48, i32 -48> %6 = add nsw <4 x i32> %4, <i32 -48, i32 -48, i32 -48, i32 -48> %7 = getelementptr inbounds [51 x [51 x i32]], ptr %masu, i64 0, i64 %indvars.iv171, i64 %index store <4 x i32> %5, ptr %7, align 4, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 store <4 x i32> %6, ptr %8, align 4, !tbaa !5 %9 = getelementptr inbounds [51 x [51 x i32]], ptr %m, i64 0, i64 %indvars.iv171, i64 %index store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %9, align 4, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %10, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond5.for.inc23_crit_edge.us, label %for.body7.us.preheader for.body7.us.preheader: ; preds = %for.cond5.preheader.us, %middle.block %indvars.iv168.ph = phi i64 [ 0, %for.cond5.preheader.us ], [ %n.vec, %middle.block ] br label %for.body7.us for.body7.us: ; preds = %for.body7.us.preheader, %for.body7.us %indvars.iv168 = phi i64 [ %indvars.iv.next169, %for.body7.us ], [ %indvars.iv168.ph, %for.body7.us.preheader ] %arrayidx11.us = getelementptr inbounds [51 x [51 x i8]], ptr %c, i64 0, i64 %indvars.iv171, i64 %indvars.iv168 %12 = load i8, ptr %arrayidx11.us, align 1, !tbaa !9 %conv.us = sext i8 %12 to i32 %sub.us = add nsw i32 %conv.us, -48 %arrayidx15.us = getelementptr inbounds [51 x [51 x i32]], ptr %masu, i64 0, i64 %indvars.iv171, i64 %indvars.iv168 store i32 %sub.us, ptr %arrayidx15.us, align 4, !tbaa !5 %arrayidx19.us = getelementptr inbounds [51 x [51 x i32]], ptr %m, i64 0, i64 %indvars.iv171, i64 %indvars.iv168 store i32 1000, ptr %arrayidx19.us, align 4, !tbaa !5 %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1 %exitcond.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count br i1 %exitcond.not, label %for.cond5.for.inc23_crit_edge.us, label %for.body7.us, !llvm.loop !14 for.cond5.for.inc23_crit_edge.us: ; preds = %for.body7.us, %middle.block %indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1 %exitcond175.not = icmp eq i64 %indvars.iv.next172, %wide.trip.count174 br i1 %exitcond175.not, label %for.end25, label %for.cond5.preheader.us, !llvm.loop !15 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [51 x [51 x i8]], ptr %c, 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 %13 = load i32, ptr %h, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp = icmp slt i64 %indvars.iv.next, %14 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !16 for.end25.thread: ; preds = %for.cond2.preheader.thread, %for.cond2.preheader %.pre186.pre192.ph = phi i32 [ %.pre186.pre, %for.cond2.preheader ], [ %.pre186.pre189, %for.cond2.preheader.thread ] %.lcssa190.ph = phi i32 [ %13, %for.cond2.preheader ], [ %0, %for.cond2.preheader.thread ] store i32 0, ptr %m, align 16, !tbaa !5 br label %for.end106 for.end25: ; preds = %for.cond5.for.inc23_crit_edge.us store i32 0, ptr %m, align 16, !tbaa !5 %cmp33160 = icmp sgt i32 %.pre186.pre, 0 %or.cond = select i1 %cmp3158, i1 %cmp33160, i1 false br i1 %or.cond, label %for.cond32.preheader.us.preheader, label %for.end106 for.cond32.preheader.us.preheader: ; preds = %for.end25 %wide.trip.count184 = zext i32 %13 to i64 %wide.trip.count179 = zext i32 %.pre186.pre to i64 br label %for.cond32.preheader.us for.cond32.preheader.us: ; preds = %for.cond32.preheader.us.preheader, %for.cond32.for.inc104_crit_edge.us %indvars.iv181 = phi i64 [ 0, %for.cond32.preheader.us.preheader ], [ %indvars.iv.next182, %for.cond32.for.inc104_crit_edge.us ] %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1 %arrayidx39.us.phi.trans.insert = getelementptr inbounds [51 x [51 x i32]], ptr %m, i64 0, i64 %indvars.iv181, i64 0 %.pre = load i32, ptr %arrayidx39.us.phi.trans.insert, align 4, !tbaa !5 br label %for.body35.us for.body35.us: ; preds = %for.cond32.preheader.us, %for.body35.us %15 = phi i32 [ %.pre, %for.cond32.preheader.us ], [ %spec.store.select.us, %for.body35.us ] %indvars.iv176 = phi i64 [ 0, %for.cond32.preheader.us ], [ %indvars.iv.next177, %for.body35.us ] %indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1 %arrayidx43.us = getelementptr inbounds [51 x [51 x i32]], ptr %masu, i64 0, i64 %indvars.iv181, i64 %indvars.iv.next177 %16 = load i32, ptr %arrayidx43.us, align 4, !tbaa !5 %add44.us = add nsw i32 %16, %15 %arrayidx49.us = getelementptr inbounds [51 x [51 x i32]], ptr %m, i64 0, i64 %indvars.iv181, i64 %indvars.iv.next177 %17 = load i32, ptr %arrayidx49.us, align 4, !tbaa !5 %spec.store.select.us = call i32 @llvm.smin.i32(i32 %add44.us, i32 %17) store i32 %spec.store.select.us, ptr %arrayidx49.us, align 4 %arrayidx75.us = getelementptr inbounds [51 x [51 x i32]], ptr %masu, i64 0, i64 %indvars.iv.next182, i64 %indvars.iv176 %18 = load i32, ptr %arrayidx75.us, align 4, !tbaa !5 %add76.us = add nsw i32 %18, %15 %arrayidx81.us = getelementptr inbounds [51 x [51 x i32]], ptr %m, i64 0, i64 %indvars.iv.next182, i64 %indvars.iv176 %19 = load i32, ptr %arrayidx81.us, align 4, !tbaa !5 %spec.store.select153.us = call i32 @llvm.smin.i32(i32 %add76.us, i32 %19) store i32 %spec.store.select153.us, ptr %arrayidx81.us, align 4 %exitcond180.not = icmp eq i64 %indvars.iv.next177, %wide.trip.count179 br i1 %exitcond180.not, label %for.cond32.for.inc104_crit_edge.us, label %for.body35.us, !llvm.loop !17 for.cond32.for.inc104_crit_edge.us: ; preds = %for.body35.us %exitcond185.not = icmp eq i64 %indvars.iv.next182, %wide.trip.count184 br i1 %exitcond185.not, label %for.end106, label %for.cond32.preheader.us, !llvm.loop !18 for.end106: ; preds = %for.cond32.for.inc104_crit_edge.us, %for.cond32.preheader.lr.ph.thread, %for.end25.thread, %for.end25 %.lcssa190197 = phi i32 [ %.lcssa190.ph, %for.end25.thread ], [ %13, %for.end25 ], [ %13, %for.cond32.preheader.lr.ph.thread ], [ %13, %for.cond32.for.inc104_crit_edge.us ] %.pre186.pre192196 = phi i32 [ %.pre186.pre192.ph, %for.end25.thread ], [ %.pre186.pre, %for.end25 ], [ %.pre186.pre, %for.cond32.preheader.lr.ph.thread ], [ %.pre186.pre, %for.cond32.for.inc104_crit_edge.us ] %sub107 = add nsw i32 %.lcssa190197, -1 %idxprom108 = sext i32 %sub107 to i64 %sub110 = add nsw i32 %.pre186.pre192196, -1 %idxprom111 = sext i32 %sub110 to i64 %arrayidx112 = getelementptr inbounds [51 x [51 x i32]], ptr %m, i64 0, i64 %idxprom108, i64 %idxprom111 %20 = load i32, ptr %arrayidx112, align 4, !tbaa !5 %call113 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) call void @llvm.lifetime.end.p0(i64 2601, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 10404, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 10404, ptr nonnull %masu) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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: 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 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 = !{!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} !16 = distinct !{!16, !11} !17 = distinct !{!17, !11} !18 = distinct !{!18, !11}
#include <stdio.h> int main(void){ int c,r; while(scanf("%d %d",&c,&r) != EOF){ if((c==0)&&(r==0)){ return 0; } if((c*r)%2){ printf("no\n"); } else{ printf("yes\n"); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266483/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266483/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 = 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: %c = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c, ptr noundef nonnull %r) %cmp.not10 = icmp eq i32 %call9, -1 br i1 %cmp.not10, label %cleanup, label %while.body while.body: ; preds = %entry, %if.end %0 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp eq i32 %0, 0 %1 = load i32, ptr %r, align 4 %cmp2 = icmp eq i32 %1, 0 %or.cond = select i1 %cmp1, i1 %cmp2, i1 false br i1 %or.cond, label %cleanup, label %if.end if.end: ; preds = %while.body %mul = mul nsw i32 %1, %0 %2 = and i32 %mul, 1 %tobool.not = icmp eq i32 %2, 0 %str.str.3 = select i1 %tobool.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c, ptr noundef nonnull %r) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !9 cleanup: ; preds = %while.body, %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 4, 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 @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,i,j; long long a[2001],b[2001][2]={0},ans=0,k; scanf("%d%lld",&n,&k); for(i=0;i<n;i++)scanf("%lld",&a[i]); for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(a[i]>a[j]){ b[i][0]++; if(i<j)b[i][1]++; } } } for(i=0;i<n;i++)ans=(b[i][0]*((k*(k-1)/2)%1000000007)+b[i][1]*k+ans)%1000000007; printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266533/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266533/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%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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [2001 x i64], align 16 %b = alloca [2001 x [2 x i64]], align 16 %k = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 16008, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 32016, ptr nonnull %b) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32016) %b, i8 0, i64 32016, i1 false) call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp63 = icmp sgt i32 %0, 0 br i1 %cmp63, label %for.body, label %for.end45 for.cond2.preheader: ; preds = %for.body %cmp367 = icmp sgt i32 %5, 0 br i1 %cmp367, label %for.cond5.preheader.us.preheader, label %for.end45 for.cond5.preheader.us.preheader: ; preds = %for.cond2.preheader %wide.trip.count81 = zext i32 %5 to i64 br label %for.cond5.preheader.us for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc27_crit_edge.us %indvars.iv78 = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvars.iv.next79, %for.cond5.for.inc27_crit_edge.us ] %arrayidx9.us = getelementptr inbounds [2001 x i64], ptr %a, i64 0, i64 %indvars.iv78 %1 = load i64, ptr %arrayidx9.us, align 8, !tbaa !9 %arrayidx14.us = getelementptr inbounds [2001 x [2 x i64]], ptr %b, i64 0, i64 %indvars.iv78 %arrayidx21.us = getelementptr inbounds [2001 x [2 x i64]], ptr %b, i64 0, i64 %indvars.iv78, i64 1 br label %for.body7.us for.body7.us: ; preds = %for.cond5.preheader.us, %for.inc24.us %indvars.iv75 = phi i64 [ 0, %for.cond5.preheader.us ], [ %indvars.iv.next76, %for.inc24.us ] %arrayidx11.us = getelementptr inbounds [2001 x i64], ptr %a, i64 0, i64 %indvars.iv75 %2 = load i64, ptr %arrayidx11.us, align 8, !tbaa !9 %cmp12.us = icmp sgt i64 %1, %2 br i1 %cmp12.us, label %if.then.us, label %for.inc24.us if.then.us: ; preds = %for.body7.us %3 = load i64, ptr %arrayidx14.us, align 16, !tbaa !9 %inc16.us = add nsw i64 %3, 1 store i64 %inc16.us, ptr %arrayidx14.us, align 16, !tbaa !9 %cmp17.us = icmp ult i64 %indvars.iv78, %indvars.iv75 br i1 %cmp17.us, label %if.then18.us, label %for.inc24.us if.then18.us: ; preds = %if.then.us %4 = load i64, ptr %arrayidx21.us, align 8, !tbaa !9 %inc22.us = add nsw i64 %4, 1 store i64 %inc22.us, ptr %arrayidx21.us, align 8, !tbaa !9 br label %for.inc24.us for.inc24.us: ; preds = %if.then18.us, %if.then.us, %for.body7.us %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count81 br i1 %exitcond.not, label %for.cond5.for.inc27_crit_edge.us, label %for.body7.us, !llvm.loop !11 for.cond5.for.inc27_crit_edge.us: ; preds = %for.inc24.us %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81 br i1 %exitcond82.not, label %for.cond30.preheader, label %for.cond5.preheader.us, !llvm.loop !13 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [2001 x i64], 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 %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.cond2.preheader, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond5.for.inc27_crit_edge.us br i1 %cmp367, label %for.body32.lr.ph, label %for.end45 for.body32.lr.ph: ; preds = %for.cond30.preheader %7 = load i64, ptr %k, align 8, !tbaa !9 %sub = add nsw i64 %7, -1 %mul = mul nsw i64 %sub, %7 %div = sdiv i64 %mul, 2 %rem = srem i64 %div, 1000000007 %wide.trip.count86 = zext i32 %5 to i64 %xtraiter = and i64 %wide.trip.count86, 1 %8 = icmp eq i32 %5, 1 br i1 %8, label %for.end45.loopexit.unr-lcssa, label %for.body32.lr.ph.new for.body32.lr.ph.new: ; preds = %for.body32.lr.ph %unroll_iter = and i64 %wide.trip.count86, 4294967294 br label %for.body32 for.body32: ; preds = %for.body32, %for.body32.lr.ph.new %indvars.iv83 = phi i64 [ 0, %for.body32.lr.ph.new ], [ %indvars.iv.next84.1, %for.body32 ] %ans.071 = phi i64 [ 0, %for.body32.lr.ph.new ], [ %rem42.1, %for.body32 ] %niter = phi i64 [ 0, %for.body32.lr.ph.new ], [ %niter.next.1, %for.body32 ] %arrayidx34 = getelementptr inbounds [2001 x [2 x i64]], ptr %b, i64 0, i64 %indvars.iv83 %9 = load i64, ptr %arrayidx34, align 16, !tbaa !9 %mul36 = mul nsw i64 %rem, %9 %arrayidx39 = getelementptr inbounds [2001 x [2 x i64]], ptr %b, i64 0, i64 %indvars.iv83, i64 1 %10 = load i64, ptr %arrayidx39, align 8, !tbaa !9 %mul40 = mul nsw i64 %10, %7 %add = add i64 %mul40, %ans.071 %add41 = add i64 %add, %mul36 %rem42 = srem i64 %add41, 1000000007 %indvars.iv.next84 = or i64 %indvars.iv83, 1 %arrayidx34.1 = getelementptr inbounds [2001 x [2 x i64]], ptr %b, i64 0, i64 %indvars.iv.next84 %11 = load i64, ptr %arrayidx34.1, align 16, !tbaa !9 %mul36.1 = mul nsw i64 %rem, %11 %arrayidx39.1 = getelementptr inbounds [2001 x [2 x i64]], ptr %b, i64 0, i64 %indvars.iv.next84, i64 1 %12 = load i64, ptr %arrayidx39.1, align 8, !tbaa !9 %mul40.1 = mul nsw i64 %12, %7 %add.1 = add i64 %mul40.1, %rem42 %add41.1 = add i64 %add.1, %mul36.1 %rem42.1 = srem i64 %add41.1, 1000000007 %indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 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.end45.loopexit.unr-lcssa, label %for.body32, !llvm.loop !15 for.end45.loopexit.unr-lcssa: ; preds = %for.body32, %for.body32.lr.ph %rem42.lcssa.ph = phi i64 [ undef, %for.body32.lr.ph ], [ %rem42.1, %for.body32 ] %indvars.iv83.unr = phi i64 [ 0, %for.body32.lr.ph ], [ %indvars.iv.next84.1, %for.body32 ] %ans.071.unr = phi i64 [ 0, %for.body32.lr.ph ], [ %rem42.1, %for.body32 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end45, label %for.body32.epil for.body32.epil: ; preds = %for.end45.loopexit.unr-lcssa %arrayidx34.epil = getelementptr inbounds [2001 x [2 x i64]], ptr %b, i64 0, i64 %indvars.iv83.unr %13 = load i64, ptr %arrayidx34.epil, align 16, !tbaa !9 %mul36.epil = mul nsw i64 %rem, %13 %arrayidx39.epil = getelementptr inbounds [2001 x [2 x i64]], ptr %b, i64 0, i64 %indvars.iv83.unr, i64 1 %14 = load i64, ptr %arrayidx39.epil, align 8, !tbaa !9 %mul40.epil = mul nsw i64 %14, %7 %add.epil = add i64 %mul40.epil, %ans.071.unr %add41.epil = add i64 %add.epil, %mul36.epil %rem42.epil = srem i64 %add41.epil, 1000000007 br label %for.end45 for.end45: ; preds = %for.body32.epil, %for.end45.loopexit.unr-lcssa, %entry, %for.cond2.preheader, %for.cond30.preheader %ans.0.lcssa = phi i64 [ 0, %for.cond30.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %rem42.lcssa.ph, %for.end45.loopexit.unr-lcssa ], [ %rem42.epil, %for.body32.epil ] %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 32016, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 16008, 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 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 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12} !15 = distinct !{!15, !12}
#include<stdio.h> int main(){ int a,b,ans; char m; while(1){ scanf("%d %c %d", &a, &m, &b); if(m == '+'){ ans = a + b; }else if(m == '-'){ ans = a - b; }else if(m == '*'){ ans = a * b; }else if(m == '/'){ ans = a / b; }else if(m == '?'){ return 0; } printf("%d\n",ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266599/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266599/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 %m = 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 %m) #3 br label %while.cond while.cond: ; preds = %if.end24, %entry %ans.0 = phi i32 [ undef, %entry ], [ %ans.1, %if.end24 ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %m, ptr noundef nonnull %b) %0 = load i8, ptr %m, align 1, !tbaa !5 switch i8 %0, label %if.end24 [ i8 43, label %if.then i8 45, label %if.then5 i8 42, label %if.then10 i8 47, label %if.then15 i8 63, label %if.then20 ] 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.end24 if.then5: ; 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.then10: ; 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.then15: ; 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.then20: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %m) #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 if.end24: ; preds = %while.cond, %if.then5, %if.then15, %if.then10, %if.then %ans.1 = phi i32 [ %add, %if.then ], [ %sub, %if.then5 ], [ %mul, %if.then10 ], [ %div, %if.then15 ], [ %ans.0, %while.cond ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1) br label %while.cond } ; 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 x; while(1){ scanf("%d %c %d",&a,&x,&b); if (x=='+'){ printf("%d\n",a+b); }else if (x=='-'){ printf("%d\n",a-b); }else if (x=='*'){ printf("%d\n",a*b); }else if (x=='/'){ printf("%d\n",a/b); }else if (x=='?'){ break; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266663/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266663/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 %x = 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 %x) #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 %x, ptr noundef nonnull %b) %0 = load i8, ptr %x, align 1, !tbaa !5 switch i8 %0, label %while.cond.backedge [ i8 43, label %if.then i8 45, label %if.then6 i8 42, label %if.then12 i8 47, label %if.then18 i8 63, label %while.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 br label %if.end28.sink.split 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.end28.sink.split 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.end28.sink.split 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.end28.sink.split if.end28.sink.split: ; preds = %if.then, %if.then12, %if.then18, %if.then6 %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.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 %x) #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; scanf("%d %c %d",&a ,&op ,&b); while(op != '?'){ 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); scanf("%d %c %d",&a ,&op ,&b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266706/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266706/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 %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 %if.end [ i8 63, label %while.end i8 43, label %if.then ] 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 %call5 = 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 = %while.cond, %if.then %3 = phi i8 [ %0, %while.cond ], [ %.pr, %if.then ] %cmp7 = icmp eq i8 %3, 45 br i1 %cmp7, label %if.then9, label %if.end11 if.then9: ; 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 %call10 = 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.end11 if.end11: ; preds = %if.then9, %if.end %6 = phi i8 [ %.pre, %if.then9 ], [ %3, %if.end ] %cmp13 = icmp eq i8 %6, 42 br i1 %cmp13, label %if.then15, label %if.end17 if.then15: ; preds = %if.end11 %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %8, %7 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) %.pr25 = load i8, ptr %op, align 1, !tbaa !5 br label %if.end17 if.end17: ; preds = %if.then15, %if.end11 %9 = phi i8 [ %.pr25, %if.then15 ], [ %6, %if.end11 ] %cmp19 = icmp eq i8 %9, 47 br i1 %cmp19, label %if.then21, label %while.cond.backedge if.then21: ; preds = %if.end17 %10 = load i32, ptr %a, align 4, !tbaa !8 %11 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %10, %11 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) br label %while.cond.backedge while.cond.backedge: ; preds = %if.then21, %if.end17 br label %while.cond, !llvm.loop !10 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} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int n; scanf("%d", &n); int i,o, h = 0, s[n], ss=0; for(i=0;i<n;i++){ scanf("%d", &(s[i])); ss = ss + s[i]; } if(ss%2){ for(i=0;i<n;i++){ if(s[i]%2){ h++; } } }else{ for(i=0;i<n;i++){ if(!(s[i]%2)){ h++; } } } printf("%d\n", h); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26675/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26675/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 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 %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 %cmp45 = icmp sgt i32 %3, 0 br i1 %cmp45, label %for.body, label %if.end29 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %ss.047 = 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, ptr noundef nonnull %arrayidx) %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %4, %ss.047 %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 %7 = and i32 %add, 1 %8 = icmp eq i32 %7, 0 %cmp1753 = icmp sgt i32 %5, 0 br i1 %8, label %for.cond16.preheader, label %for.cond4.preheader for.cond4.preheader: ; preds = %for.end br i1 %cmp1753, label %for.body6.preheader, label %if.end29 for.body6.preheader: ; preds = %for.cond4.preheader %wide.trip.count = zext i32 %5 to i64 %min.iters.check = icmp ult i32 %5, 8 br i1 %min.iters.check, label %for.body6.preheader96, label %vector.ph vector.ph: ; preds = %for.body6.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 ], [ %13, %vector.body ] %vec.phi75 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ] %9 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 %wide.load76 = load <4 x i32>, ptr %10, align 16, !tbaa !5 %11 = and <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1> %12 = and <4 x i32> %wide.load76, <i32 1, i32 1, i32 1, i32 1> %13 = add <4 x i32> %11, %vec.phi %14 = add <4 x i32> %12, %vec.phi75 %index.next = add nuw i64 %index, 8 %15 = icmp eq i64 %index.next, %n.vec br i1 %15, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %14, %13 %16 = 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 %if.end29, label %for.body6.preheader96 for.body6.preheader96: ; preds = %for.body6.preheader, %middle.block %indvars.iv60.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ] %h.050.ph = phi i32 [ 0, %for.body6.preheader ], [ %16, %middle.block ] br label %for.body6 for.cond16.preheader: ; preds = %for.end br i1 %cmp1753, label %for.body18.preheader, label %if.end29 for.body18.preheader: ; preds = %for.cond16.preheader %wide.trip.count66 = zext i32 %5 to i64 %min.iters.check79 = icmp ult i32 %5, 8 br i1 %min.iters.check79, label %for.body18.preheader94, label %vector.ph80 vector.ph80: ; preds = %for.body18.preheader %n.vec82 = and i64 %wide.trip.count66, 4294967288 br label %vector.body85 vector.body85: ; preds = %vector.body85, %vector.ph80 %index86 = phi i64 [ 0, %vector.ph80 ], [ %index.next91, %vector.body85 ] %vec.phi87 = phi <4 x i32> [ zeroinitializer, %vector.ph80 ], [ %23, %vector.body85 ] %vec.phi88 = phi <4 x i32> [ zeroinitializer, %vector.ph80 ], [ %24, %vector.body85 ] %17 = getelementptr inbounds i32, ptr %vla, i64 %index86 %wide.load89 = load <4 x i32>, ptr %17, align 16, !tbaa !5 %18 = getelementptr inbounds i32, ptr %17, i64 4 %wide.load90 = load <4 x i32>, ptr %18, align 16, !tbaa !5 %19 = and <4 x i32> %wide.load89, <i32 1, i32 1, i32 1, i32 1> %20 = and <4 x i32> %wide.load90, <i32 1, i32 1, i32 1, i32 1> %21 = xor <4 x i32> %19, <i32 1, i32 1, i32 1, i32 1> %22 = xor <4 x i32> %20, <i32 1, i32 1, i32 1, i32 1> %23 = add <4 x i32> %21, %vec.phi87 %24 = add <4 x i32> %22, %vec.phi88 %index.next91 = add nuw i64 %index86, 8 %25 = icmp eq i64 %index.next91, %n.vec82 br i1 %25, label %middle.block77, label %vector.body85, !llvm.loop !14 middle.block77: ; preds = %vector.body85 %bin.rdx92 = add <4 x i32> %24, %23 %26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx92) %cmp.n84 = icmp eq i64 %n.vec82, %wide.trip.count66 br i1 %cmp.n84, label %if.end29, label %for.body18.preheader94 for.body18.preheader94: ; preds = %for.body18.preheader, %middle.block77 %indvars.iv63.ph = phi i64 [ 0, %for.body18.preheader ], [ %n.vec82, %middle.block77 ] %h.254.ph = phi i32 [ 0, %for.body18.preheader ], [ %26, %middle.block77 ] br label %for.body18 for.body6: ; preds = %for.body6.preheader96, %for.body6 %indvars.iv60 = phi i64 [ %indvars.iv.next61, %for.body6 ], [ %indvars.iv60.ph, %for.body6.preheader96 ] %h.050 = phi i32 [ %spec.select, %for.body6 ], [ %h.050.ph, %for.body6.preheader96 ] %arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv60 %27 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %28 = and i32 %27, 1 %spec.select = add i32 %28, %h.050 %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %exitcond.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count br i1 %exitcond.not, label %if.end29, label %for.body6, !llvm.loop !15 for.body18: ; preds = %for.body18.preheader94, %for.body18 %indvars.iv63 = phi i64 [ %indvars.iv.next64, %for.body18 ], [ %indvars.iv63.ph, %for.body18.preheader94 ] %h.254 = phi i32 [ %spec.select43, %for.body18 ], [ %h.254.ph, %for.body18.preheader94 ] %arrayidx20 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv63 %29 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %30 = and i32 %29, 1 %31 = xor i32 %30, 1 %spec.select43 = add i32 %31, %h.254 %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1 %exitcond67.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count66 br i1 %exitcond67.not, label %if.end29, label %for.body18, !llvm.loop !16 if.end29: ; preds = %for.body6, %for.body18, %middle.block, %middle.block77, %entry, %for.cond4.preheader, %for.cond16.preheader %h.4 = phi i32 [ 0, %for.cond16.preheader ], [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %26, %middle.block77 ], [ %16, %middle.block ], [ %spec.select43, %for.body18 ], [ %spec.select, %for.body6 ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %h.4) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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 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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #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 = { 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} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !12, !13} !15 = distinct !{!15, !10, !13, !12} !16 = distinct !{!16, !10, !13, !12}
#include <stdio.h> int main (void){ char op; int a,b; 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; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266836/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266836/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: %op = alloca i8, align 1 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #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 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #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<string.h> #include<math.h> #include<ctype.h> #include<stdlib.h> int main(){ int l,r,a; int min,max,tot; scanf("%d%d%d",&l,&r,&a); min=(l<r)?l:r; max=(l>r)?l:r; if(min+a<=max) tot=2*(min+a); else{ a=min+a-max; a/=2; tot=2*(max+a); } printf("%d\n",tot); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26688/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26688/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%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: %l = alloca i32, align 4 %r = alloca i32, align 4 %a = 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 %r) #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 %l, ptr noundef nonnull %r, ptr noundef nonnull %a) %0 = load i32, ptr %l, align 4 %1 = load i32, ptr %r, align 4 %cond = call i32 @llvm.smin.i32(i32 %0, i32 %1) %cond5 = call i32 @llvm.smax.i32(i32 %0, i32 %1) %2 = load i32, ptr %a, align 4, !tbaa !5 %add = add nsw i32 %cond, %2 %cmp6.not = icmp sgt i32 %add, %cond5 br i1 %cmp6.not, label %if.else, label %if.end if.else: ; preds = %entry %sub = sub nsw i32 %add, %cond5 %div = sdiv i32 %sub, 2 store i32 %div, ptr %a, align 4, !tbaa !5 %add9 = add nsw i32 %div, %cond5 br label %if.end if.end: ; preds = %entry, %if.else %tot.0.in = phi i32 [ %add9, %if.else ], [ %add, %entry ] %tot.0 = shl nsw i32 %tot.0.in, 1 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %tot.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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: 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"}
#include<stdio.h> int main(){ char m; int a,b,c[256],i,j; for(i=0;i>-1;i++){ scanf("%d %c %d",&a,&m,&b); if(m=='?'){ break; } if(m=='+'){ c[i]=a+b; } if(m=='-'){ c[i]=a-b; } if(m=='*'){ c[i]=a*b; } if(m=='/'){ c[i]=a/b; } } for(j=0;j<i;j++){ printf("%d\n",c[j]); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266922/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266922/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: %m = alloca i8, align 1 %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca [256 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %m) #3 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 1024, ptr nonnull %c) #3 br label %for.cond for.cond: ; preds = %for.inc, %entry %indvars.iv56 = phi i32 [ %indvars.iv.next57, %for.inc ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %m, ptr noundef nonnull %b) %0 = load i8, ptr %m, align 1, !tbaa !5 switch i8 %0, label %for.inc [ i8 63, label %for.cond29.preheader i8 43, label %if.end7.thread i8 45, label %if.then11 i8 42, label %if.then18 i8 47, label %if.then25 ] for.cond29.preheader: ; preds = %for.cond %1 = and i64 %indvars.iv, 4294967295 %cmp3050.not = icmp eq i64 %1, 0 br i1 %cmp3050.not, label %for.end38, label %for.body32.preheader for.body32.preheader: ; preds = %for.cond29.preheader %wide.trip.count = zext i32 %indvars.iv56 to i64 br label %for.body32 if.end7.thread: ; preds = %for.cond %2 = load i32, ptr %a, align 4, !tbaa !8 %3 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %3, %2 br label %for.inc.sink.split if.then11: ; preds = %for.cond %4 = load i32, ptr %a, align 4, !tbaa !8 %5 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %4, %5 br label %for.inc.sink.split if.then18: ; preds = %for.cond %6 = load i32, ptr %a, align 4, !tbaa !8 %7 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %7, %6 br label %for.inc.sink.split if.then25: ; preds = %for.cond %8 = load i32, ptr %a, align 4, !tbaa !8 %9 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %8, %9 br label %for.inc.sink.split for.inc.sink.split: ; preds = %if.then25, %if.then18, %if.end7.thread, %if.then11 %sub.sink = phi i32 [ %sub, %if.then11 ], [ %add, %if.end7.thread ], [ %mul, %if.then18 ], [ %div, %if.then25 ] %arrayidx13 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv store i32 %sub.sink, ptr %arrayidx13, align 4, !tbaa !8 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %for.cond %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next57 = add nuw i32 %indvars.iv56, 1 br label %for.cond, !llvm.loop !10 for.body32: ; preds = %for.body32.preheader, %for.body32 %indvars.iv53 = phi i64 [ 0, %for.body32.preheader ], [ %indvars.iv.next54, %for.body32 ] %arrayidx34 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv53 %10 = load i32, ptr %arrayidx34, align 4, !tbaa !8 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10) %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1 %exitcond.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count br i1 %exitcond.not, label %for.end38, label %for.body32, !llvm.loop !12 for.end38: ; preds = %for.body32, %for.cond29.preheader call void @llvm.lifetime.end.p0(i64 1024, 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 call void @llvm.lifetime.end.p0(i64 1, 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 = !{!"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}
#include<stdio.h> int main(void){ int a,b; char op; for(;;){ 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 if(op=='?'){ break; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266973/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266973/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.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 %for.cond.backedge [ i8 43, label %if.then i8 45, label %if.then6 i8 42, label %if.then12 i8 47, label %if.then18 i8 63, label %for.end ] 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 %if.end28.sink.split 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 %if.end28.sink.split 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 %if.end28.sink.split 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 %if.end28.sink.split if.end28.sink.split: ; preds = %if.then, %if.then12, %if.then18, %if.then6 %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 %for.cond.backedge for.cond.backedge: ; preds = %if.end28.sink.split, %for.cond 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> int main(void){ int a,b,c; char op; for(;;){ scanf("%d %c %d",&a,&op,&b); if(op=='+') c=a+b; else if(op=='-') c=a-b; else if(op=='*') c=a*b; else if(op=='/') c=a/b; else break; printf("%d\n",c); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267015/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267015/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 = %if.end19, %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.then5 i8 42, label %if.then10 i8 47, label %if.then15 ] 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 %if.end19 if.then5: ; 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 %if.end19 if.then10: ; 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 %if.end19 if.then15: ; 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 %if.end19 if.end19: ; preds = %if.then5, %if.then15, %if.then10, %if.then %c.0 = phi i32 [ %add, %if.then ], [ %sub, %if.then5 ], [ %mul, %if.then10 ], [ %div, %if.then15 ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0) 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> int main() { int a, b; char op; while (scanf("%d %c %d", &a, &op, &b) == 3) { 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_267059/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267059/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, 3 br i1 %cmp25, label %while.body, label %while.end while.body: ; preds = %entry, %if.end23 %0 = load i8, ptr %op, align 1, !tbaa !5 switch i8 %0, label %if.end23 [ i8 43, label %if.then i8 45, label %if.then7 i8 42, label %if.then13 i8 47, label %if.then19 ] if.then: ; 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 br label %if.end23.sink.split if.then7: ; preds = %while.body %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.sink.split if.then13: ; preds = %while.body %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.sink.split if.then19: ; preds = %while.body %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.sink.split if.end23.sink.split: ; preds = %if.then, %if.then13, %if.then19, %if.then7 %sub.sink = phi i32 [ %sub, %if.then7 ], [ %div, %if.then19 ], [ %mul, %if.then13 ], [ %add, %if.then ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) br label %if.end23 if.end23: ; preds = %if.end23.sink.split, %while.body %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, 3 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !10 while.end: ; preds = %if.end23, %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 = !{!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"}
#include<stdio.h> int main(){ int a,b; char op; scanf("%d %c %d", &a, &op, &b); while( !(op == '?')){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 {} scanf("%d %c %d", &a, &op, &b);} return 0;}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267101/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267101/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 %call27 = 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.then i8 45, label %if.then9 i8 42, label %if.then15 i8 47, label %if.then21 ] 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.end26.sink.split if.then9: ; 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.end26.sink.split 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.end26.sink.split if.then21: ; 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.end26.sink.split if.end26.sink.split: ; preds = %if.then, %if.then15, %if.then21, %if.then9 %sub.sink = phi i32 [ %sub, %if.then9 ], [ %div, %if.then21 ], [ %mul, %if.then15 ], [ %add, %if.then ] %call10 = 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.end26.sink.split, %while.cond br label %while.cond, !llvm.loop !10 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} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main (void){ int a[100]; int b[100]; char op[100]; int ans; int i,j; for(i=0;i<100;i++){ scanf("%d %c %d",&a[i],&op[i],&b[i]); if(op[i]=='?'){ break; } } for(j=0;j<i;j++){ if(op[j]=='+'){ ans = a[j]+b[j]; } if(op[j]=='-'){ ans=a[j]-b[j]; } if(op[j]=='*'){ ans=a[j]*b[j]; } if(op[j]=='/'){ ans=a[j]/b[j]; } if(op[j]=='%'){ ans=a[j]%b[j]; } printf("%d\n",ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267152/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267152/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 [100 x i32], align 16 %b = alloca [100 x i32], align 16 %op = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %op) #3 br label %for.body for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [100 x i8], ptr %op, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4) %0 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp7 = icmp eq i8 %0, 63 br i1 %cmp7, label %for.end, label %for.inc for.inc: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 100 br i1 %exitcond.not, label %for.body12.preheader, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body %1 = and i64 %indvars.iv, 4294967295 %cmp10103.not = icmp eq i64 %1, 0 br i1 %cmp10103.not, label %for.end71, label %for.body12.preheader for.body12.preheader: ; preds = %for.inc, %for.end %i.0.lcssa113 = phi i64 [ %indvars.iv, %for.end ], [ 100, %for.inc ] %wide.trip.count = and i64 %i.0.lcssa113, 4294967295 br label %for.body12 for.body12: ; preds = %for.body12.preheader, %if.end67 %indvars.iv107 = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next108, %if.end67 ] %ans.0104 = phi i32 [ undef, %for.body12.preheader ], [ %ans.5, %if.end67 ] %arrayidx14 = getelementptr inbounds [100 x i8], ptr %op, i64 0, i64 %indvars.iv107 %2 = load i8, ptr %arrayidx14, align 1, !tbaa !5 switch i8 %2, label %if.end67 [ i8 43, label %if.end23.thread i8 45, label %if.then29 i8 42, label %if.then40 i8 47, label %if.then51 i8 37, label %if.then62 ] if.end23.thread: ; preds = %for.body12 %arrayidx20 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv107 %3 = load i32, ptr %arrayidx20, align 4, !tbaa !10 %arrayidx22 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv107 %4 = load i32, ptr %arrayidx22, align 4, !tbaa !10 %add = add nsw i32 %4, %3 br label %if.end67 if.then29: ; preds = %for.body12 %arrayidx31 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv107 %5 = load i32, ptr %arrayidx31, align 4, !tbaa !10 %arrayidx33 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv107 %6 = load i32, ptr %arrayidx33, align 4, !tbaa !10 %sub = sub nsw i32 %5, %6 br label %if.end67 if.then40: ; preds = %for.body12 %arrayidx42 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv107 %7 = load i32, ptr %arrayidx42, align 4, !tbaa !10 %arrayidx44 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv107 %8 = load i32, ptr %arrayidx44, align 4, !tbaa !10 %mul = mul nsw i32 %8, %7 br label %if.end67 if.then51: ; preds = %for.body12 %arrayidx53 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv107 %9 = load i32, ptr %arrayidx53, align 4, !tbaa !10 %arrayidx55 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv107 %10 = load i32, ptr %arrayidx55, align 4, !tbaa !10 %div = sdiv i32 %9, %10 br label %if.end67 if.then62: ; preds = %for.body12 %arrayidx64 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv107 %11 = load i32, ptr %arrayidx64, align 4, !tbaa !10 %arrayidx66 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv107 %12 = load i32, ptr %arrayidx66, align 4, !tbaa !10 %rem = srem i32 %11, %12 br label %if.end67 if.end67: ; preds = %for.body12, %if.then29, %if.end23.thread, %if.then40, %if.then51, %if.then62 %ans.5 = phi i32 [ %rem, %if.then62 ], [ %div, %if.then51 ], [ %mul, %if.then40 ], [ %add, %if.end23.thread ], [ %sub, %if.then29 ], [ %ans.0104, %for.body12 ] %call68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.5) %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1 %exitcond110.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count br i1 %exitcond110.not, label %for.end71, label %for.body12, !llvm.loop !12 for.end71: ; preds = %if.end67, %for.end call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 400, 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 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!11, !11, i64 0} !11 = !{!"int", !6, i64 0} !12 = distinct !{!12, !9}
#include<stdio.h> int main(void){ char op; int a,b; do{ 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); } ;} while(op!='?'); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267196/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267196/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: %op = alloca i8, align 1 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 br label %do.body do.body: ; preds = %do.cond, %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 %do.cond [ i8 43, label %if.then i8 45, label %if.then6 i8 42, label %if.then12 i8 47, label %if.then18 ] if.then: ; preds = %do.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 br label %do.condthread-pre-split if.then6: ; preds = %do.body %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 %do.condthread-pre-split if.then12: ; preds = %do.body %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 %do.condthread-pre-split if.then18: ; preds = %do.body %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 %do.condthread-pre-split do.condthread-pre-split: ; 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) %.pr = load i8, ptr %op, align 1, !tbaa !5 br label %do.cond do.cond: ; preds = %do.condthread-pre-split, %do.body %9 = phi i8 [ %.pr, %do.condthread-pre-split ], [ %0, %do.body ] %cmp24.not = icmp eq i8 %9, 63 br i1 %cmp24.not, label %do.end, label %do.body, !llvm.loop !10 do.end: ; preds = %do.cond call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #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} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define SIZE 256 int main(void){ char str[SIZE]; int a, b; char op = '\0'; while (1) { fgets(str, SIZE, stdin); sscanf(str, "%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 printf("%d\n", (a / b)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267239/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267239/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 [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: %str = alloca [256 x i8], align 16 %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %str) #3 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 store i8 0, ptr %op, align 1, !tbaa !5 br label %while.cond while.cond: ; preds = %if.end25, %entry %0 = load ptr, ptr @stdin, align 8, !tbaa !8 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 256, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %str, ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) #3 %1 = load i8, ptr %op, align 1, !tbaa !5 switch i8 %1, label %if.else21 [ i8 63, label %while.end i8 43, label %if.then7 i8 45, label %if.then13 i8 42, label %if.then19 ] if.then7: ; preds = %while.cond %2 = load i32, ptr %a, align 4, !tbaa !10 %3 = load i32, ptr %b, align 4, !tbaa !10 %add = add nsw i32 %3, %2 br label %if.end25 if.then13: ; preds = %while.cond %4 = load i32, ptr %a, align 4, !tbaa !10 %5 = load i32, ptr %b, align 4, !tbaa !10 %sub = sub nsw i32 %4, %5 br label %if.end25 if.then19: ; preds = %while.cond %6 = load i32, ptr %a, align 4, !tbaa !10 %7 = load i32, ptr %b, align 4, !tbaa !10 %mul = mul nsw i32 %7, %6 br label %if.end25 if.else21: ; preds = %while.cond %8 = load i32, ptr %a, align 4, !tbaa !10 %9 = load i32, ptr %b, align 4, !tbaa !10 %div = sdiv i32 %8, %9 br label %if.end25 if.end25: ; preds = %if.then7, %if.then19, %if.else21, %if.then13 %add.sink = phi i32 [ %add, %if.then7 ], [ %mul, %if.then19 ], [ %div, %if.else21 ], [ %sub, %if.then13 ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.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 call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %str) #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 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: 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 = !{!"any pointer", !6, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"int", !6, i64 0}
#include<stdio.h> int main(){ int a, b, r, i; char n; for(i=0; ;i++){ scanf("%d %c %d", &a, &n, &b); if(n!='?'){ if (n=='+'){ r=a+b;} else{ if(n=='-'){ r=a-b;} else{ if(n=='*'){ r=a*b;} else{ r=a/b;} } } } else break; printf("%d\n", r); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267282/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267282/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 %n = 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 %n) #3 br label %for.cond for.cond: ; preds = %if.end19, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %n, ptr noundef nonnull %b) %0 = load i8, ptr %n, align 1, !tbaa !5 switch i8 %0, label %if.else15 [ i8 63, label %for.end i8 43, label %if.then5 i8 45, label %if.then9 i8 42, label %if.then14 ] if.then5: ; 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 %if.end19 if.then9: ; 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 %if.end19 if.then14: ; 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 %if.end19 if.else15: ; 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 %if.end19 if.end19: ; preds = %if.then5, %if.then14, %if.else15, %if.then9 %r.0 = phi i32 [ %add, %if.then5 ], [ %sub, %if.then9 ], [ %mul, %if.then14 ], [ %div, %if.else15 ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.0) br label %for.cond for.end: ; preds = %for.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %n) #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) { char op[10]; int i = 0, j; int a[10000]; int b[10000]; int ops[10000]; do{ scanf("%d%s%d", &a[i], op, &b[i]); ops[i] = op[0]; i++; } while (op[0] != '?'); for (j = 0; j < i - 1; j++){ if (ops[j] == '+') printf("%d\n", a[j] + b[j]); if (ops[j] == '-') printf("%d\n", a[j] - b[j]); if (ops[j] == '*') printf("%d\n", a[j] * b[j]); if (ops[j] == '/') printf("%d\n", a[j] / b[j]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267332/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267332/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%s%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: %op = alloca [10 x i8], align 1 %a = alloca [10000 x i32], align 16 %b = alloca [10000 x i32], align 16 %ops = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %op) #3 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %ops) #3 br label %do.body do.body: ; preds = %do.body, %entry %indvars.iv81 = phi i32 [ %indvars.iv.next82, %do.body ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %do.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %op, ptr noundef nonnull %arrayidx2) %0 = load i8, ptr %op, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %arrayidx5 = getelementptr inbounds [10000 x i32], ptr %ops, i64 0, i64 %indvars.iv store i32 %conv, ptr %arrayidx5, align 4, !tbaa !8 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %cmp.not = icmp eq i8 %0, 63 %indvars.iv.next82 = add nuw i32 %indvars.iv81, 1 br i1 %cmp.not, label %for.cond.preheader, label %do.body, !llvm.loop !10 for.cond.preheader: ; preds = %do.body %1 = and i64 %indvars.iv, 4294967295 %cmp975.not = icmp eq i64 %1, 0 br i1 %cmp975.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %indvars.iv81 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv78 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next79, %for.inc ] %arrayidx12 = getelementptr inbounds [10000 x i32], ptr %ops, i64 0, i64 %indvars.iv78 %2 = load i32, ptr %arrayidx12, align 4, !tbaa !8 switch i32 %2, label %for.inc [ i32 43, label %if.end.thread i32 45, label %if.then24 i32 42, label %if.then36 i32 47, label %if.then47 ] if.end.thread: ; preds = %for.body %arrayidx16 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv78 %3 = load i32, ptr %arrayidx16, align 4, !tbaa !8 %arrayidx18 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %indvars.iv78 %4 = load i32, ptr %arrayidx18, align 4, !tbaa !8 %add = add nsw i32 %4, %3 br label %for.inc.sink.split if.then24: ; preds = %for.body %arrayidx26 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv78 %5 = load i32, ptr %arrayidx26, align 4, !tbaa !8 %arrayidx28 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %indvars.iv78 %6 = load i32, ptr %arrayidx28, align 4, !tbaa !8 %sub29 = sub nsw i32 %5, %6 br label %for.inc.sink.split if.then36: ; preds = %for.body %arrayidx38 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv78 %7 = load i32, ptr %arrayidx38, align 4, !tbaa !8 %arrayidx40 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %indvars.iv78 %8 = load i32, ptr %arrayidx40, align 4, !tbaa !8 %mul = mul nsw i32 %8, %7 br label %for.inc.sink.split if.then47: ; preds = %for.body %arrayidx49 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv78 %9 = load i32, ptr %arrayidx49, align 4, !tbaa !8 %arrayidx51 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %indvars.iv78 %10 = load i32, ptr %arrayidx51, align 4, !tbaa !8 %div = sdiv i32 %9, %10 br label %for.inc.sink.split for.inc.sink.split: ; preds = %if.then47, %if.then36, %if.end.thread, %if.then24 %sub29.sink = phi i32 [ %sub29, %if.then24 ], [ %add, %if.end.thread ], [ %mul, %if.then36 ], [ %div, %if.then47 ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub29.sink) br label %for.inc for.inc: ; preds = %for.inc.sink.split, %for.body %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %exitcond.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12 for.end: ; preds = %for.inc, %for.cond.preheader call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %ops) #3 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %op) #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} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include <stdio.h> int main(void){ long a, b; char op; scanf("%ld %c %ld\n", &a, &op, &b); while(op != '?'){ switch(op){ case '+': printf("%ld\n", a+b); break; case '-': printf("%ld\n", a-b); break; case '/': printf("%ld\n", a/b); break; case '*': printf("%ld\n", a*b); break; } scanf("%ld %c %ld\n", &a, &op, &b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267376/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267376/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 [12 x i8] c"%ld %c %ld\0A\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, 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 %cmp.not11 = icmp eq i8 %0, 63 br i1 %cmp.not11, label %while.end, label %while.body while.body: ; preds = %entry, %sw.epilog %1 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ] %conv = sext i8 %1 to i32 switch i32 %conv, label %sw.epilog [ i32 43, label %sw.bb i32 45, label %sw.bb4 i32 47, label %sw.bb6 i32 42, label %sw.bb8 ] sw.bb: ; preds = %while.body %2 = load i64, ptr %a, align 8, !tbaa !8 %3 = load i64, ptr %b, align 8, !tbaa !8 %add = add nsw i64 %3, %2 br label %sw.epilog.sink.split sw.bb4: ; preds = %while.body %4 = load i64, ptr %a, align 8, !tbaa !8 %5 = load i64, ptr %b, align 8, !tbaa !8 %sub = sub nsw i64 %4, %5 br label %sw.epilog.sink.split sw.bb6: ; preds = %while.body %6 = load i64, ptr %a, align 8, !tbaa !8 %7 = load i64, ptr %b, align 8, !tbaa !8 %div = sdiv i64 %6, %7 br label %sw.epilog.sink.split sw.bb8: ; preds = %while.body %8 = load i64, ptr %a, align 8, !tbaa !8 %9 = load i64, ptr %b, align 8, !tbaa !8 %mul = mul nsw i64 %9, %8 br label %sw.epilog.sink.split sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb4, %sw.bb6, %sw.bb8 %mul.sink = phi i64 [ %mul, %sw.bb8 ], [ %div, %sw.bb6 ], [ %sub, %sw.bb4 ], [ %add, %sw.bb ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %mul.sink) br label %sw.epilog sw.epilog: ; preds = %sw.epilog.sink.split, %while.body %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %10 = load i8, ptr %op, align 1, !tbaa !5 %cmp.not = icmp eq i8 %10, 63 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %sw.epilog, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int i,a,b,c; char op; for(i=0;;i++) { 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_267419/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267419/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 = %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 %for.end i8 43, label %if.then5 i8 45, label %if.then10 i8 42, label %if.then15 i8 47, label %if.then20 ] if.then5: ; 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 %if.end24 if.then10: ; 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 %if.end24 if.then15: ; 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 %if.end24 if.then20: ; 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 %if.end24 if.end24: ; preds = %for.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, %for.cond ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.1) 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> int main(void) { int a,b,i; char op; for(i=1;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 if(op=='?') break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267462/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267462/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.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 %for.cond.backedge [ i8 43, label %if.then i8 45, label %if.then7 i8 42, label %if.then13 i8 47, label %if.then19 i8 63, label %for.end ] 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.sink.split if.then7: ; 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.sink.split if.then13: ; 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.sink.split if.then19: ; 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.sink.split for.inc.sink.split: ; preds = %if.then7, %if.then19, %if.then13, %if.then %add.sink = phi i32 [ %add, %if.then ], [ %mul, %if.then13 ], [ %div, %if.then19 ], [ %sub, %if.then7 ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink) br label %for.cond.backedge for.cond.backedge: ; preds = %for.inc.sink.split, %for.cond br label %for.cond, !llvm.loop !10 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} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#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; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267505/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267505/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(void){ 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_267549/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267549/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 <math.h> int main() { int a,b; char c; scanf("%d",&a); scanf(" %c",&c); scanf("%d",&b); while (!((c=='?'))){ if (c=='+'){ printf("%d\n",a+b); }else if(c=='-'){ printf("%d\n",a-b); }else if(c=='*'){ printf("%d\n",a*b); }else if(c=='/'){ printf("%d\n",a/b); } scanf("%d",&a); scanf(" %c",&c); scanf("%d",&b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267592/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267592/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\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 %while.cond while.cond: ; preds = %while.cond.backedge, %entry %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c) %call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i8, ptr %c, align 1, !tbaa !5 switch i8 %0, label %while.cond.backedge [ i8 63, label %while.end i8 43, label %if.then i8 45, label %if.then11 i8 42, label %if.then17 i8 47, label %if.then23 ] 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.end27.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.end27.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.end27.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.end27.sink.split if.end27.sink.split: ; preds = %if.then, %if.then17, %if.then23, %if.then11 %sub.sink = phi i32 [ %sub, %if.then11 ], [ %div, %if.then23 ], [ %mul, %if.then17 ], [ %add, %if.then ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub.sink) br label %while.cond.backedge while.cond.backedge: ; preds = %if.end27.sink.split, %while.cond br label %while.cond, !llvm.loop !10 while.end: ; preds = %while.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"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int a, b; char op; scanf("%d %c %d", &a, &op, &b); while (op != '?'){ 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 { } scanf("%d %c %d", &a, &op, &b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267635/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267635/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 %call27 = 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.then i8 45, label %if.then9 i8 42, label %if.then15 i8 47, label %if.then21 ] 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.end26.sink.split if.then9: ; 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.end26.sink.split 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.end26.sink.split if.then21: ; 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.end26.sink.split if.end26.sink.split: ; preds = %if.then, %if.then15, %if.then21, %if.then9 %sub.sink = phi i32 [ %sub, %if.then9 ], [ %div, %if.then21 ], [ %mul, %if.then15 ], [ %add, %if.then ] %call10 = 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.end26.sink.split, %while.cond br label %while.cond, !llvm.loop !10 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} !10 = distinct !{!10, !11} !11 = !{!"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); }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=='\?') { break; } } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267686/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267686/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 43, label %if.then i8 45, label %if.then6 i8 42, label %if.then12 i8 47, label %if.then18 i8 63, label %while.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 br label %if.end28.sink.split 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.end28.sink.split 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.end28.sink.split 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.end28.sink.split if.end28.sink.split: ; preds = %if.then, %if.then12, %if.then18, %if.then6 %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.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> int main() { int a, b, i = 0, count, answers[100]; char op; while (1) { scanf("%d %c %d", &a, &op, &b); if (op == '?') { break; } switch (op) { case '+': answers[i] = a + b; break; case '-': answers[i] = a - b; break; case '*': answers[i] = a * b; break; case '/': answers[i] = a / b; break; default: break; } i++; } for (count = 0; count < i; count++) { printf("%d\n", answers[count]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267729/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267729/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 %answers = alloca [100 x i32], align 16 %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 400, ptr nonnull %answers) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 %call25 = 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 %cmp26 = icmp eq i8 %0, 63 br i1 %cmp26, label %for.end, label %if.end for.cond.preheader: ; preds = %sw.epilog %1 = and i64 %indvars.iv.next, 4294967295 %cmp1228.not = icmp eq i64 %1, 0 br i1 %cmp1228.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = and i64 %indvars.iv.next, 4294967295 br label %for.body if.end: ; preds = %entry, %sw.epilog %indvars.iv = phi i64 [ %indvars.iv.next, %sw.epilog ], [ 0, %entry ] %2 = phi i8 [ %11, %sw.epilog ], [ %0, %entry ] %conv = sext i8 %2 to i32 switch i32 %conv, label %sw.epilog [ i32 43, label %sw.bb i32 45, label %sw.bb3 i32 42, label %sw.bb6 i32 47, label %sw.bb9 ] sw.bb: ; preds = %if.end %3 = load i32, ptr %a, align 4, !tbaa !8 %4 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %4, %3 br label %sw.epilog.sink.split sw.bb3: ; preds = %if.end %5 = load i32, ptr %a, align 4, !tbaa !8 %6 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %5, %6 br label %sw.epilog.sink.split sw.bb6: ; preds = %if.end %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 %sw.epilog.sink.split sw.bb9: ; preds = %if.end %9 = load i32, ptr %a, align 4, !tbaa !8 %10 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %9, %10 br label %sw.epilog.sink.split sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb3, %sw.bb6, %sw.bb9 %div.sink = phi i32 [ %div, %sw.bb9 ], [ %mul, %sw.bb6 ], [ %sub, %sw.bb3 ], [ %add, %sw.bb ] %arrayidx11 = getelementptr inbounds [100 x i32], ptr %answers, i64 0, i64 %indvars.iv store i32 %div.sink, ptr %arrayidx11, align 4, !tbaa !8 br label %sw.epilog sw.epilog: ; preds = %sw.epilog.sink.split, %if.end %indvars.iv.next = add nuw i64 %indvars.iv, 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %11 = load i8, ptr %op, align 1, !tbaa !5 %cmp = icmp eq i8 %11, 63 br i1 %cmp, label %for.cond.preheader, label %if.end for.body: ; preds = %for.body.preheader, %for.body %indvars.iv30 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next31, %for.body ] %arrayidx15 = getelementptr inbounds [100 x i32], ptr %answers, i64 0, i64 %indvars.iv30 %12 = load i32, ptr %arrayidx15, align 4, !tbaa !8 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12) %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1 %exitcond.not = icmp eq i64 %indvars.iv.next31, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !10 for.end: ; preds = %for.body, %entry, %for.cond.preheader call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %answers) #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} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#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(b==0){if(op=='+'){c=a+b;} else if(op=='-'){c=a-b;} else if(op=='*'){c=a*b;} else break; printf("%d\n",c);} else if(b!=0){if(op=='+'){c=a+b;} else if(op=='-'){c=a-b;} else if(op=='*'){c=a*b;} else {c=a/b;} printf("%d\n",c);} else{break;} } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267772/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267772/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 %call54 = 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 %cmp55 = icmp eq i8 %0, 63 br i1 %cmp55, label %while.end, label %if.else if.else: ; preds = %entry, %if.end52 %1 = phi i8 [ %6, %if.end52 ], [ %0, %entry ] %2 = load i32, ptr %b, align 4, !tbaa !8 %cmp2 = icmp eq i32 %2, 0 br i1 %cmp2, label %if.then4, label %if.then26 if.then4: ; preds = %if.else switch i8 %1, label %while.end [ i8 43, label %if.then8 i8 45, label %if.then13 i8 42, label %if.end52 ] if.then8: ; preds = %if.then4 %3 = load i32, ptr %a, align 4, !tbaa !8 br label %if.end52 if.then13: ; preds = %if.then4 %4 = load i32, ptr %a, align 4, !tbaa !8 br label %if.end52 if.then26: ; preds = %if.else %5 = load i32, ptr %a, align 4, !tbaa !8 switch i8 %1, label %if.else44 [ i8 43, label %if.then30 i8 45, label %if.then36 i8 42, label %if.then42 ] if.then30: ; preds = %if.then26 %add31 = add nsw i32 %5, %2 br label %if.end52 if.then36: ; preds = %if.then26 %sub37 = sub nsw i32 %5, %2 br label %if.end52 if.then42: ; preds = %if.then26 %mul43 = mul nsw i32 %5, %2 br label %if.end52 if.else44: ; preds = %if.then26 %div = sdiv i32 %5, %2 br label %if.end52 if.end52: ; preds = %if.then30, %if.then42, %if.else44, %if.then36, %if.then8, %if.then13, %if.then4 %c.0.sink = phi i32 [ %3, %if.then8 ], [ %4, %if.then13 ], [ 0, %if.then4 ], [ %add31, %if.then30 ], [ %sub37, %if.then36 ], [ %mul43, %if.then42 ], [ %div, %if.else44 ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.sink) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %6 = load i8, ptr %op, align 1, !tbaa !5 %cmp = icmp eq i8 %6, 63 br i1 %cmp, label %while.end, label %if.else while.end: ; preds = %if.end52, %if.then4, %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 = !{!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 <string.h> #include <math.h> int main(void){ int a,b; char s[5]; for(;;){ scanf("%d %s %d",&a,s,&b); if(s[0]=='?'){break;} if(s[0]=='+'){printf("%d\n",a+b);} if(s[0]=='-'){printf("%d\n",a-b);} if(s[0]=='*'){printf("%d\n",a*b);} if(s[0]=='/'){printf("%d\n",a/b);} } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267815/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267815/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 %s %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 %s = alloca [5 x 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 5, ptr nonnull %s) #3 br label %for.cond for.cond: ; preds = %for.cond.backedge, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %s, ptr noundef nonnull %b) %0 = load i8, ptr %s, align 1, !tbaa !5 switch i8 %0, label %if.end8 [ i8 63, label %for.end i8 43, label %if.then6 ] if.then6: ; 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 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %.pr = load i8, ptr %s, align 1, !tbaa !5 br label %if.end8 if.end8: ; preds = %for.cond, %if.then6 %3 = phi i8 [ %0, %for.cond ], [ %.pr, %if.then6 ] %cmp11 = icmp eq i8 %3, 45 br i1 %cmp11, label %if.then13, label %if.end15 if.then13: ; preds = %if.end8 %4 = load i32, ptr %a, align 4, !tbaa !8 %5 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %4, %5 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) %.pre = load i8, ptr %s, align 1, !tbaa !5 br label %if.end15 if.end15: ; preds = %if.then13, %if.end8 %6 = phi i8 [ %.pre, %if.then13 ], [ %3, %if.end8 ] %cmp18 = icmp eq i8 %6, 42 br i1 %cmp18, label %if.then20, label %if.end22 if.then20: ; preds = %if.end15 %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %8, %7 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) %.pr30 = load i8, ptr %s, align 1, !tbaa !5 br label %if.end22 if.end22: ; preds = %if.then20, %if.end15 %9 = phi i8 [ %.pr30, %if.then20 ], [ %6, %if.end15 ] %cmp25 = icmp eq i8 %9, 47 br i1 %cmp25, label %if.then27, label %for.cond.backedge if.then27: ; preds = %if.end22 %10 = load i32, ptr %a, align 4, !tbaa !8 %11 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %10, %11 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) br label %for.cond.backedge for.cond.backedge: ; preds = %if.then27, %if.end22 br label %for.cond for.end: ; preds = %for.cond call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #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}
//2つの整数 a, b と1つの演算子 op を読み込んで、a op b を計算するプログラム #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main() { int a, b;//整数 char op = 'x';//文字 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;//終了 } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267866/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267866/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 store i8 120, ptr %op, align 1, !tbaa !5 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() { char op[20000]; int i,a[20000],b[20000],c[20000]; for(i=1;i<=20000;i++){ scanf("%d %c %d",&a[i],&op[i],&b[i]); if(op[i]=='?') { break; } switch(op[i]) { case '+': c[i]=a[i]+b[i]; break; case '-': c[i]=a[i]-b[i]; break; case '/': c[i]=a[i]/b[i]; break; case '*': c[i]=a[i]*b[i]; break; } } for(i=1;i<=20000;i++){ if(op[i]=='?'){ break; } printf("%d\n",c[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267916/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267916/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: %op = alloca [20000 x i8], align 16 %a = alloca [20000 x i32], align 16 %b = alloca [20000 x i32], align 16 %c = alloca [20000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %op) #3 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %c) #3 br label %for.body for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ 1, %entry ], [ %indvars.iv.next, %for.inc ] %arrayidx = getelementptr inbounds [20000 x i32], ptr %a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [20000 x i8], ptr %op, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [20000 x i32], ptr %b, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4) %0 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp7 = icmp eq i8 %0, 63 br i1 %cmp7, label %for.body42.preheader, label %if.end if.end: ; preds = %for.body %conv = sext i8 %0 to i32 switch i32 %conv, label %for.inc [ i32 43, label %sw.bb i32 45, label %sw.bb18 i32 47, label %sw.bb25 i32 42, label %sw.bb32 ] sw.bb: ; preds = %if.end %1 = load i32, ptr %arrayidx, align 4, !tbaa !8 %2 = load i32, ptr %arrayidx4, align 4, !tbaa !8 %add = add nsw i32 %2, %1 br label %for.inc.sink.split sw.bb18: ; preds = %if.end %3 = load i32, ptr %arrayidx, align 4, !tbaa !8 %4 = load i32, ptr %arrayidx4, align 4, !tbaa !8 %sub = sub nsw i32 %3, %4 br label %for.inc.sink.split sw.bb25: ; preds = %if.end %5 = load i32, ptr %arrayidx, align 4, !tbaa !8 %6 = load i32, ptr %arrayidx4, align 4, !tbaa !8 %div = sdiv i32 %5, %6 br label %for.inc.sink.split sw.bb32: ; preds = %if.end %7 = load i32, ptr %arrayidx, align 4, !tbaa !8 %8 = load i32, ptr %arrayidx4, align 4, !tbaa !8 %mul = mul nsw i32 %8, %7 br label %for.inc.sink.split for.inc.sink.split: ; preds = %sw.bb32, %sw.bb25, %sw.bb18, %sw.bb %add.sink = phi i32 [ %add, %sw.bb ], [ %sub, %sw.bb18 ], [ %div, %sw.bb25 ], [ %mul, %sw.bb32 ] %arrayidx17 = getelementptr inbounds [20000 x i32], ptr %c, i64 0, i64 %indvars.iv store i32 %add.sink, ptr %arrayidx17, align 4, !tbaa !8 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %if.end %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 20001 br i1 %exitcond.not, label %for.body42.preheader, label %for.body, !llvm.loop !10 for.body42.preheader: ; preds = %for.body, %for.inc br label %for.body42 for.body42: ; preds = %for.body42.preheader, %if.end49 %indvars.iv81 = phi i64 [ %indvars.iv.next82, %if.end49 ], [ 1, %for.body42.preheader ] %arrayidx44 = getelementptr inbounds [20000 x i8], ptr %op, i64 0, i64 %indvars.iv81 %9 = load i8, ptr %arrayidx44, align 1, !tbaa !5 %cmp46 = icmp eq i8 %9, 63 br i1 %cmp46, label %for.end55, label %if.end49 if.end49: ; preds = %for.body42 %arrayidx51 = getelementptr inbounds [20000 x i32], ptr %c, i64 0, i64 %indvars.iv81 %10 = load i32, ptr %arrayidx51, align 4, !tbaa !8 %call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10) %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1 %exitcond84.not = icmp eq i64 %indvars.iv.next82, 20001 br i1 %exitcond84.not, label %for.end55, label %for.body42, !llvm.loop !12 for.end55: ; preds = %for.body42, %if.end49 call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %op) #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} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include <stdio.h> int a[30000]; int main() { int n, t, i, res; scanf("%d %d", &n, &t); n--; t--; for (i = 0; i < n; ++i) scanf("%d", a + i); res = 0; res += a[0]; while (res < t) res += a[res]; if (res == t) printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26796/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26796/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 @a = dso_local global [30000 x i32] zeroinitializer, align 16 @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 %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 %n, ptr noundef nonnull %t) %0 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %0, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %t, align 4, !tbaa !5 %dec1 = add nsw i32 %1, -1 store i32 %dec1, ptr %t, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %0, 1 br i1 %cmp15, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr @a, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr) %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.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.body %.pre = load i32, ptr %t, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %4 = phi i32 [ %.pre, %for.end.loopexit ], [ %dec1, %entry ] %5 = load i32, ptr @a, align 16, !tbaa !5 %cmp317 = icmp slt i32 %5, %4 br i1 %cmp317, label %while.body, label %while.end while.body: ; preds = %for.end, %while.body %res.018 = phi i32 [ %add4, %while.body ], [ %5, %for.end ] %idxprom = sext i32 %res.018 to i64 %arrayidx = getelementptr inbounds [30000 x i32], ptr @a, i64 0, i64 %idxprom %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add4 = add nsw i32 %6, %res.018 %cmp3 = icmp slt i32 %add4, %4 br i1 %cmp3, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %while.body, %for.end %res.0.lcssa = phi i32 [ %5, %for.end ], [ %add4, %while.body ] %cmp5 = icmp eq i32 %res.0.lcssa, %4 %str.4.str = select i1 %cmp5, ptr @str.4, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) 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 } ; 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"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { char op; int a, b; for (int i = 0;; i++) { scanf("%d %c %d", &a, &op, &b); int wa = a + b, sa = a - b, seki = a*b; float syou = a / b; if (op == '+')printf("%d", wa); if (op == '-')printf("%d", sa); if (op == '*')printf("%d", seki); if (op == '/')printf("%.0f",syou); if (op == '?')break; printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268001/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268001/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 [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%.0f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %op = alloca i8, align 1 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #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 br label %for.cond for.cond: ; preds = %if.end27, %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 i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %mul = mul nsw i32 %1, %0 %div = sdiv i32 %0, %1 %conv = sitofp i32 %div to float %2 = load i8, ptr %op, align 1, !tbaa !9 %cmp = icmp eq i8 %2, 43 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %for.cond %add = add nsw i32 %1, %0 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %.pr = load i8, ptr %op, align 1, !tbaa !9 br label %if.end if.end: ; preds = %if.then, %for.cond %3 = phi i8 [ %.pr, %if.then ], [ %2, %for.cond ] %cmp5 = icmp eq i8 %3, 45 br i1 %cmp5, label %if.then7, label %if.end9 if.then7: ; preds = %if.end %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) %.pre = load i8, ptr %op, align 1, !tbaa !9 br label %if.end9 if.end9: ; preds = %if.then7, %if.end %4 = phi i8 [ %.pre, %if.then7 ], [ %3, %if.end ] %cmp11 = icmp eq i8 %4, 42 br i1 %cmp11, label %if.then13, label %if.end15 if.then13: ; preds = %if.end9 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) %.pr36 = load i8, ptr %op, align 1, !tbaa !9 br label %if.end15 if.end15: ; preds = %if.then13, %if.end9 %5 = phi i8 [ %.pr36, %if.then13 ], [ %4, %if.end9 ] %cmp17 = icmp eq i8 %5, 47 br i1 %cmp17, label %if.then19, label %if.end22 if.then19: ; preds = %if.end15 %conv20 = fpext float %conv to double %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %conv20) %.pre37 = load i8, ptr %op, align 1, !tbaa !9 br label %if.end22 if.end22: ; preds = %if.then19, %if.end15 %6 = phi i8 [ %.pre37, %if.then19 ], [ %5, %if.end15 ] %cmp24.not = icmp eq i8 %6, 63 br i1 %cmp24.not, label %cleanup32, label %if.end27 if.end27: ; preds = %if.end22 %putchar = call i32 @putchar(i32 10) br label %for.cond cleanup32: ; preds = %if.end22 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #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}
#include <stdio.h> int main(void){ int a,b; char c; while(1){ scanf("%d %c %d",&a,&c,&b); if(c=='?')break; if(c=='+')printf("%d\n",a+b); if(c=='-')printf("%d\n",a-b); if(c=='*')printf("%d\n",a*b); if(c=='/')printf("%d\n",a/b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268045/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268045/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 %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 %c, ptr noundef nonnull %b) %0 = load i8, ptr %c, align 1, !tbaa !5 switch i8 %0, label %if.end7 [ i8 63, label %while.end i8 43, label %if.then5 ] 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 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %.pr = load i8, ptr %c, align 1, !tbaa !5 br label %if.end7 if.end7: ; preds = %while.cond, %if.then5 %3 = phi i8 [ %0, %while.cond ], [ %.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 %c, 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) %.pr26 = load i8, ptr %c, align 1, !tbaa !5 br label %if.end19 if.end19: ; preds = %if.then17, %if.end13 %9 = phi i8 [ %.pr26, %if.then17 ], [ %6, %if.end13 ] %cmp21 = icmp eq i8 %9, 47 br i1 %cmp21, label %if.then23, label %while.cond.backedge 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 %while.cond.backedge while.cond.backedge: ; preds = %if.then23, %if.end19 br label %while.cond while.end: ; preds = %while.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"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}
#include <stdio.h> int main(void) { int a, b; char op; for(; ; ) { 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_268089/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268089/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.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 %for.cond.backedge [ i8 63, label %for.end i8 43, label %if.then5 i8 45, label %if.then11 i8 42, label %if.then17 i8 47, label %if.then23 ] if.then5: ; 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 %if.end28.sink.split if.then11: ; 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 %if.end28.sink.split if.then17: ; 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 %if.end28.sink.split if.then23: ; 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 %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 %for.cond.backedge for.cond.backedge: ; preds = %if.end28.sink.split, %for.cond 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> int main(){ int i,j,n[21],s[100],t,a,b,r[100]; i=0; while (1) { scanf("%d",&n[i]); if (n[i]==0) break; t=0; a=0; b=1000; for (j=0;j<n[i];j++) { scanf("%d",&s[j]); t+=s[j]; if (a<s[j]) {a=s[j];} if (b>s[j]) {b=s[j];} } r[i]=t-a-b; i++; } for (j=0;j<i;j++) { printf("%d\n",(r[j]/(n[j]-2))); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268146/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268146/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 [21 x i32], align 16 %s = alloca [100 x i32], align 16 %r = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 84, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %r) #4 %call68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 16, !tbaa !5 %cmp69 = icmp eq i32 %0, 0 br i1 %cmp69, label %for.end40, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %8, %for.end ], [ %0, %entry ] %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.end ], [ 0, %entry ] %arrayidx72 = phi ptr [ %arrayidx, %for.end ], [ %n, %entry ] %cmp561 = icmp sgt i32 %1, 0 br i1 %cmp561, label %for.body, label %for.end for.cond29.preheader: ; preds = %for.end %2 = and i64 %indvars.iv.next78, 4294967295 %cmp3074.not = icmp eq i64 %2, 0 br i1 %cmp3074.not, label %for.end40, label %for.body31.preheader for.body31.preheader: ; preds = %for.cond29.preheader %wide.trip.count = and i64 %indvars.iv.next78, 4294967295 br label %for.body31 for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %b.065 = phi i32 [ %b.1, %for.body ], [ 1000, %for.cond.preheader ] %a.064 = phi i32 [ %spec.select, %for.body ], [ 0, %for.cond.preheader ] %t.063 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %arrayidx7 = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %indvars.iv %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %3 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %3, %t.063 %spec.select = call i32 @llvm.smax.i32(i32 %a.064, i32 %3) %b.1 = call i32 @llvm.smin.i32(i32 %b.065, i32 %3) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %arrayidx72, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp5 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp5, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.body %6 = add i32 %spec.select, %b.1 %7 = sub i32 %add, %6 br label %for.end for.end: ; preds = %for.end.loopexit, %for.cond.preheader %sub25 = phi i32 [ -1000, %for.cond.preheader ], [ %7, %for.end.loopexit ] %arrayidx27 = getelementptr inbounds [100 x i32], ptr %r, i64 0, i64 %indvars.iv77 store i32 %sub25, ptr %arrayidx27, align 4, !tbaa !5 %indvars.iv.next78 = add nuw i64 %indvars.iv77, 1 %arrayidx = getelementptr inbounds [21 x i32], ptr %n, i64 0, i64 %indvars.iv.next78 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %8 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %8, 0 br i1 %cmp, label %for.cond29.preheader, label %for.cond.preheader for.body31: ; preds = %for.body31.preheader, %for.body31 %indvars.iv80 = phi i64 [ 0, %for.body31.preheader ], [ %indvars.iv.next81, %for.body31 ] %arrayidx33 = getelementptr inbounds [100 x i32], ptr %r, i64 0, i64 %indvars.iv80 %9 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %arrayidx35 = getelementptr inbounds [21 x i32], ptr %n, i64 0, i64 %indvars.iv80 %10 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %sub36 = add nsw i32 %10, -2 %div = sdiv i32 %9, %sub36 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %exitcond.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count br i1 %exitcond.not, label %for.end40, label %for.body31, !llvm.loop !11 for.end40: ; preds = %for.body31, %entry, %for.cond29.preheader call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 84, 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 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() { int n,t; scanf("%d %d",&n,&t); int a[n+1]; int i; for(i=1;i<=n-1;i++) scanf("%d",&a[i]); int sum=0; i=1; int c=0; while(i<=n-1) { i=i+a[i]; if(i==t) { c=1; break; } else if(i>t) { c=0; break; } } if(c==0) printf("NO\n"); else printf("YES\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26819/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26819/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 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.4 = 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: %n = alloca i32, align 4 %t = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t) %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 %cmp.not.not25 = icmp sgt i32 %3, 1 br i1 %cmp.not.not25, label %for.body, label %while.cond.preheader while.cond.preheader: ; preds = %for.body, %entry %.lcssa = phi i32 [ %3, %entry ], [ %5, %for.body ] %4 = load i32, ptr %t, align 4 br label %while.cond 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.next, %6 br i1 %cmp.not.not, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.cond: ; preds = %while.cond.preheader, %if.else %i.1 = phi i32 [ %add6, %if.else ], [ 1, %while.cond.preheader ] %cmp3.not.not = icmp slt i32 %i.1, %.lcssa br i1 %cmp3.not.not, label %while.body, label %if.end16 while.body: ; preds = %while.cond %idxprom4 = sext i32 %i.1 to i64 %arrayidx5 = getelementptr inbounds i32, ptr %vla, i64 %idxprom4 %7 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %add6 = add nsw i32 %7, %i.1 %cmp7 = icmp eq i32 %add6, %4 br i1 %cmp7, label %if.end16, label %if.else if.else: ; preds = %while.body %cmp8 = icmp sgt i32 %add6, %4 br i1 %cmp8, label %if.end16, label %while.cond, !llvm.loop !11 if.end16: ; preds = %while.body, %while.cond, %if.else %str.sink = phi ptr [ @str.4, %if.else ], [ @str.4, %while.cond ], [ @str, %while.body ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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 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"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> int main() { int n,t,a[30010],i,x; scanf ("%d %d", &n, &t); for (i=0;i<(n-1);i++){ scanf ("%d", &a[i]); } x=1; while (x < t){ x = a[x-1] +x; } if (x==t){ printf ("YES\n"); } else printf ("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26824/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26824/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 = 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 %t = alloca i32, align 4 %a = alloca [30010 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 %t) #4 call void @llvm.lifetime.start.p0(i64 120040, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %0, 1 br i1 %cmp16, label %for.body, label %while.cond.preheader while.cond.preheader: ; preds = %for.body, %entry %1 = load i32, ptr %t, align 4, !tbaa !5 %cmp218 = icmp sgt i32 %1, 1 br i1 %cmp218, label %while.body, label %while.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [30010 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 %2 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %3 = sext i32 %sub to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.body: ; preds = %while.cond.preheader, %while.body %x.019 = phi i32 [ %add, %while.body ], [ 1, %while.cond.preheader ] %sub3 = add nsw i32 %x.019, -1 %idxprom4 = sext i32 %sub3 to i64 %arrayidx5 = getelementptr inbounds [30010 x i32], ptr %a, i64 0, i64 %idxprom4 %4 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %add = add nsw i32 %4, %x.019 %cmp2 = icmp slt i32 %add, %1 br i1 %cmp2, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %while.body, %while.cond.preheader %x.0.lcssa = phi i32 [ 1, %while.cond.preheader ], [ %add, %while.body ] %cmp6 = icmp eq i32 %x.0.lcssa, %1 %str.4.str = select i1 %cmp6, ptr @str.4, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) call void @llvm.lifetime.end.p0(i64 120040, ptr nonnull %a) #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 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"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(){ int n,s[1000],i,j,num,k; while(1){ num = 0; scanf("%d",&n); if(n == 0){ break; } for(i = 0 ; i < n ; i++){ scanf("%d",&s[i]); } for(i = 0 ; i < n ; i++){ for(j = i ; j < n ; j++){ if(s[i] > s[j]){ k = s[i]; s[i] = s[j]; s[j] = k; } } } for(i = 1 ; i < n - 1 ; i++){ num += s[i]; } num /= (n-2); printf("%d\n",num); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268290/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268290/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 [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %s) #4 %call67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp68 = icmp eq i32 %0, 0 br i1 %cmp68, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end37 %1 = phi i32 [ %15, %for.end37 ], [ %0, %entry ] %cmp158 = icmp sgt i32 %1, 0 br i1 %cmp158, label %for.body, label %for.end37 for.cond3.preheader: ; preds = %for.body %cmp461 = icmp sgt i32 %3, 0 br i1 %cmp461, label %for.cond6.preheader.preheader, label %for.end37 for.cond6.preheader.preheader: ; preds = %for.cond3.preheader %2 = zext i32 %3 to i64 %wide.trip.count = zext i32 %3 to i64 br label %for.cond6.preheader for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %cmp1 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp1, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond30.preheader: ; preds = %for.inc27 %cmp3163 = icmp sgt i32 %3, 2 br i1 %cmp3163, label %for.body32.preheader, label %for.end37 for.body32.preheader: ; preds = %for.cond30.preheader %sub = add nsw i32 %3, -1 %wide.trip.count80 = zext i32 %sub to i64 %5 = add nsw i64 %wide.trip.count80, -1 %min.iters.check = icmp ult i64 %5, 8 br i1 %min.iters.check, label %for.body32.preheader90, label %vector.ph vector.ph: ; preds = %for.body32.preheader %n.vec = and i64 %5, -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.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %vec.phi88 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %offset.idx = or i64 %index, 1 %6 = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5 %7 = getelementptr inbounds i32, ptr %6, i64 4 %wide.load89 = load <4 x i32>, ptr %7, align 4, !tbaa !5 %8 = add <4 x i32> %wide.load, %vec.phi %9 = add <4 x i32> %wide.load89, %vec.phi88 %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %9, %8 %11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %5, %n.vec br i1 %cmp.n, label %for.end37, label %for.body32.preheader90 for.body32.preheader90: ; preds = %for.body32.preheader, %middle.block %indvars.iv77.ph = phi i64 [ 1, %for.body32.preheader ], [ %ind.end, %middle.block ] %num.064.ph = phi i32 [ 0, %for.body32.preheader ], [ %11, %middle.block ] br label %for.body32 for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc27 %indvars.iv71 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next72, %for.inc27 ] %arrayidx10 = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %indvars.iv71 br label %for.body8 for.body8: ; preds = %for.cond6.preheader, %for.inc24 %indvars.iv73 = phi i64 [ %indvars.iv71, %for.cond6.preheader ], [ %indvars.iv.next74, %for.inc24 ] %12 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %arrayidx12 = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %indvars.iv73 %13 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp sgt i32 %12, %13 br i1 %cmp13, label %if.then14, label %for.inc24 if.then14: ; preds = %for.body8 store i32 %13, ptr %arrayidx10, align 4, !tbaa !5 store i32 %12, ptr %arrayidx12, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.body8, %if.then14 %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %cmp7 = icmp ult i64 %indvars.iv.next74, %2 br i1 %cmp7, label %for.body8, label %for.inc27, !llvm.loop !14 for.inc27: ; preds = %for.inc24 %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %exitcond.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count br i1 %exitcond.not, label %for.cond30.preheader, label %for.cond6.preheader, !llvm.loop !15 for.body32: ; preds = %for.body32.preheader90, %for.body32 %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body32 ], [ %indvars.iv77.ph, %for.body32.preheader90 ] %num.064 = phi i32 [ %add, %for.body32 ], [ %num.064.ph, %for.body32.preheader90 ] %arrayidx34 = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %indvars.iv77 %14 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %add = add nsw i32 %14, %num.064 %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %exitcond81.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count80 br i1 %exitcond81.not, label %for.end37, label %for.body32, !llvm.loop !16 for.end37: ; preds = %for.body32, %middle.block, %for.cond.preheader, %for.cond3.preheader, %for.cond30.preheader %.lcssa8487 = phi i32 [ %3, %for.cond30.preheader ], [ %3, %for.cond3.preheader ], [ %1, %for.cond.preheader ], [ %3, %middle.block ], [ %3, %for.body32 ] %num.0.lcssa = phi i32 [ 0, %for.cond30.preheader ], [ 0, %for.cond3.preheader ], [ 0, %for.cond.preheader ], [ %11, %middle.block ], [ %add, %for.body32 ] %sub38 = add nsw i32 %.lcssa8487, -2 %div = sdiv i32 %num.0.lcssa, %sub38 %call39 = 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) %15 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %15, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end37, %entry call void @llvm.lifetime.end.p0(i64 4000, 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.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} !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} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !13, !12}
// AOJ Vol30-3039 Special Chat // 2019.1.12 //#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main() { int P; scanf("%d", &P); printf("%d\n", P - P % 500); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268340/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268340/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: %P = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %P) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %P) %0 = load i32, ptr %P, align 4, !tbaa !5 %rem = srem i32 %0, 500 %sub = sub nsw i32 %0, %rem %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %P) #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> int main() { int len,m,n,i; char a[101]; while(scanf("%s",&a)!=EOF) { m=200; n=200; len=strlen(a); for(i=0;i<len;i++) { if(a[i]=='C') { if(m==200) { m=i; } else { m=m; } } if(a[i]=='F') { n=i; } } if(m!=200&&n!=200&&m<n) printf("Yes\n"); else if(m==200||n==200||m>n) printf("No\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268399/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268399/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: %a = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %a) #5 %call61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %cmp.not62 = icmp eq i32 %call61, -1 br i1 %cmp.not62, label %while.end, label %while.body while.body: ; preds = %entry, %if.end38 %call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6 %conv = trunc i64 %call1 to i32 %cmp256 = icmp sgt i32 %conv, 0 br i1 %cmp256, label %for.body.preheader, label %if.end38.sink.split for.body.preheader: ; preds = %while.body %wide.trip.count = and i64 %call1, 4294967295 %xtraiter = and i64 %call1, 1 %0 = icmp eq i64 %wide.trip.count, 1 br i1 %0, label %for.end.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %n.058 = phi i32 [ 200, %for.body.preheader.new ], [ %n.1.1, %for.body ] %m.057 = phi i32 [ 200, %for.body.preheader.new ], [ %m.1.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds [101 x i8], ptr %a, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 2, !tbaa !5 %cmp5 = icmp eq i8 %1, 67 %cmp7 = icmp eq i32 %m.057, 200 %2 = select i1 %cmp5, i1 %cmp7, i1 false %3 = trunc i64 %indvars.iv to i32 %m.1 = select i1 %2, i32 %3, i32 %m.057 %cmp14 = icmp eq i8 %1, 70 %n.1 = select i1 %cmp14, i32 %3, i32 %n.058 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [101 x i8], ptr %a, i64 0, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %cmp5.1 = icmp eq i8 %4, 67 %cmp7.1 = icmp eq i32 %m.1, 200 %5 = select i1 %cmp5.1, i1 %cmp7.1, i1 false %6 = trunc i64 %indvars.iv.next to i32 %m.1.1 = select i1 %5, i32 %6, i32 %m.1 %cmp14.1 = icmp eq i8 %4, 70 %n.1.1 = select i1 %cmp14.1, i32 %6, i32 %n.1 %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.end.unr-lcssa, label %for.body, !llvm.loop !8 for.end.unr-lcssa: ; preds = %for.body, %for.body.preheader %m.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %m.1.1, %for.body ] %n.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %n.1.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %n.058.unr = phi i32 [ 200, %for.body.preheader ], [ %n.1.1, %for.body ] %m.057.unr = phi i32 [ 200, %for.body.preheader ], [ %m.1.1, %for.body ] %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 %arrayidx.epil = getelementptr inbounds [101 x i8], ptr %a, i64 0, i64 %indvars.iv.unr %7 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 %cmp5.epil = icmp eq i8 %7, 67 %cmp7.epil = icmp eq i32 %m.057.unr, 200 %8 = select i1 %cmp5.epil, i1 %cmp7.epil, i1 false %9 = trunc i64 %indvars.iv.unr to i32 %m.1.epil = select i1 %8, i32 %9, i32 %m.057.unr %cmp14.epil = icmp eq i8 %7, 70 %n.1.epil = select i1 %cmp14.epil, i32 %9, i32 %n.058.unr br label %for.end for.end: ; preds = %for.end.unr-lcssa, %for.body.epil %m.1.lcssa = phi i32 [ %m.1.lcssa.ph, %for.end.unr-lcssa ], [ %m.1.epil, %for.body.epil ] %n.1.lcssa = phi i32 [ %n.1.lcssa.ph, %for.end.unr-lcssa ], [ %n.1.epil, %for.body.epil ] %cmp18 = icmp ne i32 %m.1.lcssa, 200 %cmp20 = icmp ne i32 %n.1.lcssa, 200 %or.cond = select i1 %cmp18, i1 %cmp20, i1 false %cmp23 = icmp slt i32 %m.1.lcssa, %n.1.lcssa %or.cond54 = select i1 %or.cond, i1 %cmp23, i1 false br i1 %or.cond54, label %if.end38.sink.split, label %if.else27 if.else27: ; preds = %for.end %cmp28 = icmp eq i32 %m.1.lcssa, 200 %cmp30 = icmp eq i32 %n.1.lcssa, 200 %or.cond39 = select i1 %cmp28, i1 true, i1 %cmp30 %cmp33 = icmp sgt i32 %m.1.lcssa, %n.1.lcssa %or.cond55 = select i1 %or.cond39, i1 true, i1 %cmp33 br i1 %or.cond55, label %if.end38.sink.split, label %if.end38 if.end38.sink.split: ; preds = %if.else27, %while.body, %for.end %str.sink = phi ptr [ @str.3, %for.end ], [ @str, %while.body ], [ @str, %if.else27 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) br label %if.end38 if.end38: ; preds = %if.end38.sink.split, %if.else27 %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 !10 while.end: ; preds = %if.end38, %entry call void @llvm.lifetime.end.p0(i64 101, 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 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 = !{!"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> int main (int argc, char *argv[]) { int i = 1; int first = 0; int isFound = 0; char c; c = getchar(); while (i <= 100 && c != EOF) { if (c == 'C') first = 1; if (first == 1 && c == 'F') isFound = 1; c = getchar(); i++; } if (isFound == 1) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268456/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268456/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"No\00", align 1 @str.2 = private unnamed_addr constant [4 x i8] c"Yes\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: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %sext28 = shl i32 %call.i, 24 %cmp329.not = icmp eq i32 %sext28, -16777216 br i1 %cmp329.not, label %if.else, label %while.body while.body: ; preds = %entry, %while.body %sext33 = phi i32 [ %sext, %while.body ], [ %sext28, %entry ] %isFound.032 = phi i32 [ %isFound.1, %while.body ], [ 0, %entry ] %first.031 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ] %i.030 = phi i32 [ %inc, %while.body ], [ 1, %entry ] %cmp6 = icmp eq i32 %sext33, 1124073472 %spec.select = select i1 %cmp6, i32 1, i32 %first.031 %cmp8 = icmp eq i32 %spec.select, 1 %cmp11 = icmp eq i32 %sext33, 1174405120 %or.cond = and i1 %cmp11, %cmp8 %isFound.1 = select i1 %or.cond, i32 1, i32 %isFound.032 %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i27 = tail call i32 @getc(ptr noundef %1) %inc = add nuw nsw i32 %i.030, 1 %cmp = icmp ult i32 %i.030, 100 %sext = shl i32 %call.i27, 24 %cmp3 = icmp ne i32 %sext, -16777216 %2 = and i1 %cmp, %cmp3 br i1 %2, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body %3 = icmp eq i32 %isFound.1, 1 br i1 %3, label %if.end22, label %if.else if.else: ; preds = %entry, %while.end br label %if.end22 if.end22: ; preds = %while.end, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.2, %while.end ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) 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 @puts(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 = { 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 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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int i,H,N,A; scanf("%d %d",&H,&N); for(i=0; i<N; i++) { scanf("%d",&A); H=H-A; } if(H<=0) printf("Yes"); else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268557/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268557/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 %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 %H, align 4, !tbaa !5 br label %for.end for.body: ; preds = %entry, %for.body %i.07 = 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 %H, align 4, !tbaa !5 %2 = load i32, ptr %A, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 store i32 %sub, ptr %H, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.07, 1 %3 = load i32, ptr %N, 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 ] %cmp2 = icmp slt i32 %4, 1 %.str.2..str.3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3) 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> #include<stdlib.h> #include<string.h> #include<math.h> #define N 50000 int judge(int a[N], int n, int t); int main() { int i, j, k; int a[N], t, n; memset(a, 0, sizeof(a)); scanf("%d%d",&n, &t); for(i = 1; i <= n - 1; i++) { scanf("%d", &a[i]); } if(judge(a, n, t)) printf("YES\n"); else printf("NO\n"); return 0; } int judge(int a[], int n, int t) { int sum = 0, i = 1; while(sum < t) { sum = i + a[i]; if(sum == t) return 1; i = sum; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26860/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26860/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: %a = alloca [50000 x i32], align 16 %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 200000, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200000) %a, i8 0, i64 200000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not11 = icmp sgt i32 %0, 1 br i1 %cmp.not.not11, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [50000 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 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %3 = load i32, ptr %t, align 4, !tbaa !5 br label %while.cond.i while.cond.i: ; preds = %while.body.i, %for.end %sum.0.i = phi i32 [ 0, %for.end ], [ %add.i, %while.body.i ] %i.0.i = phi i32 [ 1, %for.end ], [ %add.i, %while.body.i ] %cmp.i = icmp slt i32 %sum.0.i, %3 br i1 %cmp.i, label %while.body.i, label %if.end while.body.i: ; preds = %while.cond.i %idxprom.i = sext i32 %i.0.i to i64 %arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %idxprom.i %4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %add.i = add nsw i32 %4, %i.0.i %cmp1.i = icmp eq i32 %add.i, %3 br i1 %cmp1.i, label %if.end, label %while.cond.i, !llvm.loop !11 if.end: ; preds = %while.cond.i, %while.body.i %str.sink = phi ptr [ @str.4, %while.body.i ], [ @str, %while.cond.i ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6 call void @llvm.lifetime.end.p0(i64 200000, 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: 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 norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @judge(ptr nocapture noundef readonly %a, i32 noundef %n, i32 noundef %t) local_unnamed_addr #4 { entry: br label %while.cond while.cond: ; preds = %while.body, %entry %sum.0 = phi i32 [ 0, %entry ], [ %add, %while.body ] %i.0 = phi i32 [ 1, %entry ], [ %add, %while.body ] %cmp = icmp slt i32 %sum.0, %t br i1 %cmp, label %while.body, label %cleanup while.body: ; preds = %while.cond %idxprom = sext i32 %i.0 to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %0, %i.0 %cmp1 = icmp eq i32 %add, %t br i1 %cmp1, label %cleanup, label %while.cond, !llvm.loop !11 cleanup: ; preds = %while.cond, %while.body %retval.0 = phi i32 [ 1, %while.body ], [ 0, %while.cond ] ret i32 %retval.0 } ; 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 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 = { 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 } 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}
#include <stdio.h> #include <stdlib.h> int main() { int H,N,i,A,sum=0; scanf("%d",&H); scanf("%d",&N); for(i=0;i<N;i++) {scanf("%d",&A); sum=sum+A; } if(sum<H) { printf("No\n");} else { printf("Yes\n");} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268643/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268643/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 [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) #4 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 = 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 i32, ptr %N, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %sum.011 = phi i32 [ %add, %for.body ], [ 0, %entry ] %i.010 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %1 = load i32, ptr %A, align 4, !tbaa !5 %add = add nsw i32 %1, %sum.011 %inc = add nuw nsw i32 %i.010, 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 %H, align 4, !tbaa !5 %cmp3 = icmp slt i32 %sum.0.lcssa, %3 %str.3.str = select i1 %cmp3, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 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 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> #define rep(i, n) for (int i = 0; i < (int) (n); i++) #define MOD 1000000007 typedef long long ll; int main(){ ll h, n, sum = 0, i = 0; scanf("%lld%lld", &h, &n); ll a[n]; rep(i, n){ scanf("%lld", &a[i]); sum += a[i]; if(sum >= h){ printf("Yes"); return 0; } } printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268687/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268687/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 [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 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 = 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 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %conv19 = trunc i64 %2 to i32 %cmp.not20 = icmp sgt i32 %conv19, 0 br i1 %cmp.not20, label %for.body, label %cleanup10 for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i64, ptr %n, align 8, !tbaa !5 %sext = shl i64 %3, 32 %4 = ashr exact i64 %sext, 32 %cmp.not = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp.not, label %for.body, label %cleanup10, !llvm.loop !9 for.body: ; preds = %entry, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %sum.021 = phi i64 [ %add, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %5 = load i64, ptr %arrayidx, align 8, !tbaa !5 %add = add nsw i64 %5, %sum.021 %6 = load i64, ptr %h, align 8, !tbaa !5 %cmp6.not = icmp slt i64 %add, %6 br i1 %cmp6.not, label %for.cond, label %cleanup10 cleanup10: ; preds = %for.cond, %for.body, %entry %.str.2.sink = phi ptr [ @.str.3, %entry ], [ @.str.2, %for.body ], [ @.str.3, %for.cond ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.stackrestore.p0(ptr %1) 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 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 = !{!"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(void) { int n,a[100005],b[100005]; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&a[i]); b[a[i]]=i; } int days=0; int pos=n; int j=n; while(j>=1) { pos=b[j]; //printf("%d**\n",pos-days-1); for(int i=1;i<=pos-days-1;i++ ) printf("\n"); while(j>=1&&b[j]<=pos) { printf("%d ",j); j--; } printf("\n"); days=pos; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26873/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26873/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.2 = private unnamed_addr constant [4 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 %a = alloca [100005 x i32], align 16 %b = alloca [100005 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %b) #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.not41 = icmp slt i32 %0, 1 br i1 %cmp.not41, label %while.end27, label %for.body while.cond.preheader: ; preds = %for.body %cmp649 = icmp sgt i32 %3, 0 br i1 %cmp649, label %while.body, label %while.end27 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom4 = sext i32 %1 to i64 %arrayidx5 = getelementptr inbounds [100005 x i32], ptr %b, i64 0, i64 %idxprom4 %2 = trunc i64 %indvars.iv to i32 store i32 %2, ptr %arrayidx5, 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.not.not = icmp slt i64 %indvars.iv, %4 br i1 %cmp.not.not, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.body: ; preds = %while.cond.preheader, %while.end %j.051 = phi i32 [ %j.146, %while.end ], [ %3, %while.cond.preheader ] %days.050 = phi i32 [ %5, %while.end ], [ 0, %while.cond.preheader ] %idxprom7 = zext i32 %j.051 to i64 %arrayidx8 = getelementptr inbounds [100005 x i32], ptr %b, i64 0, i64 %idxprom7 %5 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %6 = xor i32 %days.050, -1 %sub11 = add i32 %5, %6 %cmp12.not43 = icmp slt i32 %sub11, 1 br i1 %cmp12.not43, label %land.rhs.preheader, label %for.body14.preheader for.body14.preheader: ; preds = %while.body %7 = sub i32 %5, %days.050 br label %for.body14 for.body14: ; preds = %for.body14.preheader, %for.body14 %i9.044 = phi i32 [ %inc17, %for.body14 ], [ 1, %for.body14.preheader ] %putchar40 = call i32 @putchar(i32 10) %inc17 = add nuw i32 %i9.044, 1 %exitcond.not = icmp eq i32 %inc17, %7 br i1 %exitcond.not, label %land.rhs.preheader, label %for.body14, !llvm.loop !11 land.rhs.preheader: ; preds = %for.body14, %while.body br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body24 %j.146 = phi i32 [ %dec, %while.body24 ], [ %j.051, %land.rhs.preheader ] %idxprom21 = zext i32 %j.146 to i64 %arrayidx22 = getelementptr inbounds [100005 x i32], ptr %b, i64 0, i64 %idxprom21 %8 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.not = icmp sgt i32 %8, %5 br i1 %cmp23.not, label %while.end, label %while.body24 while.body24: ; preds = %land.rhs %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %j.146) %dec = add nsw i32 %j.146, -1 %cmp20 = icmp sgt i32 %j.146, 1 br i1 %cmp20, label %land.rhs, label %while.end.thread, !llvm.loop !12 while.end.thread: ; preds = %while.body24 %putchar57 = call i32 @putchar(i32 10) br label %while.end27 while.end: ; preds = %land.rhs %putchar = call i32 @putchar(i32 10) %cmp6 = icmp sgt i32 %j.146, 0 br i1 %cmp6, label %while.body, label %while.end27, !llvm.loop !13 while.end27: ; preds = %while.end, %entry, %while.end.thread, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 400020, 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: 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 @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} !13 = distinct !{!13, !10}
#include <stdio.h> #define rep(i,n) for(int i=0; i<n; i++) int main(void){ int sum=0; int h,n; scanf("%d%d",&h,&n); rep(i,n){ int a=0; scanf("%d",&a); sum+=a; } sum>=h?printf("Yes"):printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268773/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268773/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 %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 = 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 %cmp7 = icmp sgt i32 %0, 0 br i1 %cmp7, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %1 = load i32, ptr %h, align 4, !tbaa !5 %cmp2.not = icmp slt i32 %sum.0.lcssa, %1 %.str.3..str.2 = select i1 %cmp2.not, ptr @.str.3, ptr @.str.2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2) 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 for.body: ; preds = %entry, %for.body %i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %sum.08 = phi i32 [ %add, %for.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 store i32 0, ptr %a, align 4, !tbaa !5 %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, %sum.08 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 %inc = add nuw nsw i32 %i.09, 1 %3 = load i32, ptr %n, 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 @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 H,A,count=0; scanf("%d%d",&H,&A); int ara[A]; for(int i=0;i<A;i++) { scanf("%d",&ara[i]); } for(int j=0;j<A;j++) { count=count+ara[j]; } if(count>=H) { printf("Yes\n"); } else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268816/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268816/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 %A = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %A) %0 = load i32, ptr %A, 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 %A, align 4, !tbaa !5 %cmp20 = icmp sgt i32 %3, 0 br i1 %cmp20, label %for.body, label %for.cond.cleanup4 for.cond2.preheader: ; preds = %for.body %cmp322 = icmp sgt i32 %10, 0 br i1 %cmp322, label %for.body5.preheader, label %for.cond.cleanup4 for.body5.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %10 to i64 %min.iters.check = icmp ult i32 %10, 8 br i1 %min.iters.check, label %for.body5.preheader35, label %vector.ph vector.ph: ; preds = %for.body5.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.phi33 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %4 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load34 = 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.load34, %vec.phi33 %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 %for.cond.cleanup4, label %for.body5.preheader35 for.body5.preheader35: ; preds = %for.body5.preheader, %middle.block %indvars.iv28.ph = phi i64 [ 0, %for.body5.preheader ], [ %n.vec, %middle.block ] %count.023.ph = phi i32 [ 0, %for.body5.preheader ], [ %9, %middle.block ] br label %for.body5 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %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) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %10 = load i32, ptr %A, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next, %11 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13 for.cond.cleanup4: ; preds = %for.body5, %middle.block, %entry, %for.cond2.preheader %count.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %9, %middle.block ], [ %add, %for.body5 ] %12 = load i32, ptr %H, align 4, !tbaa !5 %cmp11.not = icmp slt i32 %count.0.lcssa, %12 %str.str.4 = select i1 %cmp11.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 %A) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #6 ret i32 0 for.body5: ; preds = %for.body5.preheader35, %for.body5 %indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.body5 ], [ %indvars.iv28.ph, %for.body5.preheader35 ] %count.023 = phi i32 [ %add, %for.body5 ], [ %count.023.ph, %for.body5.preheader35 ] %arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv28 %13 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %13, %count.023 %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1 %exitcond.not = icmp eq i64 %indvars.iv.next29, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup4, label %for.body5, !llvm.loop !14 } ; 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 = 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<string.h> #include<stdlib.h> #include<math.h> typedef long long (ll); #define A 200005 #define M 1000000007 ll z[A],x[A],y[A],s[A]; void merge(ll arr[],ll l,ll m,ll r) { ll i,j,k,n1,n2; n1=m-l+1; n2=r-m; ll L[n1],R[n2]; for(i=0;i<n1;i++) L[i]=arr[l+i]; for(j=0;j<n2;j++) R[j]=arr[m+1+j]; i=j=0; k=l; while(i<n1&&j<n2) { if(L[i]<R[j]) arr[k++]=L[i++]; else arr[k++]=R[j++]; } while(i<n1) arr[k++]=L[i++]; while(j<n2) arr[k++]=R[j++]; } void sort(ll arr[],ll l,ll r) { if(l<r) { ll m=l+(r-l)/2; sort(arr,l,m); sort(arr,m+1,r); merge(arr,l,m,r); } } int main() { ll a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p; scanf("%lli",&a); for(;a;a--) { scanf("%lli",&b); for(c=0;c<b;c++) { scanf("%lli",&z[c]); } sort(z,0,b-1); for(c=d=0;c<b;c++) d+=z[c]; g=d; for(c=1;c<b-1;c++) { g-=z[c]; f=g-((b-c-1)*z[c]); d+=f; } d=-d; d+=z[b-1]; printf("%lli\n",d); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26886/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26886/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"%lli\00", align 1 @z = dso_local global [200005 x i64] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%lli\0A\00", align 1 @x = dso_local local_unnamed_addr global [200005 x i64] zeroinitializer, align 16 @y = dso_local local_unnamed_addr global [200005 x i64] zeroinitializer, align 16 @s = dso_local local_unnamed_addr global [200005 x i64] zeroinitializer, align 16 ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @merge(ptr nocapture noundef %arr, i64 noundef %l, i64 noundef %m, i64 noundef %r) local_unnamed_addr #0 { entry: %sub = sub nsw i64 %m, %l %add = add nsw i64 %sub, 1 %sub1 = sub nsw i64 %r, %m %vla = alloca i64, i64 %add, align 16 %vla2 = alloca i64, i64 %sub1, align 16 %cmp.not79 = icmp slt i64 %sub, 0 br i1 %cmp.not79, label %for.cond5.preheader, label %for.body.preheader for.body.preheader: ; preds = %entry %invariant.gep = getelementptr i64, ptr %arr, i64 %l %0 = add i64 %m, 1 %1 = sub i64 %0, %l %2 = shl nuw i64 %1, 3 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %vla, ptr align 8 %invariant.gep, i64 %2, i1 false), !tbaa !5 br label %for.cond5.preheader for.cond5.preheader: ; preds = %for.body.preheader, %entry %cmp681 = icmp sgt i64 %sub1, 0 br i1 %cmp681, label %while.cond.preheader, label %while.cond28.preheader while.cond.preheader: ; preds = %for.cond5.preheader %3 = getelementptr i64, ptr %arr, i64 %m %4 = getelementptr i64, ptr %3, i64 1 %5 = sub i64 %r, %m %6 = shl i64 %5, 3 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %vla2, ptr align 8 %4, i64 %6, i1 false), !tbaa !5 %cmp1583 = icmp sgt i64 %sub, -1 %7 = and i1 %cmp1583, %cmp681 br i1 %7, label %while.body, label %while.cond28.preheader while.cond28.preheader: ; preds = %while.body, %for.cond5.preheader, %while.cond.preheader %k.0.lcssa = phi i64 [ %l, %while.cond.preheader ], [ %l, %for.cond5.preheader ], [ %k.1, %while.body ] %j.1.lcssa = phi i64 [ 0, %while.cond.preheader ], [ 0, %for.cond5.preheader ], [ %j.2, %while.body ] %i.1.lcssa = phi i64 [ 0, %while.cond.preheader ], [ 0, %for.cond5.preheader ], [ %i.2, %while.body ] %cmp29.not90 = icmp sgt i64 %i.1.lcssa, %sub br i1 %cmp29.not90, label %while.cond36.preheader, label %while.body30.preheader while.body30.preheader: ; preds = %while.cond28.preheader %8 = shl i64 %k.0.lcssa, 3 %scevgep = getelementptr i8, ptr %arr, i64 %8 %9 = shl i64 %i.1.lcssa, 3 %scevgep97 = getelementptr i8, ptr %vla, i64 %9 %10 = add i64 %m, 1 %11 = add i64 %i.1.lcssa, %l %12 = sub i64 %10, %11 %13 = shl nuw i64 %12, 3 call void @llvm.memcpy.p0.p0.i64(ptr align 8 %scevgep, ptr align 8 %scevgep97, i64 %13, i1 false), !tbaa !5 %14 = add i64 %k.0.lcssa, %m %15 = add i64 %14, 1 %16 = add i64 %i.1.lcssa, %l %17 = sub i64 %15, %16 br label %while.cond36.preheader while.body: ; preds = %while.cond.preheader, %while.body %i.187 = phi i64 [ %i.2, %while.body ], [ 0, %while.cond.preheader ] %j.186 = phi i64 [ %j.2, %while.body ], [ 0, %while.cond.preheader ] %k.085 = phi i64 [ %k.1, %while.body ], [ %l, %while.cond.preheader ] %arrayidx17 = getelementptr inbounds i64, ptr %vla, i64 %i.187 %18 = load i64, ptr %arrayidx17, align 8, !tbaa !5 %arrayidx18 = getelementptr inbounds i64, ptr %vla2, i64 %j.186 %19 = load i64, ptr %arrayidx18, align 8, !tbaa !5 %cmp19 = icmp sge i64 %18, %19 %.sink = tail call i64 @llvm.smin.i64(i64 %18, i64 %19) %inc24 = zext i1 %cmp19 to i64 %j.2 = add nuw nsw i64 %j.186, %inc24 %not.cmp19 = xor i1 %cmp19, true %inc20 = zext i1 %not.cmp19 to i64 %i.2 = add nuw nsw i64 %i.187, %inc20 %20 = getelementptr inbounds i64, ptr %arr, i64 %k.085 store i64 %.sink, ptr %20, align 8 %k.1 = add nsw i64 %k.085, 1 %cmp15 = icmp sle i64 %i.2, %sub %cmp16 = icmp slt i64 %j.2, %sub1 %21 = select i1 %cmp15, i1 %cmp16, i1 false br i1 %21, label %while.body, label %while.cond28.preheader, !llvm.loop !9 while.cond36.preheader: ; preds = %while.body30.preheader, %while.cond28.preheader %k.2.lcssa = phi i64 [ %k.0.lcssa, %while.cond28.preheader ], [ %17, %while.body30.preheader ] %cmp3794 = icmp slt i64 %j.1.lcssa, %sub1 br i1 %cmp3794, label %while.body38.preheader, label %while.end43 while.body38.preheader: ; preds = %while.cond36.preheader %22 = shl i64 %k.2.lcssa, 3 %scevgep98 = getelementptr i8, ptr %arr, i64 %22 %23 = shl i64 %j.1.lcssa, 3 %scevgep99 = getelementptr i8, ptr %vla2, i64 %23 %24 = add i64 %j.1.lcssa, %m %25 = sub i64 %r, %24 %26 = shl nuw i64 %25, 3 call void @llvm.memcpy.p0.p0.i64(ptr align 8 %scevgep98, ptr align 8 %scevgep99, i64 %26, i1 false), !tbaa !5 br label %while.end43 while.end43: ; preds = %while.body38.preheader, %while.cond36.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 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 @sort(ptr noundef %arr, i64 noundef %l, i64 noundef %r) local_unnamed_addr #0 { entry: %cmp = icmp slt i64 %l, %r br i1 %cmp, label %if.then, label %common.ret13 common.ret13: ; preds = %entry, %if.then ret void if.then: ; preds = %entry %sub = sub nsw i64 %r, %l %div = sdiv i64 %sub, 2 %add = add nsw i64 %div, %l tail call void @sort(ptr noundef %arr, i64 noundef %l, i64 noundef %add) %add1 = add nsw i64 %add, 1 tail call void @sort(ptr noundef %arr, i64 noundef %add1, i64 noundef %r) tail call void @merge(ptr noundef %arr, i64 noundef %l, i64 noundef %add, i64 noundef %r) br label %common.ret13 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %.pr = load i64, ptr %a, align 8, !tbaa !5 %tobool.not60 = icmp eq i64 %.pr, 0 br i1 %tobool.not60, label %for.end32, label %for.body for.body: ; preds = %entry, %for.end25 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i64, ptr %b, align 8, !tbaa !5 %cmp49 = icmp sgt i64 %0, 0 br i1 %cmp49, label %for.body3, label %for.end.thread for.end.thread: ; preds = %for.body %sub65 = add nsw i64 %0, -1 call void @sort(ptr noundef nonnull @z, i64 noundef 0, i64 noundef %sub65) br label %for.end25 for.body3: ; preds = %for.body, %for.body3 %c.050 = phi i64 [ %inc, %for.body3 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [200005 x i64], ptr @z, i64 0, i64 %c.050 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %c.050, 1 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %1 br i1 %cmp, label %for.body3, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body3 %sub = add nsw i64 %1, -1 call void @sort(ptr noundef nonnull @z, i64 noundef 0, i64 noundef %sub) %cmp651 = icmp sgt i64 %1, 0 br i1 %cmp651, label %for.body7.preheader, label %for.end25 for.body7.preheader: ; preds = %for.end %min.iters.check = icmp ult i64 %1, 4 br i1 %min.iters.check, label %for.body7.preheader77, label %vector.ph vector.ph: ; preds = %for.body7.preheader %n.vec = and i64 %1, -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 ], [ %4, %vector.body ] %vec.phi74 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ] %2 = getelementptr inbounds [200005 x i64], ptr @z, i64 0, i64 %index %wide.load = load <2 x i64>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i64, ptr %2, i64 2 %wide.load75 = load <2 x i64>, ptr %3, align 16, !tbaa !5 %4 = add <2 x i64> %wide.load, %vec.phi %5 = add <2 x i64> %wide.load75, %vec.phi74 %index.next = add nuw i64 %index, 4 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %5, %4 %7 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %for.cond12.preheader, label %for.body7.preheader77 for.body7.preheader77: ; preds = %for.body7.preheader, %middle.block %c.153.ph = phi i64 [ 0, %for.body7.preheader ], [ %n.vec, %middle.block ] %d.052.ph = phi i64 [ 0, %for.body7.preheader ], [ %7, %middle.block ] br label %for.body7 for.cond12.preheader: ; preds = %for.body7, %middle.block %add.lcssa = phi i64 [ %7, %middle.block ], [ %add, %for.body7 ] %cmp1455 = icmp sgt i64 %1, 2 br i1 %cmp1455, label %for.body15.preheader, label %for.end25 for.body15.preheader: ; preds = %for.cond12.preheader %xtraiter = and i64 %1, 1 %8 = icmp eq i64 %1, 3 br i1 %8, label %for.end25.loopexit.unr-lcssa, label %for.body15.preheader.new for.body15.preheader.new: ; preds = %for.body15.preheader %9 = and i64 %1, -2 %10 = add i64 %9, -4 br label %for.body15 for.body7: ; preds = %for.body7.preheader77, %for.body7 %c.153 = phi i64 [ %inc10, %for.body7 ], [ %c.153.ph, %for.body7.preheader77 ] %d.052 = phi i64 [ %add, %for.body7 ], [ %d.052.ph, %for.body7.preheader77 ] %arrayidx8 = getelementptr inbounds [200005 x i64], ptr @z, i64 0, i64 %c.153 %11 = load i64, ptr %arrayidx8, align 8, !tbaa !5 %add = add nsw i64 %11, %d.052 %inc10 = add nuw nsw i64 %c.153, 1 %exitcond.not = icmp eq i64 %inc10, %1 br i1 %exitcond.not, label %for.cond12.preheader, label %for.body7, !llvm.loop !15 for.body15: ; preds = %for.body15, %for.body15.preheader.new %c.258 = phi i64 [ 1, %for.body15.preheader.new ], [ %.neg.1, %for.body15 ] %d.157 = phi i64 [ %add.lcssa, %for.body15.preheader.new ], [ %add22.1, %for.body15 ] %g.056 = phi i64 [ %add.lcssa, %for.body15.preheader.new ], [ %sub17.1, %for.body15 ] %niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.1, %for.body15 ] %arrayidx16 = getelementptr inbounds [200005 x i64], ptr @z, i64 0, i64 %c.258 %12 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %sub17 = sub nsw i64 %g.056, %12 %.neg = add nuw nsw i64 %c.258, 1 %sub19.neg = sub i64 %.neg, %1 %mul.neg61 = mul i64 %sub19.neg, %12 %sub21 = add i64 %sub17, %d.157 %add22 = add i64 %sub21, %mul.neg61 %arrayidx16.1 = getelementptr inbounds [200005 x i64], ptr @z, i64 0, i64 %.neg %13 = load i64, ptr %arrayidx16.1, align 8, !tbaa !5 %sub17.1 = sub nsw i64 %sub17, %13 %.neg.1 = add nuw nsw i64 %c.258, 2 %sub19.neg.1 = sub i64 %.neg.1, %1 %mul.neg61.1 = mul i64 %sub19.neg.1, %13 %sub21.1 = add i64 %sub17.1, %add22 %add22.1 = add i64 %sub21.1, %mul.neg61.1 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter, %10 br i1 %niter.ncmp.1, label %for.end25.loopexit.unr-lcssa, label %for.body15, !llvm.loop !16 for.end25.loopexit.unr-lcssa: ; preds = %for.body15, %for.body15.preheader %add22.lcssa.ph = phi i64 [ undef, %for.body15.preheader ], [ %add22.1, %for.body15 ] %c.258.unr = phi i64 [ 1, %for.body15.preheader ], [ %.neg.1, %for.body15 ] %d.157.unr = phi i64 [ %add.lcssa, %for.body15.preheader ], [ %add22.1, %for.body15 ] %g.056.unr = phi i64 [ %add.lcssa, %for.body15.preheader ], [ %sub17.1, %for.body15 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end25, label %for.body15.epil for.body15.epil: ; preds = %for.end25.loopexit.unr-lcssa %arrayidx16.epil = getelementptr inbounds [200005 x i64], ptr @z, i64 0, i64 %c.258.unr %14 = load i64, ptr %arrayidx16.epil, align 8, !tbaa !5 %sub17.epil = sub nsw i64 %g.056.unr, %14 %.neg.epil = add nuw nsw i64 %c.258.unr, 1 %sub19.neg.epil = sub i64 %.neg.epil, %1 %mul.neg61.epil = mul i64 %sub19.neg.epil, %14 %sub21.epil = add i64 %sub17.epil, %d.157.unr %add22.epil = add i64 %sub21.epil, %mul.neg61.epil br label %for.end25 for.end25: ; preds = %for.body15.epil, %for.end25.loopexit.unr-lcssa, %for.end.thread, %for.end, %for.cond12.preheader %sub6873 = phi i64 [ %sub, %for.cond12.preheader ], [ %sub65, %for.end.thread ], [ %sub, %for.end ], [ %sub, %for.end25.loopexit.unr-lcssa ], [ %sub, %for.body15.epil ] %d.1.lcssa = phi i64 [ %add.lcssa, %for.cond12.preheader ], [ 0, %for.end.thread ], [ 0, %for.end ], [ %add22.lcssa.ph, %for.end25.loopexit.unr-lcssa ], [ %add22.epil, %for.body15.epil ] %arrayidx28 = getelementptr inbounds [200005 x i64], ptr @z, i64 0, i64 %sub6873 %15 = load i64, ptr %arrayidx28, align 8, !tbaa !5 %add29 = sub i64 %15, %d.1.lcssa %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add29) %16 = load i64, ptr %a, align 8, !tbaa !5 %dec = add nsw i64 %16, -1 store i64 %dec, ptr %a, align 8, !tbaa !5 %tobool.not = icmp eq i64 %dec, 0 br i1 %tobool.not, label %for.end32, label %for.body, !llvm.loop !17 for.end32: ; preds = %for.end25, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #6 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 ; Function Attrs: 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !14, !13} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> int main() { int H, N, A[100000], i = 0, AD = 0; scanf("%d%d",&H,&N); while (i<N) { scanf("%d",&A[i]); AD = AD + A[i]; i++; } if (AD>=H) { printf("Yes"); } else { printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268902/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268902/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 %A = alloca [100000 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 400000, 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 %while.body, label %while.end while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %AD.013 = phi i32 [ %add, %while.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 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, %AD.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 %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry %AD.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] %4 = load i32, ptr %H, align 4, !tbaa !5 %cmp4.not = icmp slt i32 %AD.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 400000, 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; scanf("%d", &H); scanf("%d", &N); int i=0; int A[N]; int sum = 0; for(i=0;i<N;i++){ scanf("%d", &A[i]); sum = sum + A[i]; } if(sum >= H){ printf("Yes"); return 0; } printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268953/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268953/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"Yes\00", align 1 @.str.2 = 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) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %cmp16 = icmp sgt i32 %3, 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 ] %sum.018 = 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, %sum.018 %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 ], [ %add, %for.body ] %7 = load i32, ptr %H, align 4, !tbaa !5 %cmp5.not = icmp slt i32 %sum.0.lcssa, %7 %.str.2..str.1 = select i1 %cmp5.not, ptr @.str.2, ptr @.str.1 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) 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 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> int main(void) { int ryohi, in, out, sum; int i, k; scanf("%d",&ryohi) ; while( ryohi ) { k = 0; sum = 0; for( i = 0; i < 12; i++ ) { scanf("%d",&in); scanf("%d",&out); sum += (in - out); if( sum < ryohi ) k++; } if(k == 12) { puts("NA"); } else { printf("%d\n",k + 1); } scanf("%d",&ryohi); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268997/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268997/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"NA\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: %ryohi = alloca i32, align 4 %in = alloca i32, align 4 %out = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ryohi) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %in) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %out) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ryohi) %0 = load i32, ptr %ryohi, align 4, !tbaa !5 %tobool.not19 = icmp eq i32 %0, 0 br i1 %tobool.not19, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %if.end10 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3 = icmp slt i32 %sub, %3 %inc = zext i1 %cmp3 to i32 %call1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.1 = icmp slt i32 %add.1, %6 %inc.1 = zext i1 %cmp3.1 to i32 %spec.select.1 = add nuw nsw i32 %inc, %inc.1 %call1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.2 = icmp slt i32 %add.2, %9 %inc.2 = zext i1 %cmp3.2 to i32 %spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.2 %call1.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.3 = icmp slt i32 %add.3, %12 %inc.3 = zext i1 %cmp3.3 to i32 %spec.select.3 = add nuw nsw i32 %spec.select.2, %inc.3 %call1.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.4 = icmp slt i32 %add.4, %15 %inc.4 = zext i1 %cmp3.4 to i32 %spec.select.4 = add nuw nsw i32 %spec.select.3, %inc.4 %call1.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.5 = icmp slt i32 %add.5, %18 %inc.5 = zext i1 %cmp3.5 to i32 %spec.select.5 = add nuw nsw i32 %spec.select.4, %inc.5 %call1.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.6 = icmp slt i32 %add.6, %21 %inc.6 = zext i1 %cmp3.6 to i32 %spec.select.6 = add nuw nsw i32 %spec.select.5, %inc.6 %call1.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.7 = icmp slt i32 %add.7, %24 %inc.7 = zext i1 %cmp3.7 to i32 %spec.select.7 = add nuw nsw i32 %spec.select.6, %inc.7 %call1.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.8 = icmp slt i32 %add.8, %27 %inc.8 = zext i1 %cmp3.8 to i32 %spec.select.8 = add nuw nsw i32 %spec.select.7, %inc.8 %call1.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.9 = icmp slt i32 %add.9, %30 %inc.9 = zext i1 %cmp3.9 to i32 %spec.select.9 = add nuw nsw i32 %spec.select.8, %inc.9 %call1.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.10 = icmp slt i32 %add.10, %33 %inc.10 = zext i1 %cmp3.10 to i32 %spec.select.10 = add nuw nsw i32 %spec.select.9, %inc.10 %call1.11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %call2.11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %ryohi, align 4, !tbaa !5 %cmp3.11 = icmp slt i32 %add.11, %36 %inc.11 = zext i1 %cmp3.11 to i32 %spec.select.11 = add nuw nsw i32 %spec.select.10, %inc.11 %cmp5 = icmp eq i32 %spec.select.11, 12 br i1 %cmp5, label %if.then6, label %if.else if.then6: ; preds = %for.cond.preheader %call7 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) br label %if.end10 if.else: ; preds = %for.cond.preheader %add8 = add nuw nsw i32 %spec.select.11, 1 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add8) br label %if.end10 if.end10: ; preds = %if.else, %if.then6 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ryohi) %37 = load i32, ptr %ryohi, align 4, !tbaa !5 %tobool.not = icmp eq i32 %37, 0 br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !9 while.end: ; preds = %if.end10, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %out) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %in) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ryohi) #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 @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 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 n,m,l,a,i; for(;;){ scanf("%d",&l); if(l==0)break; a=0; for(i=0;i<12;i++){ scanf("%d %d",&m,&n); l -= (m-n); if(l<=0 && a==0)a=i+1; } if(l>0)puts("NA"); else printf("%d\n",a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269060/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269060/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 [3 x i8] c"NA\00", align 1 @.str.3 = 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 %l = 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 %l) #3 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l) %0 = load i32, ptr %l, align 4, !tbaa !5 %cmp21 = icmp eq i32 %0, 0 br i1 %cmp21, label %for.end14, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %if.end13 %call3 = 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 %sub4 = add i32 %sub.neg, %3 store i32 %sub4, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.1 = add i32 %sub.neg.1, %6 store i32 %sub4.1, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.2 = add i32 %sub.neg.2, %9 store i32 %sub4.2, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.3 = add i32 %sub.neg.3, %12 store i32 %sub4.3, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.4 = add i32 %sub.neg.4, %15 store i32 %sub4.4, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.5 = add i32 %sub.neg.5, %18 store i32 %sub4.5, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.6 = add i32 %sub.neg.6, %21 store i32 %sub4.6, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.7 = add i32 %sub.neg.7, %24 store i32 %sub4.7, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.8 = add i32 %sub.neg.8, %27 store i32 %sub4.8, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.9 = add i32 %sub.neg.9, %30 store i32 %sub4.9, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.10 = add i32 %sub.neg.10, %33 store i32 %sub4.10, ptr %l, align 4, !tbaa !5 %call3.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 %sub4.11 = add i32 %sub.neg.11, %36 store i32 %sub4.11, ptr %l, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %sub4.11, 0 br i1 %cmp9, label %if.then10, label %if.else if.then10: ; preds = %for.cond1.preheader %call11 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end13 if.else: ; preds = %for.cond1.preheader %cmp5.10 = icmp slt i32 %sub4.10, 1 %cmp5.9 = icmp slt i32 %sub4.9, 1 %cmp5.8 = icmp slt i32 %sub4.8, 1 %cmp5.7 = icmp slt i32 %sub4.7, 1 %cmp5.6 = icmp slt i32 %sub4.6, 1 %cmp5.5 = icmp slt i32 %sub4.5, 1 %cmp5.4 = icmp slt i32 %sub4.4, 1 %cmp5.3 = icmp slt i32 %sub4.3, 1 %cmp5.2 = icmp slt i32 %sub4.2, 1 %cmp5.1 = icmp sgt i32 %sub4.1, 0 %cmp5 = icmp slt i32 %sub4, 1 %or.cond.1.not = select i1 %cmp5.1, i1 true, i1 %cmp5 %spec.select = zext i1 %cmp5 to i32 %spec.select.1 = select i1 %or.cond.1.not, i32 %spec.select, i32 2 %cmp6.2 = icmp eq i32 %spec.select.1, 0 %or.cond.2 = select i1 %cmp5.2, i1 %cmp6.2, i1 false %spec.select.2 = select i1 %or.cond.2, i32 3, i32 %spec.select.1 %cmp6.3 = icmp eq i32 %spec.select.2, 0 %or.cond.3 = select i1 %cmp5.3, i1 %cmp6.3, i1 false %spec.select.3 = select i1 %or.cond.3, i32 4, i32 %spec.select.2 %cmp6.4 = icmp eq i32 %spec.select.3, 0 %or.cond.4 = select i1 %cmp5.4, i1 %cmp6.4, i1 false %spec.select.4 = select i1 %or.cond.4, i32 5, i32 %spec.select.3 %cmp6.5 = icmp eq i32 %spec.select.4, 0 %or.cond.5 = select i1 %cmp5.5, i1 %cmp6.5, i1 false %spec.select.5 = select i1 %or.cond.5, i32 6, i32 %spec.select.4 %cmp6.6 = icmp eq i32 %spec.select.5, 0 %or.cond.6 = select i1 %cmp5.6, i1 %cmp6.6, i1 false %spec.select.6 = select i1 %or.cond.6, i32 7, i32 %spec.select.5 %cmp6.7 = icmp eq i32 %spec.select.6, 0 %or.cond.7 = select i1 %cmp5.7, i1 %cmp6.7, i1 false %spec.select.7 = select i1 %or.cond.7, i32 8, i32 %spec.select.6 %cmp6.8 = icmp eq i32 %spec.select.7, 0 %or.cond.8 = select i1 %cmp5.8, i1 %cmp6.8, i1 false %spec.select.8 = select i1 %or.cond.8, i32 9, i32 %spec.select.7 %cmp6.9 = icmp eq i32 %spec.select.8, 0 %or.cond.9 = select i1 %cmp5.9, i1 %cmp6.9, i1 false %spec.select.9 = select i1 %or.cond.9, i32 10, i32 %spec.select.8 %cmp6.10 = icmp eq i32 %spec.select.9, 0 %or.cond.10 = select i1 %cmp5.10, i1 %cmp6.10, i1 false %spec.select.10 = select i1 %or.cond.10, i32 11, i32 %spec.select.9 %cmp6.11 = icmp eq i32 %spec.select.10, 0 %spec.select.11 = select i1 %cmp6.11, i32 12, i32 %spec.select.10 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %spec.select.11) br label %if.end13 if.end13: ; preds = %if.else, %if.then10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l) %37 = load i32, ptr %l, align 4, !tbaa !5 %cmp = icmp eq i32 %37, 0 br i1 %cmp, label %for.end14, label %for.cond1.preheader for.end14: ; preds = %if.end13, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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 @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 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_269110/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269110/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 a,b,c; scanf("%d%d",&a,&b); c=a*b; printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269161/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269161/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: %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,n; scanf("%d %d",&d,&c); n=d*c; printf("%d\n",n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269204/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269204/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> int main(void) { int a,b,c; scanf("%d %d",&a,&b); c=a*b; printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269248/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269248/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(void) { int d,c; scanf("%d %d",&d,&c); printf("%d\n",d*c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269291/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269291/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 <float.h> #include <inttypes.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <math.h> #ifdef __cplusplus #include <bits/stdc++.h> #endif uint32_t nextpint(void){ char c=getchar_unlocked(); while(c<'0'||'9'<c) c=getchar_unlocked(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return x; } uint32_t nextstr(char *s){ char c=getchar_unlocked(); while(c==' '||c=='\n') c=getchar_unlocked(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c-'0'; len++; c=getchar_unlocked(); } *s='\0'; return len; } void printint(uint32_t x){ if(x<0){x=-x; putchar_unlocked('-');}else if(x==0){putchar_unlocked('0');} int d=0; char s[10]; while(x){ s[d]='0'+x%10; x/=10; d++; } for (int i=d-1; i>=0; i--) putchar_unlocked(s[i]); putchar_unlocked('\n'); } void rsort_str(void *base, const int count, const int size); char s[200001]; uint32_t m[2019]={1}; int main(void){ uint32_t n=nextstr(s); uint32_t a=0, b=1; for(int32_t i=n-1; i>=0; i--){ a+=b*s[i]; a%=2019; m[a]++; b*=10; b%=2019; } uint64_t ans=0; for(uint32_t i=0; i<2019; i++){ ans+=(uint64_t)m[i]*(m[i]-1)/2; } printf("%"PRIu64"\n", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269334/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269334/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] } @m = dso_local local_unnamed_addr global <{ i32, [2018 x i32] }> <{ i32 1, [2018 x i32] zeroinitializer }>, align 16 @s = dso_local global [200001 x i8] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%lu\0A\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 @nextpint() 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) #5 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 ] %sext46 = shl i32 %cond.i, 24 %4 = add i32 %sext46, -956301313 %5 = icmp ult i32 %4, -150994945 br i1 %5, label %while.body.preheader, label %while.body15.preheader while.body.preheader: ; preds = %getchar_unlocked.exit %.pre51 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.body while.body15.preheader: ; preds = %getchar_unlocked.exit35, %getchar_unlocked.exit %c.0.in.lcssa = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %cond.i31, %getchar_unlocked.exit35 ] %.pre53 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.body15 while.body: ; preds = %while.body.preheader, %getchar_unlocked.exit35 %6 = phi ptr [ %.pre51, %while.body.preheader ], [ %10, %getchar_unlocked.exit35 ] %_IO_read_ptr.i26 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 1 %7 = load ptr, ptr %_IO_read_ptr.i26, align 8, !tbaa !9 %_IO_read_end.i27 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 2 %8 = load ptr, ptr %_IO_read_end.i27, align 8, !tbaa !14 %cmp.not.i28 = icmp ult ptr %7, %8 br i1 %cmp.not.i28, label %cond.false.i32, label %cond.true.i29, !prof !15 cond.true.i29: ; preds = %while.body %call.i30 = tail call i32 @__uflow(ptr noundef nonnull %6) #5 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit35 cond.false.i32: ; preds = %while.body %incdec.ptr.i33 = getelementptr inbounds i8, ptr %7, i64 1 store ptr %incdec.ptr.i33, ptr %_IO_read_ptr.i26, align 8, !tbaa !9 %9 = load i8, ptr %7, align 1, !tbaa !16 %conv3.i34 = zext i8 %9 to i32 br label %getchar_unlocked.exit35 getchar_unlocked.exit35: ; preds = %cond.true.i29, %cond.false.i32 %10 = phi ptr [ %.pre, %cond.true.i29 ], [ %6, %cond.false.i32 ] %cond.i31 = phi i32 [ %call.i30, %cond.true.i29 ], [ %conv3.i34, %cond.false.i32 ] %sext = shl i32 %cond.i31, 24 %11 = add i32 %sext, -956301313 %12 = icmp ult i32 %11, -150994945 br i1 %12, label %while.body, label %while.body15.preheader, !llvm.loop !17 while.body15: ; preds = %while.body15.preheader, %getchar_unlocked.exit45 %13 = phi ptr [ %17, %getchar_unlocked.exit45 ], [ %.pre53, %while.body15.preheader ] %x.049 = phi i32 [ %sub, %getchar_unlocked.exit45 ], [ 0, %while.body15.preheader ] %c.1.in48 = phi i32 [ %cond.i41, %getchar_unlocked.exit45 ], [ %c.0.in.lcssa, %while.body15.preheader ] %conv9 = and i32 %c.1.in48, 255 %mul = mul i32 %x.049, 10 %add = add nsw i32 %conv9, -48 %sub = add i32 %add, %mul %_IO_read_ptr.i36 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1 %14 = load ptr, ptr %_IO_read_ptr.i36, align 8, !tbaa !9 %_IO_read_end.i37 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2 %15 = load ptr, ptr %_IO_read_end.i37, align 8, !tbaa !14 %cmp.not.i38 = icmp ult ptr %14, %15 br i1 %cmp.not.i38, label %cond.false.i42, label %cond.true.i39, !prof !15 cond.true.i39: ; preds = %while.body15 %call.i40 = tail call i32 @__uflow(ptr noundef nonnull %13) #5 %.pre52 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit45 cond.false.i42: ; preds = %while.body15 %incdec.ptr.i43 = getelementptr inbounds i8, ptr %14, i64 1 store ptr %incdec.ptr.i43, ptr %_IO_read_ptr.i36, align 8, !tbaa !9 %16 = load i8, ptr %14, align 1, !tbaa !16 %conv3.i44 = zext i8 %16 to i32 br label %getchar_unlocked.exit45 getchar_unlocked.exit45: ; preds = %cond.true.i39, %cond.false.i42 %17 = phi ptr [ %.pre52, %cond.true.i39 ], [ %13, %cond.false.i42 ] %cond.i41 = phi i32 [ %call.i40, %cond.true.i39 ], [ %conv3.i44, %cond.false.i42 ] %sext25 = shl i32 %cond.i41, 24 %18 = add i32 %sext25, -788529153 %19 = icmp ult i32 %18, 184549375 br i1 %19, label %while.body15, label %while.end19, !llvm.loop !19 while.end19: ; preds = %getchar_unlocked.exit45 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: nounwind uwtable define dso_local i32 @nextstr(ptr nocapture noundef writeonly %s) 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) #5 br label %while.cond.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 !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i = zext i8 %3 to i32 br label %while.cond.preheader while.cond.preheader: ; preds = %cond.true.i, %cond.false.i %c.0.in.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ] br label %while.cond while.cond: ; preds = %while.cond.backedge, %while.cond.preheader %c.0.in = phi i32 [ %c.0.in.ph, %while.cond.preheader ], [ %c.0.in.be, %while.cond.backedge ] %sext = shl i32 %c.0.in, 24 switch i32 %sext, label %while.cond8 [ i32 536870912, label %while.body i32 167772160, label %while.body ] while.body: ; preds = %while.cond, %while.cond %4 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i28 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i28, align 8, !tbaa !9 %_IO_read_end.i29 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i29, align 8, !tbaa !14 %cmp.not.i30 = icmp ult ptr %5, %6 br i1 %cmp.not.i30, label %cond.false.i34, label %cond.true.i31, !prof !15 cond.true.i31: ; preds = %while.body %call.i32 = tail call i32 @__uflow(ptr noundef nonnull %4) #5 br label %while.cond.backedge while.cond.backedge: ; preds = %cond.true.i31, %cond.false.i34 %c.0.in.be = phi i32 [ %call.i32, %cond.true.i31 ], [ %conv3.i36, %cond.false.i34 ] br label %while.cond, !llvm.loop !20 cond.false.i34: ; preds = %while.body %incdec.ptr.i35 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i35, ptr %_IO_read_ptr.i28, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i36 = zext i8 %7 to i32 br label %while.cond.backedge while.cond8: ; preds = %while.cond, %while.cond8.backedge %s.addr.0 = phi ptr [ %incdec.ptr, %while.cond8.backedge ], [ %s, %while.cond ] %c.1.in = phi i32 [ %c.1.in.be, %while.cond8.backedge ], [ %c.0.in, %while.cond ] %len.0 = phi i32 [ %inc, %while.cond8.backedge ], [ 0, %while.cond ] %sext27 = shl i32 %c.1.in, 24 switch i32 %sext27, label %while.body15 [ i32 536870912, label %while.end20 i32 167772160, label %while.end20 ] while.body15: ; preds = %while.cond8 %8 = trunc i32 %c.1.in to i8 %conv17 = add i8 %8, -48 %incdec.ptr = getelementptr inbounds i8, ptr %s.addr.0, i64 1 store i8 %conv17, ptr %s.addr.0, align 1, !tbaa !16 %inc = add i32 %len.0, 1 %9 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i38 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 1 %10 = load ptr, ptr %_IO_read_ptr.i38, align 8, !tbaa !9 %_IO_read_end.i39 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 2 %11 = load ptr, ptr %_IO_read_end.i39, align 8, !tbaa !14 %cmp.not.i40 = icmp ult ptr %10, %11 br i1 %cmp.not.i40, label %cond.false.i44, label %cond.true.i41, !prof !15 cond.true.i41: ; preds = %while.body15 %call.i42 = tail call i32 @__uflow(ptr noundef nonnull %9) #5 br label %while.cond8.backedge while.cond8.backedge: ; preds = %cond.true.i41, %cond.false.i44 %c.1.in.be = phi i32 [ %call.i42, %cond.true.i41 ], [ %conv3.i46, %cond.false.i44 ] br label %while.cond8, !llvm.loop !21 cond.false.i44: ; preds = %while.body15 %incdec.ptr.i45 = getelementptr inbounds i8, ptr %10, i64 1 store ptr %incdec.ptr.i45, ptr %_IO_read_ptr.i38, align 8, !tbaa !9 %12 = load i8, ptr %10, align 1, !tbaa !16 %conv3.i46 = zext i8 %12 to i32 br label %while.cond8.backedge while.end20: ; preds = %while.cond8, %while.cond8 store i8 0, ptr %s.addr.0, align 1, !tbaa !16 ret i32 %len.0 } ; Function Attrs: nounwind uwtable define dso_local void @printint(i32 noundef %x) local_unnamed_addr #0 { entry: %s = alloca [10 x i8], align 1 %cmp1 = icmp eq i32 %x, 0 br i1 %cmp1, label %if.then2, label %while.body.preheader if.then2: ; 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 !22 %_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 !23 %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.then2 %call.i = tail call i32 @__overflow(ptr noundef nonnull %0, i32 noundef 48) #5 br label %for.cond.preheader.thread cond.false.i: ; preds = %if.then2 %incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i, ptr %_IO_write_ptr.i, align 8, !tbaa !22 store i8 48, ptr %1, align 1, !tbaa !16 br label %for.cond.preheader.thread for.cond.preheader.thread: ; preds = %cond.true.i, %cond.false.i call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #5 br label %for.cond.cleanup while.body.preheader: ; preds = %entry call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #5 br label %while.body for.cond.preheader: ; preds = %while.body %3 = trunc i64 %indvars.iv.next to i32 %cmp643 = icmp sgt i32 %3, 0 br i1 %cmp643, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %for.cond.preheader %4 = and i64 %indvars.iv.next, 4294967295 br label %for.body while.body: ; preds = %while.body.preheader, %while.body %indvars.iv = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next, %while.body ] %x.addr.141 = phi i32 [ %x, %while.body.preheader ], [ %div, %while.body ] %rem = urem i32 %x.addr.141, 10 %5 = trunc i32 %rem to i8 %conv = or i8 %5, 48 %arrayidx = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv store i8 %conv, ptr %arrayidx, align 1, !tbaa !16 %div = udiv i32 %x.addr.141, 10 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %tobool.not = icmp ult i32 %x.addr.141, 10 br i1 %tobool.not, label %for.cond.preheader, label %while.body, !llvm.loop !24 for.cond.cleanup: ; preds = %putchar_unlocked.exit39, %for.cond.preheader.thread, %for.cond.preheader %6 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i22 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 5 %7 = load ptr, ptr %_IO_write_ptr.i22, align 8, !tbaa !22 %_IO_write_end.i23 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 6 %8 = load ptr, ptr %_IO_write_end.i23, align 8, !tbaa !23 %cmp.not.i24 = icmp ult ptr %7, %8 br i1 %cmp.not.i24, label %cond.false.i28, label %cond.true.i25, !prof !15 cond.true.i25: ; preds = %for.cond.cleanup %call.i26 = tail call i32 @__overflow(ptr noundef nonnull %6, i32 noundef 10) #5 br label %putchar_unlocked.exit30 cond.false.i28: ; preds = %for.cond.cleanup %incdec.ptr.i29 = getelementptr inbounds i8, ptr %7, i64 1 store ptr %incdec.ptr.i29, ptr %_IO_write_ptr.i22, align 8, !tbaa !22 store i8 10, ptr %7, align 1, !tbaa !16 br label %putchar_unlocked.exit30 putchar_unlocked.exit30: ; preds = %cond.true.i25, %cond.false.i28 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #5 ret void for.body: ; preds = %for.body.preheader, %putchar_unlocked.exit39 %indvars.iv46 = phi i64 [ %4, %for.body.preheader ], [ %indvars.iv.next47, %putchar_unlocked.exit39 ] %indvars.iv.next47 = add nsw i64 %indvars.iv46, -1 %idxprom8 = and i64 %indvars.iv.next47, 4294967295 %arrayidx9 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %idxprom8 %9 = load i8, ptr %arrayidx9, align 1, !tbaa !16 %10 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i31 = getelementptr inbounds %struct._IO_FILE, ptr %10, i64 0, i32 5 %11 = load ptr, ptr %_IO_write_ptr.i31, align 8, !tbaa !22 %_IO_write_end.i32 = getelementptr inbounds %struct._IO_FILE, ptr %10, i64 0, i32 6 %12 = load ptr, ptr %_IO_write_end.i32, align 8, !tbaa !23 %cmp.not.i33 = icmp ult ptr %11, %12 br i1 %cmp.not.i33, label %cond.false.i37, label %cond.true.i34, !prof !15 cond.true.i34: ; preds = %for.body %conv10 = zext i8 %9 to i32 %call.i35 = tail call i32 @__overflow(ptr noundef nonnull %10, i32 noundef %conv10) #5 br label %putchar_unlocked.exit39 cond.false.i37: ; preds = %for.body %incdec.ptr.i38 = getelementptr inbounds i8, ptr %11, i64 1 store ptr %incdec.ptr.i38, ptr %_IO_write_ptr.i31, align 8, !tbaa !22 store i8 %9, ptr %11, align 1, !tbaa !16 br label %putchar_unlocked.exit39 putchar_unlocked.exit39: ; preds = %cond.true.i34, %cond.false.i37 %cmp6 = icmp ugt i64 %indvars.iv46, 1 br i1 %cmp6, label %for.body, label %for.cond.cleanup, !llvm.loop !25 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 @nextstr(ptr noundef nonnull @s) %i.035 = add i32 %call, -1 %cmp36 = icmp sgt i32 %i.035, -1 br i1 %cmp36, label %for.body, label %vector.body.preheader vector.body.preheader: ; preds = %for.body, %entry br label %vector.body vector.body: ; preds = %vector.body.preheader, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.body.preheader ] %vec.phi = phi <2 x i64> [ %12, %vector.body ], [ zeroinitializer, %vector.body.preheader ] %vec.phi43 = phi <2 x i64> [ %13, %vector.body ], [ zeroinitializer, %vector.body.preheader ] %0 = getelementptr inbounds [2019 x i32], ptr @m, i64 0, i64 %index %wide.load = load <2 x i32>, ptr %0, align 16, !tbaa !26 %1 = getelementptr inbounds i32, ptr %0, i64 2 %wide.load44 = load <2 x i32>, ptr %1, align 8, !tbaa !26 %2 = zext <2 x i32> %wide.load to <2 x i64> %3 = zext <2 x i32> %wide.load44 to <2 x i64> %4 = add <2 x i32> %wide.load, <i32 -1, i32 -1> %5 = add <2 x i32> %wide.load44, <i32 -1, i32 -1> %6 = zext <2 x i32> %4 to <2 x i64> %7 = zext <2 x i32> %5 to <2 x i64> %8 = mul nuw <2 x i64> %6, %2 %9 = mul nuw <2 x i64> %7, %3 %10 = lshr <2 x i64> %8, <i64 1, i64 1> %11 = lshr <2 x i64> %9, <i64 1, i64 1> %12 = add <2 x i64> %10, %vec.phi %13 = add <2 x i64> %11, %vec.phi43 %index.next = add nuw i64 %index, 4 %14 = icmp eq i64 %index.next, 2016 br i1 %14, label %for.body10, label %vector.body, !llvm.loop !27 for.body: ; preds = %entry, %for.body %i.039 = phi i32 [ %i.0, %for.body ], [ %i.035, %entry ] %b.038 = phi i32 [ %rem4, %for.body ], [ 1, %entry ] %a.037 = phi i32 [ %rem, %for.body ], [ 0, %entry ] %idxprom = zext i32 %i.039 to i64 %arrayidx = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %idxprom %15 = load i8, ptr %arrayidx, align 1, !tbaa !16 %conv = sext i8 %15 to i32 %mul = mul nsw i32 %b.038, %conv %add = add nsw i32 %mul, %a.037 %rem = urem i32 %add, 2019 %idxprom1 = zext i32 %rem to i64 %arrayidx2 = getelementptr inbounds [2019 x i32], ptr @m, i64 0, i64 %idxprom1 %16 = load i32, ptr %arrayidx2, align 4, !tbaa !26 %inc = add i32 %16, 1 store i32 %inc, ptr %arrayidx2, align 4, !tbaa !26 %mul3 = mul nuw nsw i32 %b.038, 10 %rem4 = urem i32 %mul3, 2019 %i.0 = add nsw i32 %i.039, -1 %cmp.not = icmp eq i32 %i.039, 0 br i1 %cmp.not, label %vector.body.preheader, label %for.body, !llvm.loop !30 for.body10: ; preds = %vector.body %bin.rdx = add <2 x i64> %13, %12 %17 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %18 = load i32, ptr getelementptr inbounds (<{ i32, [2018 x i32] }>, ptr @m, i64 0, i32 1, i64 2015), align 16, !tbaa !26 %conv13 = zext i32 %18 to i64 %sub16 = add i32 %18, -1 %conv17 = zext i32 %sub16 to i64 %mul18 = mul nuw i64 %conv17, %conv13 %div34 = lshr i64 %mul18, 1 %add19 = add i64 %div34, %17 %19 = load i32, ptr getelementptr inbounds (<{ i32, [2018 x i32] }>, ptr @m, i64 0, i32 1, i64 2016), align 4, !tbaa !26 %conv13.1 = zext i32 %19 to i64 %sub16.1 = add i32 %19, -1 %conv17.1 = zext i32 %sub16.1 to i64 %mul18.1 = mul nuw i64 %conv17.1, %conv13.1 %div34.1 = lshr i64 %mul18.1, 1 %add19.1 = add i64 %div34.1, %add19 %20 = load i32, ptr getelementptr inbounds (<{ i32, [2018 x i32] }>, ptr @m, i64 0, i32 1, i64 2017), align 8, !tbaa !26 %conv13.2 = zext i32 %20 to i64 %sub16.2 = add i32 %20, -1 %conv17.2 = zext i32 %sub16.2 to i64 %mul18.2 = mul nuw i64 %conv17.2, %conv13.2 %div34.2 = lshr i64 %mul18.2, 1 %add19.2 = add i64 %div34.2, %add19.1 %call23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %add19.2) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 declare i32 @__uflow(ptr noundef) local_unnamed_addr #3 declare i32 @__overflow(ptr noundef, i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4 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 = { "no-trapping-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 = !{!"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 = distinct !{!19, !18} !20 = distinct !{!20, !18} !21 = distinct !{!21, !18} !22 = !{!10, !6, i64 40} !23 = !{!10, !6, i64 48} !24 = distinct !{!24, !18} !25 = distinct !{!25, !18} !26 = !{!11, !11, i64 0} !27 = distinct !{!27, !18, !28, !29} !28 = !{!"llvm.loop.isvectorized", i32 1} !29 = !{!"llvm.loop.unroll.runtime.disable"} !30 = distinct !{!30, !18}
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct d{ int id; char mark; int num; }Data; void quicksort(Data *, int, int); int partition(Data *, int, int); void stableJudge(Data *, int); int main(){ int i, n; Data *A; scanf("%d ",&n); A = (Data *)malloc(sizeof(Data) * n); for(i=0; i<n; i++){ scanf("%c %d ", &A[i].mark, &A[i].num); A[i].id = i; } quicksort(A, 0, n); stableJudge(A, n); for(i=0; i<n; i++){ printf("%c %d\n", A[i].mark, A[i].num); } return 0; } void quicksort(Data *A, int p, int r){ int i,q; if(p < r){ q = partition(A, p, r); quicksort(A, p, q); quicksort(A, q+1, r); } } int partition(Data *A, int p, int r){ int i=p-1, j, x=A[r-1].num; Data temp; for(j=p; j<r-1; j++){ if(A[j].num <= x){ i ++; temp = A[i]; A[i] = A[j]; A[j] = temp; } } temp = A[i+1]; A[i+1] = A[r-1]; A[r-1] = temp; return i+1; } void stableJudge(Data *A, int n){ int i; for(i=1; i<n; i++){ if(A[i-1].num == A[i].num){ if(A[i-1].id > A[i].id){ puts("Not stable"); return; } } } puts("Stable"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269385/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269385/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.d = type { i32, i8, i32 } @.str = private unnamed_addr constant [4 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 @.str.3 = 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 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 %conv = sext i32 %0 to i64 %mul = mul nsw i64 %conv, 12 %call1 = call noalias ptr @malloc(i64 noundef %mul) #7 %cmp38 = icmp sgt i32 %0, 0 br i1 %cmp38, label %for.body, label %for.end.thread for.end.thread: ; preds = %entry call void @quicksort(ptr noundef %call1, i32 noundef 0, i32 noundef %0) br label %stableJudge.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds %struct.d, ptr %call1, i64 %indvars.iv %mark = getelementptr inbounds %struct.d, ptr %call1, i64 %indvars.iv, i32 1 %num = getelementptr inbounds %struct.d, ptr %call1, i64 %indvars.iv, i32 2 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %mark, ptr noundef nonnull %num) %1 = trunc i64 %indvars.iv to i32 store i32 %1, ptr %arrayidx, align 4, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %.pr = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %.pr to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body call void @quicksort(ptr noundef nonnull %call1, i32 noundef 0, i32 noundef %.pr) %cmp23.i = icmp sgt i32 %.pr, 1 br i1 %cmp23.i, label %for.body.preheader.i, label %stableJudge.exit for.body.preheader.i: ; preds = %for.end %wide.trip.count.i = zext i32 %.pr to i64 %num.phi.trans.insert.i = getelementptr inbounds %struct.d, ptr %call1, i64 0, i32 2 %.pre.i = load i32, ptr %num.phi.trans.insert.i, align 4, !tbaa !13 %invariant.gep.i = getelementptr %struct.d, ptr %call1, i64 -1 br label %for.body.i for.body.i: ; preds = %for.inc.i, %for.body.preheader.i %3 = phi i32 [ %.pre.i, %for.body.preheader.i ], [ %4, %for.inc.i ] %indvars.iv.i = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ] %num3.i = getelementptr inbounds %struct.d, ptr %call1, i64 %indvars.iv.i, i32 2 %4 = load i32, ptr %num3.i, align 4, !tbaa !13 %cmp4.i = icmp eq i32 %3, %4 br i1 %cmp4.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body.i %arrayidx2.i = getelementptr inbounds %struct.d, ptr %call1, i64 %indvars.iv.i %gep.i = getelementptr %struct.d, ptr %invariant.gep.i, i64 %indvars.iv.i %5 = load i32, ptr %gep.i, align 4, !tbaa !9 %6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !9 %cmp11.i = icmp sgt i32 %5, %6 br i1 %cmp11.i, label %stableJudge.exit, label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body.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 %stableJudge.exit, label %for.body.i, !llvm.loop !14 stableJudge.exit: ; preds = %if.then.i, %for.inc.i, %for.end.thread, %for.end %.str.4.sink.i = phi ptr [ @.str.4, %for.end ], [ @.str.4, %for.end.thread ], [ @.str.4, %for.inc.i ], [ @.str.3, %if.then.i ] %call14.i = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.4.sink.i) %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp940 = icmp sgt i32 %7, 0 br i1 %cmp940, label %for.body11, label %for.end22 for.body11: ; preds = %stableJudge.exit, %for.body11 %indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body11 ], [ 0, %stableJudge.exit ] %mark14 = getelementptr inbounds %struct.d, ptr %call1, i64 %indvars.iv43, i32 1 %8 = load i8, ptr %mark14, align 4, !tbaa !15 %conv15 = sext i8 %8 to i32 %num18 = getelementptr inbounds %struct.d, ptr %call1, i64 %indvars.iv43, i32 2 %9 = load i32, ptr %num18, align 4, !tbaa !13 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv15, i32 noundef %9) %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp9 = icmp slt i64 %indvars.iv.next44, %11 br i1 %cmp9, label %for.body11, label %for.end22, !llvm.loop !16 for.end22: ; preds = %for.body11, %stableJudge.exit call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; 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: %temp.i = alloca %struct.d, align 4 %cmp8 = icmp slt i32 %p, %r br i1 %cmp8, label %if.then.lr.ph, label %if.end if.then.lr.ph: ; preds = %entry %sub1.i = add nsw i32 %r, -1 %idxprom.i = sext i32 %sub1.i to i64 %num.i = getelementptr inbounds %struct.d, ptr %A, i64 %idxprom.i, i32 2 %arrayidx.i = getelementptr inbounds %struct.d, ptr %A, i64 %idxprom.i br label %if.then if.then: ; preds = %if.then.lr.ph, %partition.exit %p.tr9 = phi i32 [ %p, %if.then.lr.ph ], [ %add, %partition.exit ] %0 = load i32, ptr %num.i, align 4, !tbaa !13 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %temp.i) %cmp50.i = icmp sgt i32 %sub1.i, %p.tr9 br i1 %cmp50.i, label %for.body.preheader.i, label %partition.exit for.body.preheader.i: ; preds = %if.then %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.052.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ] %num5.i = getelementptr inbounds %struct.d, ptr %A, i64 %indvars.iv.i, i32 2 %2 = load i32, ptr %num5.i, align 4, !tbaa !13 %cmp6.not.i = icmp sgt i32 %2, %0 br i1 %cmp6.not.i, label %for.inc.i, label %if.then.i if.then.i: ; preds = %for.body.i %arrayidx4.i = getelementptr inbounds %struct.d, ptr %A, i64 %indvars.iv.i %inc.i = add nsw i32 %i.052.i, 1 %idxprom7.i = sext i32 %inc.i to i64 %arrayidx8.i = getelementptr inbounds %struct.d, ptr %A, i64 %idxprom7.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %temp.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx8.i, i64 12, i1 false), !tbaa.struct !17 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx8.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4.i, i64 12, i1 false), !tbaa.struct !17 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4.i, ptr noundef nonnull align 4 dereferenceable(12) %temp.i, i64 12, i1 false), !tbaa.struct !17 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.052.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 %for.end.loopexit.i, label %for.body.i, !llvm.loop !19 for.end.loopexit.i: ; preds = %for.inc.i %3 = add nsw i32 %i.1.i, 1 br label %partition.exit partition.exit: ; preds = %if.then, %for.end.loopexit.i %i.0.lcssa.i = phi i32 [ %p.tr9, %if.then ], [ %3, %for.end.loopexit.i ] %idxprom16.i = sext i32 %i.0.lcssa.i to i64 %arrayidx17.i = getelementptr inbounds %struct.d, ptr %A, i64 %idxprom16.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %temp.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx17.i, i64 12, i1 false), !tbaa.struct !17 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx17.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, i64 12, i1 false), !tbaa.struct !17 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, ptr noundef nonnull align 4 dereferenceable(12) %temp.i, i64 12, i1 false), !tbaa.struct !17 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %temp.i) tail call void @quicksort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.0.lcssa.i) %add = add nsw i32 %i.0.lcssa.i, 1 %cmp = icmp slt i32 %add, %r br i1 %cmp, label %if.then, label %if.end if.end: ; preds = %partition.exit, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @stableJudge(ptr nocapture noundef readonly %A, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp23 = icmp sgt i32 %n, 1 br i1 %cmp23, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %num.phi.trans.insert = getelementptr inbounds %struct.d, ptr %A, i64 0, i32 2 %.pre = load i32, ptr %num.phi.trans.insert, align 4, !tbaa !13 %invariant.gep = getelementptr %struct.d, ptr %A, i64 -1 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 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %num3 = getelementptr inbounds %struct.d, ptr %A, i64 %indvars.iv, i32 2 %1 = load i32, ptr %num3, align 4, !tbaa !13 %cmp4 = icmp eq i32 %0, %1 br i1 %cmp4, label %if.then, label %for.inc if.then: ; preds = %for.body %arrayidx2 = getelementptr inbounds %struct.d, ptr %A, i64 %indvars.iv %gep = getelementptr %struct.d, ptr %invariant.gep, i64 %indvars.iv %2 = load i32, ptr %gep, align 4, !tbaa !9 %3 = load i32, ptr %arrayidx2, align 4, !tbaa !9 %cmp11 = icmp sgt i32 %2, %3 br i1 %cmp11, label %cleanup, label %for.inc for.inc: ; preds = %for.body, %if.then %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 %cleanup, label %for.body, !llvm.loop !14 cleanup: ; preds = %for.inc, %if.then, %entry %.str.4.sink = phi ptr [ @.str.4, %entry ], [ @.str.3, %if.then ], [ @.str.4, %for.inc ] %call14 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.4.sink) 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 #4 { entry: %temp = alloca %struct.d, align 4 %sub1 = add nsw i32 %r, -1 %idxprom = sext i32 %sub1 to i64 %num = getelementptr inbounds %struct.d, ptr %A, i64 %idxprom, i32 2 %0 = load i32, ptr %num, align 4, !tbaa !13 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %temp) %cmp50 = icmp sgt i32 %sub1, %p br i1 %cmp50, 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.052 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ] %num5 = getelementptr inbounds %struct.d, ptr %A, i64 %indvars.iv, i32 2 %2 = load i32, ptr %num5, align 4, !tbaa !13 %cmp6.not = icmp sgt i32 %2, %0 br i1 %cmp6.not, label %for.inc, label %if.then if.then: ; preds = %for.body %arrayidx4 = getelementptr inbounds %struct.d, ptr %A, i64 %indvars.iv %inc = add nsw i32 %i.052, 1 %idxprom7 = sext i32 %inc to i64 %arrayidx8 = getelementptr inbounds %struct.d, ptr %A, i64 %idxprom7 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %temp, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx8, i64 12, i1 false), !tbaa.struct !17 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx8, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4, i64 12, i1 false), !tbaa.struct !17 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4, ptr noundef nonnull align 4 dereferenceable(12) %temp, i64 12, i1 false), !tbaa.struct !17 br label %for.inc for.inc: ; preds = %for.body, %if.then %i.1 = phi i32 [ %inc, %if.then ], [ %i.052, %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 !19 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.d, ptr %A, i64 %idxprom %idxprom16 = sext i32 %i.0.lcssa to i64 %arrayidx17 = getelementptr inbounds %struct.d, ptr %A, i64 %idxprom16 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %temp, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx17, i64 12, i1 false), !tbaa.struct !17 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx17, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false), !tbaa.struct !17 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, ptr noundef nonnull align 4 dereferenceable(12) %temp, i64 12, i1 false), !tbaa.struct !17 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %temp) 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) #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(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 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nounwind } attributes #7 = { 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, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 0} !10 = !{!"d", !6, i64 0, !7, i64 4, !6, i64 8} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!10, !6, i64 8} !14 = distinct !{!14, !12} !15 = !{!10, !7, i64 4} !16 = distinct !{!16, !12} !17 = !{i64 0, i64 4, !5, i64 4, i64 1, !18, i64 8, i64 4, !5} !18 = !{!7, !7, i64 0} !19 = distinct !{!19, !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 ( 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(void) { 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_269428/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269428/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: %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 card{ char m[3]; int n, num; }T_card; void swap(T_card *, T_card *); void quick(T_card *, int, int); int main(){ int n; scanf("%d", &n); T_card *A; A = (T_card *)malloc(sizeof(T_card) * n); int i; for(i = 0; i < n; i++){ scanf("%s %d", A[i].m, &A[i].n); A[i].num = i; } quick(A, 0, n); int P = 0, j; for(i = 1; i < n; i++) for(j = i; j < n & A[i].n == A[j].n; j++) if(A[i].num > A[j].num) P = 1; if(P) printf("Not stable\n"); else printf("Stable\n"); for(i = 0; i < n; i++) printf("%s %d\n", A[i].m, A[i].n); free(A); return 0; } void quick(T_card *A, int l, int r){ int i, j; if(l != r){ // printf("\n l:%d r:%d\n", l, r); for(i = l, j = l; i < r - 1; i++) if(A[i].n <= A[r - 1].n){ swap(&A[i], &A[j]); j++; } swap(&A[r - 1], &A[j]); // for(i = l; i < r; i++) // printf("%s %d\n", A[i].m, A[i].n); quick(A, l, j); quick(A, j + 1, r); } } void swap(T_card *a, T_card *b){ T_card tmp; tmp = *a; *a = *b; *b = tmp; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269486/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269486/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 { [3 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 [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: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { 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 !5 %conv = sext i32 %0 to i64 %mul = mul nsw i64 %conv, 12 %call1 = call noalias ptr @malloc(i64 noundef %mul) #10 %cmp88 = icmp sgt i32 %0, 0 br i1 %cmp88, label %for.body, label %for.end.thread for.end.thread: ; preds = %entry call void @quick(ptr noundef %call1, i32 noundef 0, i32 noundef %0) br label %if.else 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 %n5 = getelementptr inbounds %struct.card, ptr %call1, i64 %indvars.iv, i32 1 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx, ptr noundef nonnull %n5) %num = getelementptr inbounds %struct.card, ptr %call1, i64 %indvars.iv, i32 2 %1 = trunc i64 %indvars.iv to i32 store i32 %1, ptr %num, align 4, !tbaa !9 %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 !11 for.end: ; preds = %for.body call void @quick(ptr noundef nonnull %call1, i32 noundef 0, i32 noundef %2) %cmp1097 = icmp sgt i32 %2, 1 br i1 %cmp1097, label %for.cond13.preheader.preheader, label %if.else for.cond13.preheader.preheader: ; preds = %for.end %4 = zext i32 %2 to i64 %wide.trip.count = zext i32 %2 to i64 br label %for.body24.lr.ph for.body24.lr.ph: ; preds = %for.inc36, %for.cond13.preheader.preheader %indvars.iv105 = phi i64 [ 1, %for.cond13.preheader.preheader ], [ %indvars.iv.next106, %for.inc36 ] %P.099 = phi i32 [ 0, %for.cond13.preheader.preheader ], [ %spec.select, %for.inc36 ] %n18 = getelementptr inbounds %struct.card, ptr %call1, i64 %indvars.iv105, i32 1 %5 = load i32, ptr %n18, align 4, !tbaa !13 %num27 = getelementptr inbounds %struct.card, ptr %call1, i64 %indvars.iv105, i32 2 %6 = load i32, ptr %num27, align 4, !tbaa !9 br label %for.body24 for.body24: ; preds = %for.body24.lr.ph, %for.body24 %indvars.iv107 = phi i64 [ %indvars.iv105, %for.body24.lr.ph ], [ %indvars.iv.next108, %for.body24 ] %P.193 = phi i32 [ %P.099, %for.body24.lr.ph ], [ %spec.select, %for.body24 ] %num30 = getelementptr inbounds %struct.card, ptr %call1, i64 %indvars.iv107, i32 2 %7 = load i32, ptr %num30, align 4, !tbaa !9 %cmp31 = icmp sgt i32 %6, %7 %spec.select = select i1 %cmp31, i32 1, i32 %P.193 %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1 %cmp14 = icmp ult i64 %indvars.iv.next108, %4 %n21 = getelementptr inbounds %struct.card, ptr %call1, i64 %indvars.iv.next108, i32 1 %8 = load i32, ptr %n21, align 4, !tbaa !13 %cmp22 = icmp eq i32 %5, %8 %and87 = and i1 %cmp14, %cmp22 br i1 %and87, label %for.body24, label %for.inc36, !llvm.loop !14 for.inc36: ; preds = %for.body24 %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1 %exitcond.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count br i1 %exitcond.not, label %for.end38, label %for.body24.lr.ph, !llvm.loop !15 for.end38: ; preds = %for.inc36 %9 = icmp eq i32 %spec.select, 0 br i1 %9, label %if.else, label %if.end43 if.else: ; preds = %for.end.thread, %for.end, %for.end38 br label %if.end43 if.end43: ; preds = %for.end38, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.5, %for.end38 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %10 = load i32, ptr %n, align 4, !tbaa !5 %cmp45101 = icmp sgt i32 %10, 0 br i1 %cmp45101, label %for.body47, label %for.end58 for.body47: ; preds = %if.end43, %for.body47 %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.body47 ], [ 0, %if.end43 ] %arrayidx49 = getelementptr inbounds %struct.card, ptr %call1, i64 %indvars.iv111 %n54 = getelementptr inbounds %struct.card, ptr %call1, i64 %indvars.iv111, i32 1 %11 = load i32, ptr %n54, align 4, !tbaa !13 %call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %arrayidx49, i32 noundef %11) %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp45 = icmp slt i64 %indvars.iv.next112, %13 br i1 %cmp45, label %for.body47, label %for.end58, !llvm.loop !16 for.end58: ; preds = %for.body47, %if.end43 call void @free(ptr noundef %call1) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @quick(ptr nocapture noundef %A, i32 noundef %l, i32 noundef %r) local_unnamed_addr #4 { entry: %tmp.i40 = alloca %struct.card, align 4 %tmp.i = alloca %struct.card, align 4 %cmp.not45 = icmp eq i32 %l, %r br i1 %cmp.not45, label %if.end18, label %for.cond.preheader.lr.ph for.cond.preheader.lr.ph: ; preds = %entry %sub = add nsw i32 %r, -1 %idxprom3 = sext i32 %sub to i64 %n5 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom3, i32 1 %arrayidx15 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom3 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %for.end %l.tr46 = phi i32 [ %l, %for.cond.preheader.lr.ph ], [ %add, %for.end ] %cmp141 = icmp slt i32 %l.tr46, %sub br i1 %cmp141, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %for.cond.preheader %0 = sext i32 %l.tr46 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %j.043 = phi i32 [ %l.tr46, %for.body.preheader ], [ %j.1, %for.inc ] %n = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv, i32 1 %1 = load i32, ptr %n, align 4, !tbaa !13 %2 = load i32, ptr %n5, align 4, !tbaa !13 %cmp6.not = icmp sgt i32 %1, %2 br i1 %cmp6.not, label %for.inc, label %if.then7 if.then7: ; preds = %for.body %arrayidx = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv %idxprom10 = sext i32 %j.043 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) %arrayidx, i64 12, i1 false), !tbaa.struct !17 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, i64 12, i1 false), !tbaa.struct !17 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, i64 12, i1 false), !tbaa.struct !17 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp.i) %inc = add nsw i32 %j.043, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then7 %j.1 = phi i32 [ %inc, %if.then7 ], [ %j.043, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom3 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !19 for.end: ; preds = %for.inc, %for.cond.preheader %j.0.lcssa = phi i32 [ %l.tr46, %for.cond.preheader ], [ %j.1, %for.inc ] %idxprom16 = sext i32 %j.0.lcssa to i64 %arrayidx17 = getelementptr inbounds %struct.card, ptr %A, i64 %idxprom16 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp.i40) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i40, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15, i64 12, i1 false), !tbaa.struct !17 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx17, i64 12, i1 false), !tbaa.struct !17 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx17, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i40, i64 12, i1 false), !tbaa.struct !17 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp.i40) tail call void @quick(ptr noundef %A, i32 noundef %l.tr46, i32 noundef %j.0.lcssa) %add = add nsw i32 %j.0.lcssa, 1 %cmp.not = icmp eq i32 %add, %r br i1 %cmp.not, label %if.end18, label %for.cond.preheader if.end18: ; preds = %for.end, %entry ret void } ; 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 #5 ; 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 nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #6 { 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 !17 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 !17 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 !17 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp) ret void } ; 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) #7 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8 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,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 #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 = { 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 #6 = { 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #8 = { nofree nounwind } attributes #9 = { nounwind } attributes #10 = { 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, !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 = !{!"card", !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 = distinct !{!16, !12} !17 = !{i64 0, i64 3, !18, i64 4, i64 4, !5, i64 8, i64 4, !5} !18 = !{!7, !7, i64 0} !19 = distinct !{!19, !12}
#include <stdio.h> // printf(), getc() #include <ctype.h> // isdigit() #define MAX_N 100000 #define swap(x, y) { card_t t = x; x = y; y = t; } typedef struct card_tbl { char mark; int val; int seq; } card_t; card_t l[MAX_N / 2 + 2], r[MAX_N / 2 + 2]; int partition(card_t a[], int p, int r) { int j; int x = a[r].val; int i = p - 1; for (j = p; j < r; ++j) { if (a[j].val <= x) { i++; swap(a[i], a[j]); } } swap(a[i + 1], a[r]); return i + 1; } void quicksort(card_t 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 main(int argc, char** argv) { card_t a[MAX_N]; int n, m; int i; int c; c = getc(stdin); n = 0; while (isdigit(c)) { n = n * 10 + c - '0'; c = getc(stdin); } for (i = 0; i < n; ++i) { while (c == ' ' || c == '\n') c = getc(stdin); a[i].mark = c; c = getc(stdin); while (c == ' ') c = getc(stdin); m = 0; while (isdigit(c)) { m = m * 10 + c - '0'; c = getc(stdin); } a[i].val = m; a[i].seq = i; } quicksort(a, 0, n - 1); for (i = 0; i < n - 1; ++i) { if (a[i].val == a[i + 1].val && a[i].seq > a[i + 1].seq) break; } if (i >= n - 1) printf("Stable\n"); else printf("Not stable\n"); for (i = 0; i < n; ++i) printf("%c %d\n", a[i].mark, a[i].val); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269529/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269529/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_tbl = type { i8, i32, i32 } @stdin = external local_unnamed_addr global ptr, align 8 @.str.2 = 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_tbl] zeroinitializer, align 16 @r = dso_local local_unnamed_addr global [50002 x %struct.card_tbl] zeroinitializer, align 16 @str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1 @str.3 = private unnamed_addr constant [7 x i8] c"Stable\00", align 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 #0 { entry: %t = alloca %struct.card_tbl, align 4 %t14 = alloca %struct.card_tbl, align 4 %idxprom = sext i32 %r to i64 %val = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %idxprom, i32 1 %0 = load i32, ptr %val, align 4, !tbaa !5 %cmp47 = icmp slt i32 %p, %r br i1 %cmp47, 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.049 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ] %val3 = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %indvars.iv, i32 1 %2 = load i32, ptr %val3, 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 %arrayidx2 = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %indvars.iv %inc = add nsw i32 %i.049, 1 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t) %idxprom5 = sext i32 %inc to i64 %arrayidx6 = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %idxprom5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %t, 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) %arrayidx2, i64 12, i1 false), !tbaa.struct !10 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, ptr noundef nonnull align 4 dereferenceable(12) %t, i64 12, i1 false), !tbaa.struct !10 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t) br label %for.inc for.inc: ; preds = %for.body, %if.then %i.1 = phi i32 [ %inc, %if.then ], [ %i.049, %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 ] %arrayidx = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %idxprom call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t14) %idxprom15 = sext i32 %i.0.lcssa to i64 %arrayidx16 = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %idxprom15 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %t14, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx16, i64 12, i1 false), !tbaa.struct !10 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx16, 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) %t14, i64 12, i1 false), !tbaa.struct !10 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t14) 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(argmem: readwrite) uwtable define dso_local void @quicksort(ptr nocapture noundef %a, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 { entry: %t.i = alloca %struct.card_tbl, align 4 %t14.i = alloca %struct.card_tbl, 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 %val.i = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %idxprom.i, i32 1 %arrayidx.i = getelementptr inbounds %struct.card_tbl, 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 %val.i, align 4, !tbaa !5 %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.049.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ] %val3.i = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %indvars.iv.i, i32 1 %2 = load i32, ptr %val3.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 %arrayidx2.i = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %indvars.iv.i %inc.i = add nsw i32 %i.049.i, 1 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t.i) %idxprom5.i = sext i32 %inc.i to i64 %arrayidx6.i = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %idxprom5.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.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) %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) %t.i, i64 12, i1 false), !tbaa.struct !10 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t.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.049.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 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t14.i) %idxprom15.i = sext i32 %3 to i64 %arrayidx16.i = getelementptr inbounds %struct.card_tbl, ptr %a, i64 %idxprom15.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %t14.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx16.i, i64 12, i1 false), !tbaa.struct !10 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx16.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) %t14.i, i64 12, i1 false), !tbaa.struct !10 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t14.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 uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #3 { entry: %a = alloca [100000 x %struct.card_tbl], align 16 call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %a) #7 %0 = load ptr, ptr @stdin, align 8, !tbaa !15 %call = tail call i32 @getc(ptr noundef %0) %call1 = tail call ptr @__ctype_b_loc() #8 %1 = load ptr, ptr %call1, align 8, !tbaa !15 %idxprom118 = sext i32 %call to i64 %arrayidx119 = getelementptr inbounds i16, ptr %1, i64 %idxprom118 %2 = load i16, ptr %arrayidx119, align 2, !tbaa !17 %3 = and i16 %2, 2048 %tobool.not120 = icmp eq i16 %3, 0 br i1 %tobool.not120, label %if.end72.thread, label %while.body for.cond.preheader: ; preds = %while.body %cmp134 = icmp sgt i32 %sub, 0 br i1 %cmp134, label %while.cond4.preheader.preheader, label %if.end72.thread while.cond4.preheader.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %sub to i64 br label %while.cond4.preheader while.body: ; preds = %entry, %while.body %c.0122 = phi i32 [ %call2, %while.body ], [ %call, %entry ] %n.0121 = phi i32 [ %sub, %while.body ], [ 0, %entry ] %mul = mul nsw i32 %n.0121, 10 %add = add i32 %c.0122, -48 %sub = add i32 %add, %mul %4 = load ptr, ptr @stdin, align 8, !tbaa !15 %call2 = tail call i32 @getc(ptr noundef %4) %5 = load ptr, ptr %call1, align 8, !tbaa !15 %idxprom = sext i32 %call2 to i64 %arrayidx = getelementptr inbounds i16, ptr %5, i64 %idxprom %6 = load i16, ptr %arrayidx, align 2, !tbaa !17 %7 = and i16 %6, 2048 %tobool.not = icmp eq i16 %7, 0 br i1 %tobool.not, label %for.cond.preheader, label %while.body, !llvm.loop !19 while.cond4.preheader: ; preds = %while.cond4.preheader.preheader, %while.end34 %indvars.iv = phi i64 [ 0, %while.cond4.preheader.preheader ], [ %indvars.iv.next, %while.end34 ] %c.1136 = phi i32 [ %call2, %while.cond4.preheader.preheader ], [ %c.4.lcssa, %while.end34 ] br label %while.cond4 while.cond4: ; preds = %while.cond4.preheader, %while.body9 %c.2 = phi i32 [ %call10, %while.body9 ], [ %c.1136, %while.cond4.preheader ] switch i32 %c.2, label %while.end11 [ i32 32, label %while.body9 i32 10, label %while.body9 ] while.body9: ; preds = %while.cond4, %while.cond4 %8 = load ptr, ptr @stdin, align 8, !tbaa !15 %call10 = tail call i32 @getc(ptr noundef %8) br label %while.cond4, !llvm.loop !20 while.end11: ; preds = %while.cond4 %conv12 = trunc i32 %c.2 to i8 %arrayidx14 = getelementptr inbounds [100000 x %struct.card_tbl], ptr %a, i64 0, i64 %indvars.iv store i8 %conv12, ptr %arrayidx14, align 4, !tbaa !21 %9 = load ptr, ptr @stdin, align 8, !tbaa !15 %call15 = tail call i32 @getc(ptr noundef %9) %cmp17125 = icmp eq i32 %call15, 32 br i1 %cmp17125, label %while.body19, label %while.cond22.preheader while.cond22.preheader: ; preds = %while.body19, %while.end11 %c.3.lcssa = phi i32 [ %call15, %while.end11 ], [ %call20, %while.body19 ] %10 = load ptr, ptr %call1, align 8, !tbaa !15 %idxprom24127 = sext i32 %c.3.lcssa to i64 %arrayidx25128 = getelementptr inbounds i16, ptr %10, i64 %idxprom24127 %11 = load i16, ptr %arrayidx25128, align 2, !tbaa !17 %12 = and i16 %11, 2048 %tobool28.not129 = icmp eq i16 %12, 0 br i1 %tobool28.not129, label %while.end34, label %while.body29 while.body19: ; preds = %while.end11, %while.body19 %13 = load ptr, ptr @stdin, align 8, !tbaa !15 %call20 = tail call i32 @getc(ptr noundef %13) %cmp17 = icmp eq i32 %call20, 32 br i1 %cmp17, label %while.body19, label %while.cond22.preheader, !llvm.loop !22 while.body29: ; preds = %while.cond22.preheader, %while.body29 %c.4131 = phi i32 [ %call33, %while.body29 ], [ %c.3.lcssa, %while.cond22.preheader ] %m.0130 = phi i32 [ %sub32, %while.body29 ], [ 0, %while.cond22.preheader ] %mul30 = mul nsw i32 %m.0130, 10 %add31 = add i32 %c.4131, -48 %sub32 = add i32 %add31, %mul30 %14 = load ptr, ptr @stdin, align 8, !tbaa !15 %call33 = tail call i32 @getc(ptr noundef %14) %15 = load ptr, ptr %call1, align 8, !tbaa !15 %idxprom24 = sext i32 %call33 to i64 %arrayidx25 = getelementptr inbounds i16, ptr %15, i64 %idxprom24 %16 = load i16, ptr %arrayidx25, align 2, !tbaa !17 %17 = and i16 %16, 2048 %tobool28.not = icmp eq i16 %17, 0 br i1 %tobool28.not, label %while.end34, label %while.body29, !llvm.loop !23 while.end34: ; preds = %while.body29, %while.cond22.preheader %m.0.lcssa = phi i32 [ 0, %while.cond22.preheader ], [ %sub32, %while.body29 ] %c.4.lcssa = phi i32 [ %c.3.lcssa, %while.cond22.preheader ], [ %call33, %while.body29 ] %val = getelementptr inbounds [100000 x %struct.card_tbl], ptr %a, i64 0, i64 %indvars.iv, i32 1 store i32 %m.0.lcssa, ptr %val, align 4, !tbaa !5 %seq = getelementptr inbounds [100000 x %struct.card_tbl], ptr %a, i64 0, i64 %indvars.iv, i32 2 %18 = trunc i64 %indvars.iv to i32 store i32 %18, ptr %seq, align 4, !tbaa !24 %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 %while.cond4.preheader, !llvm.loop !25 if.end72.thread: ; preds = %entry, %for.cond.preheader %n.0.lcssa155.ph = phi i32 [ %sub, %for.cond.preheader ], [ 0, %entry ] %sub39159 = add nsw i32 %n.0.lcssa155.ph, -1 call void @quicksort(ptr noundef nonnull %a, i32 noundef 0, i32 noundef %sub39159) %puts117168 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %for.end87 for.end: ; preds = %while.end34 %sub39 = add nsw i32 %sub, -1 call void @quicksort(ptr noundef nonnull %a, i32 noundef 0, i32 noundef %sub39) %cmp42137 = icmp sgt i32 %sub, 1 br i1 %cmp42137, label %for.body44.preheader, label %if.end72 for.body44.preheader: ; preds = %for.end %wide.trip.count145 = zext i32 %sub39 to i64 %val47.phi.trans.insert = getelementptr inbounds [100000 x %struct.card_tbl], ptr %a, i64 0, i64 0, i32 1 %.pre = load i32, ptr %val47.phi.trans.insert, align 4, !tbaa !5 br label %for.body44 for.body44: ; preds = %for.body44.preheader, %for.inc63 %19 = phi i32 [ %.pre, %for.body44.preheader ], [ %20, %for.inc63 ] %indvars.iv142 = phi i64 [ 0, %for.body44.preheader ], [ %indvars.iv.next143, %for.inc63 ] %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1 %val51 = getelementptr inbounds [100000 x %struct.card_tbl], ptr %a, i64 0, i64 %indvars.iv.next143, i32 1 %20 = load i32, ptr %val51, align 4, !tbaa !5 %cmp52 = icmp eq i32 %19, %20 br i1 %cmp52, label %land.lhs.true, label %for.inc63 land.lhs.true: ; preds = %for.body44 %seq56 = getelementptr inbounds [100000 x %struct.card_tbl], ptr %a, i64 0, i64 %indvars.iv142, i32 2 %21 = load i32, ptr %seq56, align 4, !tbaa !24 %seq60 = getelementptr inbounds [100000 x %struct.card_tbl], ptr %a, i64 0, i64 %indvars.iv.next143, i32 2 %22 = load i32, ptr %seq60, align 4, !tbaa !24 %cmp61 = icmp sgt i32 %21, %22 br i1 %cmp61, label %if.else, label %for.inc63 for.inc63: ; preds = %for.body44, %land.lhs.true %exitcond146.not = icmp eq i64 %indvars.iv.next143, %wide.trip.count145 br i1 %exitcond146.not, label %if.end72, label %for.body44, !llvm.loop !26 if.else: ; preds = %land.lhs.true %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) br i1 %cmp134, label %for.body76.preheader, label %for.end87 if.end72: ; preds = %for.inc63, %for.end %puts117 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br i1 %cmp134, label %for.body76.preheader, label %for.end87 for.body76.preheader: ; preds = %if.else, %if.end72 %wide.trip.count150 = zext i32 %sub to i64 br label %for.body76 for.body76: ; preds = %for.body76.preheader, %for.body76 %indvars.iv147 = phi i64 [ 0, %for.body76.preheader ], [ %indvars.iv.next148, %for.body76 ] %arrayidx78 = getelementptr inbounds [100000 x %struct.card_tbl], ptr %a, i64 0, i64 %indvars.iv147 %23 = load i8, ptr %arrayidx78, align 4, !tbaa !21 %conv80 = sext i8 %23 to i32 %val83 = getelementptr inbounds [100000 x %struct.card_tbl], ptr %a, i64 0, i64 %indvars.iv147, i32 1 %24 = load i32, ptr %val83, align 4, !tbaa !5 %call84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv80, i32 noundef %24) %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1 %exitcond151.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count150 br i1 %exitcond151.not, label %for.end87, label %for.body76, !llvm.loop !27 for.end87: ; preds = %for.body76, %if.end72.thread, %if.else, %if.end72 call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %a) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; 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 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 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 #6 = { nofree nounwind } attributes #7 = { nounwind } attributes #8 = { 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, !9, i64 4} !6 = !{!"card_tbl", !7, i64 0, !9, i64 4, !9, i64 8} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!"int", !7, i64 0} !10 = !{i64 0, i64 1, !11, i64 4, i64 4, !12, i64 8, i64 4, !12} !11 = !{!7, !7, i64 0} !12 = !{!9, !9, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = !{!16, !16, i64 0} !16 = !{!"any pointer", !7, i64 0} !17 = !{!18, !18, i64 0} !18 = !{!"short", !7, i64 0} !19 = distinct !{!19, !14} !20 = distinct !{!20, !14} !21 = !{!6, !7, i64 0} !22 = distinct !{!22, !14} !23 = distinct !{!23, !14} !24 = !{!6, !9, i64 8} !25 = distinct !{!25, !14} !26 = distinct !{!26, !14} !27 = distinct !{!27, !14}
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: main.c * Author: Ivan * * Created on July 3, 2018, 4:47 AM */ #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_SIZE 100000 #define INFTY 1000000001 typedef struct{ char suit; int num; }Poker; /* * */ Poker Left[MAX_SIZE/2 + 2], Right[MAX_SIZE/2 + 2]; int count = 0; void merge(Poker A[], int left, int mid, int right); void mergeSort(Poker A[], int left, int right); void quickSort(Poker A[], int left, int right); int partition(Poker A[], int left, int right); int main(int argc, char** argv) { Poker A[MAX_SIZE], B[MAX_SIZE]; int n, temp, stability = 1; char C[11]; scanf("%d", &n); for (int ix = 0; ix < n; ++ix) { scanf("%s %d", C, &temp); A[ix].suit = C[0]; B[ix].suit = C[0]; A[ix].num = temp; B[ix].num = temp; } mergeSort(A, 0, n); quickSort(B, 0, n-1); for (int k = 0; k < n; ++k) if (A[k].suit != B[k].suit) stability = 0; if (stability == 1) printf("Stable\n"); else { printf("Not stable\n"); } for (int kx = 0; kx < n; ++kx) printf("%c %d\n", B[kx].suit, B[kx].num); return (EXIT_SUCCESS); } void quickSort(Poker A[], int left, int right) { if (left < right) { int mid = partition(A, left, right); quickSort(A, left, mid-1); quickSort(A, mid+1, right); } } int partition(Poker A[], int left, int right) { Poker temp; int x = A[right].num; int i = left-1; for (int j = left; j < right; ++j) { if (A[j].num <= x) { i = i + 1; // strcmp(temp.suit , A[i].suit); // temp.num = A[i].num; // strcmp(A[i].suit, A[j].suit); // A[i].num = A[j].num; // strcmp(A[j].suit, temp.suit); // A[j].num = temp.num; temp = A[i]; A[i] = A[j]; A[j] = temp; } } // strcmp(temp.suit , A[i+1].suit); // temp.num = A[i+1].num; // strcmp(A[i+1].suit, A[right].suit); // A[i+1].num = A[right].num; // strcmp(A[right].suit, temp.suit); // A[right].num = temp.num; temp = A[i+1]; A[i+1] = A[right]; A[right] = temp; return i+1; } void merge(Poker A[], int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; for (int i = 0; i < n1; ++i) Left[i] = A[left + i]; for (int j = 0; j < n2; ++j) Right[j] = A[mid + j]; Left[n1].num = INFTY; Right[n2].num = INFTY; int i = 0, j = 0; for (int k = left; k < right; ++k) { if (Left[i].num <= Right[j].num) { A[k] = Left[i]; i = i + 1; } else { A[k] = Right[j]; j = j + 1; } count++; } } void mergeSort(Poker 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); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269673/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269673/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.Poker = type { i8, i32 } @count = dso_local local_unnamed_addr global i32 0, align 4 @.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 @Left = dso_local local_unnamed_addr global [50002 x %struct.Poker] zeroinitializer, align 16 @Right = dso_local local_unnamed_addr global [50002 x %struct.Poker] 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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %A = alloca [100000 x %struct.Poker], align 16 %B = alloca [100000 x %struct.Poker], align 16 %n = alloca i32, align 4 %temp = alloca i32, align 4 %C = alloca [11 x i8], align 1 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 4, ptr nonnull %n) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #8 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %C) #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.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %5, %for.body ] call void @mergeSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %.lcssa) %1 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %1, -1 call void @quickSort(ptr noundef nonnull %B, i32 noundef 0, i32 noundef %sub) %cmp1566 = icmp sgt i32 %1, 0 br i1 %cmp1566, label %for.body17.preheader, label %if.end35 for.body17.preheader: ; preds = %for.cond.cleanup %wide.trip.count = zext i32 %1 to i64 %xtraiter = and i64 %wide.trip.count, 3 %2 = icmp ult i32 %1, 4 br i1 %2, label %for.cond.cleanup16.unr-lcssa, label %for.body17.preheader.new for.body17.preheader.new: ; preds = %for.body17.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body17 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 %C, ptr noundef nonnull %temp) %3 = load i8, ptr %C, align 1, !tbaa !9 %arrayidx2 = getelementptr inbounds [100000 x %struct.Poker], ptr %A, i64 0, i64 %indvars.iv store i8 %3, ptr %arrayidx2, align 8, !tbaa !10 %arrayidx5 = getelementptr inbounds [100000 x %struct.Poker], ptr %B, i64 0, i64 %indvars.iv store i8 %3, ptr %arrayidx5, align 8, !tbaa !10 %4 = load i32, ptr %temp, align 4, !tbaa !5 %num = getelementptr inbounds [100000 x %struct.Poker], ptr %A, i64 0, i64 %indvars.iv, i32 1 store i32 %4, ptr %num, align 4, !tbaa !12 %num11 = getelementptr inbounds [100000 x %struct.Poker], ptr %B, i64 0, i64 %indvars.iv, i32 1 store i32 %4, ptr %num11, align 4, !tbaa !12 %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.cond.cleanup, !llvm.loop !13 for.cond.cleanup16.unr-lcssa: ; preds = %for.body17, %for.body17.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body17.preheader ], [ %spec.select.3, %for.body17 ] %indvars.iv74.unr = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next75.3, %for.body17 ] %stability.067.unr = phi i32 [ 1, %for.body17.preheader ], [ %spec.select.3, %for.body17 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup16, label %for.body17.epil for.body17.epil: ; preds = %for.cond.cleanup16.unr-lcssa, %for.body17.epil %indvars.iv74.epil = phi i64 [ %indvars.iv.next75.epil, %for.body17.epil ], [ %indvars.iv74.unr, %for.cond.cleanup16.unr-lcssa ] %stability.067.epil = phi i32 [ %spec.select.epil, %for.body17.epil ], [ %stability.067.unr, %for.cond.cleanup16.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body17.epil ], [ 0, %for.cond.cleanup16.unr-lcssa ] %arrayidx19.epil = getelementptr inbounds [100000 x %struct.Poker], ptr %A, i64 0, i64 %indvars.iv74.epil %7 = load i8, ptr %arrayidx19.epil, align 8, !tbaa !10 %arrayidx22.epil = getelementptr inbounds [100000 x %struct.Poker], ptr %B, i64 0, i64 %indvars.iv74.epil %8 = load i8, ptr %arrayidx22.epil, align 8, !tbaa !10 %cmp25.not.epil = icmp eq i8 %7, %8 %spec.select.epil = select i1 %cmp25.not.epil, i32 %stability.067.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.cond.cleanup16, label %for.body17.epil, !llvm.loop !15 for.cond.cleanup16: ; preds = %for.body17.epil, %for.cond.cleanup16.unr-lcssa %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.cond.cleanup16.unr-lcssa ], [ %spec.select.epil, %for.body17.epil ] %9 = icmp eq i32 %spec.select.lcssa, 1 %spec.select82 = select i1 %9, ptr @str.5, ptr @str br label %if.end35 for.body17: ; preds = %for.body17, %for.body17.preheader.new %indvars.iv74 = phi i64 [ 0, %for.body17.preheader.new ], [ %indvars.iv.next75.3, %for.body17 ] %stability.067 = phi i32 [ 1, %for.body17.preheader.new ], [ %spec.select.3, %for.body17 ] %niter = phi i64 [ 0, %for.body17.preheader.new ], [ %niter.next.3, %for.body17 ] %arrayidx19 = getelementptr inbounds [100000 x %struct.Poker], ptr %A, i64 0, i64 %indvars.iv74 %10 = load i8, ptr %arrayidx19, align 16, !tbaa !10 %arrayidx22 = getelementptr inbounds [100000 x %struct.Poker], ptr %B, i64 0, i64 %indvars.iv74 %11 = load i8, ptr %arrayidx22, align 16, !tbaa !10 %cmp25.not = icmp eq i8 %10, %11 %indvars.iv.next75 = or i64 %indvars.iv74, 1 %arrayidx19.1 = getelementptr inbounds [100000 x %struct.Poker], ptr %A, i64 0, i64 %indvars.iv.next75 %12 = load i8, ptr %arrayidx19.1, align 8, !tbaa !10 %arrayidx22.1 = getelementptr inbounds [100000 x %struct.Poker], ptr %B, i64 0, i64 %indvars.iv.next75 %13 = load i8, ptr %arrayidx22.1, align 8, !tbaa !10 %cmp25.not.1 = icmp eq i8 %12, %13 %indvars.iv.next75.1 = or i64 %indvars.iv74, 2 %arrayidx19.2 = getelementptr inbounds [100000 x %struct.Poker], ptr %A, i64 0, i64 %indvars.iv.next75.1 %14 = load i8, ptr %arrayidx19.2, align 16, !tbaa !10 %arrayidx22.2 = getelementptr inbounds [100000 x %struct.Poker], ptr %B, i64 0, i64 %indvars.iv.next75.1 %15 = load i8, ptr %arrayidx22.2, align 16, !tbaa !10 %cmp25.not.2 = icmp eq i8 %14, %15 %indvars.iv.next75.2 = or i64 %indvars.iv74, 3 %arrayidx19.3 = getelementptr inbounds [100000 x %struct.Poker], ptr %A, i64 0, i64 %indvars.iv.next75.2 %16 = load i8, ptr %arrayidx19.3, align 8, !tbaa !10 %arrayidx22.3 = getelementptr inbounds [100000 x %struct.Poker], ptr %B, i64 0, i64 %indvars.iv.next75.2 %17 = load i8, ptr %arrayidx22.3, align 8, !tbaa !10 %cmp25.not.3 = icmp eq i8 %16, %17 %18 = select i1 %cmp25.not.3, i1 %cmp25.not.2, i1 false %19 = select i1 %18, i1 %cmp25.not.1, i1 false %20 = select i1 %19, i1 %cmp25.not, i1 false %spec.select.3 = select i1 %20, i32 %stability.067, 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.cond.cleanup16.unr-lcssa, label %for.body17, !llvm.loop !17 if.end35: ; preds = %for.cond.cleanup16, %for.cond.cleanup %str.sink = phi ptr [ @str.5, %for.cond.cleanup ], [ %spec.select82, %for.cond.cleanup16 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %21 = load i32, ptr %n, align 4, !tbaa !5 %cmp3770 = icmp sgt i32 %21, 0 br i1 %cmp3770, label %for.body40, label %for.cond.cleanup39 for.cond.cleanup39: ; preds = %for.body40, %if.end35 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %C) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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 ret i32 0 for.body40: ; preds = %if.end35, %for.body40 %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body40 ], [ 0, %if.end35 ] %arrayidx42 = getelementptr inbounds [100000 x %struct.Poker], ptr %B, i64 0, i64 %indvars.iv77 %22 = load i8, ptr %arrayidx42, align 8, !tbaa !10 %conv44 = sext i8 %22 to i32 %num47 = getelementptr inbounds [100000 x %struct.Poker], ptr %B, i64 0, i64 %indvars.iv77, i32 1 %23 = load i32, ptr %num47, align 4, !tbaa !12 %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv44, 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 %cmp37 = icmp slt i64 %indvars.iv.next78, %25 br i1 %cmp37, label %for.body40, label %for.cond.cleanup39, !llvm.loop !18 } ; 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 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 %cmp71.i = icmp sgt i32 %sub.i, 0 br i1 %cmp71.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.Poker, 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 @Left 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.Poker], ptr @Left, i64 0, i64 %index %5 = getelementptr %struct.Poker, 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.Poker], ptr @Left, i64 0, i64 %indvars.iv.i.prol %gep.i.prol = getelementptr %struct.Poker, 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 %cmp573.i = icmp sgt i32 %sub1.i, 0 br i1 %cmp573.i, label %for.body7.preheader.i, label %for.cond.cleanup6.i for.body7.preheader.i: ; preds = %for.cond4.preheader.i %13 = sext i32 %div to i64 %wide.trip.count87.i = zext i32 %sub1.i to i64 %invariant.gep94.i = getelementptr %struct.Poker, ptr %A, i64 %13 %min.iters.check18 = icmp ult i32 %sub1.i, 10 br i1 %min.iters.check18, label %for.body7.i.preheader, label %vector.memcheck14 vector.memcheck14: ; preds = %for.body7.preheader.i %14 = shl nsw i64 %13, 3 %15 = add i64 %14, %A12 %16 = sub i64 ptrtoint (ptr @Right to i64), %15 %diff.check15 = icmp ult i64 %16, 32 br i1 %diff.check15, label %for.body7.i.preheader, label %vector.ph19 vector.ph19: ; preds = %vector.memcheck14 %n.vec21 = and i64 %wide.trip.count87.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.Poker], ptr @Right, i64 0, i64 %index25 %18 = getelementptr %struct.Poker, ptr %invariant.gep94.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.count87.i br i1 %cmp.n23, label %for.cond.cleanup6.i, label %for.body7.i.preheader for.body7.i.preheader: ; preds = %vector.memcheck14, %for.body7.preheader.i, %middle.block16 %indvars.iv83.i.ph = phi i64 [ 0, %vector.memcheck14 ], [ 0, %for.body7.preheader.i ], [ %n.vec21, %middle.block16 ] %22 = xor i64 %indvars.iv83.i.ph, -1 %23 = add nsw i64 %22, %wide.trip.count87.i %xtraiter29 = and i64 %wide.trip.count87.i, 3 %lcmp.mod30.not = icmp eq i64 %xtraiter29, 0 br i1 %lcmp.mod30.not, label %for.body7.i.prol.loopexit, label %for.body7.i.prol for.body7.i.prol: ; preds = %for.body7.i.preheader, %for.body7.i.prol %indvars.iv83.i.prol = phi i64 [ %indvars.iv.next84.i.prol, %for.body7.i.prol ], [ %indvars.iv83.i.ph, %for.body7.i.preheader ] %prol.iter31 = phi i64 [ %prol.iter31.next, %for.body7.i.prol ], [ 0, %for.body7.i.preheader ] %arrayidx9.i.prol = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %indvars.iv83.i.prol %gep95.i.prol = getelementptr %struct.Poker, ptr %invariant.gep94.i, i64 %indvars.iv83.i.prol %24 = load i64, ptr %gep95.i.prol, align 4 store i64 %24, ptr %arrayidx9.i.prol, align 8 %indvars.iv.next84.i.prol = add nuw nsw i64 %indvars.iv83.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.body7.i.prol.loopexit, label %for.body7.i.prol, !llvm.loop !24 for.body7.i.prol.loopexit: ; preds = %for.body7.i.prol, %for.body7.i.preheader %indvars.iv83.i.unr = phi i64 [ %indvars.iv83.i.ph, %for.body7.i.preheader ], [ %indvars.iv.next84.i.prol, %for.body7.i.prol ] %25 = icmp ult i64 %23, 3 br i1 %25, label %for.cond.cleanup6.i, label %for.body7.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.Poker], ptr @Left, i64 0, i64 %indvars.iv.i %gep.i = getelementptr %struct.Poker, 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.Poker], ptr @Left, i64 0, i64 %indvars.iv.next.i %gep.i.1 = getelementptr %struct.Poker, 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.Poker], ptr @Left, i64 0, i64 %indvars.iv.next.i.1 %gep.i.2 = getelementptr %struct.Poker, 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.Poker], ptr @Left, i64 0, i64 %indvars.iv.next.i.2 %gep.i.3 = getelementptr %struct.Poker, 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.cond.cleanup6.i: ; preds = %for.body7.i.prol.loopexit, %for.body7.i, %middle.block16, %for.cond4.preheader.i %idxprom16.i = sext i32 %sub.i to i64 %num.i = getelementptr inbounds [50002 x %struct.Poker], ptr @Left, i64 0, i64 %idxprom16.i, i32 1 store i32 1000000001, ptr %num.i, align 4, !tbaa !12 %idxprom18.i = sext i32 %sub1.i to i64 %num20.i = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %idxprom18.i, i32 1 store i32 1000000001, ptr %num20.i, align 4, !tbaa !12 %count.promoted.i = load i32, ptr @count, align 4, !tbaa !5 %30 = sext i32 %left to i64 %wide.trip.count92.i = sext i32 %right to i64 br label %for.body26.i for.body7.i: ; preds = %for.body7.i.prol.loopexit, %for.body7.i %indvars.iv83.i = phi i64 [ %indvars.iv.next84.i.3, %for.body7.i ], [ %indvars.iv83.i.unr, %for.body7.i.prol.loopexit ] %arrayidx9.i = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %indvars.iv83.i %gep95.i = getelementptr %struct.Poker, ptr %invariant.gep94.i, i64 %indvars.iv83.i %31 = load i64, ptr %gep95.i, align 4 store i64 %31, ptr %arrayidx9.i, align 8 %indvars.iv.next84.i = add nuw nsw i64 %indvars.iv83.i, 1 %arrayidx9.i.1 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %indvars.iv.next84.i %gep95.i.1 = getelementptr %struct.Poker, ptr %invariant.gep94.i, i64 %indvars.iv.next84.i %32 = load i64, ptr %gep95.i.1, align 4 store i64 %32, ptr %arrayidx9.i.1, align 8 %indvars.iv.next84.i.1 = add nuw nsw i64 %indvars.iv83.i, 2 %arrayidx9.i.2 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %indvars.iv.next84.i.1 %gep95.i.2 = getelementptr %struct.Poker, ptr %invariant.gep94.i, i64 %indvars.iv.next84.i.1 %33 = load i64, ptr %gep95.i.2, align 4 store i64 %33, ptr %arrayidx9.i.2, align 8 %indvars.iv.next84.i.2 = add nuw nsw i64 %indvars.iv83.i, 3 %arrayidx9.i.3 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %indvars.iv.next84.i.2 %gep95.i.3 = getelementptr %struct.Poker, ptr %invariant.gep94.i, i64 %indvars.iv.next84.i.2 %34 = load i64, ptr %gep95.i.3, align 4 store i64 %34, ptr %arrayidx9.i.3, align 8 %indvars.iv.next84.i.3 = add nuw nsw i64 %indvars.iv83.i, 4 %exitcond88.not.i.3 = icmp eq i64 %indvars.iv.next84.i.3, %wide.trip.count87.i br i1 %exitcond88.not.i.3, label %for.cond.cleanup6.i, label %for.body7.i, !llvm.loop !26 for.cond23.for.cond.cleanup25_crit_edge.i: ; preds = %for.body26.i %35 = sub i32 %right, %left %36 = add i32 %35, %count.promoted.i store i32 %36, ptr @count, align 4, !tbaa !5 br label %if.end for.body26.i: ; preds = %for.body26.i, %for.cond.cleanup6.i %indvars.iv89.i = phi i64 [ %30, %for.cond.cleanup6.i ], [ %indvars.iv.next90.i, %for.body26.i ] %j22.079.i = phi i32 [ 0, %for.cond.cleanup6.i ], [ %j22.1.i, %for.body26.i ] %i21.078.i = phi i32 [ 0, %for.cond.cleanup6.i ], [ %i21.1.i, %for.body26.i ] %idxprom27.i = zext i32 %i21.078.i to i64 %num29.i = getelementptr inbounds [50002 x %struct.Poker], ptr @Left, i64 0, i64 %idxprom27.i, i32 1 %37 = load i32, ptr %num29.i, align 4, !tbaa !12 %idxprom30.i = zext i32 %j22.079.i to i64 %num32.i = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %idxprom30.i, i32 1 %38 = load i32, ptr %num32.i, align 4, !tbaa !12 %cmp33.not.i = icmp sle i32 %37, %38 %arrayidx31.i = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %idxprom30.i %arrayidx28.i = getelementptr inbounds [50002 x %struct.Poker], ptr @Left, i64 0, i64 %idxprom27.i %.sink.in.i = select i1 %cmp33.not.i, ptr %arrayidx28.i, ptr %arrayidx31.i %add38.i = zext i1 %cmp33.not.i to i32 %i21.1.i = add nuw nsw i32 %i21.078.i, %add38.i %not.cmp33.not.i = xor i1 %cmp33.not.i, true %add43.i = zext i1 %not.cmp33.not.i to i32 %j22.1.i = add nuw nsw i32 %j22.079.i, %add43.i %.sink.i = load i64, ptr %.sink.in.i, align 8 %39 = getelementptr inbounds %struct.Poker, ptr %A, i64 %indvars.iv89.i store i64 %.sink.i, ptr %39, align 4 %indvars.iv.next90.i = add nsw i64 %indvars.iv89.i, 1 %exitcond93.not.i = icmp eq i64 %indvars.iv.next90.i, %wide.trip.count92.i br i1 %exitcond93.not.i, label %for.cond23.for.cond.cleanup25_crit_edge.i, label %for.body26.i, !llvm.loop !27 if.end: ; preds = %for.cond23.for.cond.cleanup25_crit_edge.i, %entry ret void } ; 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 #4 { 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 %num.i = getelementptr inbounds %struct.Poker, ptr %A, i64 %idxprom.i, i32 1 %arrayidx.i = getelementptr inbounds %struct.Poker, 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 %left.tr9 = phi i32 [ %left, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ] %1 = load i32, ptr %num.i, align 4, !tbaa !12 %sub.i = add nsw i32 %left.tr9, -1 %2 = sext i32 %left.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 %num3.i.prol = getelementptr inbounds %struct.Poker, ptr %A, i64 %2, i32 1 %4 = load i32, ptr %num3.i.prol, align 4, !tbaa !12 %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.Poker, ptr %A, i64 %2 %idxprom5.i.prol = sext i32 %left.tr9 to i64 %arrayidx6.i.prol = getelementptr inbounds %struct.Poker, 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 [ %left.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 ] %num3.i = getelementptr inbounds %struct.Poker, ptr %A, i64 %indvars.iv.i, i32 1 %9 = load i32, ptr %num3.i, align 4, !tbaa !12 %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.Poker, 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.Poker, 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 [ %add.i, %if.then.i ], [ %i.047.i, %for.body.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %num3.i.1 = getelementptr inbounds %struct.Poker, ptr %A, i64 %indvars.iv.next.i, i32 1 %12 = load i32, ptr %num3.i.1, align 4, !tbaa !12 %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.Poker, 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.Poker, 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 [ %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 !28 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.Poker, 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 %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 declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; 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 #5 { entry: %idxprom = sext i32 %right to i64 %num = getelementptr inbounds %struct.Poker, ptr %A, i64 %idxprom, i32 1 %0 = load i32, ptr %num, align 4, !tbaa !12 %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 %1 = sext i32 %left 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 %num3.prol = getelementptr inbounds %struct.Poker, ptr %A, i64 %1, i32 1 %3 = load i32, ptr %num3.prol, align 4, !tbaa !12 %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.Poker, ptr %A, i64 %1 %idxprom5.prol = sext i32 %left to i64 %arrayidx6.prol = getelementptr inbounds %struct.Poker, 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 [ %left, %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.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 ] %9 = 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 ], [ %9, %for.cond.cleanup.loopexit ] %arrayidx = getelementptr inbounds %struct.Poker, ptr %A, i64 %idxprom %idxprom14 = sext i32 %i.0.lcssa to i64 %arrayidx15 = getelementptr inbounds %struct.Poker, ptr %A, i64 %idxprom14 %10 = load i64, ptr %arrayidx15, align 4 %11 = load i64, ptr %arrayidx, align 4 store i64 %11, ptr %arrayidx15, align 4 store i64 %10, 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 ] %num3 = getelementptr inbounds %struct.Poker, ptr %A, i64 %indvars.iv, i32 1 %12 = load i32, ptr %num3, align 4, !tbaa !12 %cmp4.not = icmp sgt i32 %12, %0 br i1 %cmp4.not, label %for.inc, label %if.then if.then: ; preds = %for.body %arrayidx2 = getelementptr inbounds %struct.Poker, ptr %A, i64 %indvars.iv %add = add nsw i32 %i.047, 1 %idxprom5 = sext i32 %add to i64 %arrayidx6 = getelementptr inbounds %struct.Poker, ptr %A, i64 %idxprom5 %13 = load i64, ptr %arrayidx6, align 4 %14 = load i64, ptr %arrayidx2, align 4 store i64 %14, ptr %arrayidx6, align 4 store i64 %13, 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 %num3.1 = getelementptr inbounds %struct.Poker, ptr %A, i64 %indvars.iv.next, i32 1 %15 = load i32, ptr %num3.1, align 4, !tbaa !12 %cmp4.not.1 = icmp sgt i32 %15, %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.Poker, 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.Poker, ptr %A, i64 %idxprom5.1 %16 = load i64, ptr %arrayidx6.1, align 4 %17 = load i64, ptr %arrayidx2.1, align 4 store i64 %17, ptr %arrayidx6.1, align 4 store i64 %16, 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 !28 } ; 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 #6 { entry: %A96 = ptrtoint ptr %A to i64 %sub = sub nsw i32 %mid, %left %sub1 = sub i32 %right, %mid %cmp71 = icmp sgt i32 %sub, 0 br i1 %cmp71, 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.Poker, ptr %A, i64 %0 %min.iters.check = icmp ult i32 %sub, 10 br i1 %min.iters.check, label %for.body.preheader114, label %vector.memcheck vector.memcheck: ; preds = %for.body.preheader %1 = shl nsw i64 %0, 3 %2 = add i64 %1, %A96 %3 = sub i64 ptrtoint (ptr @Left to i64), %2 %diff.check = icmp ult i64 %3, 32 br i1 %diff.check, label %for.body.preheader114, 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.Poker], ptr @Left, i64 0, i64 %index %5 = getelementptr %struct.Poker, ptr %invariant.gep, i64 %index %wide.load = load <2 x i64>, ptr %5, align 4 %6 = getelementptr i64, ptr %5, i64 2 %wide.load97 = 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.load97, 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 !29 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.preheader114 for.body.preheader114: ; 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.preheader114, %for.body.prol %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader114 ] %prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader114 ] %arrayidx.prol = getelementptr inbounds [50002 x %struct.Poker], ptr @Left, i64 0, i64 %indvars.iv.prol %gep.prol = getelementptr %struct.Poker, 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 !30 for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader114 %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader114 ], [ %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 %cmp573 = icmp sgt i32 %sub1, 0 br i1 %cmp573, label %for.body7.preheader, label %for.cond.cleanup6 for.body7.preheader: ; preds = %for.cond4.preheader %13 = sext i32 %mid to i64 %wide.trip.count87 = zext i32 %sub1 to i64 %invariant.gep94 = getelementptr %struct.Poker, ptr %A, i64 %13 %min.iters.check102 = icmp ult i32 %sub1, 10 br i1 %min.iters.check102, label %for.body7.preheader113, label %vector.memcheck98 vector.memcheck98: ; preds = %for.body7.preheader %14 = shl nsw i64 %13, 3 %15 = add i64 %14, %A96 %16 = sub i64 ptrtoint (ptr @Right to i64), %15 %diff.check99 = icmp ult i64 %16, 32 br i1 %diff.check99, label %for.body7.preheader113, label %vector.ph103 vector.ph103: ; preds = %vector.memcheck98 %n.vec105 = and i64 %wide.trip.count87, 4294967292 br label %vector.body108 vector.body108: ; preds = %vector.body108, %vector.ph103 %index109 = phi i64 [ 0, %vector.ph103 ], [ %index.next112, %vector.body108 ] %17 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %index109 %18 = getelementptr %struct.Poker, ptr %invariant.gep94, i64 %index109 %wide.load110 = load <2 x i64>, ptr %18, align 4 %19 = getelementptr i64, ptr %18, i64 2 %wide.load111 = load <2 x i64>, ptr %19, align 4 store <2 x i64> %wide.load110, ptr %17, align 16 %20 = getelementptr inbounds i64, ptr %17, i64 2 store <2 x i64> %wide.load111, ptr %20, align 16 %index.next112 = add nuw i64 %index109, 4 %21 = icmp eq i64 %index.next112, %n.vec105 br i1 %21, label %middle.block100, label %vector.body108, !llvm.loop !31 middle.block100: ; preds = %vector.body108 %cmp.n107 = icmp eq i64 %n.vec105, %wide.trip.count87 br i1 %cmp.n107, label %for.cond.cleanup6, label %for.body7.preheader113 for.body7.preheader113: ; preds = %vector.memcheck98, %for.body7.preheader, %middle.block100 %indvars.iv83.ph = phi i64 [ 0, %vector.memcheck98 ], [ 0, %for.body7.preheader ], [ %n.vec105, %middle.block100 ] %22 = xor i64 %indvars.iv83.ph, -1 %23 = add nsw i64 %22, %wide.trip.count87 %xtraiter115 = and i64 %wide.trip.count87, 3 %lcmp.mod116.not = icmp eq i64 %xtraiter115, 0 br i1 %lcmp.mod116.not, label %for.body7.prol.loopexit, label %for.body7.prol for.body7.prol: ; preds = %for.body7.preheader113, %for.body7.prol %indvars.iv83.prol = phi i64 [ %indvars.iv.next84.prol, %for.body7.prol ], [ %indvars.iv83.ph, %for.body7.preheader113 ] %prol.iter117 = phi i64 [ %prol.iter117.next, %for.body7.prol ], [ 0, %for.body7.preheader113 ] %arrayidx9.prol = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %indvars.iv83.prol %gep95.prol = getelementptr %struct.Poker, ptr %invariant.gep94, i64 %indvars.iv83.prol %24 = load i64, ptr %gep95.prol, align 4 store i64 %24, ptr %arrayidx9.prol, align 8 %indvars.iv.next84.prol = add nuw nsw i64 %indvars.iv83.prol, 1 %prol.iter117.next = add i64 %prol.iter117, 1 %prol.iter117.cmp.not = icmp eq i64 %prol.iter117.next, %xtraiter115 br i1 %prol.iter117.cmp.not, label %for.body7.prol.loopexit, label %for.body7.prol, !llvm.loop !32 for.body7.prol.loopexit: ; preds = %for.body7.prol, %for.body7.preheader113 %indvars.iv83.unr = phi i64 [ %indvars.iv83.ph, %for.body7.preheader113 ], [ %indvars.iv.next84.prol, %for.body7.prol ] %25 = icmp ult i64 %23, 3 br i1 %25, label %for.cond.cleanup6, label %for.body7 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.Poker], ptr @Left, i64 0, i64 %indvars.iv %gep = getelementptr %struct.Poker, 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.Poker], ptr @Left, i64 0, i64 %indvars.iv.next %gep.1 = getelementptr %struct.Poker, 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.Poker], ptr @Left, i64 0, i64 %indvars.iv.next.1 %gep.2 = getelementptr %struct.Poker, 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.Poker], ptr @Left, i64 0, i64 %indvars.iv.next.2 %gep.3 = getelementptr %struct.Poker, 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 !33 for.cond.cleanup6: ; preds = %for.body7.prol.loopexit, %for.body7, %middle.block100, %for.cond4.preheader %idxprom16 = sext i32 %sub to i64 %num = getelementptr inbounds [50002 x %struct.Poker], ptr @Left, i64 0, i64 %idxprom16, i32 1 store i32 1000000001, ptr %num, align 4, !tbaa !12 %idxprom18 = sext i32 %sub1 to i64 %num20 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %idxprom18, i32 1 store i32 1000000001, ptr %num20, align 4, !tbaa !12 %cmp2476 = icmp slt i32 %left, %right br i1 %cmp2476, label %for.body26.preheader, label %for.cond.cleanup25 for.body26.preheader: ; preds = %for.cond.cleanup6 %count.promoted = load i32, ptr @count, align 4, !tbaa !5 %30 = sext i32 %left to i64 %31 = add i32 %count.promoted, %right %wide.trip.count92 = sext i32 %right to i64 br label %for.body26 for.body7: ; preds = %for.body7.prol.loopexit, %for.body7 %indvars.iv83 = phi i64 [ %indvars.iv.next84.3, %for.body7 ], [ %indvars.iv83.unr, %for.body7.prol.loopexit ] %arrayidx9 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %indvars.iv83 %gep95 = getelementptr %struct.Poker, ptr %invariant.gep94, i64 %indvars.iv83 %32 = load i64, ptr %gep95, align 4 store i64 %32, ptr %arrayidx9, align 8 %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %arrayidx9.1 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %indvars.iv.next84 %gep95.1 = getelementptr %struct.Poker, ptr %invariant.gep94, i64 %indvars.iv.next84 %33 = load i64, ptr %gep95.1, align 4 store i64 %33, ptr %arrayidx9.1, align 8 %indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 2 %arrayidx9.2 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %indvars.iv.next84.1 %gep95.2 = getelementptr %struct.Poker, ptr %invariant.gep94, i64 %indvars.iv.next84.1 %34 = load i64, ptr %gep95.2, align 4 store i64 %34, ptr %arrayidx9.2, align 8 %indvars.iv.next84.2 = add nuw nsw i64 %indvars.iv83, 3 %arrayidx9.3 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %indvars.iv.next84.2 %gep95.3 = getelementptr %struct.Poker, ptr %invariant.gep94, i64 %indvars.iv.next84.2 %35 = load i64, ptr %gep95.3, align 4 store i64 %35, ptr %arrayidx9.3, align 8 %indvars.iv.next84.3 = add nuw nsw i64 %indvars.iv83, 4 %exitcond88.not.3 = icmp eq i64 %indvars.iv.next84.3, %wide.trip.count87 br i1 %exitcond88.not.3, label %for.cond.cleanup6, label %for.body7, !llvm.loop !34 for.cond23.for.cond.cleanup25_crit_edge: ; preds = %for.body26 %36 = sub i32 %31, %left store i32 %36, ptr @count, align 4, !tbaa !5 br label %for.cond.cleanup25 for.cond.cleanup25: ; preds = %for.cond23.for.cond.cleanup25_crit_edge, %for.cond.cleanup6 ret void for.body26: ; preds = %for.body26.preheader, %for.body26 %indvars.iv89 = phi i64 [ %30, %for.body26.preheader ], [ %indvars.iv.next90, %for.body26 ] %j22.079 = phi i32 [ 0, %for.body26.preheader ], [ %j22.1, %for.body26 ] %i21.078 = phi i32 [ 0, %for.body26.preheader ], [ %i21.1, %for.body26 ] %idxprom27 = zext i32 %i21.078 to i64 %num29 = getelementptr inbounds [50002 x %struct.Poker], ptr @Left, i64 0, i64 %idxprom27, i32 1 %37 = load i32, ptr %num29, align 4, !tbaa !12 %idxprom30 = zext i32 %j22.079 to i64 %num32 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %idxprom30, i32 1 %38 = load i32, ptr %num32, align 4, !tbaa !12 %cmp33.not = icmp sle i32 %37, %38 %arrayidx31 = getelementptr inbounds [50002 x %struct.Poker], ptr @Right, i64 0, i64 %idxprom30 %arrayidx28 = getelementptr inbounds [50002 x %struct.Poker], ptr @Left, i64 0, i64 %idxprom27 %.sink.in = select i1 %cmp33.not, ptr %arrayidx28, ptr %arrayidx31 %add38 = zext i1 %cmp33.not to i32 %i21.1 = add nuw nsw i32 %i21.078, %add38 %not.cmp33.not = xor i1 %cmp33.not, true %add43 = zext i1 %not.cmp33.not to i32 %j22.1 = add nuw nsw i32 %j22.079, %add43 %.sink = load i64, ptr %.sink.in, align 8 %39 = getelementptr inbounds %struct.Poker, ptr %A, i64 %indvars.iv89 store i64 %.sink, ptr %39, align 4 %indvars.iv.next90 = add nsw i64 %indvars.iv89, 1 %exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92 br i1 %exitcond93.not, label %for.cond23.for.cond.cleanup25_crit_edge, label %for.body26, !llvm.loop !27 } ; 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 = !{!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, !16} !16 = !{!"llvm.loop.unroll.disable"} !17 = distinct !{!17, !14} !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, !16} !23 = distinct !{!23, !14, !20, !21} !24 = distinct !{!24, !16} !25 = distinct !{!25, !14, !20} !26 = distinct !{!26, !14, !20} !27 = distinct !{!27, !14} !28 = distinct !{!28, !14} !29 = distinct !{!29, !14, !20, !21} !30 = distinct !{!30, !16} !31 = distinct !{!31, !14, !20, !21} !32 = distinct !{!32, !16} !33 = distinct !{!33, !14, !20} !34 = distinct !{!34, !14, !20}
#include <stdio.h> #include <string.h> #define SENTINEL 1e9 #define N 100000 typedef struct{ char c; int num; } Card; Card card1[N]; Card card2[N]; void merge(int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; Card L[n1], R[n2]; int i, j, k; for (i = 0; i <= n1 - 1; i++) L[i] = card2[left + i]; for (i = 0; i <= n2 - 1; i++) R[i] = card2[mid + i]; L[n1].num = R[n2].num = SENTINEL; L[n1].c = R[n2].c = ' '; i = j = 0; for (k = left; k <= right - 1; k++) { if (L[i].num <= R[j].num) { card2[k] = L[i]; i++; } else { card2[k] = R[j]; j++; } } } void mergeSort(int left, int right) { int mid; if (left + 1 < right) { mid = (left + right) / 2; mergeSort(left, mid); mergeSort(mid, right); merge(left, mid, right); } } void swapOfInt(int *a, int *b) { int tmp; tmp = *a; *a = *b; *b = tmp; } void swapOfChar(char *a, char *b) { char tmp; tmp = *a; *a = *b; *b = tmp; } int partition(int p, int r) { int x, i, j; x = card1[r].num; i = p - 1; for (j = p; j < r; ++j) { if (card1[j].num <= x) { i++; swapOfInt(&card1[i].num, &card1[j].num); swapOfChar(&card1[i].c, &card1[j].c); } } swapOfInt(&card1[i + 1].num, &card1[r].num); swapOfChar(&card1[i + 1].c, &card1[r].c); 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 main() { int i, n, flag = 0; char ch; scanf("%d%c", &n, &ch); for (i = 0; i < n; ++i) { scanf("%c%d%c", &card1[i].c, &card1[i].num, &ch); card2[i] = card1[i]; } quickSort(0, n - 1); mergeSort(0, n); for (i = 0; i < n; i++) { if (strcmp(&card1[i].c, &card2[i].c)) flag = 1; } if (flag) printf("Not stable\n"); else printf("Stable\n"); for (i = 0; i < n; ++i) { printf("%c %d\n", card1[i].c, card1[i].num); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269730/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269730/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 } @card2 = dso_local global [100000 x %struct.Card] zeroinitializer, align 16 @card1 = dso_local global [100000 x %struct.Card] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1 @.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 [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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @merge(i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 { entry: %sub = sub nsw i32 %mid, %left %sub1 = sub nsw i32 %right, %mid %0 = zext i32 %sub to i64 %vla = alloca %struct.Card, i64 %0, align 16 %1 = zext i32 %sub1 to i64 %vla2 = alloca %struct.Card, i64 %1, align 16 %cmp.not.not78 = icmp sgt i32 %sub, 0 br i1 %cmp.not.not78, label %for.body.preheader, label %for.cond6.preheader for.body.preheader: ; preds = %entry %2 = sext i32 %left to i64 %3 = shl nsw i64 %2, 3 %scevgep = getelementptr i8, ptr @card2, i64 %3 %4 = xor i32 %left, -1 %5 = add i32 %4, %mid %6 = zext i32 %5 to i64 %7 = shl nuw nsw i64 %6, 3 %8 = add nuw nsw i64 %7, 8 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, ptr noundef nonnull align 8 dereferenceable(1) %scevgep, i64 %8, i1 false) br label %for.cond6.preheader for.cond6.preheader: ; preds = %for.body.preheader, %entry %cmp8.not.not80 = icmp sgt i32 %sub1, 0 br i1 %cmp8.not.not80, label %for.body9.preheader, label %for.end17 for.body9.preheader: ; preds = %for.cond6.preheader %9 = sext i32 %mid to i64 %10 = shl nsw i64 %9, 3 %scevgep88 = getelementptr i8, ptr @card2, i64 %10 %11 = xor i32 %mid, -1 %12 = add i32 %11, %right %13 = zext i32 %12 to i64 %14 = shl nuw nsw i64 %13, 3 %15 = add nuw nsw i64 %14, 8 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla2, ptr noundef nonnull align 8 dereferenceable(1) %scevgep88, i64 %15, i1 false) br label %for.end17 for.end17: ; preds = %for.body9.preheader, %for.cond6.preheader %idxprom18 = sext i32 %sub1 to i64 %arrayidx19 = getelementptr inbounds %struct.Card, ptr %vla2, i64 %idxprom18 %num = getelementptr inbounds %struct.Card, ptr %vla2, i64 %idxprom18, i32 1 store i32 1000000000, ptr %num, align 4, !tbaa !5 %idxprom20 = sext i32 %sub to i64 %arrayidx21 = getelementptr inbounds %struct.Card, ptr %vla, i64 %idxprom20 %num22 = getelementptr inbounds %struct.Card, ptr %vla, i64 %idxprom20, i32 1 store i32 1000000000, ptr %num22, align 4, !tbaa !5 store i8 32, ptr %arrayidx19, align 8, !tbaa !10 store i8 32, ptr %arrayidx21, align 8, !tbaa !10 %cmp30.not.not82 = icmp slt i32 %left, %right br i1 %cmp30.not.not82, label %for.body31.preheader, label %for.end51 for.body31.preheader: ; preds = %for.end17 %16 = sext i32 %left to i64 %wide.trip.count = sext i32 %right to i64 br label %for.body31 for.body31: ; preds = %for.body31.preheader, %for.body31 %indvars.iv = phi i64 [ %16, %for.body31.preheader ], [ %indvars.iv.next, %for.body31 ] %j.084 = phi i32 [ 0, %for.body31.preheader ], [ %j.1, %for.body31 ] %i.283 = phi i32 [ 0, %for.body31.preheader ], [ %i.3, %for.body31 ] %idxprom32 = zext i32 %i.283 to i64 %num34 = getelementptr inbounds %struct.Card, ptr %vla, i64 %idxprom32, i32 1 %17 = load i32, ptr %num34, align 4, !tbaa !5 %idxprom35 = zext i32 %j.084 to i64 %num37 = getelementptr inbounds %struct.Card, ptr %vla2, i64 %idxprom35, i32 1 %18 = load i32, ptr %num37, align 4, !tbaa !5 %cmp38.not = icmp sle i32 %17, %18 %arrayidx36 = getelementptr inbounds %struct.Card, ptr %vla2, i64 %idxprom35 %arrayidx33 = getelementptr inbounds %struct.Card, ptr %vla, i64 %idxprom32 %.sink.in = select i1 %cmp38.not, ptr %arrayidx33, ptr %arrayidx36 %inc43 = zext i1 %cmp38.not to i32 %i.3 = add nuw nsw i32 %i.283, %inc43 %not.cmp38.not = xor i1 %cmp38.not, true %inc48 = zext i1 %not.cmp38.not to i32 %j.1 = add nuw nsw i32 %j.084, %inc48 %.sink = load i64, ptr %.sink.in, align 8 %19 = getelementptr inbounds [100000 x %struct.Card], ptr @card2, i64 0, i64 %indvars.iv store i64 %.sink, ptr %19, align 8 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end51, label %for.body31, !llvm.loop !11 for.end51: ; preds = %for.body31, %for.end17 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(readwrite, inaccessiblemem: none) uwtable define dso_local void @mergeSort(i32 noundef %left, i32 noundef %right) local_unnamed_addr #3 { entry: %add = add nsw i32 %left, 1 %cmp = icmp slt i32 %add, %right br i1 %cmp, label %if.then, label %common.ret10 common.ret10: ; 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(i32 noundef %left, i32 noundef %div) tail call void @mergeSort(i32 noundef %div, i32 noundef %right) tail call void @merge(i32 noundef %left, i32 noundef %div, i32 noundef %right) br label %common.ret10 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swapOfInt(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !13 %1 = load i32, ptr %b, align 4, !tbaa !13 store i32 %1, ptr %a, align 4, !tbaa !13 store i32 %0, ptr %b, align 4, !tbaa !13 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swapOfChar(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load i8, ptr %a, align 1, !tbaa !14 %1 = load i8, ptr %b, align 1, !tbaa !14 store i8 %1, ptr %a, align 1, !tbaa !14 store i8 %0, ptr %b, align 1, !tbaa !14 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #5 { entry: %idxprom = sext i32 %r to i64 %num = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %num, align 4, !tbaa !13 %cmp44 = icmp slt i32 %p, %r br i1 %cmp44, 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.045 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ] %num3 = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %indvars.iv, i32 1 %2 = load i32, ptr %num3, 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 [100000 x %struct.Card], ptr @card1, i64 0, i64 %indvars.iv %inc = add nsw i32 %i.045, 1 %idxprom5 = sext i32 %inc to i64 %arrayidx6 = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom5 %num7 = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom5, i32 1 %3 = load i32, ptr %num7, align 4, !tbaa !13 store i32 %2, ptr %num7, align 4, !tbaa !13 store i32 %3, ptr %num3, align 4, !tbaa !13 %4 = load i8, ptr %arrayidx6, align 8, !tbaa !14 %5 = load i8, ptr %arrayidx2, align 8, !tbaa !14 store i8 %5, ptr %arrayidx6, align 8, !tbaa !14 store i8 %4, ptr %arrayidx2, align 8, !tbaa !14 br label %for.inc for.inc: ; preds = %for.body, %if.then %i.1 = phi i32 [ %inc, %if.then ], [ %i.045, %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 !15 for.end.loopexit: ; preds = %for.inc %.pre = load i32, ptr %num, align 4, !tbaa !13 %6 = add nsw i32 %i.1, 1 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %7 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ] %i.0.lcssa = phi i32 [ %p, %entry ], [ %6, %for.end.loopexit ] %arrayidx = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom %idxprom17 = sext i32 %i.0.lcssa to i64 %arrayidx18 = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom17 %num19 = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom17, i32 1 %8 = load i32, ptr %num19, align 4, !tbaa !13 store i32 %7, ptr %num19, align 4, !tbaa !13 store i32 %8, ptr %num, align 4, !tbaa !13 %9 = load i8, ptr %arrayidx18, align 8, !tbaa !14 %10 = load i8, ptr %arrayidx, align 8, !tbaa !14 store i8 %10, ptr %arrayidx18, align 8, !tbaa !14 store i8 %9, ptr %arrayidx, align 8, !tbaa !14 ret i32 %i.0.lcssa } ; 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: %cmp6 = icmp slt i32 %p, %r br i1 %cmp6, 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 [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom.i, i32 1 %arrayidx.i = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom.i br label %for.body.preheader.i for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit %p.tr7 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ] %0 = load i32, ptr %num.i, align 4, !tbaa !13 %sub.i = add nsw i32 %p.tr7, -1 %1 = sext i32 %p.tr7 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.045.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ] %num3.i = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %indvars.iv.i, i32 1 %2 = load i32, ptr %num3.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 [100000 x %struct.Card], ptr @card1, i64 0, i64 %indvars.iv.i %inc.i = add nsw i32 %i.045.i, 1 %idxprom5.i = sext i32 %inc.i to i64 %arrayidx6.i = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom5.i %num7.i = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom5.i, i32 1 %3 = load i32, ptr %num7.i, align 4, !tbaa !13 store i32 %2, ptr %num7.i, align 4, !tbaa !13 store i32 %3, ptr %num3.i, align 4, !tbaa !13 %4 = load i8, ptr %arrayidx6.i, align 8, !tbaa !14 %5 = load i8, ptr %arrayidx2.i, align 8, !tbaa !14 store i8 %5, ptr %arrayidx6.i, align 8, !tbaa !14 store i8 %4, ptr %arrayidx2.i, align 8, !tbaa !14 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.045.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 !15 partition.exit: ; preds = %for.inc.i %.pre.i = load i32, ptr %num.i, align 4, !tbaa !13 %6 = add nsw i32 %i.1.i, 1 %idxprom17.i = sext i32 %6 to i64 %arrayidx18.i = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom17.i %num19.i = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %idxprom17.i, i32 1 %7 = load i32, ptr %num19.i, align 4, !tbaa !13 store i32 %.pre.i, ptr %num19.i, align 4, !tbaa !13 store i32 %7, ptr %num.i, align 4, !tbaa !13 %8 = load i8, ptr %arrayidx18.i, align 8, !tbaa !14 %9 = load i8, ptr %arrayidx.i, align 8, !tbaa !14 store i8 %9, ptr %arrayidx18.i, align 8, !tbaa !14 store i8 %8, ptr %arrayidx.i, align 8, !tbaa !14 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.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: %n = alloca i32, align 4 %ch = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %ch) %0 = load i32, ptr %n, align 4, !tbaa !13 %cmp53 = icmp sgt i32 %0, 0 br i1 %cmp53, 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 [100000 x %struct.Card], ptr @card1, i64 0, i64 %indvars.iv %num = getelementptr inbounds [100000 x %struct.Card], ptr @card1, 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 %num, ptr noundef nonnull %ch) %arrayidx5 = getelementptr inbounds [100000 x %struct.Card], ptr @card2, i64 0, i64 %indvars.iv %1 = load i64, ptr %arrayidx, align 8 store i64 %1, ptr %arrayidx5, 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 !16 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ] %sub = add nsw i32 %.lcssa, -1 call void @quickSort(i32 noundef 0, i32 noundef %sub) %4 = load i32, ptr %n, align 4, !tbaa !13 call void @mergeSort(i32 noundef 0, i32 noundef %4) %5 = load i32, ptr %n, align 4, !tbaa !13 %cmp955 = icmp sgt i32 %5, 0 br i1 %cmp955, label %for.body10.preheader, label %if.else for.body10.preheader: ; preds = %for.end %wide.trip.count = zext i32 %5 to i64 br label %for.body10 for.body10: ; preds = %for.body10.preheader, %for.body10 %indvars.iv63 = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next64, %for.body10 ] %flag.057 = phi i32 [ 0, %for.body10.preheader ], [ %spec.select, %for.body10 ] %arrayidx12 = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %indvars.iv63 %arrayidx15 = getelementptr inbounds [100000 x %struct.Card], ptr @card2, i64 0, i64 %indvars.iv63 %call17 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx12, ptr noundef nonnull dereferenceable(1) %arrayidx15) #11 %tobool.not = icmp eq i32 %call17, 0 %spec.select = select i1 %tobool.not, i32 %flag.057, i32 1 %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1 %exitcond.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count br i1 %exitcond.not, label %for.end20, label %for.body10, !llvm.loop !17 for.end20: ; preds = %for.body10 %6 = icmp eq i32 %spec.select, 0 br i1 %6, label %if.else, label %if.end25 if.else: ; preds = %for.end, %for.end20 br label %if.end25 if.end25: ; preds = %for.end20, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.5, %for.end20 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %7 = load i32, ptr %n, align 4, !tbaa !13 %cmp2759 = icmp sgt i32 %7, 0 br i1 %cmp2759, label %for.body28, label %for.end38 for.body28: ; preds = %if.end25, %for.body28 %indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.body28 ], [ 0, %if.end25 ] %arrayidx30 = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %indvars.iv66 %8 = load i8, ptr %arrayidx30, align 8, !tbaa !10 %conv = sext i8 %8 to i32 %num34 = getelementptr inbounds [100000 x %struct.Card], ptr @card1, i64 0, i64 %indvars.iv66, i32 1 %9 = load i32, ptr %num34, align 4, !tbaa !5 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv, i32 noundef %9) %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1 %10 = load i32, ptr %n, align 4, !tbaa !13 %11 = sext i32 %10 to i64 %cmp27 = icmp slt i64 %indvars.iv.next67, %11 br i1 %cmp27, label %for.body28, label %for.end38, !llvm.loop !18 for.end38: ; preds = %for.body28, %if.end25 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #10 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 #7 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #8 ; 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 #9 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 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 = { 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 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 #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 = { 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 #9 = { nofree nounwind } attributes #10 = { nounwind } attributes #11 = { 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, !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 = !{!6, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!9, !9, i64 0} !14 = !{!7, !7, i64 0} !15 = distinct !{!15, !12} !16 = distinct !{!16, !12} !17 = distinct !{!17, !12} !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 (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].value = R[n2].value = SENTINEL; 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 (right - left > 1){ 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 j; struct Card t, x; x = A[r]; int 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 i, n, v; char S[10]; struct Card A[MAX], B[MAX]; 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) 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_269774/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269774/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: %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: %A13 = 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 @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, %A13 %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.load14 = 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.load14, 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.check19 = icmp ult i32 %sub1.i, 10 br i1 %min.iters.check19, label %for.body6.i.preheader, label %vector.memcheck15 vector.memcheck15: ; preds = %for.body6.preheader.i %14 = shl nsw i64 %13, 3 %15 = add i64 %14, %A13 %16 = sub i64 ptrtoint (ptr @R to i64), %15 %diff.check16 = icmp ult i64 %16, 32 br i1 %diff.check16, label %for.body6.i.preheader, label %vector.ph20 vector.ph20: ; preds = %vector.memcheck15 %n.vec22 = and i64 %wide.trip.count80.i, 4294967292 br label %vector.body25 vector.body25: ; preds = %vector.body25, %vector.ph20 %index26 = phi i64 [ 0, %vector.ph20 ], [ %index.next29, %vector.body25 ] %17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index26 %18 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %index26 %wide.load27 = load <2 x i64>, ptr %18, align 4 %19 = getelementptr i64, ptr %18, i64 2 %wide.load28 = load <2 x i64>, ptr %19, align 4 store <2 x i64> %wide.load27, ptr %17, align 16 %20 = getelementptr inbounds i64, ptr %17, i64 2 store <2 x i64> %wide.load28, ptr %20, align 16 %index.next29 = add nuw i64 %index26, 4 %21 = icmp eq i64 %index.next29, %n.vec22 br i1 %21, label %middle.block17, label %vector.body25, !llvm.loop !23 middle.block17: ; preds = %vector.body25 %cmp.n24 = icmp eq i64 %n.vec22, %wide.trip.count80.i br i1 %cmp.n24, label %for.end14.i, label %for.body6.i.preheader for.body6.i.preheader: ; preds = %vector.memcheck15, %for.body6.preheader.i, %middle.block17 %indvars.iv76.i.ph = phi i64 [ 0, %vector.memcheck15 ], [ 0, %for.body6.preheader.i ], [ %n.vec22, %middle.block17 ] %22 = xor i64 %indvars.iv76.i.ph, -1 %23 = add nsw i64 %22, %wide.trip.count80.i %xtraiter30 = and i64 %wide.trip.count80.i, 3 %lcmp.mod31.not = icmp eq i64 %xtraiter30, 0 br i1 %lcmp.mod31.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.iter32 = phi i64 [ %prol.iter32.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.iter32.next = add i64 %prol.iter32, 1 %prol.iter32.cmp.not = icmp eq i64 %prol.iter32.next, %xtraiter30 br i1 %prol.iter32.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.block17, %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 %cmp2170.i = icmp slt i32 %left, %right br i1 %cmp2170.i, label %for.body22.preheader.i, label %if.end for.body22.preheader.i: ; preds = %for.end14.i %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.body22.preheader.i %indvars.iv82.i = phi i64 [ %34, %for.body22.preheader.i ], [ %indvars.iv.next83.i, %for.body22.i ] %i.273.i = phi i32 [ 0, %for.body22.preheader.i ], [ %i.3.i, %for.body22.i ] %j.072.i = phi i32 [ 0, %for.body22.preheader.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, %for.end14.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 %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 %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 void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #8 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #8 %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 %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) %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 %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.iv71 = phi i64 [ 0, %for.body15.preheader.new ], [ %indvars.iv.next72.3, %for.body15 ] %stable.065 = 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.iv71 %7 = load i8, ptr %arrayidx17, align 16, !tbaa !31 %arrayidx20 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv71 %8 = load i8, ptr %arrayidx20, align 16, !tbaa !31 %cmp23.not = icmp eq i8 %7, %8 %indvars.iv.next72 = or i64 %indvars.iv71, 1 %arrayidx17.1 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next72 %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.next72 %10 = load i8, ptr %arrayidx20.1, align 8, !tbaa !31 %cmp23.not.1 = icmp eq i8 %9, %10 %indvars.iv.next72.1 = or i64 %indvars.iv71, 2 %arrayidx17.2 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next72.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.next72.1 %12 = load i8, ptr %arrayidx20.2, align 16, !tbaa !31 %cmp23.not.2 = icmp eq i8 %11, %12 %indvars.iv.next72.2 = or i64 %indvars.iv71, 3 %arrayidx17.3 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next72.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.next72.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.065, i32 0 %indvars.iv.next72.3 = add nuw nsw i64 %indvars.iv71, 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.iv71.unr = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next72.3, %for.body15 ] %stable.065.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.iv71.epil = phi i64 [ %indvars.iv.next72.epil, %for.body15.epil ], [ %indvars.iv71.unr, %for.end27.unr-lcssa ] %stable.065.epil = phi i32 [ %spec.select.epil, %for.body15.epil ], [ %stable.065.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.iv71.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.iv71.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.065.epil, i32 0 %indvars.iv.next72.epil = add nuw nsw i64 %indvars.iv71.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, 0 %spec.select79 = select i1 %20, ptr @str, ptr @str.5 br label %if.end31 if.end31: ; preds = %for.end27, %for.end %str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select79, %for.end27 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %21 = load i32, ptr %n, align 4, !tbaa !28 %cmp3367 = icmp sgt i32 %21, 0 br i1 %cmp3367, label %for.body35, label %for.end46 for.body35: ; preds = %if.end31, %for.body35 %indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body35 ], [ 0, %if.end31 ] %arrayidx37 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv74 %22 = load i8, ptr %arrayidx37, align 8, !tbaa !31 %conv39 = sext i8 %22 to i32 %value42 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv74, i32 1 %23 = load i32, ptr %value42, align 4, !tbaa !15 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv39, i32 noundef %23) %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1 %24 = load i32, ptr %n, align 4, !tbaa !28 %25 = sext i32 %24 to i64 %cmp33 = icmp slt i64 %indvars.iv.next75, %25 br i1 %cmp33, label %for.body35, label %for.end46, !llvm.loop !35 for.end46: ; preds = %for.body35, %if.end31 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 %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> #define INF 100000000 typedef struct{ int num; char c; }Card; Card A[100000],B[100000]; int n; int partition(int p, int r); void merge(Card *, int, int, int); void mergeSort(Card *, int, int); void quicksort(int p, int r){ int q,i; // for(i=0;i<n;i++)printf("%d ",A[i].num);printf("\n"); if(p<r) { q = partition(p,r); quicksort(p, q-1); quicksort(q+1, r); } } int table(void){ int i; for(i=0;i<n;i++){ if(A[i].c!=B[i].c)return 0; } return 1; } int main(){ int i; scanf("%d",&n); for(i=0;i<n;i++){ scanf(" %c%d",&A[i].c,&A[i].num); B[i].c = A[i].c; B[i].num = A[i].num; } quicksort(0,n-1); mergeSort(B, 0, n); if(table())printf("Stable\n"); else printf("Not stable\n"); for(i=0;i<n;i++){ printf("%c %d\n",A[i].c,A[i].num); } return 0; } int partition(int p, int r){ int i,j; Card x,tmp; x = A[r]; i = p-1; for(j=p;j<r;j++){ if(A[j].num <= x.num){ i++; tmp = A[j]; A[j] = A[i]; A[i] = tmp; } } tmp = A[r]; A[r] = A[i+1]; A[i+1] = tmp; return i+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); } } void merge(Card *A, int left, int mid, int right){ int i,j,k,n1,n2; Card l[500000],r[500000]; n1 = mid - left; n2 = right - mid; // l = malloc(sizeof(int)*n1); // r = malloc(sizeof(int)*n2); for(i=0;i<n1;i++)l[i]=A[left+i]; for(i=0;i<n2;i++)r[i]=A[mid+i]; l[n1].num=INF;r[n2].num=INF; i=0;j=0; for(k=left;k<right;k++){ if(l[i].num<=r[j].num){ A[k]=l[i]; i++; } else{ A[k]=r[j]; j++; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269824/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269824/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, i8 } @n = dso_local global i32 0, align 4 @A = dso_local global [100000 x %struct.Card] zeroinitializer, align 16 @B = dso_local global [100000 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" %c%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(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @quicksort(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 { entry: %cmp6 = icmp slt i32 %p, %r br i1 %cmp6, 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 [100000 x %struct.Card], ptr @A, i64 0, i64 %idxprom.i br label %for.body.preheader.i for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit %p.tr7 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ] %x.sroa.0.0.copyload.i = load i32, ptr %arrayidx.i, align 8, !tbaa.struct !5 %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.preheader.i %indvars.iv.i = phi i64 [ %0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ] %i.039.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ] %arrayidx2.i = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv.i %1 = load i32, ptr %arrayidx2.i, align 8, !tbaa !11 %cmp4.not.i = icmp sgt i32 %1, %x.sroa.0.0.copyload.i 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.039.i, 1 %2 = load i64, ptr %arrayidx2.i, align 8 %idxprom9.i = sext i32 %inc.i to i64 %arrayidx10.i = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %idxprom9.i %3 = load i64, ptr %arrayidx10.i, align 8 store i64 %3, ptr %arrayidx2.i, align 8 store i64 %2, ptr %arrayidx10.i, align 8 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.039.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 %4 = add nsw i32 %i.1.i, 1 %5 = load i64, ptr %arrayidx.i, align 8 %idxprom18.i = sext i32 %4 to i64 %arrayidx19.i = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %idxprom18.i %6 = load i64, ptr %arrayidx19.i, align 8 store i64 %6, ptr %arrayidx.i, align 8 store i64 %5, ptr %arrayidx19.i, align 8 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.preheader.i, label %if.end if.end: ; preds = %partition.exit, %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: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #2 { entry: %idxprom = sext i32 %r to i64 %arrayidx = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %idxprom %x.sroa.0.0.copyload = load i32, ptr %arrayidx, align 8, !tbaa.struct !5 %cmp37 = icmp slt i32 %p, %r br i1 %cmp37, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %sub = add nsw i32 %p, -1 %0 = sext i32 %p to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %i.039 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ] %arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx2, align 8, !tbaa !11 %cmp4.not = icmp sgt i32 %1, %x.sroa.0.0.copyload br i1 %cmp4.not, label %for.inc, label %if.then if.then: ; preds = %for.body %inc = add nsw i32 %i.039, 1 %2 = load i64, ptr %arrayidx2, align 8 %idxprom9 = sext i32 %inc to i64 %arrayidx10 = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %idxprom9 %3 = load i64, ptr %arrayidx10, align 8 store i64 %3, ptr %arrayidx2, align 8 store i64 %2, ptr %arrayidx10, align 8 br label %for.inc for.inc: ; preds = %for.body, %if.then %i.1 = phi i32 [ %inc, %if.then ], [ %i.039, %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 %4 = add nsw i32 %i.1, 1 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ] %5 = load i64, ptr %arrayidx, align 8 %idxprom18 = sext i32 %i.0.lcssa to i64 %arrayidx19 = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %idxprom18 %6 = load i64, ptr %arrayidx19, align 8 store i64 %6, ptr %arrayidx, align 8 store i64 %5, ptr %arrayidx19, align 8 ret i32 %i.0.lcssa } ; 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(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @table() local_unnamed_addr #3 { entry: %0 = load i32, ptr @n, align 4, !tbaa !6 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 br label %for.body for.cond: ; preds = %for.body %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 %cleanup, label %for.body, !llvm.loop !15 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %c = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv, i32 1 %1 = load i8, ptr %c, align 4, !tbaa !16 %c3 = getelementptr inbounds [100000 x %struct.Card], ptr @B, i64 0, i64 %indvars.iv, i32 1 %2 = load i8, ptr %c3, align 4, !tbaa !16 %cmp5.not = icmp eq i8 %1, %2 br i1 %cmp5.not, label %for.cond, label %cleanup cleanup: ; preds = %for.body, %for.cond, %entry %retval.0 = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ 0, %for.body ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !6 %cmp46 = icmp sgt i32 %0, 0 br i1 %cmp46, 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 [100000 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv %c = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv, i32 1 %call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c, ptr noundef nonnull %arrayidx) %1 = load i8, ptr %c, align 4, !tbaa !16 %arrayidx8 = getelementptr inbounds [100000 x %struct.Card], ptr @B, i64 0, i64 %indvars.iv %c9 = getelementptr inbounds [100000 x %struct.Card], ptr @B, i64 0, i64 %indvars.iv, i32 1 store i8 %1, ptr %c9, align 4, !tbaa !16 %2 = load i32, ptr %arrayidx, align 8, !tbaa !11 store i32 %2, ptr %arrayidx8, align 8, !tbaa !11 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !6 %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 !17 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ] %sub = add nsw i32 %.lcssa, -1 tail call void @quicksort(i32 noundef 0, i32 noundef %sub) %5 = load i32, ptr @n, align 4, !tbaa !6 tail call void @mergeSort(ptr noundef nonnull @B, i32 noundef 0, i32 noundef %5) %cmp10.i = icmp sgt i32 %5, 0 br i1 %cmp10.i, label %for.body.preheader.i, label %if.end for.body.preheader.i: ; preds = %for.end %wide.trip.count.i = zext i32 %5 to i64 br label %for.body.i for.cond.i: ; preds = %for.body.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.end, label %for.body.i, !llvm.loop !15 for.body.i: ; preds = %for.cond.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ] %c.i = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv.i, i32 1 %6 = load i8, ptr %c.i, align 4, !tbaa !16 %c3.i = getelementptr inbounds [100000 x %struct.Card], ptr @B, i64 0, i64 %indvars.iv.i, i32 1 %7 = load i8, ptr %c3.i, align 4, !tbaa !16 %cmp5.not.i = icmp eq i8 %6, %7 br i1 %cmp5.not.i, label %for.cond.i, label %if.end if.end: ; preds = %for.body.i, %for.cond.i, %for.end %str.sink = phi ptr [ @str.5, %for.end ], [ @str.5, %for.cond.i ], [ @str, %for.body.i ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %8 = load i32, ptr @n, align 4, !tbaa !6 %cmp2048 = icmp sgt i32 %8, 0 br i1 %cmp2048, label %for.body21, label %for.end31 for.body21: ; preds = %if.end, %for.body21 %indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body21 ], [ 0, %if.end ] %arrayidx23 = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv52 %c24 = getelementptr inbounds [100000 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv52, i32 1 %9 = load i8, ptr %c24, align 4, !tbaa !16 %conv = sext i8 %9 to i32 %10 = load i32, ptr %arrayidx23, align 8, !tbaa !11 %call28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv, i32 noundef %10) %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %11 = load i32, ptr @n, align 4, !tbaa !6 %12 = sext i32 %11 to i64 %cmp20 = icmp slt i64 %indvars.iv.next53, %12 br i1 %cmp20, label %for.body21, label %for.end31, !llvm.loop !18 for.end31: ; preds = %for.body21, %if.end ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; 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 #6 { 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 nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; 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) #7 ; 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 #6 { entry: %l = alloca [500000 x %struct.Card], align 16 %r = alloca [500000 x %struct.Card], align 16 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %l) #9 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %r) #9 %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 %arrayidx16 = getelementptr inbounds [500000 x %struct.Card], ptr %l, i64 0, i64 %idxprom15 store i32 100000000, ptr %arrayidx16, align 8, !tbaa !11 %idxprom17 = sext i32 %sub1 to i64 %arrayidx18 = getelementptr inbounds [500000 x %struct.Card], ptr %r, i64 0, i64 %idxprom17 store i32 100000000, ptr %arrayidx18, align 8, !tbaa !11 %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 ] %i.275 = phi i32 [ 0, %for.body22.preheader.new ], [ %i.3.1, %for.body22 ] %j.074 = phi i32 [ 0, %for.body22.preheader.new ], [ %j.1.1, %for.body22 ] %niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.1, %for.body22 ] %idxprom23 = zext i32 %i.275 to i64 %arrayidx24 = getelementptr inbounds [500000 x %struct.Card], ptr %l, i64 0, i64 %idxprom23 %19 = load i32, ptr %arrayidx24, align 8, !tbaa !11 %idxprom26 = zext i32 %j.074 to i64 %arrayidx27 = getelementptr inbounds [500000 x %struct.Card], ptr %r, i64 0, i64 %idxprom26 %20 = load i32, ptr %arrayidx27, align 8, !tbaa !11 %cmp29.not = icmp sgt i32 %19, %20 %.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 %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 %arrayidx24.1 = getelementptr inbounds [500000 x %struct.Card], ptr %l, i64 0, i64 %idxprom23.1 %22 = load i32, ptr %arrayidx24.1, align 8, !tbaa !11 %idxprom26.1 = zext i32 %j.1 to i64 %arrayidx27.1 = getelementptr inbounds [500000 x %struct.Card], ptr %r, i64 0, i64 %idxprom26.1 %23 = load i32, ptr %arrayidx27.1, align 8, !tbaa !11 %cmp29.not.1 = icmp sgt i32 %22, %23 %.sink.in.1 = select i1 %cmp29.not.1, ptr %arrayidx27.1, ptr %arrayidx24.1 %inc39.1 = zext i1 %cmp29.not.1 to i32 %j.1.1 = add nuw nsw i32 %j.1, %inc39.1 %not.cmp29.not.1 = xor i1 %cmp29.not.1, true %inc34.1 = zext i1 %not.cmp29.not.1 to i32 %i.3.1 = add nuw nsw i32 %i.3, %inc34.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 !19 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 ] %i.275.unr = phi i64 [ 0, %for.body22.preheader ], [ %24, %for.end42.loopexit.unr-lcssa.loopexit ] %j.074.unr = phi i64 [ 0, %for.body22.preheader ], [ %25, %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 %arrayidx24.epil = getelementptr inbounds [500000 x %struct.Card], ptr %l, i64 0, i64 %i.275.unr %26 = load i32, ptr %arrayidx24.epil, align 8, !tbaa !11 %arrayidx27.epil = getelementptr inbounds [500000 x %struct.Card], ptr %r, i64 0, i64 %j.074.unr %27 = load i32, ptr %arrayidx27.epil, align 8, !tbaa !11 %cmp29.not.epil = icmp sgt i32 %26, %27 %.sink.in.epil = select i1 %cmp29.not.epil, 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 4000000, ptr nonnull %r) #9 call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %l) #9 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8 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 = { 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 #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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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 4, !6, i64 4, 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, !8, i64 4} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14} !16 = !{!12, !8, i64 4} !17 = distinct !{!17, !14} !18 = distinct !{!18, !14} !19 = distinct !{!19, !14}
#include <stdio.h> #define N 100000 typedef struct C{ char pic; int num; int id; }card; int part(card arr[], int p, int r){ int x, i, j; card tmp; x = arr[r].num; i = p-1; for(j = p; j < r; j++) { if(arr[j].num <= x) { i++; tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; } } tmp = arr[i+1]; arr[i+1] = arr[r]; arr[r] = tmp; return i + 1; } void quick(card arr[], int P, int R){ int Q; if(P < R) { Q = part(arr, P, R); quick(arr, P, Q - 1); quick(arr, Q + 1, R); } } int isSta(card arr[], int n){ int i; for(i=1; i<n; i++) { if(arr[i-1].num == arr[i].num) { if(arr[i - 1].id > arr[i].id) return 0; } } return 1; } int main(int argc,char *argv[]){ int i, n; card arr[N]; scanf("%d", &n); for(i=0; i<n; i++) { if(i<n)break; } for(i=0; i<n; i++) { scanf(" %c %d", &arr[i].pic, &arr[i].num); arr[i].id=i; } quick(arr, 0, n-1); if(isSta(arr, n)) printf("Stable\n"); else printf("Not stable\n"); for(i=0; i<n; i++) { printf("%c %d\n", arr[i].pic, arr[i].num); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269868/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269868/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, i32 } @.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.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 i32 @part(ptr nocapture noundef %arr, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 { entry: %tmp = alloca %struct.C, align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp) %idxprom = sext i32 %r to i64 %num = getelementptr inbounds %struct.C, ptr %arr, i64 %idxprom, i32 1 %0 = load i32, ptr %num, 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 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 ] %num3 = getelementptr inbounds %struct.C, ptr %arr, i64 %indvars.iv, i32 1 %2 = load i32, ptr %num3, 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 %arrayidx2 = getelementptr inbounds %struct.C, ptr %arr, i64 %indvars.iv %inc = add nsw i32 %i.047, 1 %idxprom5 = sext i32 %inc to i64 %arrayidx6 = getelementptr inbounds %struct.C, ptr %arr, 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) %arrayidx2, i64 12, i1 false), !tbaa.struct !10 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 !10 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 ] %arrayidx = getelementptr inbounds %struct.C, ptr %arr, i64 %idxprom %idxprom14 = sext i32 %i.0.lcssa to i64 %arrayidx15 = getelementptr inbounds %struct.C, ptr %arr, 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 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 !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 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(argmem: readwrite) uwtable define dso_local void @quick(ptr nocapture noundef %arr, i32 noundef %P, i32 noundef %R) local_unnamed_addr #0 { entry: %tmp.i = alloca %struct.C, 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.C, ptr %arr, i64 %idxprom.i, i32 1 %arrayidx.i = getelementptr inbounds %struct.C, ptr %arr, i64 %idxprom.i br label %for.body.preheader.i for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %part.exit %P.tr9 = phi i32 [ %P, %for.body.preheader.i.lr.ph ], [ %add, %part.exit ] call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp.i) %0 = load i32, ptr %num.i, align 4, !tbaa !5 %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 ] %num3.i = getelementptr inbounds %struct.C, ptr %arr, i64 %indvars.iv.i, i32 1 %2 = load i32, ptr %num3.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 %arrayidx2.i = getelementptr inbounds %struct.C, ptr %arr, 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.C, ptr %arr, 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) %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 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 %part.exit, label %for.body.i, !llvm.loop !13 part.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.C, ptr %arr, 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) %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 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp.i) tail call void @quick(ptr noundef nonnull %arr, 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 = %part.exit, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @isSta(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #3 { entry: %cmp22 = icmp sgt i32 %n, 1 br i1 %cmp22, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %num.phi.trans.insert = getelementptr inbounds %struct.C, ptr %arr, i64 0, i32 1 %.pre = load i32, ptr %num.phi.trans.insert, align 4, !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 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %num3 = getelementptr inbounds %struct.C, ptr %arr, i64 %indvars.iv, i32 1 %1 = load i32, ptr %num3, align 4, !tbaa !5 %cmp4 = icmp eq i32 %0, %1 br i1 %cmp4, label %if.then, label %for.inc if.then: ; preds = %for.body %2 = add nsw i64 %indvars.iv, -1 %id = getelementptr inbounds %struct.C, ptr %arr, i64 %2, i32 2 %3 = load i32, ptr %id, align 4, !tbaa !15 %id10 = getelementptr inbounds %struct.C, ptr %arr, i64 %indvars.iv, i32 2 %4 = load i32, ptr %id10, align 4, !tbaa !15 %cmp11 = icmp sgt i32 %3, %4 br i1 %cmp11, label %cleanup, label %for.inc for.inc: ; preds = %for.body, %if.then %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 %cleanup, label %for.body, !llvm.loop !16 cleanup: ; preds = %if.then, %for.inc, %entry %retval.0 = phi i32 [ 1, %entry ], [ 1, %for.inc ], [ 0, %if.then ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #4 { entry: %n = alloca i32, align 4 %arr = alloca [100000 x %struct.C], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %arr) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !12 %cmp347 = icmp sgt i32 %0, 0 br i1 %cmp347, label %for.body4, label %for.end12.thread for.end12.thread: ; preds = %entry %sub57 = add nsw i32 %0, -1 call void @quick(ptr noundef nonnull %arr, i32 noundef 0, i32 noundef %sub57) br label %if.end18 for.body4: ; preds = %entry, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x %struct.C], ptr %arr, i64 0, i64 %indvars.iv %num = getelementptr inbounds [100000 x %struct.C], ptr %arr, i64 0, i64 %indvars.iv, i32 1 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %num) %id = getelementptr inbounds [100000 x %struct.C], ptr %arr, i64 0, i64 %indvars.iv, i32 2 %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 !12 %3 = sext i32 %2 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp3, label %for.body4, label %for.end12, !llvm.loop !17 for.end12: ; preds = %for.body4 %sub = add nsw i32 %2, -1 call void @quick(ptr noundef nonnull %arr, i32 noundef 0, i32 noundef %sub) %cmp22.i = icmp sgt i32 %2, 1 br i1 %cmp22.i, label %for.body.preheader.i, label %if.end18 for.body.preheader.i: ; preds = %for.end12 %wide.trip.count.i = zext i32 %2 to i64 %num.phi.trans.insert.i = getelementptr inbounds %struct.C, ptr %arr, i64 0, i32 1 %.pre.i = load i32, ptr %num.phi.trans.insert.i, align 4, !tbaa !5 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 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ] %num3.i = getelementptr inbounds %struct.C, ptr %arr, i64 %indvars.iv.i, i32 1 %5 = load i32, ptr %num3.i, align 4, !tbaa !5 %cmp4.i = icmp eq i32 %4, %5 br i1 %cmp4.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body.i %6 = add nsw i64 %indvars.iv.i, -1 %id.i = getelementptr inbounds %struct.C, ptr %arr, i64 %6, i32 2 %7 = load i32, ptr %id.i, align 4, !tbaa !15 %id10.i = getelementptr inbounds %struct.C, ptr %arr, i64 %indvars.iv.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 %if.end18, label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body.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.end18, label %for.body.i, !llvm.loop !16 if.end18: ; preds = %if.then.i, %for.inc.i, %for.end12, %for.end12.thread %str.sink = phi ptr [ @str.5, %for.end12.thread ], [ @str.5, %for.end12 ], [ @str.5, %for.inc.i ], [ @str, %if.then.i ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %9 = load i32, ptr %n, align 4, !tbaa !12 %cmp2049 = icmp sgt i32 %9, 0 br i1 %cmp2049, label %for.body21, label %for.end31 for.body21: ; preds = %if.end18, %for.body21 %indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body21 ], [ 0, %if.end18 ] %arrayidx23 = getelementptr inbounds [100000 x %struct.C], ptr %arr, i64 0, i64 %indvars.iv53 %10 = load i8, ptr %arrayidx23, align 4, !tbaa !18 %conv = sext i8 %10 to i32 %num27 = getelementptr inbounds [100000 x %struct.C], ptr %arr, i64 0, i64 %indvars.iv53, i32 1 %11 = load i32, ptr %num27, align 4, !tbaa !5 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv, i32 noundef %11) %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1 %12 = load i32, ptr %n, align 4, !tbaa !12 %13 = sext i32 %12 to i64 %cmp20 = icmp slt i64 %indvars.iv.next54, %13 br i1 %cmp20, label %for.body21, label %for.end31, !llvm.loop !19 for.end31: ; preds = %for.body21, %if.end18 call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %arr) #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 #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: 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 #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 = !{!"C", !7, i64 0, !9, i64 4, !9, i64 8} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!"int", !7, i64 0} !10 = !{i64 0, i64 1, !11, i64 4, i64 4, !12, i64 8, i64 4, !12} !11 = !{!7, !7, i64 0} !12 = !{!9, !9, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = !{!6, !9, i64 8} !16 = distinct !{!16, !14} !17 = distinct !{!17, !14} !18 = !{!6, !7, i64 0} !19 = distinct !{!19, !14}
#include<stdio.h> #define N 100000 #define MAX 2000000000 typedef struct { char suit; int val; }Card; Card L[N/2+2], R[N/2+2]; int n, A[N]; void merge(Card A[], int n, 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].val=MAX; R[n2].val=MAX; int i=0; int j=0; for(int k=left; k<right; k++){ if(L[i].val <= R[j].val){ A[k] = L[i]; i++; } else{ A[k] = R[j]; j++; } } } void mergeSort(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(Card A[], int n, int p, int r){ Card x=A[r]; int i=p-1; for(int j=p; j<r; j++){ if(A[j].val<=x.val){ i++; Card temp; temp=A[i]; A[i]=A[j]; A[j]=temp; } } Card temp; temp=A[i+1]; A[i+1]=A[r]; A[r]=temp; return i+1; } void quicksort(Card A[], int n, int p, int r){ if(p<r){ int q=partition(A, n, p, r); quicksort(A, n, p, q-1); quicksort(A, n, q+1, r); } } int main(void){ Card A[N], B[N]; char S[10]; int v; int check=1; scanf("%d", &n); for(int i=0; i<n; i++){ scanf("%s %d", S, &v); A[i].suit=B[i].suit=S[0]; A[i].val=B[i].val=v; } mergeSort(A, n, 0, n); quicksort(B, n, 0, n-1); for(int i=0; i<n; i++){ if(A[i].suit!=B[i].suit){ check=0; } } if(check==1){ printf("Stable\n"); } else{ printf("Not stable\n"); } for(int i=0; i<n; i++){ printf("%c %d\n", B[i].suit, B[i].val); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269918/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269918/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 @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 @A = dso_local local_unnamed_addr global [100000 x i32] 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 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: %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 [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.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 [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.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 [50002 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 [50002 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 [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.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 %val = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17, i32 1 store i32 2000000000, ptr %val, align 4, !tbaa !14 %idxprom19 = sext i32 %sub1 to i64 %val21 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom19, i32 1 store i32 2000000000, ptr %val21, 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 [50002 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 [50002 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 [50002 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 [50002 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 %val29 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom27, i32 1 %35 = load i32, ptr %val29, align 4, !tbaa !14 %idxprom30 = zext i32 %j.076 to i64 %val32 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom30, i32 1 %36 = load i32, ptr %val32, align 4, !tbaa !14 %cmp33.not = icmp sle i32 %35, %36 %arrayidx31 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom30 %arrayidx28 = getelementptr inbounds [50002 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 @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 %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, %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.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 [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.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.check20 = icmp ult i32 %sub1.i, 10 br i1 %min.iters.check20, label %for.body8.i.preheader, label %vector.memcheck16 vector.memcheck16: ; preds = %for.body8.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.body8.i.preheader, label %vector.ph21 vector.ph21: ; preds = %vector.memcheck16 %n.vec23 = and i64 %wide.trip.count84.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.gep91.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.count84.i br i1 %cmp.n25, label %for.cond.cleanup7.i, label %for.body8.i.preheader for.body8.i.preheader: ; preds = %vector.memcheck16, %for.body8.preheader.i, %middle.block18 %indvars.iv80.i.ph = phi i64 [ 0, %vector.memcheck16 ], [ 0, %for.body8.preheader.i ], [ %n.vec23, %middle.block18 ] %22 = xor i64 %indvars.iv80.i.ph, -1 %23 = add nsw i64 %22, %wide.trip.count84.i %xtraiter31 = and i64 %wide.trip.count84.i, 3 %lcmp.mod32.not = icmp eq i64 %xtraiter31, 0 br i1 %lcmp.mod32.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.iter33 = phi i64 [ %prol.iter33.next, %for.body8.i.prol ], [ 0, %for.body8.i.preheader ] %arrayidx10.i.prol = getelementptr inbounds [50002 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.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.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 [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.cond5.preheader.i, label %for.body.i, !llvm.loop !25 for.cond.cleanup7.i: ; preds = %for.body8.i.prol.loopexit, %for.body8.i, %middle.block18, %for.cond5.preheader.i %idxprom17.i = sext i32 %sub.i to i64 %val.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17.i, i32 1 store i32 2000000000, ptr %val.i, align 4, !tbaa !14 %idxprom19.i = sext i32 %sub1.i to i64 %val21.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom19.i, i32 1 store i32 2000000000, ptr %val21.i, align 4, !tbaa !14 %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 [50002 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 [50002 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 [50002 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 [50002 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.cond.cleanup7.i %indvars.iv86.i = phi i64 [ %30, %for.cond.cleanup7.i ], [ %indvars.iv.next87.i, %for.body26.i ] %j.076.i = phi i32 [ 0, %for.cond.cleanup7.i ], [ %j.1.i, %for.body26.i ] %i22.075.i = phi i32 [ 0, %for.cond.cleanup7.i ], [ %i22.1.i, %for.body26.i ] %idxprom27.i = zext i32 %i22.075.i to i64 %val29.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom27.i, i32 1 %35 = load i32, ptr %val29.i, align 4, !tbaa !14 %idxprom30.i = zext i32 %j.076.i to i64 %val32.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom30.i, i32 1 %36 = load i32, ptr %val32.i, align 4, !tbaa !14 %cmp33.not.i = icmp sle i32 %35, %36 %arrayidx31.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom30.i %arrayidx28.i = getelementptr inbounds [50002 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, %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 %cmp47 = icmp slt i32 %p, %r br i1 %cmp47, 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 %val.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0, i32 1 %2 = load i32, ptr %val.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.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 ] %idxprom15 = sext i32 %i.0.lcssa to i64 %arrayidx16 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom15 %9 = load i64, ptr %arrayidx16, align 4 %10 = load i64, ptr %arrayidx, align 4 store i64 %10, ptr %arrayidx16, 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.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ] %val = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1 %11 = load i32, ptr %val, align 4, !tbaa !14 %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.048, 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.048, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %val.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1 %14 = load i32, ptr %val.1, align 4, !tbaa !14 %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 %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 %val.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1, i32 1 %3 = load i32, ptr %val.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 ] %val.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1 %8 = load i32, ptr %val.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 %val.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1 %11 = load i32, ptr %val.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 %idxprom15.i = sext i32 %14 to i64 %arrayidx16.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom15.i %15 = load i64, ptr %arrayidx16.i, align 4 %16 = load i64, ptr %arrayidx.i, align 4 store i64 %16, ptr %arrayidx16.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: %A = alloca [100000 x %struct.Card], align 16 %B = alloca [100000 x %struct.Card], align 16 %S = alloca [10 x i8], align 1 %v = alloca i32, align 4 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #8 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !28 %cmp65 = icmp sgt i32 %0, 0 br i1 %cmp65, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %5, %for.body ] call void @mergeSort(ptr noundef nonnull %A, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa) %1 = load i32, ptr @n, align 4, !tbaa !28 %sub = add nsw i32 %1, -1 call void @quicksort(ptr noundef nonnull %B, i32 noundef %1, i32 noundef 0, i32 noundef %sub) %cmp1567 = icmp sgt i32 %1, 0 br i1 %cmp1567, label %for.body17.preheader, label %if.end35 for.body17.preheader: ; preds = %for.cond.cleanup %wide.trip.count = zext i32 %1 to i64 %xtraiter = and i64 %wide.trip.count, 3 %2 = icmp ult i32 %1, 4 br i1 %2, label %for.cond.cleanup16.unr-lcssa, label %for.body17.preheader.new for.body17.preheader.new: ; preds = %for.body17.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body17 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) %3 = load i8, ptr %S, align 1, !tbaa !30 %arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv store i8 %3, ptr %arrayidx2, align 8, !tbaa !31 %arrayidx4 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv store i8 %3, ptr %arrayidx4, align 8, !tbaa !31 %4 = load i32, ptr %v, align 4, !tbaa !28 %val = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv, i32 1 store i32 %4, ptr %val, align 4, !tbaa !14 %val10 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1 store i32 %4, ptr %val10, align 4, !tbaa !14 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr @n, align 4, !tbaa !28 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !32 for.cond.cleanup16.unr-lcssa: ; preds = %for.body17, %for.body17.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body17.preheader ], [ %spec.select.3, %for.body17 ] %indvars.iv75.unr = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next76.3, %for.body17 ] %check.068.unr = phi i32 [ 1, %for.body17.preheader ], [ %spec.select.3, %for.body17 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup16, label %for.body17.epil for.body17.epil: ; preds = %for.cond.cleanup16.unr-lcssa, %for.body17.epil %indvars.iv75.epil = phi i64 [ %indvars.iv.next76.epil, %for.body17.epil ], [ %indvars.iv75.unr, %for.cond.cleanup16.unr-lcssa ] %check.068.epil = phi i32 [ %spec.select.epil, %for.body17.epil ], [ %check.068.unr, %for.cond.cleanup16.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body17.epil ], [ 0, %for.cond.cleanup16.unr-lcssa ] %arrayidx19.epil = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv75.epil %7 = load i8, ptr %arrayidx19.epil, align 8, !tbaa !31 %arrayidx22.epil = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv75.epil %8 = load i8, ptr %arrayidx22.epil, align 8, !tbaa !31 %cmp25.not.epil = icmp eq i8 %7, %8 %spec.select.epil = select i1 %cmp25.not.epil, i32 %check.068.epil, i32 0 %indvars.iv.next76.epil = add nuw nsw i64 %indvars.iv75.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.cond.cleanup16, label %for.body17.epil, !llvm.loop !33 for.cond.cleanup16: ; preds = %for.body17.epil, %for.cond.cleanup16.unr-lcssa %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.cond.cleanup16.unr-lcssa ], [ %spec.select.epil, %for.body17.epil ] %9 = icmp eq i32 %spec.select.lcssa, 1 %spec.select83 = select i1 %9, ptr @str.5, ptr @str br label %if.end35 for.body17: ; preds = %for.body17, %for.body17.preheader.new %indvars.iv75 = phi i64 [ 0, %for.body17.preheader.new ], [ %indvars.iv.next76.3, %for.body17 ] %check.068 = phi i32 [ 1, %for.body17.preheader.new ], [ %spec.select.3, %for.body17 ] %niter = phi i64 [ 0, %for.body17.preheader.new ], [ %niter.next.3, %for.body17 ] %arrayidx19 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv75 %10 = load i8, ptr %arrayidx19, align 16, !tbaa !31 %arrayidx22 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv75 %11 = load i8, ptr %arrayidx22, align 16, !tbaa !31 %cmp25.not = icmp eq i8 %10, %11 %indvars.iv.next76 = or i64 %indvars.iv75, 1 %arrayidx19.1 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next76 %12 = load i8, ptr %arrayidx19.1, align 8, !tbaa !31 %arrayidx22.1 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next76 %13 = load i8, ptr %arrayidx22.1, align 8, !tbaa !31 %cmp25.not.1 = icmp eq i8 %12, %13 %indvars.iv.next76.1 = or i64 %indvars.iv75, 2 %arrayidx19.2 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next76.1 %14 = load i8, ptr %arrayidx19.2, align 16, !tbaa !31 %arrayidx22.2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next76.1 %15 = load i8, ptr %arrayidx22.2, align 16, !tbaa !31 %cmp25.not.2 = icmp eq i8 %14, %15 %indvars.iv.next76.2 = or i64 %indvars.iv75, 3 %arrayidx19.3 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next76.2 %16 = load i8, ptr %arrayidx19.3, align 8, !tbaa !31 %arrayidx22.3 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next76.2 %17 = load i8, ptr %arrayidx22.3, align 8, !tbaa !31 %cmp25.not.3 = icmp eq i8 %16, %17 %18 = select i1 %cmp25.not.3, i1 %cmp25.not.2, i1 false %19 = select i1 %18, i1 %cmp25.not.1, i1 false %20 = select i1 %19, i1 %cmp25.not, i1 false %spec.select.3 = select i1 %20, i32 %check.068, i32 0 %indvars.iv.next76.3 = add nuw nsw i64 %indvars.iv75, 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.cond.cleanup16.unr-lcssa, label %for.body17, !llvm.loop !34 if.end35: ; preds = %for.cond.cleanup16, %for.cond.cleanup %str.sink = phi ptr [ @str.5, %for.cond.cleanup ], [ %spec.select83, %for.cond.cleanup16 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %21 = load i32, ptr @n, align 4, !tbaa !28 %cmp3871 = icmp sgt i32 %21, 0 br i1 %cmp3871, label %for.body41, label %for.cond.cleanup40 for.cond.cleanup40: ; preds = %for.body41, %if.end35 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #8 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 ret i32 0 for.body41: ; preds = %if.end35, %for.body41 %indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.body41 ], [ 0, %if.end35 ] %arrayidx43 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv78 %22 = load i8, ptr %arrayidx43, align 8, !tbaa !31 %conv45 = sext i8 %22 to i32 %val48 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv78, i32 1 %23 = load i32, ptr %val48, align 4, !tbaa !14 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv45, i32 noundef %23) %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %24 = load i32, ptr @n, align 4, !tbaa !28 %25 = sext i32 %24 to i64 %cmp38 = icmp slt i64 %indvars.iv.next79, %25 br i1 %cmp38, label %for.body41, label %for.cond.cleanup40, !llvm.loop !35 } ; 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 = !{!"", !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, !10} !34 = distinct !{!34, !6} !35 = distinct !{!35, !6}
#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) { 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_269961/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269961/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: %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> int main () { int t; scanf("%d",&t); while(t--) { long long n; scanf("%lli",&n); if(n%4==0) printf("YES\n"); else printf("NO\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27001/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27001/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"%lli\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: %t = alloca i32, align 4 %n = alloca i64, align 8 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 %dec5 = add nsw i32 %0, -1 store i32 %dec5, ptr %t, 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 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %1 = load i64, ptr %n, align 8, !tbaa !9 %2 = and i64 %1, 3 %cmp = icmp eq i64 %2, 0 %str.4.str = select i1 %cmp, ptr @str.4, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 %3 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %3, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %3, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body, %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: 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 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #define INFTY 1000000001 #define true 1 #define false 0 typedef struct{ char kind; int num; } card; int isStable(card *, card *); /*出力が安定であるか判定する関数*/ void merge(card *, int, int, int); void mergeSort(card *, int, int); int partition(card *, int, int); void quicksort(card *, int, int); int n; int main() { int i; card A[100000], in_copy[100000]; scanf("%d",&n); for(i = 0 ; i < n ; i++) scanf(" %c %d",&A[i].kind,&A[i].num); for(i = 0 ; i < n ; i++) in_copy[i] = A[i]; quicksort(A, 0, n-1); /*安定なソートであるバブルソートより高速なマージソートを判定用の比較 に使用する。*/ mergeSort(in_copy, 0, n); if(isStable(A, in_copy) == true) printf("Stable\n"); else if(isStable(A, in_copy) == false) printf("Not stable\n"); for(i = 0 ; i < n ; i++) printf("%c %d\n",A[i].kind,A[i].num); return 0; } int partition(card *A, int p, int r) { int x, i, j; card for_change; x = A[r].num; i = p - 1; for(j = p ; j < r ; j++){ if(A[j].num <= x){ i++; for_change = A[i]; A[i] = A[j]; A[j] = for_change; } } for_change = A[i+1]; A[i+1] = A[r]; A[r] = for_change; return ++i; } 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 isStable(card *in, card *out) { int i; for(i = 0 ; i < n ; i++){ if(in[i].kind != out[i].kind) return false; } return true; } void merge(card *A, int left , int mid, int right) { int n1, n2, i, j, k; card *L, *R; n1 = mid - left; n2 = right - mid; L = (card *)malloc((n1 + 1) * sizeof(card)); R = (card *)malloc((n2 + 1) * sizeof(card)); for(i = 0 ; i < n1 ; i++) L[i] = A[left+i]; for(i = 0 ; i < n2 ; i++) R[i] = A[mid+i]; L[n1].num = INFTY; R[n2].num = INFTY; i = 0; j = 0; for(k = left ; k < right ; k++){ if(L[i].num <= R[j].num){ A[k] = L[i]; i++; } else{ A[k] = R[j]; j++; } } free(L); free(R); } 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); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270053/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270053/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 [7 x i8] c" %c %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: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca [100000 x %struct.card], align 16 %in_copy = alloca [100000 x %struct.card], align 16 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #10 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %in_copy) #10 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp69 = icmp sgt i32 %0, 0 br i1 %cmp69, label %for.body, label %for.end13 for.cond4.preheader: ; preds = %for.body %cmp571 = icmp sgt i32 %3, 0 br i1 %cmp571, label %for.body6.preheader, label %for.end13 for.body6.preheader: ; preds = %for.cond4.preheader %1 = zext i32 %3 to i64 %2 = shl nuw nsw i64 %1, 3 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %in_copy, ptr nonnull align 16 %A, i64 %2, i1 false) br label %for.end13 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x %struct.card], ptr %A, i64 0, i64 %indvars.iv %num = getelementptr inbounds [100000 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 %num) %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.cond4.preheader, !llvm.loop !9 for.end13: ; preds = %entry, %for.body6.preheader, %for.cond4.preheader %.lcssa85 = phi i32 [ %3, %for.body6.preheader ], [ %3, %for.cond4.preheader ], [ %0, %entry ] %sub = add nsw i32 %.lcssa85, -1 call void @quicksort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub) call void @mergeSort(ptr noundef nonnull %in_copy, i32 noundef 0, i32 noundef %.lcssa85) %5 = load i32, ptr @n, align 4, !tbaa !5 %cmp10.i = icmp sgt i32 %5, 0 br i1 %cmp10.i, label %for.body.preheader.i, label %if.end26.sink.split for.body.preheader.i: ; preds = %for.end13 %wide.trip.count.i = zext i32 %5 to i64 br label %for.body.i for.cond.i: ; preds = %for.body.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.sink.split, label %for.body.i, !llvm.loop !11 for.body.i: ; preds = %for.cond.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ] %arrayidx.i = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.i %6 = load i8, ptr %arrayidx.i, align 8, !tbaa !12 %arrayidx2.i = getelementptr inbounds %struct.card, ptr %in_copy, i64 %indvars.iv.i %7 = load i8, ptr %arrayidx2.i, align 8, !tbaa !12 %cmp5.not.i = icmp eq i8 %6, %7 br i1 %cmp5.not.i, label %for.cond.i, label %for.body.i56 for.cond.i61: ; preds = %for.body.i56 %indvars.iv.next.i62 = add nuw nsw i64 %indvars.iv.i57, 1 %exitcond.not.i63 = icmp eq i64 %indvars.iv.next.i62, %wide.trip.count.i br i1 %exitcond.not.i63, label %if.end26, label %for.body.i56, !llvm.loop !11 for.body.i56: ; preds = %for.body.i, %for.cond.i61 %indvars.iv.i57 = phi i64 [ %indvars.iv.next.i62, %for.cond.i61 ], [ 0, %for.body.i ] %arrayidx.i58 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.i57 %8 = load i8, ptr %arrayidx.i58, align 8, !tbaa !12 %arrayidx2.i59 = getelementptr inbounds %struct.card, ptr %in_copy, i64 %indvars.iv.i57 %9 = load i8, ptr %arrayidx2.i59, align 8, !tbaa !12 %cmp5.not.i60 = icmp eq i8 %8, %9 br i1 %cmp5.not.i60, label %for.cond.i61, label %if.end26.sink.split if.end26.sink.split: ; preds = %for.cond.i, %for.body.i56, %for.end13 %str.sink = phi ptr [ @str.5, %for.end13 ], [ @str, %for.body.i56 ], [ @str.5, %for.cond.i ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) br label %if.end26 if.end26: ; preds = %for.cond.i61, %if.end26.sink.split %10 = load i32, ptr @n, align 4, !tbaa !5 %cmp2873 = icmp sgt i32 %10, 0 br i1 %cmp2873, label %for.body29, label %for.end39 for.body29: ; preds = %if.end26, %for.body29 %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.body29 ], [ 0, %if.end26 ] %arrayidx31 = getelementptr inbounds [100000 x %struct.card], ptr %A, i64 0, i64 %indvars.iv80 %11 = load i8, ptr %arrayidx31, align 8, !tbaa !12 %conv = sext i8 %11 to i32 %num35 = getelementptr inbounds [100000 x %struct.card], ptr %A, i64 0, i64 %indvars.iv80, i32 1 %12 = load i32, ptr %num35, align 4, !tbaa !14 %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv, i32 noundef %12) %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %13 = load i32, ptr @n, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp28 = icmp slt i64 %indvars.iv.next81, %14 br i1 %cmp28, label %for.body29, label %for.end39, !llvm.loop !15 for.end39: ; preds = %for.body29, %if.end26 call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %in_copy) #10 call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #10 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 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(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 %num.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 %num.i, align 4, !tbaa !14 %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 %num3.i.prol = getelementptr inbounds %struct.card, ptr %A, i64 %2, i32 1 %4 = load i32, ptr %num3.i.prol, align 4, !tbaa !14 %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 ] %num3.i = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.i, i32 1 %9 = load i32, ptr %num3.i, align 4, !tbaa !14 %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 %num3.i.1 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.next.i, i32 1 %12 = load i32, ptr %num3.i.1, align 4, !tbaa !14 %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 !16 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: nounwind 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(read, inaccessiblemem: none) uwtable define dso_local i32 @isStable(ptr nocapture noundef readonly %in, ptr nocapture noundef readonly %out) local_unnamed_addr #5 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 br label %for.body for.cond: ; preds = %for.body %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 %cleanup, label %for.body, !llvm.loop !11 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds %struct.card, ptr %in, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 4, !tbaa !12 %arrayidx2 = getelementptr inbounds %struct.card, ptr %out, i64 %indvars.iv %2 = load i8, ptr %arrayidx2, align 4, !tbaa !12 %cmp5.not = icmp eq i8 %1, %2 br i1 %cmp5.not, label %for.cond, label %cleanup cleanup: ; preds = %for.body, %for.cond, %entry %retval.0 = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ 0, %for.body ] ret i32 %retval.0 } ; 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 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #6 { entry: %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 !14 %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 %num3.prol = getelementptr inbounds %struct.card, ptr %A, i64 %1, i32 1 %3 = load i32, ptr %num3.prol, align 4, !tbaa !14 %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 ] %num3 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv, i32 1 %9 = load i32, ptr %num3, align 4, !tbaa !14 %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 %num3.1 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.next, i32 1 %12 = load i32, ptr %num3.1, align 4, !tbaa !14 %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 !16 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: nounwind uwtable define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 { entry: %sub = sub nsw i32 %mid, %left %sub1 = sub nsw i32 %right, %mid %add = add nsw i32 %sub, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 3 %call = tail call noalias ptr @malloc(i64 noundef %mul) #11 %add2 = add nsw i32 %sub1, 1 %conv3 = sext i32 %add2 to i64 %mul4 = shl nsw i64 %conv3, 3 %call5 = tail call noalias ptr @malloc(i64 noundef %mul4) #11 %cmp87 = icmp sgt i32 %sub, 0 br i1 %cmp87, label %for.body.preheader, label %for.cond10.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 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call, ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i64 %6, i1 false) br label %for.cond10.preheader for.cond10.preheader: ; preds = %for.body.preheader, %entry %cmp1189 = icmp sgt i32 %sub1, 0 br i1 %cmp1189, label %for.body13.preheader, label %for.end21 for.body13.preheader: ; preds = %for.cond10.preheader %7 = sext i32 %mid to i64 %8 = shl nsw i64 %7, 3 %scevgep97 = 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 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call5, ptr noundef nonnull align 4 dereferenceable(1) %scevgep97, i64 %13, i1 false) br label %for.end21 for.end21: ; preds = %for.body13.preheader, %for.cond10.preheader %idxprom22 = sext i32 %sub to i64 %num = getelementptr inbounds %struct.card, ptr %call, i64 %idxprom22, i32 1 store i32 1000000001, ptr %num, align 4, !tbaa !14 %idxprom24 = sext i32 %sub1 to i64 %num26 = getelementptr inbounds %struct.card, ptr %call5, i64 %idxprom24, i32 1 store i32 1000000001, ptr %num26, align 4, !tbaa !14 %cmp2891 = icmp slt i32 %left, %right br i1 %cmp2891, label %for.body30.preheader, label %for.end51 for.body30.preheader: ; preds = %for.end21 %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.end51.loopexit.unr-lcssa, label %for.body30.preheader.new for.body30.preheader.new: ; preds = %for.body30.preheader %unroll_iter = and i64 %15, -2 %invariant.gep = getelementptr %struct.card, ptr %A, i64 1 br label %for.body30 for.body30: ; preds = %for.body30, %for.body30.preheader.new %indvars.iv = phi i64 [ %14, %for.body30.preheader.new ], [ %indvars.iv.next.1, %for.body30 ] %i.294 = phi i32 [ 0, %for.body30.preheader.new ], [ %i.3.1, %for.body30 ] %j.093 = phi i32 [ 0, %for.body30.preheader.new ], [ %j.1.1, %for.body30 ] %niter = phi i64 [ 0, %for.body30.preheader.new ], [ %niter.next.1, %for.body30 ] %idxprom31 = zext i32 %i.294 to i64 %num33 = getelementptr inbounds %struct.card, ptr %call, i64 %idxprom31, i32 1 %19 = load i32, ptr %num33, align 4, !tbaa !14 %idxprom34 = zext i32 %j.093 to i64 %num36 = getelementptr inbounds %struct.card, ptr %call5, i64 %idxprom34, i32 1 %20 = load i32, ptr %num36, align 4, !tbaa !14 %cmp37.not = icmp sgt i32 %19, %20 %arrayidx35 = getelementptr inbounds %struct.card, ptr %call5, i64 %idxprom34 %arrayidx32 = getelementptr inbounds %struct.card, ptr %call, i64 %idxprom31 %.sink.in = select i1 %cmp37.not, ptr %arrayidx35, ptr %arrayidx32 %inc48 = zext i1 %cmp37.not to i32 %j.1 = add nuw nsw i32 %j.093, %inc48 %not.cmp37.not = xor i1 %cmp37.not, true %inc43 = zext i1 %not.cmp37.not to i32 %i.3 = add nuw nsw i32 %i.294, %inc43 %.sink = load i64, ptr %.sink.in, align 4 %21 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv store i64 %.sink, ptr %21, align 4 %idxprom31.1 = zext i32 %i.3 to i64 %num33.1 = getelementptr inbounds %struct.card, ptr %call, i64 %idxprom31.1, i32 1 %22 = load i32, ptr %num33.1, align 4, !tbaa !14 %idxprom34.1 = zext i32 %j.1 to i64 %num36.1 = getelementptr inbounds %struct.card, ptr %call5, i64 %idxprom34.1, i32 1 %23 = load i32, ptr %num36.1, align 4, !tbaa !14 %cmp37.not.1 = icmp sgt i32 %22, %23 %arrayidx35.1 = getelementptr inbounds %struct.card, ptr %call5, i64 %idxprom34.1 %arrayidx32.1 = getelementptr inbounds %struct.card, ptr %call, i64 %idxprom31.1 %.sink.in.1 = select i1 %cmp37.not.1, ptr %arrayidx35.1, ptr %arrayidx32.1 %inc48.1 = zext i1 %cmp37.not.1 to i32 %j.1.1 = add nuw nsw i32 %j.1, %inc48.1 %not.cmp37.not.1 = xor i1 %cmp37.not.1, true %inc43.1 = zext i1 %not.cmp37.not.1 to i32 %i.3.1 = add nuw nsw i32 %i.3, %inc43.1 %.sink.1 = load i64, ptr %.sink.in.1, align 4 %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.end51.loopexit.unr-lcssa.loopexit, label %for.body30, !llvm.loop !17 for.end51.loopexit.unr-lcssa.loopexit: ; preds = %for.body30 %24 = zext i32 %i.3.1 to i64 %25 = zext i32 %j.1.1 to i64 br label %for.end51.loopexit.unr-lcssa for.end51.loopexit.unr-lcssa: ; preds = %for.end51.loopexit.unr-lcssa.loopexit, %for.body30.preheader %indvars.iv.unr = phi i64 [ %14, %for.body30.preheader ], [ %indvars.iv.next.1, %for.end51.loopexit.unr-lcssa.loopexit ] %i.294.unr = phi i64 [ 0, %for.body30.preheader ], [ %24, %for.end51.loopexit.unr-lcssa.loopexit ] %j.093.unr = phi i64 [ 0, %for.body30.preheader ], [ %25, %for.end51.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end51, label %for.body30.epil for.body30.epil: ; preds = %for.end51.loopexit.unr-lcssa %num33.epil = getelementptr inbounds %struct.card, ptr %call, i64 %i.294.unr, i32 1 %26 = load i32, ptr %num33.epil, align 4, !tbaa !14 %num36.epil = getelementptr inbounds %struct.card, ptr %call5, i64 %j.093.unr, i32 1 %27 = load i32, ptr %num36.epil, align 4, !tbaa !14 %cmp37.not.epil = icmp sgt i32 %26, %27 %arrayidx35.epil = getelementptr inbounds %struct.card, ptr %call5, i64 %j.093.unr %arrayidx32.epil = getelementptr inbounds %struct.card, ptr %call, i64 %i.294.unr %.sink.in.epil = select i1 %cmp37.not.epil, ptr %arrayidx35.epil, ptr %arrayidx32.epil %.sink.epil = load i64, ptr %.sink.in.epil, align 4 %28 = getelementptr inbounds %struct.card, ptr %A, i64 %indvars.iv.unr store i64 %.sink.epil, ptr %28, align 4 br label %for.end51 for.end51: ; preds = %for.body30.epil, %for.end51.loopexit.unr-lcssa, %for.end21 tail call void @free(ptr noundef nonnull %call) #10 tail call void @free(ptr noundef nonnull %call5) #10 ret void } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #7 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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(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 #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 = { 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 #8 = { 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 #9 = { nofree nounwind } attributes #10 = { nounwind } attributes #11 = { 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, !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, !7, i64 0} !13 = !{!"", !7, i64 0, !6, i64 4} !14 = !{!13, !6, i64 4} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> #define N 100000 typedef struct{ char pic; int num; } Card; #define INFTY 1000000001 void mergeSort(int,int); void merge(int,int,int); int partition(int,int); void quickSort(int,int); int n; Card Q[N],M[N],L[N/2+2],R[N/2+2]; int main(){ int i,data,judge = 1; char str[2]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s%d",str,&data); Q[i].pic = str[0]; Q[i].num = data; M[i].pic = str[0]; M[i].num = data; } quickSort(0,n-1); mergeSort(0,n); for(i=0;i<n;i++){ if(Q[i].pic != M[i].pic){ judge = 0; } } if(judge == 1){ printf("Stable\n"); } else{ printf("Not stable\n"); } for(i=0;i<n;i++){ printf("%c %d\n",Q[i].pic,Q[i].num); } return 0; } int partition(int p,int r){ int i,j; Card tmp,x; x = Q[r]; i = p-1; for(j=p;j<r;j++){ if(Q[j].num <= x.num){ i = i+1; tmp = Q[i]; Q[i] = Q[j]; Q[j] = tmp; } } tmp = Q[i+1]; Q[i+1] = Q[r]; Q[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); } } void merge(int left,int mid,int right){ int n1,n2,i,j,k; n1 = mid - left; n2 = right - mid; for(i=0;i<n1;i++){ L[i] = M[left + i]; } for(i=0;i<n2;i++){ R[i] = M[mid+i]; } L[n1].num = INFTY; R[n2].num = INFTY; i = 0; j = 0; for(k = left;k<right;k++){ if(L[i].num <= R[j].num){ M[k] = L[i]; i = i + 1; } else{ M[k] = R[j]; j = j + 1; } } } void mergeSort(int left,int right){ int mid; if(left+1 < right){ mid = (left + right)/2; mergeSort(left,mid); mergeSort(mid,right); merge(left,mid,right); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270097/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270097/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 [5 x i8] c"%s%d\00", align 1 @Q = dso_local local_unnamed_addr global [100000 x %struct.Card] zeroinitializer, align 16 @M = dso_local local_unnamed_addr global [100000 x %struct.Card] zeroinitializer, align 16 @.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: %data = alloca i32, align 4 %str = alloca [2 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %data) #8 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %str) #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 %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 %str, ptr noundef nonnull %data) %1 = load i8, ptr %str, align 1, !tbaa !9 %arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv store i8 %1, ptr %arrayidx2, align 8, !tbaa !10 %2 = load i32, ptr %data, align 4, !tbaa !5 %num = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv, i32 1 store i32 %2, ptr %num, align 4, !tbaa !12 %arrayidx7 = getelementptr inbounds [100000 x %struct.Card], ptr @M, i64 0, i64 %indvars.iv store i8 %1, ptr %arrayidx7, align 8, !tbaa !10 %num11 = getelementptr inbounds [100000 x %struct.Card], ptr @M, i64 0, i64 %indvars.iv, i32 1 store i32 %2, ptr %num11, 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 ] %sub = add nsw i32 %.lcssa, -1 call void @quickSort(i32 noundef 0, i32 noundef %sub) %5 = load i32, ptr @n, align 4, !tbaa !5 call void @mergeSort(i32 noundef 0, i32 noundef %5) %6 = load i32, ptr @n, align 4, !tbaa !5 %cmp1364 = icmp sgt i32 %6, 0 br i1 %cmp1364, label %for.body14.preheader, label %if.end32 for.body14.preheader: ; preds = %for.end %wide.trip.count = zext i32 %6 to i64 %xtraiter = and i64 %wide.trip.count, 1 %7 = icmp eq i32 %6, 1 br i1 %7, 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 [ 1, %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 [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv72 %8 = load i8, ptr %arrayidx16, align 16, !tbaa !10 %arrayidx19 = getelementptr inbounds [100000 x %struct.Card], ptr @M, i64 0, i64 %indvars.iv72 %9 = load i8, ptr %arrayidx19, align 16, !tbaa !10 %cmp22.not = icmp eq i8 %8, %9 %indvars.iv.next73 = or i64 %indvars.iv72, 1 %arrayidx16.1 = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv.next73 %10 = load i8, ptr %arrayidx16.1, align 8, !tbaa !10 %arrayidx19.1 = getelementptr inbounds [100000 x %struct.Card], ptr @M, i64 0, i64 %indvars.iv.next73 %11 = load i8, ptr %arrayidx19.1, align 8, !tbaa !10 %cmp22.not.1 = icmp eq i8 %10, %11 %12 = select i1 %cmp22.not.1, i1 %cmp22.not, i1 false %spec.select.1 = select i1 %12, i32 %judge.066, i32 0 %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 !15 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 [ 1, %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 [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv72.unr %13 = load i8, ptr %arrayidx16.epil, align 8, !tbaa !10 %arrayidx19.epil = getelementptr inbounds [100000 x %struct.Card], ptr @M, i64 0, i64 %indvars.iv72.unr %14 = load i8, ptr %arrayidx19.epil, align 8, !tbaa !10 %cmp22.not.epil = icmp eq i8 %13, %14 %spec.select.epil = select i1 %cmp22.not.epil, i32 %judge.066.unr, i32 0 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 ] %15 = icmp eq i32 %spec.select.lcssa, 1 %spec.select80 = select i1 %15, ptr @str.5, ptr @str br label %if.end32 if.end32: ; preds = %for.end26, %for.end %str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select80, %for.end26 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %16 = load i32, ptr @n, align 4, !tbaa !5 %cmp3468 = icmp sgt i32 %16, 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 [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv75 %17 = load i8, ptr %arrayidx38, align 8, !tbaa !10 %conv40 = sext i8 %17 to i32 %num43 = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv75, i32 1 %18 = load i32, ptr %num43, align 4, !tbaa !12 %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv40, i32 noundef %18) %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %19 = load i32, ptr @n, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp34 = icmp slt i64 %indvars.iv.next76, %20 br i1 %cmp34, label %for.body36, label %for.end47, !llvm.loop !16 for.end47: ; preds = %for.body36, %if.end32 call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %str) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %data) #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, argmem: none, inaccessiblemem: none) uwtable define dso_local void @quickSort(i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 { entry: %cmp6 = icmp slt i32 %p, %r br i1 %cmp6, 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 [100000 x %struct.Card], ptr @Q, i64 0, i64 %idxprom.i %x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4 br label %for.body.preheader.i for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit %p.tr7 = 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 !17 %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.preheader.i %indvars.iv.i = phi i64 [ %0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ] %i.039.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ] %num.i = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv.i, i32 1 %1 = load i32, ptr %num.i, align 4, !tbaa !12 %cmp4.not.i = icmp sgt i32 %1, %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 [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv.i %add.i = add nsw i32 %i.039.i, 1 %idxprom5.i = sext i32 %add.i to i64 %arrayidx6.i = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %idxprom5.i %2 = load i64, ptr %arrayidx6.i, align 8 %3 = load i64, ptr %arrayidx2.i, align 8 store i64 %3, ptr %arrayidx6.i, align 8 store i64 %2, ptr %arrayidx2.i, align 8 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.039.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 %4 = add nsw i32 %i.1.i, 1 %idxprom14.i = sext i32 %4 to i64 %arrayidx15.i = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %idxprom14.i %5 = load i64, ptr %arrayidx15.i, align 8 %6 = load i64, ptr %arrayidx.i, align 8 store i64 %6, ptr %arrayidx15.i, align 8 store i64 %5, ptr %arrayidx.i, align 8 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.preheader.i, label %if.end if.end: ; preds = %partition.exit, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local void @mergeSort(i32 noundef %left, i32 noundef %right) local_unnamed_addr #4 { entry: %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(i32 noundef %left, i32 noundef %div) tail call void @mergeSort(i32 noundef %div, i32 noundef %right) %sub.i = sub nsw i32 %div, %left %sub1.i = sub nsw i32 %right, %div %cmp65.i = icmp sgt i32 %sub.i, 0 br i1 %cmp65.i, label %for.body.preheader.i, label %for.cond4.preheader.i for.body.preheader.i: ; preds = %if.then %0 = sext i32 %left to i64 %1 = shl nsw i64 %0, 3 %scevgep.i = getelementptr i8, ptr @M, i64 %1 %2 = xor i32 %left, -1 %3 = add i32 %div, %2 %4 = zext i32 %3 to i64 %5 = shl nuw nsw i64 %4, 3 %6 = add nuw nsw i64 %5, 8 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @L, ptr noundef nonnull align 8 dereferenceable(1) %scevgep.i, i64 %6, i1 false) br label %for.cond4.preheader.i for.cond4.preheader.i: ; preds = %for.body.preheader.i, %if.then %cmp567.i = icmp sgt i32 %sub1.i, 0 br i1 %cmp567.i, label %for.body6.preheader.i, label %for.end14.i for.body6.preheader.i: ; preds = %for.cond4.preheader.i %7 = sext i32 %div to i64 %8 = shl nsw i64 %7, 3 %scevgep75.i = getelementptr i8, ptr @M, i64 %8 %9 = xor i32 %div, -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 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @R, ptr noundef nonnull align 8 dereferenceable(1) %scevgep75.i, i64 %13, i1 false) br label %for.end14.i for.end14.i: ; preds = %for.body6.preheader.i, %for.cond4.preheader.i %idxprom15.i = sext i32 %sub.i to i64 %num.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom15.i, i32 1 store i32 1000000001, ptr %num.i, align 4, !tbaa !12 %idxprom17.i = sext i32 %sub1.i to i64 %num19.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom17.i, i32 1 store i32 1000000001, ptr %num19.i, align 4, !tbaa !12 %14 = sext i32 %left to i64 %wide.trip.count.i = sext i32 %right to i64 br label %for.body22.i for.body22.i: ; preds = %for.body22.i, %for.end14.i %indvars.iv.i = phi i64 [ %14, %for.end14.i ], [ %indvars.iv.next.i, %for.body22.i ] %j.071.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ] %i.270.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ] %idxprom23.i = zext i32 %i.270.i to i64 %num25.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i, i32 1 %15 = load i32, ptr %num25.i, align 4, !tbaa !12 %idxprom26.i = zext i32 %j.071.i to i64 %num28.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i, i32 1 %16 = load i32, ptr %num28.i, align 4, !tbaa !12 %cmp29.not.i = icmp sle i32 %15, %16 %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 %arrayidx24.i, ptr %arrayidx27.i %add34.i = zext i1 %cmp29.not.i to i32 %i.3.i = add nuw nsw i32 %i.270.i, %add34.i %not.cmp29.not.i = xor i1 %cmp29.not.i, true %add39.i = zext i1 %not.cmp29.not.i to i32 %j.1.i = add nuw nsw i32 %j.071.i, %add39.i %.sink.i = load i64, ptr %.sink.in.i, align 8 %17 = getelementptr inbounds [100000 x %struct.Card], ptr @M, i64 0, i64 %indvars.iv.i store i64 %.sink.i, ptr %17, align 8 %indvars.iv.next.i = add 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.end, label %for.body22.i, !llvm.loop !19 if.end: ; preds = %for.body22.i, %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, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #5 { entry: %idxprom = sext i32 %r to i64 %arrayidx = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, 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 !17 %cmp37 = icmp slt i32 %p, %r br i1 %cmp37, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %sub = add nsw i32 %p, -1 %0 = sext i32 %p to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %i.039 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ] %num = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %1 = load i32, ptr %num, align 4, !tbaa !12 %cmp4.not = icmp sgt i32 %1, %x.sroa.3.0.copyload br i1 %cmp4.not, label %for.inc, label %if.then if.then: ; preds = %for.body %arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %indvars.iv %add = add nsw i32 %i.039, 1 %idxprom5 = sext i32 %add to i64 %arrayidx6 = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %idxprom5 %2 = load i64, ptr %arrayidx6, align 8 %3 = load i64, ptr %arrayidx2, align 8 store i64 %3, ptr %arrayidx6, align 8 store i64 %2, ptr %arrayidx2, align 8 br label %for.inc for.inc: ; preds = %for.body, %if.then %i.1 = phi i32 [ %add, %if.then ], [ %i.039, %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 %4 = add nsw i32 %i.1, 1 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ] %idxprom14 = sext i32 %i.0.lcssa to i64 %arrayidx15 = getelementptr inbounds [100000 x %struct.Card], ptr @Q, i64 0, i64 %idxprom14 %5 = load i64, ptr %arrayidx15, align 8 %6 = load i64, ptr %arrayidx, align 8 store i64 %6, ptr %arrayidx15, align 8 store i64 %5, ptr %arrayidx, align 8 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) #6 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local void @merge(i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #4 { entry: %sub = sub nsw i32 %mid, %left %sub1 = sub nsw i32 %right, %mid %cmp65 = icmp sgt i32 %sub, 0 br i1 %cmp65, 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 @M, 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 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @L, ptr noundef nonnull align 8 dereferenceable(1) %scevgep, i64 %6, i1 false) br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.body.preheader, %entry %cmp567 = icmp sgt i32 %sub1, 0 br i1 %cmp567, 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 %scevgep75 = getelementptr i8, ptr @M, 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 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @R, ptr noundef nonnull align 8 dereferenceable(1) %scevgep75, i64 %13, i1 false) br label %for.end14 for.end14: ; preds = %for.body6.preheader, %for.cond4.preheader %idxprom15 = sext i32 %sub to i64 %num = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom15, i32 1 store i32 1000000001, ptr %num, align 4, !tbaa !12 %idxprom17 = sext i32 %sub1 to i64 %num19 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom17, i32 1 store i32 1000000001, ptr %num19, align 4, !tbaa !12 %cmp2169 = icmp slt i32 %left, %right br i1 %cmp2169, 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 br label %for.body22 for.body22: ; preds = %for.body22.preheader, %for.body22 %indvars.iv = phi i64 [ %14, %for.body22.preheader ], [ %indvars.iv.next, %for.body22 ] %j.071 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ] %i.270 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ] %idxprom23 = zext i32 %i.270 to i64 %num25 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23, i32 1 %15 = load i32, ptr %num25, align 4, !tbaa !12 %idxprom26 = zext i32 %j.071 to i64 %num28 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26, i32 1 %16 = load i32, ptr %num28, align 4, !tbaa !12 %cmp29.not = icmp sle i32 %15, %16 %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 %add34 = zext i1 %cmp29.not to i32 %i.3 = add nuw nsw i32 %i.270, %add34 %not.cmp29.not = xor i1 %cmp29.not, true %add39 = zext i1 %not.cmp29.not to i32 %j.1 = add nuw nsw i32 %j.071, %add39 %.sink = load i64, ptr %.sink.in, align 8 %17 = getelementptr inbounds [100000 x %struct.Card], ptr @M, i64 0, i64 %indvars.iv store i64 %.sink, ptr %17, align 8 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end42, label %for.body22, !llvm.loop !19 for.end42: ; preds = %for.body22, %for.end14 ret void } ; 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, 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 nosync nounwind memory(readwrite, argmem: 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 #5 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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, !14} !17 = !{i64 0, i64 4, !5} !18 = distinct !{!18, !14} !19 = distinct !{!19, !14}
#include <stdio.h> #include <string.h> int main() { char s[1001]; int w; scanf("%s%d", s, &w); int len = strlen(s); for (int i = 0; i < len; i++) { if (i % w == 0) { printf("%c", s[i]); } } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270161/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270161/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"%s%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1001 x i8], align 16 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call2 to i32 %cmp13 = icmp sgt i32 %conv, 0 br i1 %cmp13, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 br label %for.body for.cond.cleanup: ; preds = %for.inc, %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 1001, ptr nonnull %s) #5 ret i32 0 for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %0 = load i32, ptr %w, align 4, !tbaa !5 %1 = trunc i64 %indvars.iv to i32 %rem = srem i32 %1, %0 %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %if.then, label %for.inc if.then: ; preds = %for.body %arrayidx = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv6 = sext i8 %2 to i32 %putchar12 = call i32 @putchar(i32 %conv6) br label %for.inc for.inc: ; preds = %for.body, %if.then %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 !10 } ; 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 = !{!"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"}