Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> int main(void) { int n1,n2,n3; scanf("%d %d %d",&n1,&n2,&n3); if(n1<=n2&&n2<=n3) printf("%d %d %d\n",n1,n2,n3); else if(n1<=n3&&n3<=n2) printf("%d %d %d\n",n1,n3,n2); else if(n2<=n1&&n1<=n3) printf("%d %d %d\n",n2,n1,n3); else if(n2<=n3&&n3<=n1) printf("%d %d %d\n",n2,n3,n1); else if(n3<=n1&&n1<=n2) printf("%d %d %d\n",n3,n1,n2); else if(n3<=n2&&n2<=n1) printf("%d %d %d\n",n3,n2,n1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168679/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168679/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n1 = alloca i32, align 4 %n2 = alloca i32, align 4 %n3 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n3) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n1, ptr noundef nonnull %n2, ptr noundef nonnull %n3) %0 = load i32, ptr %n1, align 4, !tbaa !5 %1 = load i32, ptr %n2, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %.pre = load i32, ptr %n3, align 4, !tbaa !5 %cmp1.not = icmp sgt i32 %1, %.pre %or.cond59 = select i1 %cmp.not, i1 true, i1 %cmp1.not br i1 %or.cond59, label %if.else, label %if.then if.then: ; preds = %entry %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre) br label %if.end36 if.else: ; preds = %entry %cmp3.not = icmp sgt i32 %0, %.pre br i1 %cmp3.not, label %if.else8, label %land.lhs.true4 land.lhs.true4: ; preds = %if.else %cmp5.not = icmp sgt i32 %.pre, %1 br i1 %cmp5.not, label %if.else8.thread, label %if.then6 if.then6: ; preds = %land.lhs.true4 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1) br label %if.end36 if.else8: ; preds = %if.else %cmp9.not = icmp sgt i32 %1, %0 br label %if.else14 if.else8.thread: ; preds = %land.lhs.true4 %cmp9.not54 = icmp sgt i32 %1, %0 br i1 %cmp9.not54, label %if.else14, label %if.then12 if.then12: ; preds = %if.else8.thread %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre) br label %if.end36 if.else14: ; preds = %if.else8, %if.else8.thread %cmp9.not56 = phi i1 [ true, %if.else8.thread ], [ %cmp9.not, %if.else8 ] %cmp15.not = icmp sgt i32 %1, %.pre %cmp17.not = icmp sgt i32 %.pre, %0 %or.cond = or i1 %cmp15.not, %cmp17.not br i1 %or.cond, label %if.else20, label %if.then18 if.then18: ; preds = %if.else14 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0) br label %if.end36 if.else20: ; preds = %if.else14 %brmerge = or i1 %cmp.not, %cmp17.not br i1 %brmerge, label %if.else26, label %if.then24 if.then24: ; preds = %if.else20 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1) br label %if.end36 if.else26: ; preds = %if.else20 %cmp27.not = icmp sgt i32 %.pre, %1 %brmerge58 = or i1 %cmp27.not, %cmp9.not56 br i1 %brmerge58, label %if.end36, label %if.then30 if.then30: ; preds = %if.else26 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0) br label %if.end36 if.end36: ; preds = %if.else26, %if.then6, %if.then18, %if.then30, %if.then24, %if.then12, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n3) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n1) #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, tmp; scanf("%d %d %d", &a,&b,&c); if (a > b){ tmp = a; a = b; b = tmp; } if (b > c){ tmp = b; b = c; c = tmp; } if (a > b){ tmp = a; a = b; b = tmp; } printf("%d %d %d\n", a, b, c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168729/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168729/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); printf("%d\n",n/2); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16878/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16878/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 = 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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %div = sdiv i32 %1, 2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 %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 %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(void){ int num[3]; int i, j, tmp; scanf("%d %d %d", &num[0], &num[1], &num[2]); for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { if (num[j] > num[j + 1]) { tmp = num[j]; num[j] = num[j + 1]; num[j + 1] = tmp; } } } printf("%d %d %d\n", num[0], num[1], num[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168822/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168822/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %num) #3 %arrayidx1 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2) %0 = load i32, ptr %num, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, %1 br i1 %cmp9, label %if.then, label %for.inc if.then: ; preds = %entry store i32 %1, ptr %num, align 4, !tbaa !5 store i32 %0, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %entry, %if.then %2 = phi i32 [ %0, %entry ], [ %1, %if.then ] %3 = phi i32 [ %1, %entry ], [ %0, %if.then ] %4 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp9.1 = icmp sgt i32 %3, %4 br i1 %cmp9.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc store i32 %4, ptr %arrayidx1, align 4, !tbaa !5 store i32 %3, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %5 = phi i32 [ %3, %if.then.1 ], [ %4, %for.inc ] %6 = phi i32 [ %4, %if.then.1 ], [ %3, %for.inc ] %cmp9.140 = icmp sgt i32 %2, %6 br i1 %cmp9.140, label %if.then.141, label %for.inc.142 if.then.141: ; preds = %for.inc.1 store i32 %6, ptr %num, align 4, !tbaa !5 store i32 %2, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.142 for.inc.142: ; preds = %if.then.141, %for.inc.1 %7 = phi i32 [ %6, %if.then.141 ], [ %2, %for.inc.1 ] %8 = phi i32 [ %2, %if.then.141 ], [ %6, %for.inc.1 ] %cmp9.1.1 = icmp sgt i32 %8, %5 br i1 %cmp9.1.1, label %if.then.1.1, label %for.inc.1.1 if.then.1.1: ; preds = %for.inc.142 store i32 %5, ptr %arrayidx1, align 4, !tbaa !5 store i32 %8, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc.1.1 for.inc.1.1: ; preds = %if.then.1.1, %for.inc.142 %9 = phi i32 [ %8, %if.then.1.1 ], [ %5, %for.inc.142 ] %10 = phi i32 [ %5, %if.then.1.1 ], [ %8, %for.inc.142 ] %cmp9.2 = icmp sgt i32 %7, %10 br i1 %cmp9.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1.1 store i32 %10, ptr %num, align 4, !tbaa !5 store i32 %7, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1.1 %11 = phi i32 [ %10, %if.then.2 ], [ %7, %for.inc.1.1 ] %12 = phi i32 [ %7, %if.then.2 ], [ %10, %for.inc.1.1 ] %cmp9.1.2 = icmp sgt i32 %12, %9 br i1 %cmp9.1.2, label %if.then.1.2, label %for.inc.1.2 if.then.1.2: ; preds = %for.inc.2 store i32 %9, ptr %arrayidx1, align 4, !tbaa !5 store i32 %12, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc.1.2 for.inc.1.2: ; preds = %if.then.1.2, %for.inc.2 %13 = phi i32 [ %12, %if.then.1.2 ], [ %9, %for.inc.2 ] %14 = phi i32 [ %9, %if.then.1.2 ], [ %12, %for.inc.2 ] %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11, i32 noundef %14, i32 noundef %13) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %num) #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,x; scanf("%d %d %d",&a,&b,&c); if(a>b){ x = a; a = b; b = x; } if(a>c){ x = a; a = c; c = x; } if(b>c){ x = b; b = c; c = x; } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168866/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168866/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %1, %if.then ], [ %0, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %a, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %b, align 4, !tbaa !5 store i32 %2, ptr %c, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b,c,x,y,z; scanf("%d %d %d",&a,&b,&c); if(a > b){ x = a; a = b; b = x; } if(b > c){ y = b; b = c; c = y; } if(a > b){ z = a; a = b; b = z; } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168916/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168916/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int i,j,a[3]; for(i=0;i < 3;i++) scanf("%d",&a[i]); for (i = 0; i < 2; i++) { for (j = 2; j > i; j--) { if (a[j - 1] > a[j]) { int change = a[j]; a[j] = a[j - 1]; a[j-1] = change; } } } printf("%d %d %d\n",a[0],a[1],a[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168967/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168967/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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { for.body6.preheader: %a = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %arrayidx.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %0 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %cmp11 = icmp sgt i32 %0, %1 br i1 %cmp11, label %if.then, label %for.inc22 if.then: ; preds = %for.body6.preheader store i32 %0, ptr %arrayidx.2, align 4, !tbaa !5 store i32 %1, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.inc22 for.inc22: ; preds = %for.body6.preheader, %if.then %2 = phi i32 [ %0, %for.body6.preheader ], [ %1, %if.then ] %3 = load i32, ptr %a, align 4, !tbaa !5 %cmp11.155 = icmp sgt i32 %3, %2 br i1 %cmp11.155, label %if.then.157, label %for.body6.preheader.1 if.then.157: ; preds = %for.inc22 store i32 %3, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %2, ptr %a, align 4, !tbaa !5 br label %for.body6.preheader.1 for.body6.preheader.1: ; preds = %if.then.157, %for.inc22 %4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %5 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %cmp11.1 = icmp sgt i32 %4, %5 br i1 %cmp11.1, label %if.then.1, label %for.inc24.1 if.then.1: ; preds = %for.body6.preheader.1 store i32 %4, ptr %arrayidx.2, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.inc24.1 for.inc24.1: ; preds = %for.body6.preheader.1, %if.then.1 %6 = phi i32 [ %4, %if.then.1 ], [ %5, %for.body6.preheader.1 ] %7 = phi i32 [ %5, %if.then.1 ], [ %4, %for.body6.preheader.1 ] %8 = load i32, ptr %a, align 4, !tbaa !5 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %6) call void @llvm.lifetime.end.p0(i64 12, 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: 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"}
#include <stdio.h> #define swap(type,m,n) do{type t=m; m=n; n=t;}while(0) int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if (a > b)swap(int, a, b); if (b > c)swap(int, b, c); if (a > b)swap(int, a, b); printf("%d %d %d\n", a, b, c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169009/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169009/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %do.body, label %if.end do.body: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %do.body, %entry %2 = phi i32 [ %1, %do.body ], [ %0, %entry ] %3 = phi i32 [ %0, %do.body ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %do.body3, label %if.end7 do.body3: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end7 if.end7: ; preds = %do.body3, %if.end %5 = phi i32 [ %3, %do.body3 ], [ %4, %if.end ] %6 = phi i32 [ %4, %do.body3 ], [ %3, %if.end ] %cmp8 = icmp sgt i32 %2, %6 br i1 %cmp8, label %do.body10, label %if.end14 do.body10: ; preds = %if.end7 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end14 if.end14: ; preds = %do.body10, %if.end7 %7 = phi i32 [ %2, %do.body10 ], [ %6, %if.end7 ] %8 = phi i32 [ %6, %do.body10 ], [ %2, %if.end7 ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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"}
#include <stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<=b && b<=c){ printf("%d %d %d\n",a,b,c); }else if(a<=c && c<=b){ printf("%d %d %d\n",a,c,b); }else if(b<=a && a<=c){ printf("%d %d %d\n",b,a,c); }else if(b<=c && c<=a){ printf("%d %d %d\n",b,c,a); }else if(c<=a && a<=b){ printf("%d %d %d\n",c,a,b); }else if(c<=a && b<=a){ printf("%d %d %d\n",c,b,a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169052/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169052/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %.pre = load i32, ptr %c, align 4, !tbaa !5 %cmp1.not = icmp sgt i32 %1, %.pre %or.cond58 = select i1 %cmp.not, i1 true, i1 %cmp1.not br i1 %or.cond58, label %if.else, label %if.then if.then: ; preds = %entry %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre) br label %if.end36 if.else: ; preds = %entry %cmp3.not = icmp sgt i32 %0, %.pre br i1 %cmp3.not, label %if.else8, label %land.lhs.true4 land.lhs.true4: ; preds = %if.else %cmp5.not = icmp sgt i32 %.pre, %1 br i1 %cmp5.not, label %if.else8.thread, label %if.then6 if.then6: ; preds = %land.lhs.true4 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1) br label %if.end36 if.else8: ; preds = %if.else %cmp9.not = icmp sgt i32 %1, %0 br label %if.else14 if.else8.thread: ; preds = %land.lhs.true4 %cmp9.not54 = icmp sgt i32 %1, %0 br i1 %cmp9.not54, label %if.else14, label %if.then12 if.then12: ; preds = %if.else8.thread %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre) br label %if.end36 if.else14: ; preds = %if.else8, %if.else8.thread %cmp9.not56 = phi i1 [ true, %if.else8.thread ], [ %cmp9.not, %if.else8 ] %cmp15.not = icmp sgt i32 %1, %.pre %cmp17.not = icmp sgt i32 %.pre, %0 %or.cond = or i1 %cmp15.not, %cmp17.not br i1 %or.cond, label %if.else20, label %if.then18 if.then18: ; preds = %if.else14 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0) br label %if.end36 if.else20: ; preds = %if.else14 br i1 %cmp17.not, label %if.end36, label %land.lhs.true22 land.lhs.true22: ; preds = %if.else20 br i1 %cmp.not, label %land.lhs.true28, label %if.then24 if.then24: ; preds = %land.lhs.true22 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1) br label %if.end36 land.lhs.true28: ; preds = %land.lhs.true22 br i1 %cmp9.not56, label %if.end36, label %if.then30 if.then30: ; preds = %land.lhs.true28 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0) br label %if.end36 if.end36: ; preds = %if.else20, %if.then6, %if.then18, %land.lhs.true28, %if.then30, %if.then24, %if.then12, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #define NUMBERS 3 int main(void){ int num[NUMBERS]; int i; int flag; int temp; for(i=0;i<NUMBERS;i++){ scanf("%d", &num[i]); } do{ flag=0; for(i=0;i<NUMBERS-1;i++){ if (num[i]>num[i+1]){ temp = num[i]; num[i] = num[i+1]; num[i+1] = temp; flag++; } } } while(flag!=0); for(i=0;i<NUMBERS;i++){ printf("%d", num[i]); if(i<NUMBERS-1){printf(" ");} } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169102/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169102/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %num) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %arrayidx.1 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %.pre = load i32, ptr %num, align 4, !tbaa !5 %.pre62 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx.2.promoted = load i32, ptr %arrayidx.2, align 4, !tbaa !5 br label %do.body do.body: ; preds = %entry, %for.inc20.1 %0 = phi i32 [ %arrayidx.2.promoted, %entry ], [ %5, %for.inc20.1 ] %1 = phi i32 [ %.pre62, %entry ], [ %6, %for.inc20.1 ] %2 = phi i32 [ %.pre, %entry ], [ %4, %for.inc20.1 ] %cmp8 = icmp sgt i32 %2, %1 br i1 %cmp8, label %if.then, label %for.inc20 if.then: ; preds = %do.body store i32 %1, ptr %num, align 4, !tbaa !5 store i32 %2, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.inc20 for.inc20: ; preds = %do.body, %if.then %3 = phi i32 [ %2, %if.then ], [ %1, %do.body ] %4 = phi i32 [ %1, %if.then ], [ %2, %do.body ] %flag.1 = phi i32 [ 1, %if.then ], [ 0, %do.body ] %cmp8.1 = icmp sgt i32 %3, %0 br i1 %cmp8.1, label %if.then.1, label %for.inc20.1 if.then.1: ; preds = %for.inc20 store i32 %0, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %3, ptr %arrayidx.2, align 4, !tbaa !5 br label %for.inc20.1 for.inc20.1: ; preds = %if.then.1, %for.inc20 %5 = phi i32 [ %3, %if.then.1 ], [ %0, %for.inc20 ] %6 = phi i32 [ %0, %if.then.1 ], [ %3, %for.inc20 ] %flag.1.1 = phi i32 [ 1, %if.then.1 ], [ %flag.1, %for.inc20 ] %cmp23.not = icmp eq i32 %flag.1.1, 0 br i1 %cmp23.not, label %for.inc34.2, label %do.body, !llvm.loop !9 for.inc34.2: ; preds = %for.inc20.1 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4) %putchar54 = call i32 @putchar(i32 32) %7 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %call29.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %putchar54.1 = call i32 @putchar(i32 32) %8 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %call29.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %num) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int a,b,c,d; int i; scanf("%d %d %d",&a,&b,&c); for(i=0;i<3;i++){ if(a>b) { d = b; b = a; a = d; }else if(b>c){ d = c; c = b; b = d; } } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169146/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169146/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %c.promoted = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %a.promoted, %b.promoted br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %entry store i32 %a.promoted, ptr %b, align 4, !tbaa !5 store i32 %b.promoted, ptr %a, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %cmp2 = icmp sgt i32 %b.promoted, %c.promoted br i1 %cmp2, label %if.then3, label %for.inc if.then3: ; preds = %if.else store i32 %b.promoted, ptr %c, align 4, !tbaa !5 store i32 %c.promoted, ptr %b, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.then3, %if.else %0 = phi i32 [ %c.promoted, %if.then ], [ %b.promoted, %if.then3 ], [ %c.promoted, %if.else ] %1 = phi i32 [ %a.promoted, %if.then ], [ %c.promoted, %if.then3 ], [ %b.promoted, %if.else ] %2 = phi i32 [ %b.promoted, %if.then ], [ %a.promoted, %if.then3 ], [ %a.promoted, %if.else ] %cmp1.1 = icmp sgt i32 %2, %1 br i1 %cmp1.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %cmp2.1 = icmp sgt i32 %1, %0 br i1 %cmp2.1, label %if.then3.1, label %for.inc.1 if.then3.1: ; preds = %if.else.1 store i32 %1, ptr %c, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %for.inc.1 if.then.1: ; preds = %for.inc store i32 %2, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.then3.1, %if.else.1 %3 = phi i32 [ %0, %if.then.1 ], [ %1, %if.then3.1 ], [ %0, %if.else.1 ] %4 = phi i32 [ %2, %if.then.1 ], [ %0, %if.then3.1 ], [ %1, %if.else.1 ] %5 = phi i32 [ %1, %if.then.1 ], [ %2, %if.then3.1 ], [ %2, %if.else.1 ] %cmp1.2 = icmp sgt i32 %5, %4 br i1 %cmp1.2, label %if.then.2, label %if.else.2 if.else.2: ; preds = %for.inc.1 %cmp2.2 = icmp sgt i32 %4, %3 br i1 %cmp2.2, label %if.then3.2, label %for.inc.2 if.then3.2: ; preds = %if.else.2 store i32 %4, ptr %c, align 4, !tbaa !5 store i32 %3, ptr %b, align 4, !tbaa !5 br label %for.inc.2 if.then.2: ; preds = %for.inc.1 store i32 %5, ptr %b, align 4, !tbaa !5 store i32 %4, ptr %a, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %if.then3.2, %if.else.2 %6 = phi i32 [ %3, %if.then.2 ], [ %4, %if.then3.2 ], [ %3, %if.else.2 ] %7 = phi i32 [ %5, %if.then.2 ], [ %3, %if.then3.2 ], [ %4, %if.else.2 ] %8 = phi i32 [ %4, %if.then.2 ], [ %5, %if.then3.2 ], [ %5, %if.else.2 ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %6) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> void bsort(int *n1, int *n2, int *n3) { if(*n1 > *n2) { int tmp = *n1; *n1 = *n2; *n2 = tmp; } if(*n1 > *n3){ int tmp = *n1; *n1 = *n3; *n3 = tmp; } if(*n2 > *n3){ int tmp = *n2; *n2 = *n3; *n3 = tmp; } } int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); bsort(&a, &b, &c); printf("%d %d %d\n", a, b, c); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169203/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169203/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @bsort(ptr nocapture noundef %n1, ptr nocapture noundef %n2, ptr nocapture noundef %n3) local_unnamed_addr #0 { entry: %0 = load i32, ptr %n1, align 4, !tbaa !5 %1 = load i32, ptr %n2, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %n1, align 4, !tbaa !5 store i32 %0, ptr %n2, align 4, !tbaa !5 %.pre = load i32, ptr %n1, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ] %4 = load i32, ptr %n3, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end4 if.then2: ; preds = %if.end store i32 %4, ptr %n1, align 4, !tbaa !5 store i32 %3, ptr %n3, align 4, !tbaa !5 %.pre29 = load i32, ptr %n2, align 4, !tbaa !5 br label %if.end4 if.end4: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %.pre29, %if.then2 ], [ %2, %if.end ] %cmp5 = icmp sgt i32 %6, %5 br i1 %cmp5, label %if.then6, label %if.end8 if.then6: ; preds = %if.end4 store i32 %5, ptr %n2, align 4, !tbaa !5 store i32 %6, ptr %n3, align 4, !tbaa !5 br label %if.end8 if.end8: ; preds = %if.then6, %if.end4 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.i = icmp sgt i32 %0, %1 br i1 %cmp.i, label %if.then.i, label %if.end.i if.then.i: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %.pre29.i = phi i32 [ %0, %if.then.i ], [ %1, %entry ] %2 = phi i32 [ %1, %if.then.i ], [ %0, %entry ] %3 = load i32, ptr %c, align 4, !tbaa !5 %cmp1.i = icmp sgt i32 %2, %3 br i1 %cmp1.i, label %if.then2.i, label %if.end4.i if.then2.i: ; preds = %if.end.i store i32 %3, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %c, align 4, !tbaa !5 br label %if.end4.i if.end4.i: ; preds = %if.then2.i, %if.end.i %4 = phi i32 [ %3, %if.then2.i ], [ %2, %if.end.i ] %5 = phi i32 [ %2, %if.then2.i ], [ %3, %if.end.i ] %cmp5.i = icmp sgt i32 %.pre29.i, %5 br i1 %cmp5.i, label %if.then6.i, label %bsort.exit if.then6.i: ; preds = %if.end4.i store i32 %5, ptr %b, align 4, !tbaa !5 store i32 %.pre29.i, ptr %c, align 4, !tbaa !5 br label %bsort.exit bsort.exit: ; preds = %if.end4.i, %if.then6.i %6 = phi i32 [ %5, %if.end4.i ], [ %.pre29.i, %if.then6.i ] %7 = phi i32 [ %.pre29.i, %if.end4.i ], [ %5, %if.then6.i ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %7, i32 noundef %6) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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 %d",&a,&b,&c); if (a <= b && b <= c){ printf("%d %d %d\n", a, b, c); } else if (b <= c && c <= a){ printf("%d %d %d\n", b ,c, a); } else if (c <= a && a <= b){ printf("%d %d %d\n", c, a, b); } else if (a <= c && c <= b){ printf("%d %d %d\n", a, c, b); } else if (c <= b && b <= a){ printf("%d %d %d\n", c, b, a); } else if (b <= a && a <= c){ printf("%d %d %d\n", b, a, c); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169261/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169261/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %.pre = load i32, ptr %c, align 4, !tbaa !5 %cmp1.not = icmp sgt i32 %1, %.pre %or.cond57 = select i1 %cmp.not, i1 true, i1 %cmp1.not br i1 %or.cond57, label %if.else, label %if.then if.then: ; preds = %entry %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre) br label %if.end36 if.else: ; preds = %entry %cmp3.not = icmp sgt i32 %1, %.pre %cmp5.not = icmp sgt i32 %.pre, %0 %or.cond = or i1 %cmp3.not, %cmp5.not br i1 %or.cond, label %if.else8, label %if.then6 if.then6: ; preds = %if.else %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0) br label %if.end36 if.else8: ; preds = %if.else %brmerge = or i1 %cmp.not, %cmp5.not br i1 %brmerge, label %if.else14, label %if.then12 if.then12: ; preds = %if.else8 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1) br label %if.end36 if.else14: ; preds = %if.else8 %cmp15.not = icmp sgt i32 %0, %.pre %cmp17.not = icmp sgt i32 %.pre, %1 %or.cond54 = or i1 %cmp15.not, %cmp17.not br i1 %or.cond54, label %if.else20, label %if.then18 if.then18: ; preds = %if.else14 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1) br label %if.end36 if.else20: ; preds = %if.else14 %cmp23.not = icmp sgt i32 %1, %0 %or.cond55 = or i1 %cmp23.not, %cmp17.not br i1 %or.cond55, label %if.else26, label %if.then24 if.then24: ; preds = %if.else20 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0) br label %if.end36 if.else26: ; preds = %if.else20 %brmerge56 = or i1 %cmp23.not, %cmp15.not br i1 %brmerge56, label %if.end36, label %if.then30 if.then30: ; preds = %if.else26 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre) br label %if.end36 if.end36: ; preds = %if.else26, %if.then6, %if.then18, %if.then30, %if.then24, %if.then12, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main (void){ int a,b,c,tmp; scanf("%d %d %d",&a,&b,&c); if(a > b){ tmp = a; a = b; b =tmp; } if(b > c){ tmp = b; b = c; c = tmp; } if(a > b){ tmp = a; a = b; b = tmp; } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169304/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169304/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); if(a>=b && b>=c) printf("%d %d %d\n",c, b, a); else if (a>=c && c>=b) printf("%d %d %d\n",b, c, a); else if (c>=a && a>=b) printf("%d %d %d\n",b, a, c); else if (b>=a && a>=c) printf("%d %d %d\n",c, a, b); else if (c>=b && b>=a) printf("%d %d %d\n",a, b, c); else printf("%d %d %d\n",a, c, b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169362/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169362/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %.pre = load i32, ptr %c, align 4, !tbaa !5 %cmp1.not = icmp slt i32 %1, %.pre %or.cond47 = select i1 %cmp.not, i1 true, i1 %cmp1.not br i1 %or.cond47, label %if.else, label %if.then if.then: ; preds = %entry %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0) br label %if.end31 if.else: ; preds = %entry %cmp3.not = icmp slt i32 %0, %.pre %cmp5.not = icmp slt i32 %.pre, %1 %or.cond = or i1 %cmp3.not, %cmp5.not br i1 %or.cond, label %if.else8, label %if.then6 if.then6: ; preds = %if.else %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0) br label %if.end31 if.else8: ; preds = %if.else %cmp9.not = icmp slt i32 %.pre, %0 %brmerge = or i1 %cmp.not, %cmp9.not br i1 %brmerge, label %if.else14, label %if.then12 if.then12: ; preds = %if.else8 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre) br label %if.end31 if.else14: ; preds = %if.else8 %cmp15.not = icmp slt i32 %1, %0 br i1 %cmp15.not, label %if.else26, label %land.lhs.true16 land.lhs.true16: ; preds = %if.else14 br i1 %cmp3.not, label %if.else20.thread, label %if.then18 if.then18: ; preds = %land.lhs.true16 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1) br label %if.end31 if.else20.thread: ; preds = %land.lhs.true16 br i1 %cmp5.not, label %if.else26, label %if.then24 if.then24: ; preds = %if.else20.thread %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre) br label %if.end31 if.else26: ; preds = %if.else14, %if.else20.thread %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1) br label %if.end31 if.end31: ; preds = %if.then6, %if.then18, %if.else26, %if.then24, %if.then12, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a,b,c,d; scanf("%d %d %d",&a,&b,&c); if(a>b){ d=a; a=b; b=d; } if(b>c){ d=b; b=c; c=d; } if(a>b){ d=a; a=b; b=d; } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169405/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169405/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a[3],b[3] = {0,0,0},c[3]; int i; scanf("%d%d%d",&a[0],&a[1],&a[2]); if(a[0] > a[1]){ b[0]++; }else{ b[1]++; } if(a[0] > a[2]){ b[0]++; }else{ b[2]++; } if(a[1] > a[2]){ b[1]++; }else{ b[2]++; } for(i = 0;i < 3;i++){ c[b[i]] = a[i]; } for(i = 0;i < 3;i++){ if(i < 2){ printf("%d ",c[i]); }else{ printf("%d\n",c[i]); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169449/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169449/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 \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 [3 x i32], align 4 %c = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %c) #3 %arrayidx1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %spec.select = zext i1 %cmp to i64 %not.cmp = xor i1 %cmp, true %spec.select73 = zext i1 %not.cmp to i64 %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp10 = icmp sle i32 %0, %2 %inc13 = select i1 %cmp, i64 2, i64 1 %b.sroa.0.1 = select i1 %cmp10, i64 %spec.select, i64 %inc13 %b.sroa.13.0 = zext i1 %cmp10 to i64 %cmp20 = icmp sgt i32 %1, %2 %inc23 = select i1 %cmp, i64 1, i64 2 %inc26 = select i1 %cmp10, i64 2, i64 1 %b.sroa.8.1 = select i1 %cmp20, i64 %inc23, i64 %spec.select73 %b.sroa.13.1 = select i1 %cmp20, i64 %b.sroa.13.0, i64 %inc26 %arrayidx33 = getelementptr inbounds [3 x i32], ptr %c, i64 0, i64 %b.sroa.0.1 store i32 %0, ptr %arrayidx33, align 4, !tbaa !5 %arrayidx33.1 = getelementptr inbounds [3 x i32], ptr %c, i64 0, i64 %b.sroa.8.1 store i32 %1, ptr %arrayidx33.1, align 4, !tbaa !5 %arrayidx33.2 = getelementptr inbounds [3 x i32], ptr %c, i64 0, i64 %b.sroa.13.1 store i32 %2, ptr %arrayidx33.2, align 4, !tbaa !5 %arrayidx45 = getelementptr inbounds [3 x i32], ptr %c, i64 0, i64 2 %3 = load i32, ptr %arrayidx45, align 4 %4 = load i32, ptr %c, align 4, !tbaa !5 %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) %arrayidx41.1 = getelementptr inbounds [3 x i32], ptr %c, i64 0, i64 1 %5 = load i32, ptr %arrayidx41.1, align 4, !tbaa !5 %call42.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5) %call46.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %3) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 12, 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 a, b, c; int tmp; scanf("%d %d %d", &a, &b, &c); if(a > b){ tmp = a; a = b; b = tmp; } if(b > c) { tmp = b; b = c; c = tmp; } if(a > b) { tmp = a; a = b; b = tmp; } printf("%d %d %d\n", a, b, c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169506/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169506/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a, b, c, x; scanf("%d %d %d\n", &a, &b, &c); if(a>b){ x = b; b = a; a = x; } if(b>c){ x = c; c = b; b = x; } if(a>b){ x = b; b = a; a = x; } printf("%d %d %d\n", a, b, c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169571/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169571/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 [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %0, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %3, ptr %c, align 4, !tbaa !5 store i32 %4, ptr %b, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %2, ptr %b, align 4, !tbaa !5 store i32 %6, ptr %a, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a[100]={},i,j,m; for(i=0;i<3;i++){ scanf("%d",&a[i]); } for(j=0;j<2;j++){ for(i=0;i<2;i++){ if(a[i]>a[i+1]){ m=a[i]; a[i]=a[i+1]; a[i+1]=m; } } } printf("%d %d %d\n",a[0],a[1],a[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169614/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169614/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 [10 x i8] c"%d %d %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 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %a, i8 0, i64 400, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %arrayidx.1 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %0 = load i32, ptr %a, align 16, !tbaa !5 %1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %cmp11 = icmp sgt i32 %0, %1 br i1 %cmp11, label %if.then, label %for.inc22 if.then: ; preds = %entry store i32 %1, ptr %a, align 16, !tbaa !5 store i32 %0, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.inc22 for.inc22: ; preds = %entry, %if.then %2 = phi i32 [ %0, %entry ], [ %1, %if.then ] %3 = phi i32 [ %1, %entry ], [ %0, %if.then ] %4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %cmp11.1 = icmp sgt i32 %3, %4 br i1 %cmp11.1, label %if.then.1, label %for.inc22.1 if.then.1: ; preds = %for.inc22 store i32 %4, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %3, ptr %arrayidx.2, align 8, !tbaa !5 br label %for.inc22.1 for.inc22.1: ; preds = %if.then.1, %for.inc22 %5 = phi i32 [ %3, %if.then.1 ], [ %4, %for.inc22 ] %6 = phi i32 [ %4, %if.then.1 ], [ %3, %for.inc22 ] %cmp11.150 = icmp sgt i32 %2, %6 br i1 %cmp11.150, label %if.then.151, label %for.inc22.152 if.then.151: ; preds = %for.inc22.1 store i32 %6, ptr %a, align 16, !tbaa !5 store i32 %2, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.inc22.152 for.inc22.152: ; preds = %if.then.151, %for.inc22.1 %7 = phi i32 [ %6, %if.then.151 ], [ %2, %for.inc22.1 ] %8 = phi i32 [ %2, %if.then.151 ], [ %6, %for.inc22.1 ] %cmp11.1.1 = icmp sgt i32 %8, %5 br i1 %cmp11.1.1, label %if.then.1.1, label %for.inc22.1.1 if.then.1.1: ; preds = %for.inc22.152 store i32 %5, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %8, ptr %arrayidx.2, align 8, !tbaa !5 br label %for.inc22.1.1 for.inc22.1.1: ; preds = %if.then.1.1, %for.inc22.152 %9 = phi i32 [ %8, %if.then.1.1 ], [ %5, %for.inc22.152 ] %10 = phi i32 [ %5, %if.then.1.1 ], [ %8, %for.inc22.152 ] %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7, i32 noundef %10, i32 noundef %9) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b,c,s,m,h; scanf("%d %d %d",&a,&b,&c); if(a>b) { s=b; m=a; } else{ m=b; s=a; } if(m>c) { h=m; if(s>c){ m=s; s=c;} else{m=c;}} else{h=c;} printf("%d %d %d\n",s,m,h); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169658/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169658/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %. = call i32 @llvm.smin.i32(i32 %0, i32 %1) %.17 = call i32 @llvm.smax.i32(i32 %0, i32 %1) %2 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %.17, %2 %.. = call i32 @llvm.smin.i32(i32 %., i32 %2) %..18 = call i32 @llvm.smax.i32(i32 %., i32 %2) %s.1 = select i1 %cmp1, i32 %.., i32 %. %m.1 = select i1 %cmp1, i32 %..18, i32 %.17 %h.0 = call i32 @llvm.smax.i32(i32 %.17, i32 %2) %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.1, i32 noundef %m.1, i32 noundef %h.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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> void swap_int(int *a, int *b) { int tmp; tmp = *a; *a = *b; *b = tmp; } int main(int argc, char *argv[]) { int a[3], i, j; scanf("%d %d %d", &a[0], &a[1], &a[2]); for (i = 0; i < 3; i++) { /* printf("%d %d %d\n", a[0], a[1], a[2]); */ for (j = i; j < 3; j++) { if (a[i] > a[j]) { swap_int(&a[i], &a[j]); } } } for (i = 0; i < 2; i++) { printf("%d ", a[i]); } printf("%d\n", a[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169715/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169715/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap_int(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 { for.inc: %a = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #4 %arrayidx1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp9.147 = icmp sgt i32 %0, %1 br i1 %cmp9.147, label %if.then.149, label %for.inc.150 if.then.149: ; preds = %for.inc store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.150 for.inc.150: ; preds = %if.then.149, %for.inc %2 = phi i32 [ %0, %if.then.149 ], [ %1, %for.inc ] %3 = phi i32 [ %1, %if.then.149 ], [ %0, %for.inc ] %4 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp9.252 = icmp sgt i32 %3, %4 br i1 %cmp9.252, label %if.then.254, label %for.inc.1 if.then.254: ; preds = %for.inc.150 store i32 %4, ptr %a, align 4, !tbaa !5 store i32 %3, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %for.inc.150, %if.then.254 %5 = phi i32 [ %4, %if.then.254 ], [ %3, %for.inc.150 ] %6 = phi i32 [ %3, %if.then.254 ], [ %4, %for.inc.150 ] %cmp9.1.1 = icmp sgt i32 %2, %6 br i1 %cmp9.1.1, label %if.then.1.1, label %for.inc.2 if.then.1.1: ; preds = %for.inc.1 store i32 %6, ptr %arrayidx1, align 4, !tbaa !5 store i32 %2, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %for.inc.1, %if.then.1.1 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5) %7 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %call22.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %8 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int a , b , c; int main () { scanf ("%d %d %d" , &a , &b ,&c); if (a<=b && b<=c) { printf ("%d %d %d\n" , a , b , c ); } else if (a<=c && c<=b) { printf ("%d %d %d\n" , a , c , b ); } else if (b<=a && a<=c) { printf ("%d %d %d\n" , b , a , c ); } else if (b<=c && c<=a) { printf ("%d %d %d\n" , b , c , a ); } else if (c<=a && a<=b) { printf ("%d %d %d\n" , c , a , b ); } else if (c<=b && b<=a) { printf ("%d %d %d\n" , c , b , a ); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169766/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169766/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 %d %d\00", align 1 @a = dso_local global i32 0, align 4 @b = dso_local global i32 0, align 4 @c = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b, ptr noundef nonnull @c) %0 = load i32, ptr @a, align 4, !tbaa !5 %1 = load i32, ptr @b, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %.pre = load i32, ptr @c, align 4, !tbaa !5 %cmp1.not = icmp sgt i32 %1, %.pre %or.cond59 = select i1 %cmp.not, i1 true, i1 %cmp1.not br i1 %or.cond59, label %if.else, label %if.then if.then: ; preds = %entry %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre) br label %if.end36 if.else: ; preds = %entry %cmp3.not = icmp sgt i32 %0, %.pre br i1 %cmp3.not, label %if.else8, label %land.lhs.true4 land.lhs.true4: ; preds = %if.else %cmp5.not = icmp sgt i32 %.pre, %1 br i1 %cmp5.not, label %if.else8.thread, label %if.then6 if.then6: ; preds = %land.lhs.true4 %call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1) br label %if.end36 if.else8: ; preds = %if.else %cmp9.not = icmp sgt i32 %1, %0 br label %if.else14 if.else8.thread: ; preds = %land.lhs.true4 %cmp9.not54 = icmp sgt i32 %1, %0 br i1 %cmp9.not54, label %if.else14, label %if.then12 if.then12: ; preds = %if.else8.thread %call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre) br label %if.end36 if.else14: ; preds = %if.else8, %if.else8.thread %cmp9.not56 = phi i1 [ true, %if.else8.thread ], [ %cmp9.not, %if.else8 ] %cmp15.not = icmp sgt i32 %1, %.pre %cmp17.not = icmp sgt i32 %.pre, %0 %or.cond = or i1 %cmp15.not, %cmp17.not br i1 %or.cond, label %if.else20, label %if.then18 if.then18: ; preds = %if.else14 %call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0) br label %if.end36 if.else20: ; preds = %if.else14 %brmerge = or i1 %cmp.not, %cmp17.not br i1 %brmerge, label %if.else26, label %if.then24 if.then24: ; preds = %if.else20 %call25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1) br label %if.end36 if.else26: ; preds = %if.else20 %cmp27.not = icmp sgt i32 %.pre, %1 %brmerge58 = or i1 %cmp27.not, %cmp9.not56 br i1 %brmerge58, label %if.end36, label %if.then30 if.then30: ; preds = %if.else26 %call31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0) br label %if.end36 if.end36: ; preds = %if.else26, %if.then6, %if.then18, %if.then30, %if.then24, %if.then12, %if.then ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> void judge(int,int); int num[3]; int main(){ int i; for(i=0;i<3;i++) scanf("%d",&num[i]); judge(0,1); judge(1,2); judge(0,1); printf("%d %d %d\n",num[0],num[1],num[2]); return 0; } void judge(int a,int b){ int tmp; if(num[a]>num[b]){ tmp=num[a]; num[a]=num[b]; num[b]=tmp; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169816/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169816/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 @num = dso_local global [3 x i32] zeroinitializer, align 4 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @num) %call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1)) %call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2)) %0 = load i32, ptr @num, align 4, !tbaa !5 %1 = load i32, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5 %cmp.i = icmp sgt i32 %0, %1 br i1 %cmp.i, label %if.then.i, label %judge.exit if.then.i: ; preds = %entry store i32 %1, ptr @num, align 4, !tbaa !5 store i32 %0, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5 br label %judge.exit judge.exit: ; preds = %entry, %if.then.i %2 = phi i32 [ %0, %entry ], [ %1, %if.then.i ] %3 = phi i32 [ %1, %entry ], [ %0, %if.then.i ] %4 = load i32, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2), align 4, !tbaa !5 %cmp.i4 = icmp sgt i32 %3, %4 br i1 %cmp.i4, label %if.then.i5, label %judge.exit6 if.then.i5: ; preds = %judge.exit store i32 %4, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5 store i32 %3, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2), align 4, !tbaa !5 br label %judge.exit6 judge.exit6: ; preds = %judge.exit, %if.then.i5 %5 = phi i32 [ %4, %judge.exit ], [ %3, %if.then.i5 ] %6 = phi i32 [ %3, %judge.exit ], [ %4, %if.then.i5 ] %cmp.i7 = icmp sgt i32 %2, %6 br i1 %cmp.i7, label %if.then.i8, label %judge.exit9 if.then.i8: ; preds = %judge.exit6 store i32 %6, ptr @num, align 4, !tbaa !5 store i32 %2, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5 br label %judge.exit9 judge.exit9: ; preds = %judge.exit6, %if.then.i8 %7 = phi i32 [ %6, %judge.exit6 ], [ %2, %if.then.i8 ] %8 = phi i32 [ %2, %judge.exit6 ], [ %6, %if.then.i8 ] %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @judge(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %idxprom = sext i32 %a to i64 %arrayidx = getelementptr inbounds [3 x i32], ptr @num, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom1 = sext i32 %b to i64 %arrayidx2 = getelementptr inbounds [3 x i32], ptr @num, i64 0, i64 %idxprom1 %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %arrayidx, align 4, !tbaa !5 store i32 %0, ptr %arrayidx2, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn 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" } !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,t; scanf("%d%d%d",&a,&b,&c); int array[3] = { a,b,c }; for (int i = 0; i<2; i++) { for (int m = i + 1; m<3; m++) if (array[i]>array[m]) { t= array[i]; array[i] = array[m]; array[m] = t; } } printf("%d %d %d\n", array[0], array[1], array[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169867/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169867/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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { for.body5.lr.ph: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %c, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1) %spec.select54 = call i32 @llvm.smin.i32(i32 %0, i32 %1) %array.sroa.14.3 = call i32 @llvm.smax.i32(i32 %spec.select54, i32 %2) %array.sroa.0.2 = call i32 @llvm.smin.i32(i32 %spec.select54, i32 %2) %array.sroa.14.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %array.sroa.14.3) %array.sroa.8.1 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %array.sroa.14.3) %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %array.sroa.0.2, i32 noundef %array.sroa.8.1, i32 noundef %array.sroa.14.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 ; 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"}
#include<stdio.h> int main() { int a,b,c,d; scanf("%d %d %d", &a, &b, &c); if(a > b){ d = a; a = b; b = d; } if(a > c){ d = a; a = c; c = d; } if(b > c){ d = b; b = c; c = d; } printf("%d %d %d\n", a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169917/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169917/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %1, %if.then ], [ %0, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %a, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %b, align 4, !tbaa !5 store i32 %2, ptr %c, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
/* * 3つの整数を読み込み、それらを小さい順に並び替えて出力する * プログラム。 * * Input * a b c * * Constraints * 1<=a,b,c<=10000 */ #include <stdio.h> int main() { int a,b,c,tmp; scanf("%d %d %d", &a, &b, &c); if (a > b) { tmp = a; a = b; b = tmp; } if (b > c) { tmp = b; b = c; c = tmp; } if (a > b) { tmp = a; a = b; b = tmp; } printf("%d %d %d\n", a, b, c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169960/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169960/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> void max(int *x,int *y) { if(*x>*y) { int t=*x; *x=*y; *y=t; } } int main() { int a,b,c; scanf("%d%d%d",&a,&b,&c); max(&a,&b); max(&a,&c); max(&b,&c); printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170001/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170001/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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @max(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 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %x, align 4, !tbaa !5 store i32 %0, ptr %y, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.i = icmp sgt i32 %0, %1 br i1 %cmp.i, label %if.then.i, label %max.exit if.then.i: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %max.exit max.exit: ; preds = %entry, %if.then.i %2 = phi i32 [ %1, %entry ], [ %0, %if.then.i ] %3 = phi i32 [ %0, %entry ], [ %1, %if.then.i ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp.i2 = icmp sgt i32 %3, %4 br i1 %cmp.i2, label %if.then.i3, label %max.exit4 if.then.i3: ; preds = %max.exit store i32 %4, ptr %a, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %max.exit4 max.exit4: ; preds = %max.exit, %if.then.i3 %5 = phi i32 [ %3, %max.exit ], [ %4, %if.then.i3 ] %6 = phi i32 [ %4, %max.exit ], [ %3, %if.then.i3 ] %cmp.i5 = icmp sgt i32 %2, %6 br i1 %cmp.i5, label %if.then.i6, label %max.exit7 if.then.i6: ; preds = %max.exit4 store i32 %6, ptr %b, align 4, !tbaa !5 store i32 %2, ptr %c, align 4, !tbaa !5 br label %max.exit7 max.exit7: ; preds = %max.exit4, %if.then.i6 %7 = phi i32 [ %6, %max.exit4 ], [ %2, %if.then.i6 ] %8 = phi i32 [ %2, %max.exit4 ], [ %6, %if.then.i6 ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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", &a); scanf("%d", &b); scanf("%d", &c); if (a <= b && b <= c) printf("%d %d %d\n", a, b, c); else if (a >= b && b >= c) printf("%d %d %d\n", c, b, a); else if (a >= c && a <= b) printf("%d %d %d\n", c, a, b); else if (a <= c && c <= b) printf("%d %d %d\n", a, c, b); else if (a >= c && c >= b) printf("%d %d %d\n", b, c, a); else if (c >= a && a >= b) printf("%d %d %d\n", b, a, c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170045/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170045/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 [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %.pre.pre = load i32, ptr %c, align 4, !tbaa !5 %cmp3.not = icmp sgt i32 %1, %.pre.pre %or.cond58 = select i1 %cmp.not, i1 true, i1 %cmp3.not br i1 %or.cond58, label %if.else, label %if.then if.then: ; preds = %entry %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre.pre) br label %if.end38 if.else: ; preds = %entry %cmp5.not = icmp slt i32 %0, %1 %cmp7.not = icmp slt i32 %1, %.pre.pre %or.cond59 = select i1 %cmp5.not, i1 true, i1 %cmp7.not br i1 %or.cond59, label %if.else10, label %if.then8 if.then8: ; preds = %if.else %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.pre, i32 noundef %1, i32 noundef %0) br label %if.end38 if.else10: ; preds = %if.else %cmp11.not = icmp slt i32 %0, %.pre.pre %brmerge = or i1 %cmp.not, %cmp11.not br i1 %brmerge, label %if.else16, label %if.then14 if.then14: ; preds = %if.else10 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.pre, i32 noundef %0, i32 noundef %1) br label %if.end38 if.else16: ; preds = %if.else10 %cmp17.not = icmp sgt i32 %0, %.pre.pre %cmp19.not = icmp sgt i32 %.pre.pre, %1 %or.cond = or i1 %cmp17.not, %cmp19.not br i1 %or.cond, label %if.else22, label %if.then20 if.then20: ; preds = %if.else16 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre.pre, i32 noundef %1) br label %if.end38 if.else22: ; preds = %if.else16 %cmp25.not = icmp slt i32 %.pre.pre, %1 %or.cond56 = or i1 %cmp11.not, %cmp25.not br i1 %or.cond56, label %if.else28, label %if.then26 if.then26: ; preds = %if.else22 %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre.pre, i32 noundef %0) br label %if.end38 if.else28: ; preds = %if.else22 %brmerge57 = or i1 %cmp5.not, %cmp17.not br i1 %brmerge57, label %if.end38, label %if.then32 if.then32: ; preds = %if.else28 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre.pre) br label %if.end38 if.end38: ; preds = %if.else28, %if.then8, %if.then20, %if.then32, %if.then26, %if.then14, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a, b, c; int x, y, z; int j; scanf("%d %d %d", &a, &b, &c); x = a; y = b; z = c; if (x > y){ x = b; y = a; } if (y > z){ j = y; y = z; z = j; } if (x > y){ j = x; x = y; y = j; } printf("%d %d %d\n", x, y, z); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170089/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170089/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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 i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %c, align 4, !tbaa !5 %spec.select = call i32 @llvm.smin.i32(i32 %0, i32 %1) %spec.select23 = call i32 @llvm.smax.i32(i32 %0, i32 %1) %y.1 = call i32 @llvm.smin.i32(i32 %spec.select23, i32 %2) %z.0 = call i32 @llvm.smax.i32(i32 %spec.select23, i32 %2) %cmp4 = icmp slt i32 %2, %spec.select %x.1 = select i1 %cmp4, i32 %y.1, i32 %spec.select %y.2 = select i1 %cmp4, i32 %spec.select, i32 %y.1 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.1, i32 noundef %y.2, i32 noundef %z.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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() { int i, N, M, a[100001], b[100001]; scanf("%d %d", &N, &M); for (i = 1; i <= M; i++) scanf("%d %d", &(a[i]), &(b[i])); int parity[100001] = {}; for (i = 1; i <= M; i++) { parity[a[i]] ^= 1; parity[b[i]] ^= 1; } for (i = 1; i <= N; i++) if (parity[i] == 1) break; if (i <= N) printf("NO\n"); else printf("YES\n"); fflush(stdout); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170139/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170139/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 @stdout = external local_unnamed_addr global ptr, align 8 @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: %N = alloca i32, align 4 %M = alloca i32, align 4 %a = alloca [100001 x i32], align 16 %b = alloca [100001 x i32], align 16 %parity = alloca [100001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #5 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M) %0 = load i32, ptr %M, align 4, !tbaa !5 %cmp.not46 = icmp slt i32 %0, 1 br i1 %cmp.not46, label %for.end.thread, label %for.body for.end.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %parity) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %parity, i8 0, i64 400004, i1 false) br label %for.cond19.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [100001 x i32], ptr %b, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %M, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %parity) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %parity, i8 0, i64 400004, i1 false) %cmp5.not48 = icmp slt i32 %1, 1 br i1 %cmp5.not48, label %for.cond19.preheader, label %for.body6.preheader for.body6.preheader: ; preds = %for.end %3 = zext i32 %1 to i64 %xtraiter = and i64 %3, 1 %4 = icmp eq i32 %1, 1 br i1 %4, label %for.cond19.preheader.loopexit.unr-lcssa, label %for.body6.preheader.new for.body6.preheader.new: ; preds = %for.body6.preheader %unroll_iter = and i64 %3, 4294967294 br label %for.body6 for.cond19.preheader.loopexit.unr-lcssa: ; preds = %for.body6, %for.body6.preheader %indvars.iv54.unr = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next55.1, %for.body6 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond19.preheader, label %for.body6.epil for.body6.epil: ; preds = %for.cond19.preheader.loopexit.unr-lcssa %arrayidx8.epil = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %indvars.iv54.unr %5 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5 %idxprom9.epil = sext i32 %5 to i64 %arrayidx10.epil = getelementptr inbounds [100001 x i32], ptr %parity, i64 0, i64 %idxprom9.epil %6 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5 %xor.epil = xor i32 %6, 1 store i32 %xor.epil, ptr %arrayidx10.epil, align 4, !tbaa !5 %arrayidx12.epil = getelementptr inbounds [100001 x i32], ptr %b, i64 0, i64 %indvars.iv54.unr %7 = load i32, ptr %arrayidx12.epil, align 4, !tbaa !5 %idxprom13.epil = sext i32 %7 to i64 %arrayidx14.epil = getelementptr inbounds [100001 x i32], ptr %parity, i64 0, i64 %idxprom13.epil %8 = load i32, ptr %arrayidx14.epil, align 4, !tbaa !5 %xor15.epil = xor i32 %8, 1 store i32 %xor15.epil, ptr %arrayidx14.epil, align 4, !tbaa !5 br label %for.cond19.preheader for.cond19.preheader: ; preds = %for.body6.epil, %for.cond19.preheader.loopexit.unr-lcssa, %for.end.thread, %for.end %9 = load i32, ptr %N, align 4, !tbaa !5 %cmp20.not50 = icmp slt i32 %9, 1 br i1 %cmp20.not50, label %if.end32, label %for.body21.preheader for.body21.preheader: ; preds = %for.cond19.preheader %10 = add nuw i32 %9, 1 %wide.trip.count60 = zext i32 %10 to i64 br label %for.body21 for.body6: ; preds = %for.body6, %for.body6.preheader.new %indvars.iv54 = phi i64 [ 1, %for.body6.preheader.new ], [ %indvars.iv.next55.1, %for.body6 ] %niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.body6 ] %arrayidx8 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %indvars.iv54 %11 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %idxprom9 = sext i32 %11 to i64 %arrayidx10 = getelementptr inbounds [100001 x i32], ptr %parity, i64 0, i64 %idxprom9 %12 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %xor = xor i32 %12, 1 store i32 %xor, ptr %arrayidx10, align 4, !tbaa !5 %arrayidx12 = getelementptr inbounds [100001 x i32], ptr %b, i64 0, i64 %indvars.iv54 %13 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %idxprom13 = sext i32 %13 to i64 %arrayidx14 = getelementptr inbounds [100001 x i32], ptr %parity, i64 0, i64 %idxprom13 %14 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %xor15 = xor i32 %14, 1 store i32 %xor15, ptr %arrayidx14, align 4, !tbaa !5 %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1 %arrayidx8.1 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %indvars.iv.next55 %15 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %idxprom9.1 = sext i32 %15 to i64 %arrayidx10.1 = getelementptr inbounds [100001 x i32], ptr %parity, i64 0, i64 %idxprom9.1 %16 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %xor.1 = xor i32 %16, 1 store i32 %xor.1, ptr %arrayidx10.1, align 4, !tbaa !5 %arrayidx12.1 = getelementptr inbounds [100001 x i32], ptr %b, i64 0, i64 %indvars.iv.next55 %17 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5 %idxprom13.1 = sext i32 %17 to i64 %arrayidx14.1 = getelementptr inbounds [100001 x i32], ptr %parity, i64 0, i64 %idxprom13.1 %18 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5 %xor15.1 = xor i32 %18, 1 store i32 %xor15.1, ptr %arrayidx14.1, align 4, !tbaa !5 %indvars.iv.next55.1 = add nuw nsw i64 %indvars.iv54, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond19.preheader.loopexit.unr-lcssa, label %for.body6, !llvm.loop !11 for.cond19: ; preds = %for.body21 %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60 br i1 %exitcond61.not, label %if.end32, label %for.body21, !llvm.loop !12 for.body21: ; preds = %for.body21.preheader, %for.cond19 %indvars.iv57 = phi i64 [ 1, %for.body21.preheader ], [ %indvars.iv.next58, %for.cond19 ] %arrayidx23 = getelementptr inbounds [100001 x i32], ptr %parity, i64 0, i64 %indvars.iv57 %19 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %cmp24 = icmp eq i32 %19, 1 br i1 %cmp24, label %if.end32, label %for.cond19 if.end32: ; preds = %for.cond19, %for.body21, %for.cond19.preheader %str.sink = phi ptr [ @str, %for.cond19.preheader ], [ @str.3, %for.body21 ], [ @str, %for.cond19 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %20 = load ptr, ptr @stdout, align 8, !tbaa !13 %call33 = call i32 @fflush(ptr noundef %20) call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %parity) #5 call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @fflush(ptr nocapture noundef) 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 #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 nounwind willreturn memory(argmem: write) } 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 = !{!14, !14, i64 0} !14 = !{!"any pointer", !7, i64 0}
#include <stdio.h> int main(void) { int x[3],y[3],i,p[3],q[3],count=0,j; for(i=0;i<3;i++) { scanf("%d%d",&x[i],&y[i]); } p[0]=x[0]+x[1]-x[2];q[0]=y[0]+y[1]-y[2]; p[1]=x[1]+x[2]-x[0]; q[1]=y[1]+y[2]-y[0]; p[2]=x[0]+x[2]-x[1];q[2]=y[0]+y[2]-y[1]; for(i=0;i<3;i++) { for(j=i+1;j<3;j++) { if(p[i]==p[j] &&q[i]==q[j] ) {p[j]=10000; q[j]=10000; count++; } } } if(count==0) {printf("3\n"); for(i=0;i<3;i++) printf("%d %d\n",p[i],q[i]); } else if(count==1) { printf("2\n"); for(i=0;i<3;i++) {if(p[i]<10000) printf("%d %d\n",p[i],q[i]); } } else {printf("1\n"); printf("%d %d\n",p[0],q[0]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17019/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17019/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.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"1\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"2\00", align 1 @str.6 = private unnamed_addr constant [2 x i8] c"3\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { for.body43.lr.ph: %x = alloca [3 x i32], align 4 %y = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %arrayidx.1 = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 1 %arrayidx2.1 = getelementptr inbounds [3 x i32], ptr %y, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1, ptr noundef nonnull %arrayidx2.1) %arrayidx.2 = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 2 %arrayidx2.2 = getelementptr inbounds [3 x i32], ptr %y, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2, ptr noundef nonnull %arrayidx2.2) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %sub = sub i32 %add, %2 %3 = load i32, ptr %y, align 4, !tbaa !5 %4 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %add9 = add nsw i32 %4, %3 %5 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5 %sub11 = sub i32 %add9, %5 %add21 = sub i32 %4, %3 %sub23 = add i32 %add21, %5 %add27 = sub i32 %0, %1 %sub29 = add i32 %add27, %2 %add33 = sub i32 %3, %4 %sub35 = add i32 %add33, %5 %add15 = sub i32 %1, %0 %sub17 = add i32 %add15, %2 %cmp48 = icmp eq i32 %sub, %sub17 br i1 %cmp48, label %land.lhs.true, label %for.inc59 for.body43.lr.ph.1: ; preds = %if.then.1161, %land.lhs.true.1159, %for.inc59 %q.sroa.13.3 = phi i32 [ 10000, %if.then.1161 ], [ %sub35, %land.lhs.true.1159 ], [ %sub35, %for.inc59 ] %p.sroa.13.3 = phi i32 [ 10000, %if.then.1161 ], [ %sub, %land.lhs.true.1159 ], [ %sub29, %for.inc59 ] %count.2.1162 = phi i32 [ %inc58.1160, %if.then.1161 ], [ %count.2, %land.lhs.true.1159 ], [ %count.2, %for.inc59 ] %cmp48.1 = icmp eq i32 %p.sroa.7.1, %p.sroa.13.3 br i1 %cmp48.1, label %land.lhs.true.1, label %for.cond37.loopexit.2 land.lhs.true.1: ; preds = %for.body43.lr.ph.1 %cmp53.1 = icmp eq i32 %q.sroa.7.1, %q.sroa.13.3 br i1 %cmp53.1, label %if.then.1, label %for.cond37.loopexit.2 if.then.1: ; preds = %land.lhs.true.1 %inc58.1 = add nuw nsw i32 %count.2.1162, 1 br label %for.cond37.loopexit.2 for.cond37.loopexit.2: ; preds = %if.then.1, %land.lhs.true.1, %for.body43.lr.ph.1 %q.sroa.13.1 = phi i32 [ 10000, %if.then.1 ], [ %q.sroa.13.3, %land.lhs.true.1 ], [ %q.sroa.13.3, %for.body43.lr.ph.1 ] %p.sroa.13.1 = phi i32 [ 10000, %if.then.1 ], [ %p.sroa.7.1, %land.lhs.true.1 ], [ %p.sroa.13.3, %for.body43.lr.ph.1 ] %count.2.1 = phi i32 [ %inc58.1, %if.then.1 ], [ %count.2.1162, %land.lhs.true.1 ], [ %count.2.1162, %for.body43.lr.ph.1 ] switch i32 %count.2.1, label %if.else98 [ i32 0, label %if.then66 i32 1, label %if.then80 ] land.lhs.true: ; preds = %for.body43.lr.ph %cmp53 = icmp eq i32 %sub11, %sub23 br i1 %cmp53, label %if.then, label %for.inc59 if.then: ; preds = %land.lhs.true br label %for.inc59 for.inc59: ; preds = %for.body43.lr.ph, %land.lhs.true, %if.then %p.sroa.7.1 = phi i32 [ 10000, %if.then ], [ %sub, %land.lhs.true ], [ %sub17, %for.body43.lr.ph ] %q.sroa.7.1 = phi i32 [ 10000, %if.then ], [ %sub23, %land.lhs.true ], [ %sub23, %for.body43.lr.ph ] %count.2 = phi i32 [ 1, %if.then ], [ 0, %land.lhs.true ], [ 0, %for.body43.lr.ph ] %cmp48.1155 = icmp eq i32 %sub, %sub29 br i1 %cmp48.1155, label %land.lhs.true.1159, label %for.body43.lr.ph.1 land.lhs.true.1159: ; preds = %for.inc59 %cmp53.1158 = icmp eq i32 %sub11, %sub35 br i1 %cmp53.1158, label %if.then.1161, label %for.body43.lr.ph.1 if.then.1161: ; preds = %land.lhs.true.1159 %inc58.1160 = add nuw nsw i32 %count.2, 1 br label %for.body43.lr.ph.1 if.then66: ; preds = %for.cond37.loopexit.2 %puts130 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) %call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub, i32 noundef %sub11) %call75.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %p.sroa.7.1, i32 noundef %q.sroa.7.1) %call75.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %p.sroa.13.1, i32 noundef %q.sroa.13.1) br label %if.end104 if.then80: ; preds = %for.cond37.loopexit.2 %puts129 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) %cmp87 = icmp slt i32 %sub, 10000 br i1 %cmp87, label %if.then88, label %for.inc95 if.then88: ; preds = %if.then80 %call93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub, i32 noundef %sub11) br label %for.inc95 for.inc95: ; preds = %if.then80, %if.then88 %cmp87.1 = icmp slt i32 %p.sroa.7.1, 10000 br i1 %cmp87.1, label %if.then88.1, label %for.inc95.1 if.then88.1: ; preds = %for.inc95 %call93.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %p.sroa.7.1, i32 noundef %q.sroa.7.1) br label %for.inc95.1 for.inc95.1: ; preds = %if.then88.1, %for.inc95 %cmp87.2 = icmp slt i32 %p.sroa.13.1, 10000 br i1 %cmp87.2, label %if.then88.2, label %if.end104 if.then88.2: ; preds = %for.inc95.1 %call93.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %p.sroa.13.1, i32 noundef %q.sroa.13.1) br label %if.end104 if.else98: ; preds = %for.cond37.loopexit.2 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %call102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub, i32 noundef %sub11) br label %if.end104 if.end104: ; preds = %for.inc95.1, %if.then88.2, %if.then66, %if.else98 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
//Date:18-12-16 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<float.h> #include<math.h> #include<ctype.h> #include<limits.h> #include<time.h> #define ll long long #define For(i,n) for(i=0;i<n;i++) #define rep(i ,a ,b) for(i=(a);i<=(b);i++) #define mset(a ,value) memset(a ,value ,sizeof(a)) #define s(a) scanf("%d" ,&a); #define ls(a) scanf("%ld" ,&a) #define reg(i) register int i #define INF 0xfffffffffffffffLL #define MAX 25001 int min(int a,int b){ return (a<b?a:b); } int max(int a,int b){ return (a>b?a:b); } int main(){ int n ,i; s(n); if(n==2) printf("1\n2"); else if(n==3) printf("1\n3"); else{ if(n%2==0){ printf("%d\n" ,n/2); for(i=1;i<=n/2;i++) printf("2 "); }else{ n-=3; printf("%d\n" ,n/2+1); for(i=1;i<=n/2;i++) printf("2 "); printf("3"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17024/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17024/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"1\0A2\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"1\0A3\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.4 = private unnamed_addr constant [3 x i8] c"2 \00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { 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 switch i32 %0, label %if.else5 [ i32 2, label %if.then i32 3, label %if.then3 ] if.then: ; preds = %entry %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) br label %if.end25 if.then3: ; preds = %entry %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end25 if.else5: ; preds = %entry %1 = and i32 %0, 1 %cmp6 = icmp eq i32 %1, 0 br i1 %cmp6, label %if.then7, label %if.else12 if.then7: ; preds = %if.else5 %div = sdiv i32 %0, 2 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %div) %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp10.not33 = icmp slt i32 %2, 2 br i1 %cmp10.not33, label %if.end25, label %for.body for.body: ; preds = %if.then7, %for.body %i.034 = phi i32 [ %inc, %for.body ], [ 1, %if.then7 ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4) %inc = add nuw nsw i32 %i.034, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %div9 = sdiv i32 %3, 2 %cmp10.not.not = icmp slt i32 %i.034, %div9 br i1 %cmp10.not.not, label %for.body, label %if.end25, !llvm.loop !9 if.else12: ; preds = %if.else5 %sub = add nsw i32 %0, -3 store i32 %sub, ptr %n, align 4, !tbaa !5 %div13 = sdiv i32 %sub, 2 %add = add nsw i32 %div13, 1 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add) %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp17.not30 = icmp slt i32 %4, 2 br i1 %cmp17.not30, label %for.end22, label %for.body18 for.body18: ; preds = %if.else12, %for.body18 %i.131 = phi i32 [ %inc21, %for.body18 ], [ 1, %if.else12 ] %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4) %inc21 = add nuw nsw i32 %i.131, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %div16 = sdiv i32 %5, 2 %cmp17.not.not = icmp slt i32 %i.131, %div16 br i1 %cmp17.not.not, label %for.body18, label %for.end22, !llvm.loop !11 for.end22: ; preds = %for.body18, %if.else12 %putchar = call i32 @putchar(i32 51) br label %if.end25 if.end25: ; preds = %for.body, %if.then7, %if.then3, %for.end22, %if.then 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) #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) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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> #include <string.h> #include <math.h> int descending_compare(const void *a, const void *b){ if (*(int*)a > *(int*)b){ return -1; }else if (*(int*)a == *(int*)b){ return 0; }else{ return 1; } } int ascending_compare(const void *a, const void *b){ if (*(int*)a < *(int*)b){ return -1; }else if (*(int*)a == *(int*)b){ return 0; }else{ return 1; } } int lower_bound(int *a, int n, int key){ int left, mid, right; left = 0, right = n; mid = (left + right)/2; while ((left+1 != mid || mid+1 != right) && mid != left){ if (key > a[mid]){ left = mid; }else{ right = mid+1; } mid = (left + right)/2; } if (a[left] >= key)return left; if (a[mid] >= key)return mid; if (a[right] >= key)return right; return n; } //greatest common divisor unsigned long gcd(unsigned long x, unsigned long y){ if (y == 0){ return x; }else if (x > y){ return gcd(y, x % y); }else{ return gcd(x, y % x); } } long long factorial(int x){ long long rtn = 1; int i; for (i = x; i > 1; i--){ rtn = (rtn*i); } return rtn; } int main(void){ long long n, m; long long ans = 0; scanf("%lld %lld", &n, &m); if (m - 2*n >= 0){ m -= 2*n; ans = n; n = 0; }else{ ans = m/2; printf("%lld\n", ans); return 0; } ans += m/4; printf("%lld\n", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170283/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170283/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 [10 x i8] c"%lld %lld\00", align 1 @.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: read) uwtable define dso_local i32 @descending_compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ascending_compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %n, i32 noundef %key) local_unnamed_addr #1 { entry: %mid.050 = sdiv i32 %n, 2 %0 = and i32 %n, -2 %cmp.not51 = icmp eq i32 %0, 2 %add252 = add nsw i32 %mid.050, 1 %cmp3.not53 = icmp eq i32 %add252, %n %or.cond54 = select i1 %cmp.not51, i1 %cmp3.not53, i1 false %n.off = add i32 %n, 1 %cmp4.not55 = icmp ult i32 %n.off, 3 %or.cond4956 = or i1 %cmp4.not55, %or.cond54 br i1 %or.cond4956, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %add260 = phi i32 [ %add2, %while.body ], [ %add252, %entry ] %mid.059 = phi i32 [ %mid.0, %while.body ], [ %mid.050, %entry ] %right.058 = phi i32 [ %right.1, %while.body ], [ %n, %entry ] %left.057 = phi i32 [ %left.1, %while.body ], [ 0, %entry ] %idxprom = sext i32 %mid.059 to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp5 = icmp slt i32 %1, %key %left.1 = select i1 %cmp5, i32 %mid.059, i32 %left.057 %right.1 = select i1 %cmp5, i32 %right.058, i32 %add260 %add7 = add nsw i32 %left.1, %right.1 %mid.0 = sdiv i32 %add7, 2 %add1 = add nsw i32 %left.1, 1 %cmp.not = icmp eq i32 %add1, %mid.0 %add2 = add nsw i32 %mid.0, 1 %cmp3.not = icmp eq i32 %add2, %right.1 %or.cond = select i1 %cmp.not, i1 %cmp3.not, i1 false %cmp4.not = icmp eq i32 %mid.0, %left.1 %or.cond49 = or i1 %cmp4.not, %or.cond br i1 %or.cond49, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %left.0.lcssa = phi i32 [ 0, %entry ], [ %left.1, %while.body ] %right.0.lcssa = phi i32 [ %n, %entry ], [ %right.1, %while.body ] %mid.0.lcssa = phi i32 [ %mid.050, %entry ], [ %mid.0, %while.body ] %idxprom9 = sext i32 %left.0.lcssa to i64 %arrayidx10 = getelementptr inbounds i32, ptr %a, i64 %idxprom9 %2 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11.not = icmp slt i32 %2, %key br i1 %cmp11.not, label %if.end13, label %cleanup if.end13: ; preds = %while.end %idxprom14 = sext i32 %mid.0.lcssa to i64 %arrayidx15 = getelementptr inbounds i32, ptr %a, i64 %idxprom14 %3 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16.not = icmp slt i32 %3, %key br i1 %cmp16.not, label %if.end18, label %cleanup if.end18: ; preds = %if.end13 %idxprom19 = sext i32 %right.0.lcssa to i64 %arrayidx20 = getelementptr inbounds i32, ptr %a, i64 %idxprom19 %4 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21.not = icmp slt i32 %4, %key %n.right.0 = select i1 %cmp21.not, i32 %n, i32 %right.0.lcssa br label %cleanup cleanup: ; preds = %if.end18, %if.end13, %while.end %retval.0 = phi i32 [ %left.0.lcssa, %while.end ], [ %mid.0.lcssa, %if.end13 ], [ %n.right.0, %if.end18 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #3 { entry: %cmp1518 = icmp eq i64 %y, 0 br i1 %cmp1518, label %return, label %if.else.lr.ph if.else.lr.ph: ; preds = %entry, %if.then2 %y.tr.ph20 = phi i64 [ %rem, %if.then2 ], [ %y, %entry ] %x.tr.ph19 = phi i64 [ %y.tr16, %if.then2 ], [ %x, %entry ] br label %if.else if.else: ; preds = %if.else.lr.ph, %if.else3 %y.tr16 = phi i64 [ %y.tr.ph20, %if.else.lr.ph ], [ %rem4, %if.else3 ] %cmp1 = icmp ugt i64 %x.tr.ph19, %y.tr16 br i1 %cmp1, label %if.then2, label %if.else3 if.then2: ; preds = %if.else %rem = urem i64 %x.tr.ph19, %y.tr16 %cmp15 = icmp eq i64 %rem, 0 br i1 %cmp15, label %return, label %if.else.lr.ph if.else3: ; preds = %if.else %rem4 = urem i64 %y.tr16, %x.tr.ph19 %cmp = icmp eq i64 %rem4, 0 br i1 %cmp, label %return, label %if.else return: ; preds = %if.then2, %if.else3, %entry %x.tr.ph.lcssa = phi i64 [ %x, %entry ], [ %x.tr.ph19, %if.else3 ], [ %y.tr16, %if.then2 ] ret i64 %x.tr.ph.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @factorial(i32 noundef %x) local_unnamed_addr #3 { entry: %cmp4 = icmp sgt i32 %x, 1 br i1 %cmp4, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = zext i32 %x 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 ] %rtn.05 = phi i64 [ 1, %for.body.preheader ], [ %mul, %for.body ] %mul = mul nsw i64 %rtn.05, %indvars.iv %indvars.iv.next = add nsw i64 %indvars.iv, -1 %cmp = icmp ugt i64 %indvars.iv, 2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %rtn.0.lcssa = phi i64 [ 1, %entry ], [ %mul, %for.body ] ret i64 %rtn.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %n = alloca i64, align 8 %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i64, ptr %m, align 8, !tbaa !12 %1 = load i64, ptr %n, align 8, !tbaa !12 %mul = shl nsw i64 %1, 1 %sub = sub nsw i64 %0, %mul %cmp = icmp sgt i64 %sub, -1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry store i64 %sub, ptr %m, align 8, !tbaa !12 store i64 0, ptr %n, align 8, !tbaa !12 %div41011 = lshr i64 %sub, 2 %add = add nsw i64 %div41011, %1 br label %cleanup if.else: ; preds = %entry %div = sdiv i64 %0, 2 br label %cleanup cleanup: ; preds = %if.then, %if.else %add.sink = phi i64 [ %add, %if.then ], [ %div, %if.else ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add.sink) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6 ret i32 0 } ; 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 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { 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 #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 = { 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 = !{!"long long", !7, i64 0}
#include <stdio.h> int main(void){ long long n, m, ans = 0; scanf("%lld %lld", &n, &m); if (n >= m/2){ ans = m/2; } else { ans = n; ans += (m-n*2)/4; } printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170326/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170326/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 [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %m, align 8, !tbaa !5 %div = sdiv i64 %1, 2 %cmp.not = icmp slt i64 %0, %div br i1 %cmp.not, label %if.else, label %if.end if.else: ; preds = %entry %mul = shl nsw i64 %0, 1 %sub = sub nsw i64 %1, %mul %div2 = sdiv i64 %sub, 4 %add = add nsw i64 %div2, %0 br label %if.end if.end: ; preds = %entry, %if.else %ans.0 = phi i64 [ %add, %if.else ], [ %div, %entry ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int x,y,x1,y1,x2,y2,x3,y3,k,x4,x5,y4,y5; while(scanf("%d%d",&x1,&y1)==2) { scanf("%d%d%d%d",&x2,&y2,&x3,&y3); x=x1+x2-x3; y=y1+y2-y3; x4=x1+x3-x2; y4=y1+y3-y2; x5=x2+x3-x1; y5=y2+y3-y1; printf("3\n"); printf("%d %d\n%d %d\n%d %d\n",x,y,x4,y4,x5,y5); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17037/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17037/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 [9 x i8] c"%d%d%d%d\00", align 1 @.str.3 = private unnamed_addr constant [19 x i8] c"%d %d\0A%d %d\0A%d %d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"3\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x1 = alloca i32, align 4 %y1 = alloca i32, align 4 %x2 = alloca i32, align 4 %y2 = alloca i32, align 4 %x3 = alloca i32, align 4 %y3 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x3) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y3) #4 %call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1) %cmp20 = icmp eq i32 %call19, 2 br i1 %cmp20, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x2, ptr noundef nonnull %y2, ptr noundef nonnull %x3, ptr noundef nonnull %y3) %0 = load i32, ptr %x1, align 4, !tbaa !5 %1 = load i32, ptr %x2, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %x3, align 4, !tbaa !5 %sub = sub i32 %add, %2 %3 = load i32, ptr %y1, align 4, !tbaa !5 %4 = load i32, ptr %y2, align 4, !tbaa !5 %add2 = add nsw i32 %4, %3 %5 = load i32, ptr %y3, align 4, !tbaa !5 %sub3 = sub i32 %add2, %5 %add4 = sub i32 %0, %1 %sub5 = add i32 %add4, %2 %add6 = sub i32 %3, %4 %sub7 = add i32 %add6, %5 %add8 = sub i32 %1, %0 %sub9 = add i32 %add8, %2 %add10 = sub i32 %4, %3 %sub11 = add i32 %add10, %5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub, i32 noundef %sub3, i32 noundef %sub5, i32 noundef %sub7, i32 noundef %sub9, i32 noundef %sub11) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1) %cmp = icmp eq i32 %call, 2 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y3) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x3) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int A, B, C, D, E, F, S; scanf("%d %d %d %d %d %d", &A, &B, &C, &D, &E, &F); S = A + B + C; if ( S < B + C + D ) S = B + C + D; if ( S < C + D + A ) S = C + D + A; if ( S < D + A + B ) S = D + A + B; if ( E > F ) printf("%d\n", S + E); else printf("%d\n", S + F); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170412/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170412/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 [18 x i8] c"%d %d %d %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: %A = alloca i32, align 4 %B = alloca i32, align 4 %C = alloca i32, align 4 %D = alloca i32, align 4 %E = alloca i32, align 4 %F = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %E) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %F) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D, ptr noundef nonnull %E, ptr noundef nonnull %F) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %add = add i32 %1, %0 %2 = load i32, ptr %C, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %add2 = add nsw i32 %2, %1 %3 = load i32, ptr %D, align 4, !tbaa !5 %add3 = add nsw i32 %add2, %3 %spec.select = call i32 @llvm.smax.i32(i32 %add1, i32 %add3) %add6 = add i32 %2, %0 %add7 = add i32 %add6, %3 %S.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %add7) %add14 = add i32 %add, %3 %S.2 = call i32 @llvm.smax.i32(i32 %S.1, i32 %add14) %4 = load i32, ptr %E, align 4, !tbaa !5 %5 = load i32, ptr %F, align 4, !tbaa !5 %. = call i32 @llvm.smax.i32(i32 %4, i32 %5) %add24 = add nsw i32 %S.2, %. %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add24) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %F) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %E) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 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> #include<string.h> #define P(type,x) fprintf(stdout,"%"#type"\n",x) #define S(type,x) fscanf(stdin,"%"#type,&x) int main() { char s[50]; S(s,s); P(c, s[0] == 'o' ? 'o' : s[strlen(s) - 1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170456/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170456/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [50 x i8], align 16 call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %s) #5 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str, ptr noundef nonnull %s) #5 %1 = load ptr, ptr @stdout, align 8, !tbaa !5 %2 = load i8, ptr %s, align 16, !tbaa !9 %cmp = icmp eq i8 %2, 111 br i1 %cmp, label %cond.end, label %cond.false cond.false: ; preds = %entry %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %sub = add i64 %call2, -1 %arrayidx3 = getelementptr inbounds [50 x i8], ptr %s, i64 0, i64 %sub %3 = load i8, ptr %arrayidx3, align 1, !tbaa !9 %conv4 = sext i8 %3 to i32 br label %cond.end cond.end: ; preds = %entry, %cond.false %cond = phi i32 [ %conv4, %cond.false ], [ 111, %entry ] %call5 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.1, i32 noundef %cond) call void @llvm.lifetime.end.p0(i64 50, 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 declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @fprintf(ptr nocapture noundef, 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 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress 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 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0}
#include <stdio.h> #include <stdlib.h> int n, m; void merge(int *u, int *net, int oldnet, int newnet); int main(int argc, char *argv[]) { int i, s, t, p, q; int *u; int *net; scanf("%d", &n); scanf("%d", &m); u = (int *)malloc(sizeof(int) * n); net = (int *)malloc(sizeof(int) * (m + 1)); for (i = 0; i < n; i++) u[i] = -1; for (i = 0; i <= m; i++) net[i] = 0; p = 1; for (i = 0; i < m; i++) { scanf("%d", &s); scanf("%d", &t); if (s != t) { if (u[s] == -1 && u[t] == -1) { u[s] = p; u[t] = p; net[p] += 2; p++; } else { if (u[s] != -1 && u[t] == -1) { u[t] = u[s]; net[u[s]]++; } else if (u[s] == -1 && u[t] != -1) { u[s] = u[t]; net[u[t]]++; } else { if (u[s] != u[t]) { if (net[u[s]] > net[u[t]]) merge(u, net, u[t], u[s]); else merge(u, net, u[s], u[t]); } } } } } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &s); scanf("%d", &t); if (s == t) printf("yes\n"); else { if (u[s] == u[t] && u[s] != -1 && u[t] != -1) printf("yes\n"); else printf("no\n"); } } return 0; } void merge(int *u, int *net, int oldnet, int newnet) { int i; for (i = 0; i < n; i++) { if (u[i] == oldnet) u[i] = newnet; } net[newnet] += net[oldnet]; net[oldnet] = 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170506/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170506/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 @n = dso_local global i32 0, align 4 @m = dso_local global i32 0, align 4 @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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %t = alloca i32, align 4 %q = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m) %0 = load i32, ptr @n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call2 = tail call noalias ptr @malloc(i64 noundef %mul) #8 %1 = load i32, ptr @m, align 4, !tbaa !5 %add = add i32 %1, 1 %conv3 = sext i32 %add to i64 %mul4 = shl nsw i64 %conv3, 2 %call5 = tail call noalias ptr @malloc(i64 noundef %mul4) #8 %cmp228 = icmp sgt i32 %0, 0 br i1 %cmp228, label %for.body.preheader, label %for.cond7.preheader for.body.preheader: ; preds = %entry %2 = zext i32 %0 to i64 %3 = shl nuw nsw i64 %2, 2 tail call void @llvm.memset.p0.i64(ptr align 4 %call2, i8 -1, i64 %3, i1 false), !tbaa !5 br label %for.cond7.preheader for.cond7.preheader: ; preds = %for.body.preheader, %entry %cmp8.not230 = icmp slt i32 %1, 0 br i1 %cmp8.not230, label %for.end115, label %for.cond16.preheader for.cond16.preheader: ; preds = %for.cond7.preheader %4 = zext i32 %add to i64 %5 = shl nuw nsw i64 %4, 2 tail call void @llvm.memset.p0.i64(ptr align 4 %call5, i8 0, i64 %5, i1 false), !tbaa !5 %cmp17232.not = icmp eq i32 %1, 0 br i1 %cmp17232.not, label %for.end115, label %for.body19 for.body19: ; preds = %for.cond16.preheader, %for.inc113 %i.2234 = phi i32 [ %inc114, %for.inc113 ], [ 0, %for.cond16.preheader ] %p.0233 = phi i32 [ %p.1, %for.inc113 ], [ 1, %for.cond16.preheader ] %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %6 = load i32, ptr %s, align 4, !tbaa !5 %7 = load i32, ptr %t, align 4, !tbaa !5 %cmp22.not = icmp eq i32 %6, %7 br i1 %cmp22.not, label %for.inc113, label %if.then if.then: ; preds = %for.body19 %idxprom24 = sext i32 %6 to i64 %arrayidx25 = getelementptr inbounds i32, ptr %call2, i64 %idxprom24 %8 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %cmp26 = icmp eq i32 %8, -1 %idxprom28 = sext i32 %7 to i64 %arrayidx29 = getelementptr inbounds i32, ptr %call2, i64 %idxprom28 %9 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %cmp30 = icmp eq i32 %9, -1 br i1 %cmp26, label %land.lhs.true, label %land.lhs.true45 land.lhs.true: ; preds = %if.then br i1 %cmp30, label %if.then32, label %if.then70 if.then32: ; preds = %land.lhs.true store i32 %p.0233, ptr %arrayidx25, align 4, !tbaa !5 store i32 %p.0233, ptr %arrayidx29, align 4, !tbaa !5 %idxprom37 = sext i32 %p.0233 to i64 %arrayidx38 = getelementptr inbounds i32, ptr %call5, i64 %idxprom37 %10 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %add39 = add nsw i32 %10, 2 store i32 %add39, ptr %arrayidx38, align 4, !tbaa !5 %inc40 = add nsw i32 %p.0233, 1 br label %for.inc113 land.lhs.true45: ; preds = %if.then br i1 %cmp30, label %if.then50, label %if.else80 if.then50: ; preds = %land.lhs.true45 store i32 %8, ptr %arrayidx29, align 4, !tbaa !5 %11 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %idxprom57 = sext i32 %11 to i64 %arrayidx58 = getelementptr inbounds i32, ptr %call5, i64 %idxprom57 %12 = load i32, ptr %arrayidx58, align 4, !tbaa !5 %inc59 = add nsw i32 %12, 1 store i32 %inc59, ptr %arrayidx58, align 4, !tbaa !5 br label %for.inc113 if.then70: ; preds = %land.lhs.true store i32 %9, ptr %arrayidx25, align 4, !tbaa !5 %13 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %idxprom77 = sext i32 %13 to i64 %arrayidx78 = getelementptr inbounds i32, ptr %call5, i64 %idxprom77 %14 = load i32, ptr %arrayidx78, align 4, !tbaa !5 %inc79 = add nsw i32 %14, 1 store i32 %inc79, ptr %arrayidx78, align 4, !tbaa !5 br label %for.inc113 if.else80: ; preds = %land.lhs.true45 %cmp85.not = icmp eq i32 %8, %9 br i1 %cmp85.not, label %for.inc113, label %if.then87 if.then87: ; preds = %if.else80 %idxprom90 = sext i32 %8 to i64 %arrayidx91 = getelementptr inbounds i32, ptr %call5, i64 %idxprom90 %15 = load i32, ptr %arrayidx91, align 4, !tbaa !5 %idxprom94 = sext i32 %9 to i64 %arrayidx95 = getelementptr inbounds i32, ptr %call5, i64 %idxprom94 %16 = load i32, ptr %arrayidx95, align 4, !tbaa !5 %cmp96 = icmp sgt i32 %15, %16 %17 = load i32, ptr @n, align 4, !tbaa !5 %cmp19.i = icmp sgt i32 %17, 0 br i1 %cmp96, label %if.then98, label %if.else103 if.then98: ; preds = %if.then87 br i1 %cmp19.i, label %for.body.i.preheader, label %merge.exit for.body.i.preheader: ; preds = %if.then98 %18 = zext i32 %17 to i64 %min.iters.check = icmp ult i32 %17, 8 br i1 %min.iters.check, label %for.body.i.preheader287, label %vector.ph vector.ph: ; preds = %for.body.i.preheader %n.vec = and i64 %18, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %9, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %pred.store.continue255, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue255 ] %19 = or i64 %index, 4 %20 = getelementptr inbounds i32, ptr %call2, i64 %index %wide.load = load <4 x i32>, ptr %20, align 4, !tbaa !5 %21 = getelementptr inbounds i32, ptr %20, i64 4 %wide.load241 = load <4 x i32>, ptr %21, align 4, !tbaa !5 %22 = icmp eq <4 x i32> %wide.load, %broadcast.splat %23 = icmp eq <4 x i32> %wide.load241, %broadcast.splat %24 = extractelement <4 x i1> %22, i64 0 br i1 %24, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %25 = getelementptr inbounds i32, ptr %call2, i64 %index store i32 %8, ptr %25, align 4, !tbaa !5 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %26 = extractelement <4 x i1> %22, i64 1 br i1 %26, label %pred.store.if242, label %pred.store.continue243 pred.store.if242: ; preds = %pred.store.continue %27 = or i64 %index, 1 %28 = getelementptr inbounds i32, ptr %call2, i64 %27 store i32 %8, ptr %28, align 4, !tbaa !5 br label %pred.store.continue243 pred.store.continue243: ; preds = %pred.store.if242, %pred.store.continue %29 = extractelement <4 x i1> %22, i64 2 br i1 %29, label %pred.store.if244, label %pred.store.continue245 pred.store.if244: ; preds = %pred.store.continue243 %30 = or i64 %index, 2 %31 = getelementptr inbounds i32, ptr %call2, i64 %30 store i32 %8, ptr %31, align 4, !tbaa !5 br label %pred.store.continue245 pred.store.continue245: ; preds = %pred.store.if244, %pred.store.continue243 %32 = extractelement <4 x i1> %22, i64 3 br i1 %32, label %pred.store.if246, label %pred.store.continue247 pred.store.if246: ; preds = %pred.store.continue245 %33 = or i64 %index, 3 %34 = getelementptr inbounds i32, ptr %call2, i64 %33 store i32 %8, ptr %34, align 4, !tbaa !5 br label %pred.store.continue247 pred.store.continue247: ; preds = %pred.store.if246, %pred.store.continue245 %35 = extractelement <4 x i1> %23, i64 0 br i1 %35, label %pred.store.if248, label %pred.store.continue249 pred.store.if248: ; preds = %pred.store.continue247 %36 = getelementptr inbounds i32, ptr %call2, i64 %19 store i32 %8, ptr %36, align 4, !tbaa !5 br label %pred.store.continue249 pred.store.continue249: ; preds = %pred.store.if248, %pred.store.continue247 %37 = extractelement <4 x i1> %23, i64 1 br i1 %37, label %pred.store.if250, label %pred.store.continue251 pred.store.if250: ; preds = %pred.store.continue249 %38 = or i64 %index, 5 %39 = getelementptr inbounds i32, ptr %call2, i64 %38 store i32 %8, ptr %39, align 4, !tbaa !5 br label %pred.store.continue251 pred.store.continue251: ; preds = %pred.store.if250, %pred.store.continue249 %40 = extractelement <4 x i1> %23, i64 2 br i1 %40, label %pred.store.if252, label %pred.store.continue253 pred.store.if252: ; preds = %pred.store.continue251 %41 = or i64 %index, 6 %42 = getelementptr inbounds i32, ptr %call2, i64 %41 store i32 %8, ptr %42, align 4, !tbaa !5 br label %pred.store.continue253 pred.store.continue253: ; preds = %pred.store.if252, %pred.store.continue251 %43 = extractelement <4 x i1> %23, i64 3 br i1 %43, label %pred.store.if254, label %pred.store.continue255 pred.store.if254: ; preds = %pred.store.continue253 %44 = or i64 %index, 7 %45 = getelementptr inbounds i32, ptr %call2, i64 %44 store i32 %8, ptr %45, align 4, !tbaa !5 br label %pred.store.continue255 pred.store.continue255: ; preds = %pred.store.if254, %pred.store.continue253 %index.next = add nuw i64 %index, 8 %46 = icmp eq i64 %index.next, %n.vec br i1 %46, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %pred.store.continue255 %cmp.n = icmp eq i64 %n.vec, %18 br i1 %cmp.n, label %merge.exit, label %for.body.i.preheader287 for.body.i.preheader287: ; preds = %for.body.i.preheader, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader287, %for.inc.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ %indvars.iv.i.ph, %for.body.i.preheader287 ] %arrayidx.i = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv.i %47 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp1.i = icmp eq i32 %47, %9 br i1 %cmp1.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body.i store i32 %8, ptr %arrayidx.i, align 4, !tbaa !5 br 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 %exitcond239.not = icmp eq i64 %indvars.iv.next.i, %18 br i1 %exitcond239.not, label %merge.exit, label %for.body.i, !llvm.loop !13 merge.exit: ; preds = %for.inc.i, %middle.block, %if.then98 %add.i = add nsw i32 %16, %15 store i32 %add.i, ptr %arrayidx91, align 4, !tbaa !5 store i32 0, ptr %arrayidx95, align 4, !tbaa !5 br label %for.inc113 if.else103: ; preds = %if.then87 br i1 %cmp19.i, label %for.body.i218.preheader, label %merge.exit227 for.body.i218.preheader: ; preds = %if.else103 %48 = zext i32 %17 to i64 %min.iters.check258 = icmp ult i32 %17, 8 br i1 %min.iters.check258, label %for.body.i218.preheader288, label %vector.ph259 vector.ph259: ; preds = %for.body.i218.preheader %n.vec261 = and i64 %48, 4294967288 %broadcast.splatinsert268 = insertelement <4 x i32> poison, i32 %8, i64 0 %broadcast.splat269 = shufflevector <4 x i32> %broadcast.splatinsert268, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body264 vector.body264: ; preds = %pred.store.continue285, %vector.ph259 %index265 = phi i64 [ 0, %vector.ph259 ], [ %index.next286, %pred.store.continue285 ] %49 = or i64 %index265, 4 %50 = getelementptr inbounds i32, ptr %call2, i64 %index265 %wide.load266 = load <4 x i32>, ptr %50, align 4, !tbaa !5 %51 = getelementptr inbounds i32, ptr %50, i64 4 %wide.load267 = load <4 x i32>, ptr %51, align 4, !tbaa !5 %52 = icmp eq <4 x i32> %wide.load266, %broadcast.splat269 %53 = icmp eq <4 x i32> %wide.load267, %broadcast.splat269 %54 = extractelement <4 x i1> %52, i64 0 br i1 %54, label %pred.store.if270, label %pred.store.continue271 pred.store.if270: ; preds = %vector.body264 %55 = getelementptr inbounds i32, ptr %call2, i64 %index265 store i32 %9, ptr %55, align 4, !tbaa !5 br label %pred.store.continue271 pred.store.continue271: ; preds = %pred.store.if270, %vector.body264 %56 = extractelement <4 x i1> %52, i64 1 br i1 %56, label %pred.store.if272, label %pred.store.continue273 pred.store.if272: ; preds = %pred.store.continue271 %57 = or i64 %index265, 1 %58 = getelementptr inbounds i32, ptr %call2, i64 %57 store i32 %9, ptr %58, align 4, !tbaa !5 br label %pred.store.continue273 pred.store.continue273: ; preds = %pred.store.if272, %pred.store.continue271 %59 = extractelement <4 x i1> %52, i64 2 br i1 %59, label %pred.store.if274, label %pred.store.continue275 pred.store.if274: ; preds = %pred.store.continue273 %60 = or i64 %index265, 2 %61 = getelementptr inbounds i32, ptr %call2, i64 %60 store i32 %9, ptr %61, align 4, !tbaa !5 br label %pred.store.continue275 pred.store.continue275: ; preds = %pred.store.if274, %pred.store.continue273 %62 = extractelement <4 x i1> %52, i64 3 br i1 %62, label %pred.store.if276, label %pred.store.continue277 pred.store.if276: ; preds = %pred.store.continue275 %63 = or i64 %index265, 3 %64 = getelementptr inbounds i32, ptr %call2, i64 %63 store i32 %9, ptr %64, align 4, !tbaa !5 br label %pred.store.continue277 pred.store.continue277: ; preds = %pred.store.if276, %pred.store.continue275 %65 = extractelement <4 x i1> %53, i64 0 br i1 %65, label %pred.store.if278, label %pred.store.continue279 pred.store.if278: ; preds = %pred.store.continue277 %66 = getelementptr inbounds i32, ptr %call2, i64 %49 store i32 %9, ptr %66, align 4, !tbaa !5 br label %pred.store.continue279 pred.store.continue279: ; preds = %pred.store.if278, %pred.store.continue277 %67 = extractelement <4 x i1> %53, i64 1 br i1 %67, label %pred.store.if280, label %pred.store.continue281 pred.store.if280: ; preds = %pred.store.continue279 %68 = or i64 %index265, 5 %69 = getelementptr inbounds i32, ptr %call2, i64 %68 store i32 %9, ptr %69, align 4, !tbaa !5 br label %pred.store.continue281 pred.store.continue281: ; preds = %pred.store.if280, %pred.store.continue279 %70 = extractelement <4 x i1> %53, i64 2 br i1 %70, label %pred.store.if282, label %pred.store.continue283 pred.store.if282: ; preds = %pred.store.continue281 %71 = or i64 %index265, 6 %72 = getelementptr inbounds i32, ptr %call2, i64 %71 store i32 %9, ptr %72, align 4, !tbaa !5 br label %pred.store.continue283 pred.store.continue283: ; preds = %pred.store.if282, %pred.store.continue281 %73 = extractelement <4 x i1> %53, i64 3 br i1 %73, label %pred.store.if284, label %pred.store.continue285 pred.store.if284: ; preds = %pred.store.continue283 %74 = or i64 %index265, 7 %75 = getelementptr inbounds i32, ptr %call2, i64 %74 store i32 %9, ptr %75, align 4, !tbaa !5 br label %pred.store.continue285 pred.store.continue285: ; preds = %pred.store.if284, %pred.store.continue283 %index.next286 = add nuw i64 %index265, 8 %76 = icmp eq i64 %index.next286, %n.vec261 br i1 %76, label %middle.block256, label %vector.body264, !llvm.loop !14 middle.block256: ; preds = %pred.store.continue285 %cmp.n263 = icmp eq i64 %n.vec261, %48 br i1 %cmp.n263, label %merge.exit227, label %for.body.i218.preheader288 for.body.i218.preheader288: ; preds = %for.body.i218.preheader, %middle.block256 %indvars.iv.i219.ph = phi i64 [ 0, %for.body.i218.preheader ], [ %n.vec261, %middle.block256 ] br label %for.body.i218 for.body.i218: ; preds = %for.body.i218.preheader288, %for.inc.i222 %indvars.iv.i219 = phi i64 [ %indvars.iv.next.i223, %for.inc.i222 ], [ %indvars.iv.i219.ph, %for.body.i218.preheader288 ] %arrayidx.i220 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv.i219 %77 = load i32, ptr %arrayidx.i220, align 4, !tbaa !5 %cmp1.i221 = icmp eq i32 %77, %8 br i1 %cmp1.i221, label %if.then.i225, label %for.inc.i222 if.then.i225: ; preds = %for.body.i218 store i32 %9, ptr %arrayidx.i220, align 4, !tbaa !5 br label %for.inc.i222 for.inc.i222: ; preds = %if.then.i225, %for.body.i218 %indvars.iv.next.i223 = add nuw nsw i64 %indvars.iv.i219, 1 %exitcond.not = icmp eq i64 %indvars.iv.next.i223, %48 br i1 %exitcond.not, label %merge.exit227, label %for.body.i218, !llvm.loop !15 merge.exit227: ; preds = %for.inc.i222, %middle.block256, %if.else103 %add.i217 = add nsw i32 %16, %15 store i32 %add.i217, ptr %arrayidx95, align 4, !tbaa !5 store i32 0, ptr %arrayidx91, align 4, !tbaa !5 br label %for.inc113 for.inc113: ; preds = %for.body19, %if.then50, %if.else80, %merge.exit227, %merge.exit, %if.then70, %if.then32 %p.1 = phi i32 [ %inc40, %if.then32 ], [ %p.0233, %if.then50 ], [ %p.0233, %if.then70 ], [ %p.0233, %merge.exit ], [ %p.0233, %merge.exit227 ], [ %p.0233, %if.else80 ], [ %p.0233, %for.body19 ] %inc114 = add nuw nsw i32 %i.2234, 1 %78 = load i32, ptr @m, align 4, !tbaa !5 %cmp17 = icmp slt i32 %inc114, %78 br i1 %cmp17, label %for.body19, label %for.end115, !llvm.loop !16 for.end115: ; preds = %for.inc113, %for.cond7.preheader, %for.cond16.preheader %call116 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %79 = load i32, ptr %q, align 4, !tbaa !5 %cmp118235 = icmp sgt i32 %79, 0 br i1 %cmp118235, label %for.body120, label %for.end152 for.body120: ; preds = %for.end115, %for.inc150 %i.3236 = phi i32 [ %inc151, %for.inc150 ], [ 0, %for.end115 ] %call121 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call122 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %80 = load i32, ptr %s, align 4, !tbaa !5 %81 = load i32, ptr %t, align 4, !tbaa !5 %cmp123 = icmp eq i32 %80, %81 br i1 %cmp123, label %for.inc150, label %if.else127 if.else127: ; preds = %for.body120 %idxprom128 = sext i32 %80 to i64 %arrayidx129 = getelementptr inbounds i32, ptr %call2, i64 %idxprom128 %82 = load i32, ptr %arrayidx129, align 4, !tbaa !5 %idxprom130 = sext i32 %81 to i64 %arrayidx131 = getelementptr inbounds i32, ptr %call2, i64 %idxprom130 %83 = load i32, ptr %arrayidx131, align 4, !tbaa !5 %cmp132 = icmp ne i32 %82, %83 %cmp137.not = icmp eq i32 %82, -1 %or.cond = or i1 %cmp137.not, %cmp132 %cmp142.not = icmp eq i32 %83, -1 %or.cond211 = or i1 %cmp142.not, %or.cond %str.str.3 = select i1 %or.cond211, ptr @str, ptr @str.4 br label %for.inc150 for.inc150: ; preds = %if.else127, %for.body120 %str.4.sink = phi ptr [ @str.4, %for.body120 ], [ %str.str.3, %if.else127 ] %puts210 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) %inc151 = add nuw nsw i32 %i.3236, 1 %84 = load i32, ptr %q, align 4, !tbaa !5 %cmp118 = icmp slt i32 %inc151, %84 br i1 %cmp118, label %for.body120, label %for.end152, !llvm.loop !17 for.end152: ; preds = %for.inc150, %for.end115 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @merge(ptr nocapture noundef %u, ptr nocapture noundef %net, i32 noundef %oldnet, i32 noundef %newnet) local_unnamed_addr #4 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp19 = icmp sgt i32 %0, 0 br i1 %cmp19, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %1 = phi i32 [ %3, %for.inc ], [ %0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %u, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %2, %oldnet br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body store i32 %newnet, ptr %arrayidx, align 4, !tbaa !5 %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then %3 = phi i32 [ %1, %for.body ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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 !18 for.end: ; preds = %for.inc, %entry %idxprom4 = sext i32 %oldnet to i64 %arrayidx5 = getelementptr inbounds i32, ptr %net, i64 %idxprom4 %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %idxprom6 = sext i32 %newnet to i64 %arrayidx7 = getelementptr inbounds i32, ptr %net, i64 %idxprom6 %6 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %6, %5 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 store i32 0, ptr %arrayidx5, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 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 norecurse nosync nounwind memory(read, 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 #5 = { nofree nounwind } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nounwind } attributes #8 = { 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, !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, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include<stdio.h> int main() { int x1, x2 , x3, y1, y2, y3; scanf("%d %d", &x1, &y1); scanf("%d %d", &x2, &y2); scanf("%d %d", &x3, &y3); printf("3\n"); int x, y; printf("%d %d\n", x2+x3-x1, y2+y3-y1); printf("%d %d\n", x2+x1-x3, y2+y1-y3); printf("%d %d", x1+x3-x2, y1+y3-y2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17055/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17055/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.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"3\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x1 = alloca i32, align 4 %x2 = alloca i32, align 4 %x3 = alloca i32, align 4 %y1 = alloca i32, align 4 %y2 = alloca i32, align 4 %y3 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x3) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y3) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x2, ptr noundef nonnull %y2) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x3, ptr noundef nonnull %y3) %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %0 = load i32, ptr %x2, align 4, !tbaa !5 %1 = load i32, ptr %x3, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %x1, align 4, !tbaa !5 %sub = sub i32 %add, %2 %3 = load i32, ptr %y2, align 4, !tbaa !5 %4 = load i32, ptr %y3, align 4, !tbaa !5 %add4 = add nsw i32 %4, %3 %5 = load i32, ptr %y1, align 4, !tbaa !5 %sub5 = sub i32 %add4, %5 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub, i32 noundef %sub5) %6 = load i32, ptr %x2, align 4, !tbaa !5 %7 = load i32, ptr %x1, align 4, !tbaa !5 %add7 = add nsw i32 %7, %6 %8 = load i32, ptr %x3, align 4, !tbaa !5 %sub8 = sub i32 %add7, %8 %9 = load i32, ptr %y2, align 4, !tbaa !5 %10 = load i32, ptr %y1, align 4, !tbaa !5 %add9 = add nsw i32 %10, %9 %11 = load i32, ptr %y3, align 4, !tbaa !5 %sub10 = sub i32 %add9, %11 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub8, i32 noundef %sub10) %12 = load i32, ptr %x1, align 4, !tbaa !5 %13 = load i32, ptr %x3, align 4, !tbaa !5 %add12 = add nsw i32 %13, %12 %14 = load i32, ptr %x2, align 4, !tbaa !5 %sub13 = sub i32 %add12, %14 %15 = load i32, ptr %y1, align 4, !tbaa !5 %16 = load i32, ptr %y3, align 4, !tbaa !5 %add14 = add nsw i32 %16, %15 %17 = load i32, ptr %y2, align 4, !tbaa !5 %sub15 = sub i32 %add14, %17 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub13, i32 noundef %sub15) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y3) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x3) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int N, m, q; int vector[100000][100]; int count[100000]; int group[100000]; int ID = 1; void dfs(int s){ int i; group[s]=ID; for(i = 0; i < count[s]; i++ ) { if ( group[vector[s][i]] == 0 ) dfs(vector[s][i]); } } int main(void) { int i, j, a, b; scanf("%d%d", &N, &m); for ( i = 0; i < m; i++ ) { scanf("%d%d", &a, &b); vector[a][count[a]++] = b; vector[b][count[b]++] = a; } for ( i = 0; i < N; i++ ) { if ( group[i] == 0 ) { dfs(i); ID++; } } scanf("%d",&q); for ( i = 0; i < q; i++ ) { scanf("%d%d", &a, &b); if ( group[a] == group[b] ) printf("yes\n"); else printf("no\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170593/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170593/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" @ID = dso_local local_unnamed_addr global i32 1, align 4 @group = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16 @count = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16 @vector = dso_local local_unnamed_addr global [100000 x [100 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @N = dso_local global i32 0, align 4 @m = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @q = dso_local global i32 0, align 4 @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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs(i32 noundef %s) local_unnamed_addr #0 { entry: %0 = load i32, ptr @ID, align 4, !tbaa !5 %idxprom = sext i32 %s to i64 %arrayidx = getelementptr inbounds [100000 x i32], ptr @group, i64 0, i64 %idxprom store i32 %0, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100000 x i32], ptr @count, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp20 = icmp sgt i32 %1, 0 br i1 %cmp20, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %5, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100000 x [100 x i32]], ptr @vector, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %idxprom7 = sext i32 %3 to i64 %arrayidx8 = getelementptr inbounds [100000 x i32], ptr @group, i64 0, i64 %idxprom7 %4 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9 = icmp eq i32 %4, 0 br i1 %cmp9, label %if.then, label %for.inc if.then: ; preds = %for.body tail call void @dfs(i32 noundef %3) %.pre = load i32, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then %5 = phi i32 [ %2, %for.body ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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.inc, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N, ptr noundef nonnull @m) %0 = load i32, ptr @m, align 4, !tbaa !5 %cmp49 = icmp sgt i32 %0, 0 br i1 %cmp49, label %for.body, label %for.cond14.preheader for.cond14.preheader: ; preds = %for.body, %entry %1 = load i32, ptr @N, align 4, !tbaa !5 %cmp1551 = icmp sgt i32 %1, 0 br i1 %cmp1551, label %for.body16, label %for.end23 for.body: ; preds = %entry, %for.body %i.050 = phi i32 [ %inc13, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %2 = load i32, ptr %b, align 4, !tbaa !5 %3 = load i32, ptr %a, align 4, !tbaa !5 %idxprom = sext i32 %3 to i64 %arrayidx3 = getelementptr inbounds [100000 x i32], ptr @count, i64 0, i64 %idxprom %4 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %inc = add nsw i32 %4, 1 store i32 %inc, ptr %arrayidx3, align 4, !tbaa !5 %idxprom4 = sext i32 %4 to i64 %arrayidx5 = getelementptr inbounds [100000 x [100 x i32]], ptr @vector, i64 0, i64 %idxprom, i64 %idxprom4 store i32 %2, ptr %arrayidx5, align 4, !tbaa !5 %idxprom6 = sext i32 %2 to i64 %arrayidx9 = getelementptr inbounds [100000 x i32], ptr @count, i64 0, i64 %idxprom6 %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %inc10 = add nsw i32 %5, 1 store i32 %inc10, ptr %arrayidx9, align 4, !tbaa !5 %idxprom11 = sext i32 %5 to i64 %arrayidx12 = getelementptr inbounds [100000 x [100 x i32]], ptr @vector, i64 0, i64 %idxprom6, i64 %idxprom11 store i32 %3, ptr %arrayidx12, align 4, !tbaa !5 %inc13 = add nuw nsw i32 %i.050, 1 %6 = load i32, ptr @m, align 4, !tbaa !5 %cmp = icmp slt i32 %inc13, %6 br i1 %cmp, label %for.body, label %for.cond14.preheader, !llvm.loop !11 for.body16: ; preds = %for.cond14.preheader, %for.inc21 %7 = phi i32 [ %11, %for.inc21 ], [ %1, %for.cond14.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc21 ], [ 0, %for.cond14.preheader ] %arrayidx18 = getelementptr inbounds [100000 x i32], ptr @group, i64 0, i64 %indvars.iv %8 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %cmp19 = icmp eq i32 %8, 0 br i1 %cmp19, label %if.then, label %for.inc21 if.then: ; preds = %for.body16 %9 = trunc i64 %indvars.iv to i32 call void @dfs(i32 noundef %9) %10 = load i32, ptr @ID, align 4, !tbaa !5 %inc20 = add nsw i32 %10, 1 store i32 %inc20, ptr @ID, align 4, !tbaa !5 %.pre = load i32, ptr @N, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.body16, %if.then %11 = phi i32 [ %7, %for.body16 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %12 = sext i32 %11 to i64 %cmp15 = icmp slt i64 %indvars.iv.next, %12 br i1 %cmp15, label %for.body16, label %for.end23, !llvm.loop !12 for.end23: ; preds = %for.inc21, %for.cond14.preheader %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @q) %13 = load i32, ptr @q, align 4, !tbaa !5 %cmp2653 = icmp sgt i32 %13, 0 br i1 %cmp2653, label %for.body27, label %for.end40 for.body27: ; preds = %for.end23, %for.body27 %i.254 = phi i32 [ %inc39, %for.body27 ], [ 0, %for.end23 ] %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %14 = load i32, ptr %a, align 4, !tbaa !5 %idxprom29 = sext i32 %14 to i64 %arrayidx30 = getelementptr inbounds [100000 x i32], ptr @group, i64 0, i64 %idxprom29 %15 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %16 = load i32, ptr %b, align 4, !tbaa !5 %idxprom31 = sext i32 %16 to i64 %arrayidx32 = getelementptr inbounds [100000 x i32], ptr @group, i64 0, i64 %idxprom31 %17 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %cmp33 = icmp eq i32 %15, %17 %str.4.str = select i1 %cmp33, ptr @str.4, ptr @str %puts48 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) %inc39 = add nuw nsw i32 %i.254, 1 %18 = load i32, ptr @q, align 4, !tbaa !5 %cmp26 = icmp slt i32 %inc39, %18 br i1 %cmp26, label %for.body27, label %for.end40, !llvm.loop !13 for.end40: ; preds = %for.body27, %for.end23 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 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 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 = { 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 a,b,c,m; scanf("%d%d%d",&a,&b,&c); m=a; if(m<b) m=b; if(m<c) m=c; printf("%d\n",a+b+c-m); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170643/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170643/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: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1) %2 = load i32, ptr %c, align 4, !tbaa !5 %m.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %2) %add = add nsw i32 %1, %0 %add4 = add nsw i32 %add, %2 %sub = sub i32 %add4, %m.1 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 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(void){ int a,b,c,min=0; scanf("%d%d%d",&a,&b,&c); min=a+b; if(min>a+c) min=a+c; if(min>b+c) min=b+c; printf("%d",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170700/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170700/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %c, align 4, !tbaa !5 %spec.select = call i32 @llvm.smin.i32(i32 %1, i32 %2) %min.0 = add nsw i32 %spec.select, %0 %add3 = add nsw i32 %2, %1 %min.1 = call i32 @llvm.smin.i32(i32 %min.0, i32 %add3) %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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"}
#include <stdio.h> int main() { int a,b,c,i,ans[3],min; scanf("%d%d%d",&a,&b,&c); ans[0]=a+b; ans[1]=b+c; ans[2]=a+c; min=ans[0]; for(i=0;i<3;i++) if(ans[i]<min) min=ans[i]; printf("%d",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170744/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170744/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %add1 = add nsw i32 %2, %1 %add3 = add nsw i32 %2, %0 %spec.select.1 = call i32 @llvm.smin.i32(i32 %add1, i32 %add) %spec.select.2 = call i32 @llvm.smin.i32(i32 %add3, i32 %spec.select.1) %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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"}
#include <stdio.h> int main() { int a, b, c, ret; scanf("%d %d %d", &a, &b, &c); ret = a + b + c; if (a >= b && a >= c) ret -= a; else if (b >= c && b >= a) ret -= b; else if (c >= a && c >= b) ret -= c; printf("%d\n", ret); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170788/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170788/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 %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 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4 %1 = load i32, ptr %b, align 4 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %cmp.not = icmp slt i32 %0, %1 %cmp2.not = icmp slt i32 %0, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp2.not br i1 %or.cond, label %if.else, label %if.then if.then: ; preds = %entry %sub = sub nsw i32 %add1, %0 br label %if.end15 if.else: ; preds = %entry %cmp3.not = icmp slt i32 %1, %2 %cmp5.not = icmp slt i32 %1, %0 %or.cond22 = or i1 %cmp5.not, %cmp3.not br i1 %or.cond22, label %if.else8, label %if.then6 if.then6: ; preds = %if.else %sub7 = sub nsw i32 %add1, %1 br label %if.end15 if.else8: ; preds = %if.else %cmp9.not = icmp slt i32 %2, %0 %cmp11.not = icmp slt i32 %2, %1 %or.cond23 = or i1 %cmp9.not, %cmp11.not %spec.select = select i1 %or.cond23, i32 %add1, i32 %add br label %if.end15 if.end15: ; preds = %if.else8, %if.then6, %if.then %ret.0 = phi i32 [ %sub, %if.then ], [ %sub7, %if.then6 ], [ %spec.select, %if.else8 ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ret.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); int max = a; if(b > max){ max = b; } if(c > max){ max = c; } printf("%d",a+b+c-max); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170830/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170830/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 %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %0) %2 = load i32, ptr %c, align 4, !tbaa !5 %max.1 = call i32 @llvm.smax.i32(i32 %2, i32 %spec.select) %add = add nsw i32 %1, %0 %add4 = add nsw i32 %add, %2 %sub = sub i32 %add4, %max.1 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 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(void) { int a,b,c; scanf("%d %d %d",&a,&b,&c); if( (a >= b)&&(a >= c) ) { printf("%d\n",b + c); return 0; } if( (b >= a)&&(b >= c) ) { printf("%d\n",a + c); return 0; } if( (c>= a)&&(c >= b) ) printf("%d\n",a + b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170874/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170874/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 %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 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %.pre.pre = load i32, ptr %c, align 4, !tbaa !5 %cmp1.not = icmp slt i32 %0, %.pre.pre %or.cond27 = select i1 %cmp.not, i1 true, i1 %cmp1.not br i1 %or.cond27, label %if.end, label %if.then if.then: ; preds = %entry %add = add nsw i32 %.pre.pre, %1 br label %cleanup.sink.split if.end: ; preds = %entry %cmp3.not = icmp slt i32 %1, %0 %cmp5.not = icmp slt i32 %1, %.pre.pre %or.cond28 = select i1 %cmp3.not, i1 true, i1 %cmp5.not br i1 %or.cond28, label %if.end9, label %if.then6 if.then6: ; preds = %if.end %add7 = add nsw i32 %.pre.pre, %0 br label %cleanup.sink.split if.end9: ; preds = %if.end %cmp10.not = icmp slt i32 %.pre.pre, %0 %cmp12.not = icmp slt i32 %.pre.pre, %1 %or.cond = or i1 %cmp10.not, %cmp12.not br i1 %or.cond, label %cleanup, label %if.then13 if.then13: ; preds = %if.end9 %add14 = add nsw i32 %1, %0 br label %cleanup.sink.split cleanup.sink.split: ; preds = %if.then, %if.then6, %if.then13 %add14.sink = phi i32 [ %add14, %if.then13 ], [ %add7, %if.then6 ], [ %add, %if.then ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add14.sink) br label %cleanup cleanup: ; preds = %cleanup.sink.split, %if.end9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) {int x,y,z,temp; scanf("%d%d%d",&x,&y,&z); if(x<y) { temp=x;x=y;y=temp; } if(x<z) { temp=x;x=z;z=temp; } printf("%d",y+z); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170917/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170917/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 ; 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 %z = 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 %z) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %x, align 4, !tbaa !5 store i32 %0, ptr %y, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %1, %if.then ], [ %0, %entry ] %4 = load i32, ptr %z, align 4, !tbaa !5 %cmp1 = icmp slt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %x, align 4, !tbaa !5 store i32 %3, ptr %z, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %add = add nsw i32 %5, %2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #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"}
// AOJ 0293 Algorithm Exam // 2018.3.10 bal4u #include <stdio.h> #include <stdlib.h> #include <string.h> #define QMAX 3005 typedef struct { int t, s; } QUE; QUE que[QMAX]; int qsize; #define PARENT(i) ((i)>>1) #define LEFT(i) ((i)<<1) #define RIGHT(i) (((i)<<1)+1) void min_heapify(int i) { int l, r, min; QUE qt; l = LEFT(i), r = RIGHT(i); if (l < qsize && que[l].t < que[i].t) min = l; else min = i; if (r < qsize && que[r].t < que[min].t) min = r; if (min != i) { qt = que[i], que[i] = que[min], que[min] = qt; min_heapify(min); } } void deq() { que[0] = que[--qsize]; min_heapify(0); } void enq(int s, int t) { int i, min; QUE qt; i = qsize++; que[i].s = s, que[i].t = t; while (i > 0 && que[min = PARENT(i)].t > que[i].t) { qt = que[i], que[i] = que[min], que[min] = qt; i = min; } } #define INF 0x10101010 #define MAX 110 typedef struct { int to, rev; int cap, cost; } EDGE; EDGE edge[MAX][MAX]; int hi[MAX]; int V; // 頂点数 int potential[MAX], dist[MAX], prevv[MAX], preve[MAX]; void add_edge(int from, int to, int cap, int cost) { int f, t; EDGE *ep; f = hi[from]++, t = hi[to]++; ep = &edge[from][f], ep->to = to, ep->cap = cap, ep->cost = cost, ep->rev = t; ep = &edge[to][t], ep->to = from, ep->cap = 0, ep->cost = -cost, ep->rev = f; } int minCostFlow(int S, int T, int F) { int i, v, nv, t, nt, ret; EDGE *ep; ret = 0; memset(potential, 0, V << 2); while (F > 0) { memset(dist, INF, V << 2); qsize = 0; enq(S, 0), dist[S] = 0; while (qsize) { v = que[0].s, t = que[0].t, deq(); if (dist[v] < t) continue; for (i = 0; i < hi[v]; i++) { ep = &edge[v][i]; if (ep->cap <= 0) continue; nv = ep->to; nt = t + ep->cost - potential[nv] + potential[v]; if(dist[nv] > nt) { dist[nv] = nt; prevv[nv] = v, preve[nv] = i; enq(nv, nt); } } } if (dist[T] == INF) return -1; for (v = 0; v < V; v++) potential[v] += dist[v]; t = F; for (v = T; v != S; v = prevv[v]) { ep = &edge[prevv[v]][preve[v]]; if (t > ep->cap) t = ep->cap; } F -= t; ret += t * potential[T]; for (v = T; v != S; v = prevv[v]) { ep = &edge[prevv[v]][preve[v]]; ep->cap -= t; edge[v][ep->rev].cap += t; } } return ret; } //#define getchar_unlocked() getchar() int in() { int n = 0; int c = getchar_unlocked(); if (c == '-') { c = getchar_unlocked(); do n = 10*n + (c & 0xf), c = getchar_unlocked(); while (c >= '0'); return -n; } do n = 10*n + (c & 0xf), c = getchar_unlocked(); while (c >= '0'); return n; } #define ABS(a) ((a)>=0?(a):-(a)) int N, M, source, sink; int ax[101], ay[101]; int bx[6], by[6], c[6], f[6]; int calc(int s, int mi) { int i, j, x; memset(hi, 0, V << 2); for (i = 0; i < N; i++) add_edge(source, i, 1, 0); for (i = 0; i < M; i++) if ((1<<i) & s) { for (j = 0; j < N; j++) { x = ABS(ax[j]-bx[i]) + ABS(ay[j]-by[i]) - mi; if (x < 0) x = 0; add_edge(j, N+i, 1, x); } add_edge(N+i, sink, c[i], 0); } return minCostFlow(source, sink, N); } int main() { int B, i, s, lim, res, cnt, ans; int lb, mi, ub, t1, t2; while (N = in()) { M = in(), B = in(); for (i = 0; i < N; i++) ax[i] = in(), ay[i] = in(); for (i = 0; i < M; i++) bx[i] = in(), by[i] = in(), c[i] = in(), f[i] = in(); source = N + M, sink = source + 1, V = sink + 1; ans = INF, lim = 1 << M; for (s = 0; s < lim; s++) { res = 0, cnt = 0; for (i = 0; i < M; i++) if ((1<<i) & s) res += f[i], cnt++; lb = 0, ub = 4001; while (1) { if (lb + 1 >= ub) { res += calc(s, lb) + lb*B*cnt; if (ans > res) ans = res; break; } mi = (lb + ub) >> 1; if ((t1 = calc(s, mi ) + mi*B*cnt) < 0) break; if ((t2 = calc(s, mi-1) + (mi-1)*B*cnt) < 0) break; if (t1 < t2) lb = mi; else ub = mi; } } printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170968/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170968/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.QUE = type { i32, i32 } %struct.EDGE = type { i32, i32, i32, i32 } %struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] } @qsize = dso_local local_unnamed_addr global i32 0, align 4 @que = dso_local local_unnamed_addr global [3005 x %struct.QUE] zeroinitializer, align 16 @hi = dso_local local_unnamed_addr global [110 x i32] zeroinitializer, align 16 @edge = dso_local local_unnamed_addr global [110 x [110 x %struct.EDGE]] zeroinitializer, align 16 @potential = dso_local local_unnamed_addr global [110 x i32] zeroinitializer, align 16 @V = dso_local local_unnamed_addr global i32 0, align 4 @dist = dso_local local_unnamed_addr global [110 x i32] zeroinitializer, align 16 @prevv = dso_local local_unnamed_addr global [110 x i32] zeroinitializer, align 16 @preve = dso_local local_unnamed_addr global [110 x i32] zeroinitializer, align 16 @N = dso_local local_unnamed_addr global i32 0, align 4 @source = dso_local local_unnamed_addr global i32 0, align 4 @M = dso_local local_unnamed_addr global i32 0, align 4 @ax = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @bx = dso_local local_unnamed_addr global [6 x i32] zeroinitializer, align 16 @ay = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @by = dso_local local_unnamed_addr global [6 x i32] zeroinitializer, align 16 @sink = dso_local local_unnamed_addr global i32 0, align 4 @c = dso_local local_unnamed_addr global [6 x i32] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [6 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @min_heapify(i32 noundef %i) local_unnamed_addr #0 { entry: %0 = load i32, ptr @qsize, align 4, !tbaa !5 br label %tailrecurse tailrecurse: ; preds = %if.then18, %entry %i.tr = phi i32 [ %i, %entry ], [ %min.1, %if.then18 ] %shl = shl i32 %i.tr, 1 %add = or i32 %shl, 1 %cmp = icmp slt i32 %shl, %0 br i1 %cmp, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %tailrecurse %idxprom = sext i32 %shl to i64 %arrayidx = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 16, !tbaa !9 %idxprom2 = sext i32 %i.tr to i64 %arrayidx3 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2 %2 = load i32, ptr %arrayidx3, align 8, !tbaa !9 %cmp5 = icmp slt i32 %1, %2 br i1 %cmp5, label %if.end, label %if.else if.else: ; preds = %land.lhs.true, %tailrecurse br label %if.end if.end: ; preds = %land.lhs.true, %if.else %min.0 = phi i32 [ %i.tr, %if.else ], [ %shl, %land.lhs.true ] %cmp6 = icmp slt i32 %add, %0 br i1 %cmp6, label %land.lhs.true7, label %if.end16 land.lhs.true7: ; preds = %if.end %idxprom8 = sext i32 %add to i64 %arrayidx9 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8 %3 = load i32, ptr %arrayidx9, align 8, !tbaa !9 %idxprom11 = sext i32 %min.0 to i64 %arrayidx12 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11 %4 = load i32, ptr %arrayidx12, align 8, !tbaa !9 %cmp14 = icmp slt i32 %3, %4 %spec.select = select i1 %cmp14, i32 %add, i32 %min.0 br label %if.end16 if.end16: ; preds = %land.lhs.true7, %if.end %min.1 = phi i32 [ %min.0, %if.end ], [ %spec.select, %land.lhs.true7 ] %cmp17.not = icmp eq i32 %min.1, %i.tr br i1 %cmp17.not, label %if.end27, label %if.then18 if.then18: ; preds = %if.end16 %idxprom19 = sext i32 %i.tr to i64 %arrayidx20 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19 %5 = load i64, ptr %arrayidx20, align 8 %idxprom23 = sext i32 %min.1 to i64 %arrayidx24 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23 %6 = load i64, ptr %arrayidx24, align 8 store i64 %6, ptr %arrayidx20, align 8 store i64 %5, ptr %arrayidx24, align 8 br label %tailrecurse if.end27: ; preds = %if.end16 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @deq() local_unnamed_addr #0 { entry: %0 = load i32, ptr @qsize, align 4, !tbaa !5 %dec = add nsw i32 %0, -1 store i32 %dec, ptr @qsize, align 4, !tbaa !5 %idxprom = sext i32 %dec to i64 %arrayidx = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8 store i64 %1, ptr @que, align 16 %2 = trunc i64 %1 to i32 br label %tailrecurse.i tailrecurse.i: ; preds = %if.then18.i, %entry %i.tr.i = phi i32 [ 0, %entry ], [ %min.1.i, %if.then18.i ] %shl.i = shl i32 %i.tr.i, 1 %add.i = or i32 %shl.i, 1 %cmp.i = icmp slt i32 %shl.i, %dec br i1 %cmp.i, label %land.lhs.true.i, label %if.else.i land.lhs.true.i: ; preds = %tailrecurse.i %idxprom.i = sext i32 %shl.i to i64 %arrayidx.i = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i %3 = load i32, ptr %arrayidx.i, align 16, !tbaa !9 %cmp5.i = icmp slt i32 %3, %2 br i1 %cmp5.i, label %if.end.i, label %if.else.i if.else.i: ; preds = %land.lhs.true.i, %tailrecurse.i br label %if.end.i if.end.i: ; preds = %if.else.i, %land.lhs.true.i %min.0.i = phi i32 [ %i.tr.i, %if.else.i ], [ %shl.i, %land.lhs.true.i ] %cmp6.i = icmp slt i32 %add.i, %dec br i1 %cmp6.i, label %land.lhs.true7.i, label %if.end16.i land.lhs.true7.i: ; preds = %if.end.i %idxprom8.i = sext i32 %add.i to i64 %arrayidx9.i = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i %4 = load i32, ptr %arrayidx9.i, align 8, !tbaa !9 %idxprom11.i = sext i32 %min.0.i to i64 %arrayidx12.i = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11.i %5 = load i32, ptr %arrayidx12.i, align 8, !tbaa !9 %cmp14.i = icmp slt i32 %4, %5 %spec.select.i = select i1 %cmp14.i, i32 %add.i, i32 %min.0.i br label %if.end16.i if.end16.i: ; preds = %land.lhs.true7.i, %if.end.i %min.1.i = phi i32 [ %min.0.i, %if.end.i ], [ %spec.select.i, %land.lhs.true7.i ] %cmp17.not.i = icmp eq i32 %min.1.i, %i.tr.i br i1 %cmp17.not.i, label %min_heapify.exit, label %if.then18.i if.then18.i: ; preds = %if.end16.i %idxprom19.i = sext i32 %i.tr.i to i64 %arrayidx20.i = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19.i %idxprom23.i = sext i32 %min.1.i to i64 %arrayidx24.i = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23.i %6 = load i64, ptr %arrayidx24.i, align 8 store i64 %6, ptr %arrayidx20.i, align 8 store i64 %1, ptr %arrayidx24.i, align 8 br label %tailrecurse.i min_heapify.exit: ; preds = %if.end16.i ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @enq(i32 noundef %s, i32 noundef %t) local_unnamed_addr #0 { entry: %0 = load i32, ptr @qsize, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @qsize, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom %s1 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 1 store i32 %s, ptr %s1, align 4, !tbaa !11 store i32 %t, ptr %arrayidx, align 8, !tbaa !9 %cmp28 = icmp sgt i32 %0, 0 br i1 %cmp28, label %land.rhs.preheader, label %while.end land.rhs.preheader: ; preds = %entry %idxprom8.phi.trans.insert = zext i32 %0 to i64 %arrayidx9.phi.trans.insert = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.phi.trans.insert %.pre = load i32, ptr %arrayidx9.phi.trans.insert, align 8, !tbaa !9 br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %1 = phi i32 [ %5, %while.body ], [ %.pre, %land.rhs.preheader ] %i.029 = phi i32 [ %shr, %while.body ], [ %0, %land.rhs.preheader ] %shr = lshr i32 %i.029, 1 %idxprom5 = zext i32 %shr to i64 %arrayidx6 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5 %2 = load i32, ptr %arrayidx6, align 8, !tbaa !9 %cmp11 = icmp sgt i32 %2, %1 br i1 %cmp11, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom8 = zext i32 %i.029 to i64 %arrayidx9 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8 %3 = load i64, ptr %arrayidx9, align 8 %4 = load i64, ptr %arrayidx6, align 8 store i64 %4, ptr %arrayidx9, align 8 store i64 %3, ptr %arrayidx6, align 8 %cmp.not = icmp ult i32 %i.029, 2 %5 = trunc i64 %3 to i32 br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !12 while.end: ; preds = %land.rhs, %while.body, %entry ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @add_edge(i32 noundef %from, i32 noundef %to, i32 noundef %cap, i32 noundef %cost) local_unnamed_addr #1 { entry: %idxprom = sext i32 %from to i64 %arrayidx = getelementptr inbounds [110 x i32], ptr @hi, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 %idxprom1 = sext i32 %to to i64 %arrayidx2 = getelementptr inbounds [110 x i32], ptr @hi, i64 0, i64 %idxprom1 %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %inc3 = add nsw i32 %1, 1 store i32 %inc3, ptr %arrayidx2, align 4, !tbaa !5 %idxprom6 = sext i32 %0 to i64 %arrayidx7 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom, i64 %idxprom6 store i32 %to, ptr %arrayidx7, align 16, !tbaa !14 %cap9 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom, i64 %idxprom6, i32 2 store i32 %cap, ptr %cap9, align 8, !tbaa !16 %cost10 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom, i64 %idxprom6, i32 3 store i32 %cost, ptr %cost10, align 4, !tbaa !17 %rev = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom, i64 %idxprom6, i32 1 store i32 %1, ptr %rev, align 4, !tbaa !18 %idxprom13 = sext i32 %1 to i64 %arrayidx14 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1, i64 %idxprom13 store i32 %from, ptr %arrayidx14, align 16, !tbaa !14 %cap16 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1, i64 %idxprom13, i32 2 store i32 0, ptr %cap16, align 8, !tbaa !16 %sub = sub nsw i32 0, %cost %cost17 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1, i64 %idxprom13, i32 3 store i32 %sub, ptr %cost17, align 4, !tbaa !17 %rev18 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1, i64 %idxprom13, i32 1 store i32 %0, ptr %rev18, align 4, !tbaa !18 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @minCostFlow(i32 noundef %S, i32 noundef %T, i32 noundef %F) local_unnamed_addr #2 { entry: %0 = load i32, ptr @V, align 4, !tbaa !5 %shl = shl i32 %0, 2 %conv = sext i32 %shl to i64 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @potential, i8 0, i64 %conv, i1 false) %idxprom39 = sext i32 %T to i64 %arrayidx40 = getelementptr inbounds [110 x i32], ptr @dist, i64 0, i64 %idxprom39 %cmp206 = icmp sgt i32 %F, 0 br i1 %cmp206, label %enq.exit.lr.ph, label %cleanup enq.exit.lr.ph: ; preds = %entry %idxprom = sext i32 %S to i64 %arrayidx = getelementptr inbounds [110 x i32], ptr @dist, i64 0, i64 %idxprom %cmp46199 = icmp sgt i32 %0, 0 %cmp58.not201 = icmp eq i32 %T, %S %arrayidx81 = getelementptr inbounds [110 x i32], ptr @potential, i64 0, i64 %idxprom39 %wide.trip.count218 = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %0, 8 %n.vec = and i64 %wide.trip.count218, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count218 br label %while.body5.preheader while.cond.loopexit: ; preds = %for.body86, %for.end78 %cmp = icmp sgt i32 %sub79, 0 br i1 %cmp, label %while.body5.preheader, label %cleanup.sink.split, !llvm.loop !19 while.body5.preheader: ; preds = %while.cond.loopexit, %enq.exit.lr.ph %ret.0208 = phi i32 [ 0, %enq.exit.lr.ph ], [ %add82, %while.cond.loopexit ] %F.addr.0207 = phi i32 [ %F, %enq.exit.lr.ph ], [ %sub79, %while.cond.loopexit ] tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @dist, i8 16, i64 %conv, i1 false) store i32 %S, ptr getelementptr inbounds ([3005 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 4, !tbaa !11 store i32 0, ptr @que, align 16, !tbaa !9 store i32 0, ptr %arrayidx, align 4, !tbaa !5 br label %while.body5 while.body5: ; preds = %while.body5.preheader, %while.cond4.backedge %qsize.promoted191195 = phi i32 [ %inc.i165196, %while.cond4.backedge ], [ 1, %while.body5.preheader ] %1 = load i32, ptr getelementptr inbounds ([3005 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 4, !tbaa !11 %2 = load i32, ptr @que, align 16, !tbaa !9 %dec.i = add nsw i32 %qsize.promoted191195, -1 %idxprom.i163 = sext i32 %dec.i to i64 %arrayidx.i164 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i163 %3 = load i64, ptr %arrayidx.i164, align 8 store i64 %3, ptr @que, align 16 %4 = trunc i64 %3 to i32 br label %tailrecurse.i.i tailrecurse.i.i: ; preds = %if.then18.i.i, %while.body5 %i.tr.i.i = phi i32 [ 0, %while.body5 ], [ %min.1.i.i, %if.then18.i.i ] %shl.i.i = shl i32 %i.tr.i.i, 1 %add.i.i = or i32 %shl.i.i, 1 %cmp.i.i = icmp slt i32 %shl.i.i, %dec.i br i1 %cmp.i.i, label %land.lhs.true.i.i, label %if.else.i.i land.lhs.true.i.i: ; preds = %tailrecurse.i.i %idxprom.i.i = sext i32 %shl.i.i to i64 %arrayidx.i.i = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i.i %5 = load i32, ptr %arrayidx.i.i, align 16, !tbaa !9 %cmp5.i.i = icmp slt i32 %5, %4 br i1 %cmp5.i.i, label %if.end.i.i, label %if.else.i.i if.else.i.i: ; preds = %land.lhs.true.i.i, %tailrecurse.i.i br label %if.end.i.i if.end.i.i: ; preds = %if.else.i.i, %land.lhs.true.i.i %min.0.i.i = phi i32 [ %i.tr.i.i, %if.else.i.i ], [ %shl.i.i, %land.lhs.true.i.i ] %cmp6.i.i = icmp slt i32 %add.i.i, %dec.i br i1 %cmp6.i.i, label %land.lhs.true7.i.i, label %if.end16.i.i land.lhs.true7.i.i: ; preds = %if.end.i.i %idxprom8.i.i = sext i32 %add.i.i to i64 %arrayidx9.i.i = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i.i %6 = load i32, ptr %arrayidx9.i.i, align 8, !tbaa !9 %idxprom11.i.i = sext i32 %min.0.i.i to i64 %arrayidx12.i.i = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11.i.i %7 = load i32, ptr %arrayidx12.i.i, align 8, !tbaa !9 %cmp14.i.i = icmp slt i32 %6, %7 %spec.select.i.i = select i1 %cmp14.i.i, i32 %add.i.i, i32 %min.0.i.i br label %if.end16.i.i if.end16.i.i: ; preds = %land.lhs.true7.i.i, %if.end.i.i %min.1.i.i = phi i32 [ %min.0.i.i, %if.end.i.i ], [ %spec.select.i.i, %land.lhs.true7.i.i ] %cmp17.not.i.i = icmp eq i32 %min.1.i.i, %i.tr.i.i br i1 %cmp17.not.i.i, label %deq.exit, label %if.then18.i.i if.then18.i.i: ; preds = %if.end16.i.i %idxprom19.i.i = sext i32 %i.tr.i.i to i64 %arrayidx20.i.i = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19.i.i %idxprom23.i.i = sext i32 %min.1.i.i to i64 %arrayidx24.i.i = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23.i.i %8 = load i64, ptr %arrayidx24.i.i, align 8 store i64 %8, ptr %arrayidx20.i.i, align 8 store i64 %3, ptr %arrayidx24.i.i, align 8 br label %tailrecurse.i.i deq.exit: ; preds = %if.end16.i.i %idxprom6 = sext i32 %1 to i64 %arrayidx7 = getelementptr inbounds [110 x i32], ptr @dist, i64 0, i64 %idxprom6 %9 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8 = icmp slt i32 %9, %2 br i1 %cmp8, label %while.cond4.backedge, label %for.cond.preheader while.cond4.backedge: ; preds = %for.inc, %for.cond.preheader, %deq.exit %inc.i165196 = phi i32 [ %dec.i, %deq.exit ], [ %dec.i, %for.cond.preheader ], [ %inc.i165185, %for.inc ] %tobool.not = icmp eq i32 %inc.i165196, 0 br i1 %tobool.not, label %while.end, label %while.body5, !llvm.loop !20 for.cond.preheader: ; preds = %deq.exit %arrayidx11 = getelementptr inbounds [110 x i32], ptr @hi, i64 0, i64 %idxprom6 %10 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12187 = icmp sgt i32 %10, 0 br i1 %cmp12187, label %for.body.lr.ph, label %while.cond4.backedge, !llvm.loop !20 for.body.lr.ph: ; preds = %for.cond.preheader %arrayidx25 = getelementptr inbounds [110 x i32], ptr @potential, i64 0, i64 %idxprom6 %wide.trip.count = zext i32 %10 to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ] %inc.i165186188 = phi i32 [ %dec.i, %for.body.lr.ph ], [ %inc.i165185, %for.inc ] %cap = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom6, i64 %indvars.iv, i32 2 %11 = load i32, ptr %cap, align 8, !tbaa !16 %cmp18 = icmp slt i32 %11, 1 br i1 %cmp18, label %for.inc, label %if.end21 if.end21: ; preds = %for.body %arrayidx17 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom6, i64 %indvars.iv %12 = load i32, ptr %arrayidx17, align 16, !tbaa !14 %cost = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom6, i64 %indvars.iv, i32 3 %13 = load i32, ptr %cost, align 4, !tbaa !17 %add = add nsw i32 %13, %2 %idxprom22 = sext i32 %12 to i64 %arrayidx23 = getelementptr inbounds [110 x i32], ptr @potential, i64 0, i64 %idxprom22 %14 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %sub = sub i32 %add, %14 %15 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %add26 = add nsw i32 %sub, %15 %arrayidx28 = getelementptr inbounds [110 x i32], ptr @dist, i64 0, i64 %idxprom22 %16 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29 = icmp sgt i32 %16, %add26 br i1 %cmp29, label %if.then31, label %for.inc if.then31: ; preds = %if.end21 store i32 %add26, ptr %arrayidx28, align 4, !tbaa !5 %arrayidx35 = getelementptr inbounds [110 x i32], ptr @prevv, i64 0, i64 %idxprom22 store i32 %1, ptr %arrayidx35, align 4, !tbaa !5 %arrayidx37 = getelementptr inbounds [110 x i32], ptr @preve, i64 0, i64 %idxprom22 %17 = trunc i64 %indvars.iv to i32 store i32 %17, ptr %arrayidx37, align 4, !tbaa !5 %inc.i165 = add nsw i32 %inc.i165186188, 1 %idxprom.i166 = sext i32 %inc.i165186188 to i64 %arrayidx.i167 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i166 %s1.i168 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i166, i32 1 store i32 %12, ptr %s1.i168, align 4, !tbaa !11 store i32 %add26, ptr %arrayidx.i167, align 8, !tbaa !9 %cmp28.i169 = icmp sgt i32 %inc.i165186188, 0 br i1 %cmp28.i169, label %land.rhs.preheader.i170, label %for.inc land.rhs.preheader.i170: ; preds = %if.then31 %idxprom8.phi.trans.insert.i171 = zext i32 %inc.i165186188 to i64 %arrayidx9.phi.trans.insert.i172 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.phi.trans.insert.i171 %.pre.i173 = load i32, ptr %arrayidx9.phi.trans.insert.i172, align 8, !tbaa !9 br label %land.rhs.i174 land.rhs.i174: ; preds = %while.body.i180, %land.rhs.preheader.i170 %18 = phi i32 [ %22, %while.body.i180 ], [ %.pre.i173, %land.rhs.preheader.i170 ] %i.029.i175 = phi i32 [ %shr.i176, %while.body.i180 ], [ %inc.i165186188, %land.rhs.preheader.i170 ] %shr.i176 = lshr i32 %i.029.i175, 1 %idxprom5.i177 = zext i32 %shr.i176 to i64 %arrayidx6.i178 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5.i177 %19 = load i32, ptr %arrayidx6.i178, align 8, !tbaa !9 %cmp11.i179 = icmp sgt i32 %19, %18 br i1 %cmp11.i179, label %while.body.i180, label %for.inc while.body.i180: ; preds = %land.rhs.i174 %idxprom8.i181 = zext i32 %i.029.i175 to i64 %arrayidx9.i182 = getelementptr inbounds [3005 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i181 %20 = load i64, ptr %arrayidx9.i182, align 8 %21 = load i64, ptr %arrayidx6.i178, align 8 store i64 %21, ptr %arrayidx9.i182, align 8 store i64 %20, ptr %arrayidx6.i178, align 8 %cmp.not.i183 = icmp ult i32 %i.029.i175, 2 %22 = trunc i64 %20 to i32 br i1 %cmp.not.i183, label %for.inc, label %land.rhs.i174, !llvm.loop !12 for.inc: ; preds = %while.body.i180, %land.rhs.i174, %if.then31, %if.end21, %for.body %inc.i165185 = phi i32 [ %inc.i165, %if.then31 ], [ %inc.i165186188, %if.end21 ], [ %inc.i165186188, %for.body ], [ %inc.i165, %land.rhs.i174 ], [ %inc.i165, %while.body.i180 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %while.cond4.backedge, label %for.body, !llvm.loop !21 while.end: ; preds = %while.cond4.backedge %23 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp41 = icmp eq i32 %23, 269488144 br i1 %cmp41, label %cleanup.sink.split, label %for.cond45.preheader for.cond45.preheader: ; preds = %while.end br i1 %cmp46199, label %for.body48.preheader, label %for.cond57.preheader for.body48.preheader: ; preds = %for.cond45.preheader br i1 %min.iters.check, label %for.body48.preheader239, label %vector.body vector.body: ; preds = %for.body48.preheader, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.body48.preheader ] %24 = getelementptr inbounds [110 x i32], ptr @dist, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %24, align 16, !tbaa !5 %25 = getelementptr inbounds i32, ptr %24, i64 4 %wide.load236 = load <4 x i32>, ptr %25, align 16, !tbaa !5 %26 = getelementptr inbounds [110 x i32], ptr @potential, i64 0, i64 %index %wide.load237 = load <4 x i32>, ptr %26, align 16, !tbaa !5 %27 = getelementptr inbounds i32, ptr %26, i64 4 %wide.load238 = load <4 x i32>, ptr %27, align 16, !tbaa !5 %28 = add nsw <4 x i32> %wide.load237, %wide.load %29 = add nsw <4 x i32> %wide.load238, %wide.load236 store <4 x i32> %28, ptr %26, align 16, !tbaa !5 store <4 x i32> %29, ptr %27, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %30 = icmp eq i64 %index.next, %n.vec br i1 %30, label %middle.block, label %vector.body, !llvm.loop !22 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond57.preheader, label %for.body48.preheader239 for.body48.preheader239: ; preds = %for.body48.preheader, %middle.block %indvars.iv215.ph = phi i64 [ 0, %for.body48.preheader ], [ %n.vec, %middle.block ] br label %for.body48 for.cond57.preheader: ; preds = %for.body48, %middle.block, %for.cond45.preheader br i1 %cmp58.not201, label %while.cond.loopexit.thread, label %for.body60 while.cond.loopexit.thread: ; preds = %for.cond57.preheader %31 = load i32, ptr %arrayidx81, align 4, !tbaa !5 %mul222 = mul nsw i32 %31, %F.addr.0207 %add82223 = add nsw i32 %mul222, %ret.0208 br label %cleanup.sink.split for.body48: ; preds = %for.body48.preheader239, %for.body48 %indvars.iv215 = phi i64 [ %indvars.iv.next216, %for.body48 ], [ %indvars.iv215.ph, %for.body48.preheader239 ] %arrayidx50 = getelementptr inbounds [110 x i32], ptr @dist, i64 0, i64 %indvars.iv215 %32 = load i32, ptr %arrayidx50, align 4, !tbaa !5 %arrayidx52 = getelementptr inbounds [110 x i32], ptr @potential, i64 0, i64 %indvars.iv215 %33 = load i32, ptr %arrayidx52, align 4, !tbaa !5 %add53 = add nsw i32 %33, %32 store i32 %add53, ptr %arrayidx52, align 4, !tbaa !5 %indvars.iv.next216 = add nuw nsw i64 %indvars.iv215, 1 %exitcond219.not = icmp eq i64 %indvars.iv.next216, %wide.trip.count218 br i1 %exitcond219.not, label %for.cond57.preheader, label %for.body48, !llvm.loop !25 for.body60: ; preds = %for.cond57.preheader, %for.body60 %t.0203 = phi i32 [ %spec.select, %for.body60 ], [ %F.addr.0207, %for.cond57.preheader ] %v.1202 = phi i32 [ %34, %for.body60 ], [ %T, %for.cond57.preheader ] %idxprom61 = sext i32 %v.1202 to i64 %arrayidx62 = getelementptr inbounds [110 x i32], ptr @prevv, i64 0, i64 %idxprom61 %34 = load i32, ptr %arrayidx62, align 4, !tbaa !5 %idxprom63 = sext i32 %34 to i64 %arrayidx66 = getelementptr inbounds [110 x i32], ptr @preve, i64 0, i64 %idxprom61 %35 = load i32, ptr %arrayidx66, align 4, !tbaa !5 %idxprom67 = sext i32 %35 to i64 %cap69 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom63, i64 %idxprom67, i32 2 %36 = load i32, ptr %cap69, align 8, !tbaa !16 %spec.select = tail call i32 @llvm.smin.i32(i32 %t.0203, i32 %36) %cmp58.not = icmp eq i32 %34, %S br i1 %cmp58.not, label %for.end78, label %for.body60, !llvm.loop !26 for.end78: ; preds = %for.body60 %sub79 = sub nsw i32 %F.addr.0207, %spec.select %37 = load i32, ptr %arrayidx81, align 4, !tbaa !5 %mul = mul nsw i32 %37, %spec.select %add82 = add nsw i32 %mul, %ret.0208 br i1 %cmp58.not201, label %while.cond.loopexit, label %for.body86 for.body86: ; preds = %for.end78, %for.body86 %v.2205 = phi i32 [ %38, %for.body86 ], [ %T, %for.end78 ] %idxprom87 = sext i32 %v.2205 to i64 %arrayidx88 = getelementptr inbounds [110 x i32], ptr @prevv, i64 0, i64 %idxprom87 %38 = load i32, ptr %arrayidx88, align 4, !tbaa !5 %idxprom89 = sext i32 %38 to i64 %arrayidx92 = getelementptr inbounds [110 x i32], ptr @preve, i64 0, i64 %idxprom87 %39 = load i32, ptr %arrayidx92, align 4, !tbaa !5 %idxprom93 = sext i32 %39 to i64 %cap95 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom89, i64 %idxprom93, i32 2 %40 = load i32, ptr %cap95, align 8, !tbaa !16 %sub96 = sub nsw i32 %40, %spec.select store i32 %sub96, ptr %cap95, align 8, !tbaa !16 %rev = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom89, i64 %idxprom93, i32 1 %41 = load i32, ptr %rev, align 4, !tbaa !18 %idxprom99 = sext i32 %41 to i64 %cap101 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom87, i64 %idxprom99, i32 2 %42 = load i32, ptr %cap101, align 8, !tbaa !16 %add102 = add nsw i32 %42, %spec.select store i32 %add102, ptr %cap101, align 8, !tbaa !16 %cmp84.not = icmp eq i32 %38, %S br i1 %cmp84.not, label %while.cond.loopexit, label %for.body86, !llvm.loop !27 cleanup.sink.split: ; preds = %while.end, %while.cond.loopexit, %while.cond.loopexit.thread %retval.0.ph = phi i32 [ %add82223, %while.cond.loopexit.thread ], [ %add82, %while.cond.loopexit ], [ -1, %while.end ] store i32 0, ptr @qsize, align 4, !tbaa !5 br label %cleanup cleanup: ; preds = %cleanup.sink.split, %entry %retval.0 = phi i32 [ 0, %entry ], [ %retval.0.ph, %cleanup.sink.split ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nounwind uwtable define dso_local i32 @in() local_unnamed_addr #4 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !28 %_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 !30 %_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 !34 %cmp.not.i = icmp ult ptr %1, %2 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !35 cond.true.i: ; preds = %entry %call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #9 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 !30 %3 = load i8, ptr %1, align 1, !tbaa !36 %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 ] %cmp = icmp eq i32 %cond.i, 45 %4 = load ptr, ptr @stdin, align 8, !tbaa !28 br i1 %cmp, label %if.then, label %do.body4 if.then: ; preds = %getchar_unlocked.exit %_IO_read_ptr.i20 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i20, align 8, !tbaa !30 %_IO_read_end.i21 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i21, align 8, !tbaa !34 %cmp.not.i22 = icmp ult ptr %5, %6 br i1 %cmp.not.i22, label %cond.false.i26, label %cond.true.i23, !prof !35 cond.true.i23: ; preds = %if.then %call.i24 = tail call i32 @__uflow(ptr noundef nonnull %4) #9 %.pre52.pre = load ptr, ptr @stdin, align 8, !tbaa !28 br label %do.body.preheader cond.false.i26: ; preds = %if.then %incdec.ptr.i27 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i27, ptr %_IO_read_ptr.i20, align 8, !tbaa !30 %7 = load i8, ptr %5, align 1, !tbaa !36 %conv3.i28 = zext i8 %7 to i32 br label %do.body.preheader do.body.preheader: ; preds = %cond.true.i23, %cond.false.i26 %.ph = phi ptr [ %4, %cond.false.i26 ], [ %.pre52.pre, %cond.true.i23 ] %c.0.ph = phi i32 [ %conv3.i28, %cond.false.i26 ], [ %call.i24, %cond.true.i23 ] br label %do.body do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit39 %8 = phi ptr [ %12, %getchar_unlocked.exit39 ], [ %.ph, %do.body.preheader ] %n.0 = phi i32 [ %add, %getchar_unlocked.exit39 ], [ 0, %do.body.preheader ] %c.0 = phi i32 [ %cond.i35, %getchar_unlocked.exit39 ], [ %c.0.ph, %do.body.preheader ] %mul = mul nsw i32 %n.0, 10 %and = and i32 %c.0, 15 %add = add nsw i32 %and, %mul %_IO_read_ptr.i30 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 1 %9 = load ptr, ptr %_IO_read_ptr.i30, align 8, !tbaa !30 %_IO_read_end.i31 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 2 %10 = load ptr, ptr %_IO_read_end.i31, align 8, !tbaa !34 %cmp.not.i32 = icmp ult ptr %9, %10 br i1 %cmp.not.i32, label %cond.false.i36, label %cond.true.i33, !prof !35 cond.true.i33: ; preds = %do.body %call.i34 = tail call i32 @__uflow(ptr noundef nonnull %8) #9 %.pre51 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit39 cond.false.i36: ; preds = %do.body %incdec.ptr.i37 = getelementptr inbounds i8, ptr %9, i64 1 store ptr %incdec.ptr.i37, ptr %_IO_read_ptr.i30, align 8, !tbaa !30 %11 = load i8, ptr %9, align 1, !tbaa !36 %conv3.i38 = zext i8 %11 to i32 br label %getchar_unlocked.exit39 getchar_unlocked.exit39: ; preds = %cond.true.i33, %cond.false.i36 %12 = phi ptr [ %.pre51, %cond.true.i33 ], [ %8, %cond.false.i36 ] %cond.i35 = phi i32 [ %call.i34, %cond.true.i33 ], [ %conv3.i38, %cond.false.i36 ] %cmp3 = icmp sgt i32 %cond.i35, 47 br i1 %cmp3, label %do.body, label %do.end, !llvm.loop !37 do.end: ; preds = %getchar_unlocked.exit39 %sub = sub nsw i32 0, %add br label %cleanup do.body4: ; preds = %getchar_unlocked.exit, %getchar_unlocked.exit49 %13 = phi ptr [ %17, %getchar_unlocked.exit49 ], [ %4, %getchar_unlocked.exit ] %n.1 = phi i32 [ %add7, %getchar_unlocked.exit49 ], [ 0, %getchar_unlocked.exit ] %c.1 = phi i32 [ %cond.i45, %getchar_unlocked.exit49 ], [ %cond.i, %getchar_unlocked.exit ] %mul5 = mul nsw i32 %n.1, 10 %and6 = and i32 %c.1, 15 %add7 = add nsw i32 %and6, %mul5 %_IO_read_ptr.i40 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1 %14 = load ptr, ptr %_IO_read_ptr.i40, align 8, !tbaa !30 %_IO_read_end.i41 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2 %15 = load ptr, ptr %_IO_read_end.i41, align 8, !tbaa !34 %cmp.not.i42 = icmp ult ptr %14, %15 br i1 %cmp.not.i42, label %cond.false.i46, label %cond.true.i43, !prof !35 cond.true.i43: ; preds = %do.body4 %call.i44 = tail call i32 @__uflow(ptr noundef nonnull %13) #9 %.pre = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit49 cond.false.i46: ; preds = %do.body4 %incdec.ptr.i47 = getelementptr inbounds i8, ptr %14, i64 1 store ptr %incdec.ptr.i47, ptr %_IO_read_ptr.i40, align 8, !tbaa !30 %16 = load i8, ptr %14, align 1, !tbaa !36 %conv3.i48 = zext i8 %16 to i32 br label %getchar_unlocked.exit49 getchar_unlocked.exit49: ; preds = %cond.true.i43, %cond.false.i46 %17 = phi ptr [ %.pre, %cond.true.i43 ], [ %13, %cond.false.i46 ] %cond.i45 = phi i32 [ %call.i44, %cond.true.i43 ], [ %conv3.i48, %cond.false.i46 ] %cmp10 = icmp sgt i32 %cond.i45, 47 br i1 %cmp10, label %do.body4, label %cleanup, !llvm.loop !38 cleanup: ; preds = %getchar_unlocked.exit49, %do.end %retval.0 = phi i32 [ %sub, %do.end ], [ %add7, %getchar_unlocked.exit49 ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @calc(i32 noundef %s, i32 noundef %mi) local_unnamed_addr #5 { entry: %0 = load i32, ptr @V, align 4, !tbaa !5 %shl = shl i32 %0, 2 %conv = sext i32 %shl to i64 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @hi, i8 0, i64 %conv, i1 false) %1 = load i32, ptr @N, align 4, !tbaa !5 %.fr = freeze i32 %1 %cmp118 = icmp sgt i32 %.fr, 0 br i1 %cmp118, label %for.body.lr.ph, label %for.cond2.preheader.thread for.body.lr.ph: ; preds = %entry %2 = load i32, ptr @source, align 4, !tbaa !5 %idxprom.i = sext i32 %2 to i64 %arrayidx.i = getelementptr inbounds [110 x i32], ptr @hi, i64 0, i64 %idxprom.i %wide.trip.count = zext i32 %.fr to i64 br label %for.body for.cond2.preheader: ; preds = %for.body %3 = load i32, ptr @M, align 4, !tbaa !5 %cmp3122 = icmp sgt i32 %3, 0 %.pre = load i32, ptr @sink, align 4 br i1 %cmp3122, label %for.body5.lr.ph, label %for.end62 for.cond2.preheader.thread: ; preds = %entry %4 = load i32, ptr @M, align 4, !tbaa !5 %cmp3122144 = icmp sgt i32 %4, 0 %.pre145 = load i32, ptr @sink, align 4 br i1 %cmp3122144, label %for.body5.lr.ph.thread, label %for.end62 for.body5.lr.ph.thread: ; preds = %for.cond2.preheader.thread %idxprom1.i105149 = sext i32 %.pre145 to i64 %arrayidx2.i106150 = getelementptr inbounds [110 x i32], ptr @hi, i64 0, i64 %idxprom1.i105149 br label %for.body5.preheader for.body5.lr.ph: ; preds = %for.cond2.preheader %idxprom1.i105 = sext i32 %.pre to i64 %arrayidx2.i106 = getelementptr inbounds [110 x i32], ptr @hi, i64 0, i64 %idxprom1.i105 br i1 %cmp118, label %for.body5.us.preheader, label %for.body5.preheader for.body5.preheader: ; preds = %for.body5.lr.ph.thread, %for.body5.lr.ph %arrayidx2.i106153 = phi ptr [ %arrayidx2.i106150, %for.body5.lr.ph.thread ], [ %arrayidx2.i106, %for.body5.lr.ph ] %idxprom1.i105152 = phi i64 [ %idxprom1.i105149, %for.body5.lr.ph.thread ], [ %idxprom1.i105, %for.body5.lr.ph ] %5 = phi i32 [ %4, %for.body5.lr.ph.thread ], [ %3, %for.body5.lr.ph ] %.pre146151 = phi i32 [ %.pre145, %for.body5.lr.ph.thread ], [ %.pre, %for.body5.lr.ph ] %6 = sext i32 %.fr to i64 %wide.trip.count130 = zext i32 %5 to i64 br label %for.body5 for.body5.us.preheader: ; preds = %for.body5.lr.ph %7 = zext i32 %.fr to i64 %wide.trip.count142 = zext i32 %3 to i64 %wide.trip.count135 = zext i32 %.fr to i64 br label %for.body5.us for.body5.us: ; preds = %for.body5.us.preheader, %for.inc60.us %indvars.iv137 = phi i64 [ 0, %for.body5.us.preheader ], [ %indvars.iv.next138, %for.inc60.us ] %8 = trunc i64 %indvars.iv137 to i32 %shl6.us = shl nuw i32 1, %8 %and.us = and i32 %shl6.us, %s %tobool.not.us = icmp eq i32 %and.us, 0 br i1 %tobool.not.us, label %for.inc60.us, label %for.cond7.preheader.us for.body10.us: ; preds = %for.cond7.preheader.us, %for.body10.us %indvars.iv132 = phi i64 [ 0, %for.cond7.preheader.us ], [ %indvars.iv.next133, %for.body10.us ] %arrayidx.us = getelementptr inbounds [101 x i32], ptr @ax, i64 0, i64 %indvars.iv132 %9 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 %sub.us = sub nsw i32 %9, %14 %cond.us = tail call i32 @llvm.abs.i32(i32 %sub.us, i1 true) %arrayidx27.us = getelementptr inbounds [101 x i32], ptr @ay, i64 0, i64 %indvars.iv132 %10 = load i32, ptr %arrayidx27.us, align 4, !tbaa !5 %sub30.us = sub nsw i32 %10, %15 %cond47.us = tail call i32 @llvm.abs.i32(i32 %sub30.us, i1 true) %add.us = sub i32 %cond.us, %mi %sub48.us = add i32 %add.us, %cond47.us %spec.store.select.us = tail call i32 @llvm.smax.i32(i32 %sub48.us, i32 0) %arrayidx.i87.us = getelementptr inbounds [110 x i32], ptr @hi, i64 0, i64 %indvars.iv132 %11 = load i32, ptr %arrayidx.i87.us, align 4, !tbaa !5 %inc.i88.us = add nsw i32 %11, 1 store i32 %inc.i88.us, ptr %arrayidx.i87.us, align 4, !tbaa !5 %12 = load i32, ptr %arrayidx2.i90.us, align 4, !tbaa !5 %inc3.i91.us = add nsw i32 %12, 1 store i32 %inc3.i91.us, ptr %arrayidx2.i90.us, align 4, !tbaa !5 %idxprom6.i92.us = sext i32 %11 to i64 %arrayidx7.i93.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv132, i64 %idxprom6.i92.us store i32 %17, ptr %arrayidx7.i93.us, align 16, !tbaa !14 %cap9.i94.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv132, i64 %idxprom6.i92.us, i32 2 store i32 1, ptr %cap9.i94.us, align 8, !tbaa !16 %cost10.i95.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv132, i64 %idxprom6.i92.us, i32 3 store i32 %spec.store.select.us, ptr %cost10.i95.us, align 4, !tbaa !17 %rev.i96.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv132, i64 %idxprom6.i92.us, i32 1 store i32 %12, ptr %rev.i96.us, align 4, !tbaa !18 %idxprom13.i97.us = sext i32 %12 to i64 %arrayidx14.i98.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %16, i64 %idxprom13.i97.us %13 = trunc i64 %indvars.iv132 to i32 store i32 %13, ptr %arrayidx14.i98.us, align 16, !tbaa !14 %cap16.i99.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %16, i64 %idxprom13.i97.us, i32 2 store i32 0, ptr %cap16.i99.us, align 8, !tbaa !16 %sub.i.us = sub nsw i32 0, %spec.store.select.us %cost17.i100.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %16, i64 %idxprom13.i97.us, i32 3 store i32 %sub.i.us, ptr %cost17.i100.us, align 4, !tbaa !17 %rev18.i101.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %16, i64 %idxprom13.i97.us, i32 1 store i32 %11, ptr %rev18.i101.us, align 4, !tbaa !18 %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1 %exitcond136.not = icmp eq i64 %indvars.iv.next133, %wide.trip.count135 br i1 %exitcond136.not, label %for.cond7.for.end55_crit_edge.us, label %for.body10.us, !llvm.loop !39 for.inc60.us: ; preds = %for.cond7.for.end55_crit_edge.us, %for.body5.us %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1 %exitcond143.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count142 br i1 %exitcond143.not, label %for.end62, label %for.body5.us, !llvm.loop !40 for.cond7.preheader.us: ; preds = %for.body5.us %arrayidx12.us = getelementptr inbounds [6 x i32], ptr @bx, i64 0, i64 %indvars.iv137 %14 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %arrayidx29.us = getelementptr inbounds [6 x i32], ptr @by, i64 0, i64 %indvars.iv137 %15 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %16 = add nuw nsw i64 %indvars.iv137, %7 %arrayidx2.i90.us = getelementptr inbounds [110 x i32], ptr @hi, i64 0, i64 %16 %17 = trunc i64 %16 to i32 br label %for.body10.us for.cond7.for.end55_crit_edge.us: ; preds = %for.body10.us %arrayidx58.us = getelementptr inbounds [6 x i32], ptr @c, i64 0, i64 %indvars.iv137 %18 = load i32, ptr %arrayidx58.us, align 4, !tbaa !5 %inc.i104.us = add nsw i32 %12, 2 store i32 %inc.i104.us, ptr %arrayidx2.i90.us, align 4, !tbaa !5 %19 = load i32, ptr %arrayidx2.i106, align 4, !tbaa !5 %inc3.i107.us = add nsw i32 %19, 1 store i32 %inc3.i107.us, ptr %arrayidx2.i106, align 4, !tbaa !5 %idxprom6.i108.us = sext i32 %inc3.i91.us to i64 %arrayidx7.i109.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %16, i64 %idxprom6.i108.us store i32 %.pre, ptr %arrayidx7.i109.us, align 16, !tbaa !14 %cap9.i110.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %16, i64 %idxprom6.i108.us, i32 2 store i32 %18, ptr %cap9.i110.us, align 8, !tbaa !16 %cost10.i111.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %16, i64 %idxprom6.i108.us, i32 3 store i32 0, ptr %cost10.i111.us, align 4, !tbaa !17 %rev.i112.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %16, i64 %idxprom6.i108.us, i32 1 store i32 %19, ptr %rev.i112.us, align 4, !tbaa !18 %idxprom13.i113.us = sext i32 %19 to i64 %arrayidx14.i114.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i105, i64 %idxprom13.i113.us store i32 %17, ptr %arrayidx14.i114.us, align 16, !tbaa !14 %cap16.i115.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i105, i64 %idxprom13.i113.us, i32 2 store i32 0, ptr %cap16.i115.us, align 8, !tbaa !16 %cost17.i116.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i105, i64 %idxprom13.i113.us, i32 3 store i32 0, ptr %cost17.i116.us, align 4, !tbaa !17 %rev18.i117.us = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i105, i64 %idxprom13.i113.us, i32 1 store i32 %inc3.i91.us, ptr %rev18.i117.us, align 4, !tbaa !18 br label %for.inc60.us for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %20 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %inc.i = add nsw i32 %20, 1 store i32 %inc.i, ptr %arrayidx.i, align 4, !tbaa !5 %arrayidx2.i = getelementptr inbounds [110 x i32], ptr @hi, i64 0, i64 %indvars.iv %21 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %inc3.i = add nsw i32 %21, 1 store i32 %inc3.i, ptr %arrayidx2.i, align 4, !tbaa !5 %idxprom6.i = sext i32 %20 to i64 %arrayidx7.i = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom.i, i64 %idxprom6.i %22 = trunc i64 %indvars.iv to i32 store i32 %22, ptr %arrayidx7.i, align 16, !tbaa !14 %cap9.i = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom.i, i64 %idxprom6.i, i32 2 store i32 1, ptr %cap9.i, align 8, !tbaa !16 %cost10.i = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom.i, i64 %idxprom6.i, i32 3 store i32 0, ptr %cost10.i, align 4, !tbaa !17 %rev.i = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom.i, i64 %idxprom6.i, i32 1 store i32 %21, ptr %rev.i, align 4, !tbaa !18 %idxprom13.i = sext i32 %21 to i64 %arrayidx14.i = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv, i64 %idxprom13.i store i32 %2, ptr %arrayidx14.i, align 16, !tbaa !14 %cap16.i = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv, i64 %idxprom13.i, i32 2 store i32 0, ptr %cap16.i, align 8, !tbaa !16 %cost17.i = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv, i64 %idxprom13.i, i32 3 store i32 0, ptr %cost17.i, align 4, !tbaa !17 %rev18.i = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv, i64 %idxprom13.i, i32 1 store i32 %20, ptr %rev18.i, align 4, !tbaa !18 %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.cond2.preheader, label %for.body, !llvm.loop !41 for.body5: ; preds = %for.body5.preheader, %for.inc60 %indvars.iv126 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next127, %for.inc60 ] %23 = trunc i64 %indvars.iv126 to i32 %shl6 = shl nuw i32 1, %23 %and = and i32 %shl6, %s %tobool.not = icmp eq i32 %and, 0 br i1 %tobool.not, label %for.inc60, label %for.cond7.preheader for.cond7.preheader: ; preds = %for.body5 %24 = add nsw i64 %indvars.iv126, %6 %arrayidx58 = getelementptr inbounds [6 x i32], ptr @c, i64 0, i64 %indvars.iv126 %25 = load i32, ptr %arrayidx58, align 4, !tbaa !5 %arrayidx.i103 = getelementptr inbounds [110 x i32], ptr @hi, i64 0, i64 %24 %26 = load i32, ptr %arrayidx.i103, align 4, !tbaa !5 %inc.i104 = add nsw i32 %26, 1 store i32 %inc.i104, ptr %arrayidx.i103, align 4, !tbaa !5 %27 = load i32, ptr %arrayidx2.i106153, align 4, !tbaa !5 %inc3.i107 = add nsw i32 %27, 1 store i32 %inc3.i107, ptr %arrayidx2.i106153, align 4, !tbaa !5 %idxprom6.i108 = sext i32 %26 to i64 %arrayidx7.i109 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %24, i64 %idxprom6.i108 store i32 %.pre146151, ptr %arrayidx7.i109, align 16, !tbaa !14 %cap9.i110 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %24, i64 %idxprom6.i108, i32 2 store i32 %25, ptr %cap9.i110, align 8, !tbaa !16 %cost10.i111 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %24, i64 %idxprom6.i108, i32 3 store i32 0, ptr %cost10.i111, align 4, !tbaa !17 %rev.i112 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %24, i64 %idxprom6.i108, i32 1 store i32 %27, ptr %rev.i112, align 4, !tbaa !18 %idxprom13.i113 = sext i32 %27 to i64 %arrayidx14.i114 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i105152, i64 %idxprom13.i113 %28 = trunc i64 %24 to i32 store i32 %28, ptr %arrayidx14.i114, align 16, !tbaa !14 %cap16.i115 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i105152, i64 %idxprom13.i113, i32 2 store i32 0, ptr %cap16.i115, align 8, !tbaa !16 %cost17.i116 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i105152, i64 %idxprom13.i113, i32 3 store i32 0, ptr %cost17.i116, align 4, !tbaa !17 %rev18.i117 = getelementptr inbounds [110 x [110 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i105152, i64 %idxprom13.i113, i32 1 store i32 %26, ptr %rev18.i117, align 4, !tbaa !18 br label %for.inc60 for.inc60: ; preds = %for.body5, %for.cond7.preheader %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1 %exitcond131.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count130 br i1 %exitcond131.not, label %for.end62, label %for.body5, !llvm.loop !40 for.end62: ; preds = %for.inc60, %for.inc60.us, %for.cond2.preheader.thread, %for.cond2.preheader %.pre147 = phi i32 [ %.pre145, %for.cond2.preheader.thread ], [ %.pre, %for.cond2.preheader ], [ %.pre, %for.inc60.us ], [ %.pre146151, %for.inc60 ] %29 = load i32, ptr @source, align 4, !tbaa !5 %call = tail call i32 @minCostFlow(i32 noundef %29, i32 noundef %.pre147, i32 noundef %.fr) ret i32 %call } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %call453 = tail call i32 @in() store i32 %call453, ptr @N, align 4, !tbaa !5 %tobool.not454 = icmp eq i32 %call453, 0 br i1 %tobool.not454, label %while.end78, label %while.body while.body: ; preds = %entry, %for.end76 %call1 = tail call i32 @in() store i32 %call1, ptr @M, align 4, !tbaa !5 %call2 = tail call i32 @in() %0 = load i32, ptr @N, align 4, !tbaa !5 %cmp436 = icmp sgt i32 %0, 0 br i1 %cmp436, label %for.body.preheader, label %for.cond7.preheader for.body.preheader: ; preds = %while.body %.pre = load ptr, ptr @stdin, align 8, !tbaa !28 br label %for.body for.cond7.preheader: ; preds = %in.exit178, %while.body %1 = phi i32 [ %0, %while.body ], [ %52, %in.exit178 ] %2 = load i32, ptr @M, align 4, !tbaa !5 %cmp8438 = icmp sgt i32 %2, 0 br i1 %cmp8438, label %for.body9.preheader, label %for.end24 for.body9.preheader: ; preds = %for.cond7.preheader %.pre466 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %for.body9 for.body: ; preds = %for.body.preheader, %in.exit178 %3 = phi ptr [ %.pre, %for.body.preheader ], [ %50, %in.exit178 ] %4 = phi ptr [ %.pre, %for.body.preheader ], [ %51, %in.exit178 ] %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %in.exit178 ] %_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !30 %_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !34 %cmp.not.i.i = icmp ult ptr %5, %6 br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !35 cond.true.i.i: ; preds = %for.body %call.i.i = tail call i32 @__uflow(ptr noundef nonnull %4) #9 %.pre464 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit.i cond.false.i.i: ; preds = %for.body %incdec.ptr.i.i = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !30 %7 = load i8, ptr %5, align 1, !tbaa !36 %conv3.i.i = zext i8 %7 to i32 br label %getchar_unlocked.exit.i getchar_unlocked.exit.i: ; preds = %cond.false.i.i, %cond.true.i.i %8 = phi ptr [ %.pre464, %cond.true.i.i ], [ %3, %cond.false.i.i ] %9 = phi ptr [ %.pre464, %cond.true.i.i ], [ %4, %cond.false.i.i ] %cond.i.i = phi i32 [ %call.i.i, %cond.true.i.i ], [ %conv3.i.i, %cond.false.i.i ] %cmp.i = icmp eq i32 %cond.i.i, 45 br i1 %cmp.i, label %if.then.i, label %do.body4.i if.then.i: ; preds = %getchar_unlocked.exit.i %_IO_read_ptr.i20.i = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 1 %10 = load ptr, ptr %_IO_read_ptr.i20.i, align 8, !tbaa !30 %_IO_read_end.i21.i = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 2 %11 = load ptr, ptr %_IO_read_end.i21.i, align 8, !tbaa !34 %cmp.not.i22.i = icmp ult ptr %10, %11 br i1 %cmp.not.i22.i, label %cond.false.i26.i, label %cond.true.i23.i, !prof !35 cond.true.i23.i: ; preds = %if.then.i %call.i24.i = tail call i32 @__uflow(ptr noundef nonnull %9) #9 %.pre52.pre.i = load ptr, ptr @stdin, align 8, !tbaa !28 br label %do.body.i.preheader cond.false.i26.i: ; preds = %if.then.i %incdec.ptr.i27.i = getelementptr inbounds i8, ptr %10, i64 1 store ptr %incdec.ptr.i27.i, ptr %_IO_read_ptr.i20.i, align 8, !tbaa !30 %12 = load i8, ptr %10, align 1, !tbaa !36 %conv3.i28.i = zext i8 %12 to i32 br label %do.body.i.preheader do.body.i.preheader: ; preds = %cond.false.i26.i, %cond.true.i23.i %.ph533 = phi ptr [ %8, %cond.false.i26.i ], [ %.pre52.pre.i, %cond.true.i23.i ] %.ph534 = phi ptr [ %9, %cond.false.i26.i ], [ %.pre52.pre.i, %cond.true.i23.i ] %c.0.i.ph = phi i32 [ %conv3.i28.i, %cond.false.i26.i ], [ %call.i24.i, %cond.true.i23.i ] br label %do.body.i do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit39.i %13 = phi ptr [ %18, %getchar_unlocked.exit39.i ], [ %.ph533, %do.body.i.preheader ] %14 = phi ptr [ %19, %getchar_unlocked.exit39.i ], [ %.ph534, %do.body.i.preheader ] %n.0.i = phi i32 [ %add.i, %getchar_unlocked.exit39.i ], [ 0, %do.body.i.preheader ] %c.0.i = phi i32 [ %cond.i35.i, %getchar_unlocked.exit39.i ], [ %c.0.i.ph, %do.body.i.preheader ] %mul.i = mul nsw i32 %n.0.i, 10 %and.i = and i32 %c.0.i, 15 %add.i = add nsw i32 %and.i, %mul.i %_IO_read_ptr.i30.i = getelementptr inbounds %struct._IO_FILE, ptr %14, i64 0, i32 1 %15 = load ptr, ptr %_IO_read_ptr.i30.i, align 8, !tbaa !30 %_IO_read_end.i31.i = getelementptr inbounds %struct._IO_FILE, ptr %14, i64 0, i32 2 %16 = load ptr, ptr %_IO_read_end.i31.i, align 8, !tbaa !34 %cmp.not.i32.i = icmp ult ptr %15, %16 br i1 %cmp.not.i32.i, label %cond.false.i36.i, label %cond.true.i33.i, !prof !35 cond.true.i33.i: ; preds = %do.body.i %call.i34.i = tail call i32 @__uflow(ptr noundef nonnull %14) #9 %.pre51.i = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit39.i cond.false.i36.i: ; preds = %do.body.i %incdec.ptr.i37.i = getelementptr inbounds i8, ptr %15, i64 1 store ptr %incdec.ptr.i37.i, ptr %_IO_read_ptr.i30.i, align 8, !tbaa !30 %17 = load i8, ptr %15, align 1, !tbaa !36 %conv3.i38.i = zext i8 %17 to i32 br label %getchar_unlocked.exit39.i getchar_unlocked.exit39.i: ; preds = %cond.false.i36.i, %cond.true.i33.i %18 = phi ptr [ %.pre51.i, %cond.true.i33.i ], [ %13, %cond.false.i36.i ] %19 = phi ptr [ %.pre51.i, %cond.true.i33.i ], [ %14, %cond.false.i36.i ] %cond.i35.i = phi i32 [ %call.i34.i, %cond.true.i33.i ], [ %conv3.i38.i, %cond.false.i36.i ] %cmp3.i = icmp sgt i32 %cond.i35.i, 47 br i1 %cmp3.i, label %do.body.i, label %do.end.i, !llvm.loop !37 do.end.i: ; preds = %getchar_unlocked.exit39.i %sub.i = sub nsw i32 0, %add.i br label %in.exit do.body4.i: ; preds = %getchar_unlocked.exit.i, %getchar_unlocked.exit49.i %20 = phi ptr [ %25, %getchar_unlocked.exit49.i ], [ %8, %getchar_unlocked.exit.i ] %21 = phi ptr [ %26, %getchar_unlocked.exit49.i ], [ %9, %getchar_unlocked.exit.i ] %n.1.i = phi i32 [ %add7.i, %getchar_unlocked.exit49.i ], [ 0, %getchar_unlocked.exit.i ] %c.1.i = phi i32 [ %cond.i45.i, %getchar_unlocked.exit49.i ], [ %cond.i.i, %getchar_unlocked.exit.i ] %mul5.i = mul nsw i32 %n.1.i, 10 %and6.i = and i32 %c.1.i, 15 %add7.i = add nsw i32 %and6.i, %mul5.i %_IO_read_ptr.i40.i = getelementptr inbounds %struct._IO_FILE, ptr %21, i64 0, i32 1 %22 = load ptr, ptr %_IO_read_ptr.i40.i, align 8, !tbaa !30 %_IO_read_end.i41.i = getelementptr inbounds %struct._IO_FILE, ptr %21, i64 0, i32 2 %23 = load ptr, ptr %_IO_read_end.i41.i, align 8, !tbaa !34 %cmp.not.i42.i = icmp ult ptr %22, %23 br i1 %cmp.not.i42.i, label %cond.false.i46.i, label %cond.true.i43.i, !prof !35 cond.true.i43.i: ; preds = %do.body4.i %call.i44.i = tail call i32 @__uflow(ptr noundef nonnull %21) #9 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit49.i cond.false.i46.i: ; preds = %do.body4.i %incdec.ptr.i47.i = getelementptr inbounds i8, ptr %22, i64 1 store ptr %incdec.ptr.i47.i, ptr %_IO_read_ptr.i40.i, align 8, !tbaa !30 %24 = load i8, ptr %22, align 1, !tbaa !36 %conv3.i48.i = zext i8 %24 to i32 br label %getchar_unlocked.exit49.i getchar_unlocked.exit49.i: ; preds = %cond.false.i46.i, %cond.true.i43.i %25 = phi ptr [ %.pre.i, %cond.true.i43.i ], [ %20, %cond.false.i46.i ] %26 = phi ptr [ %.pre.i, %cond.true.i43.i ], [ %21, %cond.false.i46.i ] %cond.i45.i = phi i32 [ %call.i44.i, %cond.true.i43.i ], [ %conv3.i48.i, %cond.false.i46.i ] %cmp10.i = icmp sgt i32 %cond.i45.i, 47 br i1 %cmp10.i, label %do.body4.i, label %in.exit, !llvm.loop !38 in.exit: ; preds = %getchar_unlocked.exit49.i, %do.end.i %27 = phi ptr [ %18, %do.end.i ], [ %25, %getchar_unlocked.exit49.i ] %28 = phi ptr [ %19, %do.end.i ], [ %26, %getchar_unlocked.exit49.i ] %retval.0.i = phi i32 [ %sub.i, %do.end.i ], [ %add7.i, %getchar_unlocked.exit49.i ] %arrayidx = getelementptr inbounds [101 x i32], ptr @ax, i64 0, i64 %indvars.iv store i32 %retval.0.i, ptr %arrayidx, align 4, !tbaa !5 %_IO_read_ptr.i.i115 = getelementptr inbounds %struct._IO_FILE, ptr %28, i64 0, i32 1 %29 = load ptr, ptr %_IO_read_ptr.i.i115, align 8, !tbaa !30 %_IO_read_end.i.i116 = getelementptr inbounds %struct._IO_FILE, ptr %28, i64 0, i32 2 %30 = load ptr, ptr %_IO_read_end.i.i116, align 8, !tbaa !34 %cmp.not.i.i117 = icmp ult ptr %29, %30 br i1 %cmp.not.i.i117, label %cond.false.i.i175, label %cond.true.i.i118, !prof !35 cond.true.i.i118: ; preds = %in.exit %call.i.i119 = tail call i32 @__uflow(ptr noundef nonnull %28) #9 %.pre465 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit.i120 cond.false.i.i175: ; preds = %in.exit %incdec.ptr.i.i176 = getelementptr inbounds i8, ptr %29, i64 1 store ptr %incdec.ptr.i.i176, ptr %_IO_read_ptr.i.i115, align 8, !tbaa !30 %31 = load i8, ptr %29, align 1, !tbaa !36 %conv3.i.i177 = zext i8 %31 to i32 br label %getchar_unlocked.exit.i120 getchar_unlocked.exit.i120: ; preds = %cond.false.i.i175, %cond.true.i.i118 %32 = phi ptr [ %.pre465, %cond.true.i.i118 ], [ %27, %cond.false.i.i175 ] %cond.i.i121 = phi i32 [ %call.i.i119, %cond.true.i.i118 ], [ %conv3.i.i177, %cond.false.i.i175 ] %cmp.i122 = icmp eq i32 %cond.i.i121, 45 br i1 %cmp.i122, label %if.then.i142, label %do.body4.i123 if.then.i142: ; preds = %getchar_unlocked.exit.i120 %_IO_read_ptr.i20.i143 = getelementptr inbounds %struct._IO_FILE, ptr %32, i64 0, i32 1 %33 = load ptr, ptr %_IO_read_ptr.i20.i143, align 8, !tbaa !30 %_IO_read_end.i21.i144 = getelementptr inbounds %struct._IO_FILE, ptr %32, i64 0, i32 2 %34 = load ptr, ptr %_IO_read_end.i21.i144, align 8, !tbaa !34 %cmp.not.i22.i145 = icmp ult ptr %33, %34 br i1 %cmp.not.i22.i145, label %cond.false.i26.i172, label %cond.true.i23.i146, !prof !35 cond.true.i23.i146: ; preds = %if.then.i142 %call.i24.i147 = tail call i32 @__uflow(ptr noundef nonnull %32) #9 %.pre52.pre.i148 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %do.body.i152.preheader cond.false.i26.i172: ; preds = %if.then.i142 %incdec.ptr.i27.i173 = getelementptr inbounds i8, ptr %33, i64 1 store ptr %incdec.ptr.i27.i173, ptr %_IO_read_ptr.i20.i143, align 8, !tbaa !30 %35 = load i8, ptr %33, align 1, !tbaa !36 %conv3.i28.i174 = zext i8 %35 to i32 br label %do.body.i152.preheader do.body.i152.preheader: ; preds = %cond.false.i26.i172, %cond.true.i23.i146 %.ph532 = phi ptr [ %32, %cond.false.i26.i172 ], [ %.pre52.pre.i148, %cond.true.i23.i146 ] %c.0.i154.ph = phi i32 [ %conv3.i28.i174, %cond.false.i26.i172 ], [ %call.i24.i147, %cond.true.i23.i146 ] br label %do.body.i152 do.body.i152: ; preds = %do.body.i152.preheader, %getchar_unlocked.exit39.i164 %36 = phi ptr [ %41, %getchar_unlocked.exit39.i164 ], [ %.ph532, %do.body.i152.preheader ] %37 = phi ptr [ %42, %getchar_unlocked.exit39.i164 ], [ %.ph532, %do.body.i152.preheader ] %n.0.i153 = phi i32 [ %add.i157, %getchar_unlocked.exit39.i164 ], [ 0, %do.body.i152.preheader ] %c.0.i154 = phi i32 [ %cond.i35.i165, %getchar_unlocked.exit39.i164 ], [ %c.0.i154.ph, %do.body.i152.preheader ] %mul.i155 = mul nsw i32 %n.0.i153, 10 %and.i156 = and i32 %c.0.i154, 15 %add.i157 = add nsw i32 %and.i156, %mul.i155 %_IO_read_ptr.i30.i158 = getelementptr inbounds %struct._IO_FILE, ptr %37, i64 0, i32 1 %38 = load ptr, ptr %_IO_read_ptr.i30.i158, align 8, !tbaa !30 %_IO_read_end.i31.i159 = getelementptr inbounds %struct._IO_FILE, ptr %37, i64 0, i32 2 %39 = load ptr, ptr %_IO_read_end.i31.i159, align 8, !tbaa !34 %cmp.not.i32.i160 = icmp ult ptr %38, %39 br i1 %cmp.not.i32.i160, label %cond.false.i36.i169, label %cond.true.i33.i161, !prof !35 cond.true.i33.i161: ; preds = %do.body.i152 %call.i34.i162 = tail call i32 @__uflow(ptr noundef nonnull %37) #9 %.pre51.i163 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit39.i164 cond.false.i36.i169: ; preds = %do.body.i152 %incdec.ptr.i37.i170 = getelementptr inbounds i8, ptr %38, i64 1 store ptr %incdec.ptr.i37.i170, ptr %_IO_read_ptr.i30.i158, align 8, !tbaa !30 %40 = load i8, ptr %38, align 1, !tbaa !36 %conv3.i38.i171 = zext i8 %40 to i32 br label %getchar_unlocked.exit39.i164 getchar_unlocked.exit39.i164: ; preds = %cond.false.i36.i169, %cond.true.i33.i161 %41 = phi ptr [ %.pre51.i163, %cond.true.i33.i161 ], [ %36, %cond.false.i36.i169 ] %42 = phi ptr [ %.pre51.i163, %cond.true.i33.i161 ], [ %37, %cond.false.i36.i169 ] %cond.i35.i165 = phi i32 [ %call.i34.i162, %cond.true.i33.i161 ], [ %conv3.i38.i171, %cond.false.i36.i169 ] %cmp3.i166 = icmp sgt i32 %cond.i35.i165, 47 br i1 %cmp3.i166, label %do.body.i152, label %do.end.i167, !llvm.loop !37 do.end.i167: ; preds = %getchar_unlocked.exit39.i164 %sub.i168 = sub nsw i32 0, %add.i157 br label %in.exit178 do.body4.i123: ; preds = %getchar_unlocked.exit.i120, %getchar_unlocked.exit49.i135 %43 = phi ptr [ %48, %getchar_unlocked.exit49.i135 ], [ %32, %getchar_unlocked.exit.i120 ] %44 = phi ptr [ %49, %getchar_unlocked.exit49.i135 ], [ %32, %getchar_unlocked.exit.i120 ] %n.1.i124 = phi i32 [ %add7.i128, %getchar_unlocked.exit49.i135 ], [ 0, %getchar_unlocked.exit.i120 ] %c.1.i125 = phi i32 [ %cond.i45.i136, %getchar_unlocked.exit49.i135 ], [ %cond.i.i121, %getchar_unlocked.exit.i120 ] %mul5.i126 = mul nsw i32 %n.1.i124, 10 %and6.i127 = and i32 %c.1.i125, 15 %add7.i128 = add nsw i32 %and6.i127, %mul5.i126 %_IO_read_ptr.i40.i129 = getelementptr inbounds %struct._IO_FILE, ptr %44, i64 0, i32 1 %45 = load ptr, ptr %_IO_read_ptr.i40.i129, align 8, !tbaa !30 %_IO_read_end.i41.i130 = getelementptr inbounds %struct._IO_FILE, ptr %44, i64 0, i32 2 %46 = load ptr, ptr %_IO_read_end.i41.i130, align 8, !tbaa !34 %cmp.not.i42.i131 = icmp ult ptr %45, %46 br i1 %cmp.not.i42.i131, label %cond.false.i46.i139, label %cond.true.i43.i132, !prof !35 cond.true.i43.i132: ; preds = %do.body4.i123 %call.i44.i133 = tail call i32 @__uflow(ptr noundef nonnull %44) #9 %.pre.i134 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit49.i135 cond.false.i46.i139: ; preds = %do.body4.i123 %incdec.ptr.i47.i140 = getelementptr inbounds i8, ptr %45, i64 1 store ptr %incdec.ptr.i47.i140, ptr %_IO_read_ptr.i40.i129, align 8, !tbaa !30 %47 = load i8, ptr %45, align 1, !tbaa !36 %conv3.i48.i141 = zext i8 %47 to i32 br label %getchar_unlocked.exit49.i135 getchar_unlocked.exit49.i135: ; preds = %cond.false.i46.i139, %cond.true.i43.i132 %48 = phi ptr [ %.pre.i134, %cond.true.i43.i132 ], [ %43, %cond.false.i46.i139 ] %49 = phi ptr [ %.pre.i134, %cond.true.i43.i132 ], [ %44, %cond.false.i46.i139 ] %cond.i45.i136 = phi i32 [ %call.i44.i133, %cond.true.i43.i132 ], [ %conv3.i48.i141, %cond.false.i46.i139 ] %cmp10.i137 = icmp sgt i32 %cond.i45.i136, 47 br i1 %cmp10.i137, label %do.body4.i123, label %in.exit178, !llvm.loop !38 in.exit178: ; preds = %getchar_unlocked.exit49.i135, %do.end.i167 %50 = phi ptr [ %41, %do.end.i167 ], [ %48, %getchar_unlocked.exit49.i135 ] %51 = phi ptr [ %42, %do.end.i167 ], [ %49, %getchar_unlocked.exit49.i135 ] %retval.0.i138 = phi i32 [ %sub.i168, %do.end.i167 ], [ %add7.i128, %getchar_unlocked.exit49.i135 ] %arrayidx6 = getelementptr inbounds [101 x i32], ptr @ay, i64 0, i64 %indvars.iv store i32 %retval.0.i138, ptr %arrayidx6, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %52 = load i32, ptr @N, align 4, !tbaa !5 %53 = sext i32 %52 to i64 %cmp = icmp slt i64 %indvars.iv.next, %53 br i1 %cmp, label %for.body, label %for.cond7.preheader, !llvm.loop !42 for.body9: ; preds = %for.body9.preheader, %in.exit434 %54 = phi ptr [ %.pre466, %for.body9.preheader ], [ %149, %in.exit434 ] %55 = phi ptr [ %.pre466, %for.body9.preheader ], [ %150, %in.exit434 ] %indvars.iv457 = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next458, %in.exit434 ] %_IO_read_ptr.i.i179 = getelementptr inbounds %struct._IO_FILE, ptr %55, i64 0, i32 1 %56 = load ptr, ptr %_IO_read_ptr.i.i179, align 8, !tbaa !30 %_IO_read_end.i.i180 = getelementptr inbounds %struct._IO_FILE, ptr %55, i64 0, i32 2 %57 = load ptr, ptr %_IO_read_end.i.i180, align 8, !tbaa !34 %cmp.not.i.i181 = icmp ult ptr %56, %57 br i1 %cmp.not.i.i181, label %cond.false.i.i239, label %cond.true.i.i182, !prof !35 cond.true.i.i182: ; preds = %for.body9 %call.i.i183 = tail call i32 @__uflow(ptr noundef nonnull %55) #9 %.pre467 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit.i184 cond.false.i.i239: ; preds = %for.body9 %incdec.ptr.i.i240 = getelementptr inbounds i8, ptr %56, i64 1 store ptr %incdec.ptr.i.i240, ptr %_IO_read_ptr.i.i179, align 8, !tbaa !30 %58 = load i8, ptr %56, align 1, !tbaa !36 %conv3.i.i241 = zext i8 %58 to i32 br label %getchar_unlocked.exit.i184 getchar_unlocked.exit.i184: ; preds = %cond.false.i.i239, %cond.true.i.i182 %59 = phi ptr [ %.pre467, %cond.true.i.i182 ], [ %54, %cond.false.i.i239 ] %60 = phi ptr [ %.pre467, %cond.true.i.i182 ], [ %55, %cond.false.i.i239 ] %cond.i.i185 = phi i32 [ %call.i.i183, %cond.true.i.i182 ], [ %conv3.i.i241, %cond.false.i.i239 ] %cmp.i186 = icmp eq i32 %cond.i.i185, 45 br i1 %cmp.i186, label %if.then.i206, label %do.body4.i187 if.then.i206: ; preds = %getchar_unlocked.exit.i184 %_IO_read_ptr.i20.i207 = getelementptr inbounds %struct._IO_FILE, ptr %60, i64 0, i32 1 %61 = load ptr, ptr %_IO_read_ptr.i20.i207, align 8, !tbaa !30 %_IO_read_end.i21.i208 = getelementptr inbounds %struct._IO_FILE, ptr %60, i64 0, i32 2 %62 = load ptr, ptr %_IO_read_end.i21.i208, align 8, !tbaa !34 %cmp.not.i22.i209 = icmp ult ptr %61, %62 br i1 %cmp.not.i22.i209, label %cond.false.i26.i236, label %cond.true.i23.i210, !prof !35 cond.true.i23.i210: ; preds = %if.then.i206 %call.i24.i211 = tail call i32 @__uflow(ptr noundef nonnull %60) #9 %.pre52.pre.i212 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %do.body.i216.preheader cond.false.i26.i236: ; preds = %if.then.i206 %incdec.ptr.i27.i237 = getelementptr inbounds i8, ptr %61, i64 1 store ptr %incdec.ptr.i27.i237, ptr %_IO_read_ptr.i20.i207, align 8, !tbaa !30 %63 = load i8, ptr %61, align 1, !tbaa !36 %conv3.i28.i238 = zext i8 %63 to i32 br label %do.body.i216.preheader do.body.i216.preheader: ; preds = %cond.false.i26.i236, %cond.true.i23.i210 %.ph529 = phi ptr [ %59, %cond.false.i26.i236 ], [ %.pre52.pre.i212, %cond.true.i23.i210 ] %.ph530 = phi ptr [ %60, %cond.false.i26.i236 ], [ %.pre52.pre.i212, %cond.true.i23.i210 ] %c.0.i218.ph = phi i32 [ %conv3.i28.i238, %cond.false.i26.i236 ], [ %call.i24.i211, %cond.true.i23.i210 ] br label %do.body.i216 do.body.i216: ; preds = %do.body.i216.preheader, %getchar_unlocked.exit39.i228 %64 = phi ptr [ %69, %getchar_unlocked.exit39.i228 ], [ %.ph529, %do.body.i216.preheader ] %65 = phi ptr [ %70, %getchar_unlocked.exit39.i228 ], [ %.ph530, %do.body.i216.preheader ] %n.0.i217 = phi i32 [ %add.i221, %getchar_unlocked.exit39.i228 ], [ 0, %do.body.i216.preheader ] %c.0.i218 = phi i32 [ %cond.i35.i229, %getchar_unlocked.exit39.i228 ], [ %c.0.i218.ph, %do.body.i216.preheader ] %mul.i219 = mul nsw i32 %n.0.i217, 10 %and.i220 = and i32 %c.0.i218, 15 %add.i221 = add nsw i32 %and.i220, %mul.i219 %_IO_read_ptr.i30.i222 = getelementptr inbounds %struct._IO_FILE, ptr %65, i64 0, i32 1 %66 = load ptr, ptr %_IO_read_ptr.i30.i222, align 8, !tbaa !30 %_IO_read_end.i31.i223 = getelementptr inbounds %struct._IO_FILE, ptr %65, i64 0, i32 2 %67 = load ptr, ptr %_IO_read_end.i31.i223, align 8, !tbaa !34 %cmp.not.i32.i224 = icmp ult ptr %66, %67 br i1 %cmp.not.i32.i224, label %cond.false.i36.i233, label %cond.true.i33.i225, !prof !35 cond.true.i33.i225: ; preds = %do.body.i216 %call.i34.i226 = tail call i32 @__uflow(ptr noundef nonnull %65) #9 %.pre51.i227 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit39.i228 cond.false.i36.i233: ; preds = %do.body.i216 %incdec.ptr.i37.i234 = getelementptr inbounds i8, ptr %66, i64 1 store ptr %incdec.ptr.i37.i234, ptr %_IO_read_ptr.i30.i222, align 8, !tbaa !30 %68 = load i8, ptr %66, align 1, !tbaa !36 %conv3.i38.i235 = zext i8 %68 to i32 br label %getchar_unlocked.exit39.i228 getchar_unlocked.exit39.i228: ; preds = %cond.false.i36.i233, %cond.true.i33.i225 %69 = phi ptr [ %.pre51.i227, %cond.true.i33.i225 ], [ %64, %cond.false.i36.i233 ] %70 = phi ptr [ %.pre51.i227, %cond.true.i33.i225 ], [ %65, %cond.false.i36.i233 ] %cond.i35.i229 = phi i32 [ %call.i34.i226, %cond.true.i33.i225 ], [ %conv3.i38.i235, %cond.false.i36.i233 ] %cmp3.i230 = icmp sgt i32 %cond.i35.i229, 47 br i1 %cmp3.i230, label %do.body.i216, label %do.end.i231, !llvm.loop !37 do.end.i231: ; preds = %getchar_unlocked.exit39.i228 %sub.i232 = sub nsw i32 0, %add.i221 br label %in.exit242 do.body4.i187: ; preds = %getchar_unlocked.exit.i184, %getchar_unlocked.exit49.i199 %71 = phi ptr [ %76, %getchar_unlocked.exit49.i199 ], [ %59, %getchar_unlocked.exit.i184 ] %72 = phi ptr [ %77, %getchar_unlocked.exit49.i199 ], [ %60, %getchar_unlocked.exit.i184 ] %n.1.i188 = phi i32 [ %add7.i192, %getchar_unlocked.exit49.i199 ], [ 0, %getchar_unlocked.exit.i184 ] %c.1.i189 = phi i32 [ %cond.i45.i200, %getchar_unlocked.exit49.i199 ], [ %cond.i.i185, %getchar_unlocked.exit.i184 ] %mul5.i190 = mul nsw i32 %n.1.i188, 10 %and6.i191 = and i32 %c.1.i189, 15 %add7.i192 = add nsw i32 %and6.i191, %mul5.i190 %_IO_read_ptr.i40.i193 = getelementptr inbounds %struct._IO_FILE, ptr %72, i64 0, i32 1 %73 = load ptr, ptr %_IO_read_ptr.i40.i193, align 8, !tbaa !30 %_IO_read_end.i41.i194 = getelementptr inbounds %struct._IO_FILE, ptr %72, i64 0, i32 2 %74 = load ptr, ptr %_IO_read_end.i41.i194, align 8, !tbaa !34 %cmp.not.i42.i195 = icmp ult ptr %73, %74 br i1 %cmp.not.i42.i195, label %cond.false.i46.i203, label %cond.true.i43.i196, !prof !35 cond.true.i43.i196: ; preds = %do.body4.i187 %call.i44.i197 = tail call i32 @__uflow(ptr noundef nonnull %72) #9 %.pre.i198 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit49.i199 cond.false.i46.i203: ; preds = %do.body4.i187 %incdec.ptr.i47.i204 = getelementptr inbounds i8, ptr %73, i64 1 store ptr %incdec.ptr.i47.i204, ptr %_IO_read_ptr.i40.i193, align 8, !tbaa !30 %75 = load i8, ptr %73, align 1, !tbaa !36 %conv3.i48.i205 = zext i8 %75 to i32 br label %getchar_unlocked.exit49.i199 getchar_unlocked.exit49.i199: ; preds = %cond.false.i46.i203, %cond.true.i43.i196 %76 = phi ptr [ %.pre.i198, %cond.true.i43.i196 ], [ %71, %cond.false.i46.i203 ] %77 = phi ptr [ %.pre.i198, %cond.true.i43.i196 ], [ %72, %cond.false.i46.i203 ] %cond.i45.i200 = phi i32 [ %call.i44.i197, %cond.true.i43.i196 ], [ %conv3.i48.i205, %cond.false.i46.i203 ] %cmp10.i201 = icmp sgt i32 %cond.i45.i200, 47 br i1 %cmp10.i201, label %do.body4.i187, label %in.exit242, !llvm.loop !38 in.exit242: ; preds = %getchar_unlocked.exit49.i199, %do.end.i231 %78 = phi ptr [ %69, %do.end.i231 ], [ %76, %getchar_unlocked.exit49.i199 ] %79 = phi ptr [ %70, %do.end.i231 ], [ %77, %getchar_unlocked.exit49.i199 ] %retval.0.i202 = phi i32 [ %sub.i232, %do.end.i231 ], [ %add7.i192, %getchar_unlocked.exit49.i199 ] %arrayidx12 = getelementptr inbounds [6 x i32], ptr @bx, i64 0, i64 %indvars.iv457 store i32 %retval.0.i202, ptr %arrayidx12, align 4, !tbaa !5 %_IO_read_ptr.i.i243 = getelementptr inbounds %struct._IO_FILE, ptr %79, i64 0, i32 1 %80 = load ptr, ptr %_IO_read_ptr.i.i243, align 8, !tbaa !30 %_IO_read_end.i.i244 = getelementptr inbounds %struct._IO_FILE, ptr %79, i64 0, i32 2 %81 = load ptr, ptr %_IO_read_end.i.i244, align 8, !tbaa !34 %cmp.not.i.i245 = icmp ult ptr %80, %81 br i1 %cmp.not.i.i245, label %cond.false.i.i303, label %cond.true.i.i246, !prof !35 cond.true.i.i246: ; preds = %in.exit242 %call.i.i247 = tail call i32 @__uflow(ptr noundef nonnull %79) #9 %.pre468 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit.i248 cond.false.i.i303: ; preds = %in.exit242 %incdec.ptr.i.i304 = getelementptr inbounds i8, ptr %80, i64 1 store ptr %incdec.ptr.i.i304, ptr %_IO_read_ptr.i.i243, align 8, !tbaa !30 %82 = load i8, ptr %80, align 1, !tbaa !36 %conv3.i.i305 = zext i8 %82 to i32 br label %getchar_unlocked.exit.i248 getchar_unlocked.exit.i248: ; preds = %cond.false.i.i303, %cond.true.i.i246 %83 = phi ptr [ %.pre468, %cond.true.i.i246 ], [ %78, %cond.false.i.i303 ] %84 = phi ptr [ %.pre468, %cond.true.i.i246 ], [ %79, %cond.false.i.i303 ] %cond.i.i249 = phi i32 [ %call.i.i247, %cond.true.i.i246 ], [ %conv3.i.i305, %cond.false.i.i303 ] %cmp.i250 = icmp eq i32 %cond.i.i249, 45 br i1 %cmp.i250, label %if.then.i270, label %do.body4.i251 if.then.i270: ; preds = %getchar_unlocked.exit.i248 %_IO_read_ptr.i20.i271 = getelementptr inbounds %struct._IO_FILE, ptr %84, i64 0, i32 1 %85 = load ptr, ptr %_IO_read_ptr.i20.i271, align 8, !tbaa !30 %_IO_read_end.i21.i272 = getelementptr inbounds %struct._IO_FILE, ptr %84, i64 0, i32 2 %86 = load ptr, ptr %_IO_read_end.i21.i272, align 8, !tbaa !34 %cmp.not.i22.i273 = icmp ult ptr %85, %86 br i1 %cmp.not.i22.i273, label %cond.false.i26.i300, label %cond.true.i23.i274, !prof !35 cond.true.i23.i274: ; preds = %if.then.i270 %call.i24.i275 = tail call i32 @__uflow(ptr noundef nonnull %84) #9 %.pre52.pre.i276 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %do.body.i280.preheader cond.false.i26.i300: ; preds = %if.then.i270 %incdec.ptr.i27.i301 = getelementptr inbounds i8, ptr %85, i64 1 store ptr %incdec.ptr.i27.i301, ptr %_IO_read_ptr.i20.i271, align 8, !tbaa !30 %87 = load i8, ptr %85, align 1, !tbaa !36 %conv3.i28.i302 = zext i8 %87 to i32 br label %do.body.i280.preheader do.body.i280.preheader: ; preds = %cond.false.i26.i300, %cond.true.i23.i274 %.ph527 = phi ptr [ %83, %cond.false.i26.i300 ], [ %.pre52.pre.i276, %cond.true.i23.i274 ] %.ph528 = phi ptr [ %84, %cond.false.i26.i300 ], [ %.pre52.pre.i276, %cond.true.i23.i274 ] %c.0.i282.ph = phi i32 [ %conv3.i28.i302, %cond.false.i26.i300 ], [ %call.i24.i275, %cond.true.i23.i274 ] br label %do.body.i280 do.body.i280: ; preds = %do.body.i280.preheader, %getchar_unlocked.exit39.i292 %88 = phi ptr [ %93, %getchar_unlocked.exit39.i292 ], [ %.ph527, %do.body.i280.preheader ] %89 = phi ptr [ %94, %getchar_unlocked.exit39.i292 ], [ %.ph528, %do.body.i280.preheader ] %n.0.i281 = phi i32 [ %add.i285, %getchar_unlocked.exit39.i292 ], [ 0, %do.body.i280.preheader ] %c.0.i282 = phi i32 [ %cond.i35.i293, %getchar_unlocked.exit39.i292 ], [ %c.0.i282.ph, %do.body.i280.preheader ] %mul.i283 = mul nsw i32 %n.0.i281, 10 %and.i284 = and i32 %c.0.i282, 15 %add.i285 = add nsw i32 %and.i284, %mul.i283 %_IO_read_ptr.i30.i286 = getelementptr inbounds %struct._IO_FILE, ptr %89, i64 0, i32 1 %90 = load ptr, ptr %_IO_read_ptr.i30.i286, align 8, !tbaa !30 %_IO_read_end.i31.i287 = getelementptr inbounds %struct._IO_FILE, ptr %89, i64 0, i32 2 %91 = load ptr, ptr %_IO_read_end.i31.i287, align 8, !tbaa !34 %cmp.not.i32.i288 = icmp ult ptr %90, %91 br i1 %cmp.not.i32.i288, label %cond.false.i36.i297, label %cond.true.i33.i289, !prof !35 cond.true.i33.i289: ; preds = %do.body.i280 %call.i34.i290 = tail call i32 @__uflow(ptr noundef nonnull %89) #9 %.pre51.i291 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit39.i292 cond.false.i36.i297: ; preds = %do.body.i280 %incdec.ptr.i37.i298 = getelementptr inbounds i8, ptr %90, i64 1 store ptr %incdec.ptr.i37.i298, ptr %_IO_read_ptr.i30.i286, align 8, !tbaa !30 %92 = load i8, ptr %90, align 1, !tbaa !36 %conv3.i38.i299 = zext i8 %92 to i32 br label %getchar_unlocked.exit39.i292 getchar_unlocked.exit39.i292: ; preds = %cond.false.i36.i297, %cond.true.i33.i289 %93 = phi ptr [ %.pre51.i291, %cond.true.i33.i289 ], [ %88, %cond.false.i36.i297 ] %94 = phi ptr [ %.pre51.i291, %cond.true.i33.i289 ], [ %89, %cond.false.i36.i297 ] %cond.i35.i293 = phi i32 [ %call.i34.i290, %cond.true.i33.i289 ], [ %conv3.i38.i299, %cond.false.i36.i297 ] %cmp3.i294 = icmp sgt i32 %cond.i35.i293, 47 br i1 %cmp3.i294, label %do.body.i280, label %do.end.i295, !llvm.loop !37 do.end.i295: ; preds = %getchar_unlocked.exit39.i292 %sub.i296 = sub nsw i32 0, %add.i285 br label %in.exit306 do.body4.i251: ; preds = %getchar_unlocked.exit.i248, %getchar_unlocked.exit49.i263 %95 = phi ptr [ %100, %getchar_unlocked.exit49.i263 ], [ %83, %getchar_unlocked.exit.i248 ] %96 = phi ptr [ %101, %getchar_unlocked.exit49.i263 ], [ %84, %getchar_unlocked.exit.i248 ] %n.1.i252 = phi i32 [ %add7.i256, %getchar_unlocked.exit49.i263 ], [ 0, %getchar_unlocked.exit.i248 ] %c.1.i253 = phi i32 [ %cond.i45.i264, %getchar_unlocked.exit49.i263 ], [ %cond.i.i249, %getchar_unlocked.exit.i248 ] %mul5.i254 = mul nsw i32 %n.1.i252, 10 %and6.i255 = and i32 %c.1.i253, 15 %add7.i256 = add nsw i32 %and6.i255, %mul5.i254 %_IO_read_ptr.i40.i257 = getelementptr inbounds %struct._IO_FILE, ptr %96, i64 0, i32 1 %97 = load ptr, ptr %_IO_read_ptr.i40.i257, align 8, !tbaa !30 %_IO_read_end.i41.i258 = getelementptr inbounds %struct._IO_FILE, ptr %96, i64 0, i32 2 %98 = load ptr, ptr %_IO_read_end.i41.i258, align 8, !tbaa !34 %cmp.not.i42.i259 = icmp ult ptr %97, %98 br i1 %cmp.not.i42.i259, label %cond.false.i46.i267, label %cond.true.i43.i260, !prof !35 cond.true.i43.i260: ; preds = %do.body4.i251 %call.i44.i261 = tail call i32 @__uflow(ptr noundef nonnull %96) #9 %.pre.i262 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit49.i263 cond.false.i46.i267: ; preds = %do.body4.i251 %incdec.ptr.i47.i268 = getelementptr inbounds i8, ptr %97, i64 1 store ptr %incdec.ptr.i47.i268, ptr %_IO_read_ptr.i40.i257, align 8, !tbaa !30 %99 = load i8, ptr %97, align 1, !tbaa !36 %conv3.i48.i269 = zext i8 %99 to i32 br label %getchar_unlocked.exit49.i263 getchar_unlocked.exit49.i263: ; preds = %cond.false.i46.i267, %cond.true.i43.i260 %100 = phi ptr [ %.pre.i262, %cond.true.i43.i260 ], [ %95, %cond.false.i46.i267 ] %101 = phi ptr [ %.pre.i262, %cond.true.i43.i260 ], [ %96, %cond.false.i46.i267 ] %cond.i45.i264 = phi i32 [ %call.i44.i261, %cond.true.i43.i260 ], [ %conv3.i48.i269, %cond.false.i46.i267 ] %cmp10.i265 = icmp sgt i32 %cond.i45.i264, 47 br i1 %cmp10.i265, label %do.body4.i251, label %in.exit306, !llvm.loop !38 in.exit306: ; preds = %getchar_unlocked.exit49.i263, %do.end.i295 %102 = phi ptr [ %93, %do.end.i295 ], [ %100, %getchar_unlocked.exit49.i263 ] %103 = phi ptr [ %94, %do.end.i295 ], [ %101, %getchar_unlocked.exit49.i263 ] %retval.0.i266 = phi i32 [ %sub.i296, %do.end.i295 ], [ %add7.i256, %getchar_unlocked.exit49.i263 ] %arrayidx15 = getelementptr inbounds [6 x i32], ptr @by, i64 0, i64 %indvars.iv457 store i32 %retval.0.i266, ptr %arrayidx15, align 4, !tbaa !5 %_IO_read_ptr.i.i307 = getelementptr inbounds %struct._IO_FILE, ptr %103, i64 0, i32 1 %104 = load ptr, ptr %_IO_read_ptr.i.i307, align 8, !tbaa !30 %_IO_read_end.i.i308 = getelementptr inbounds %struct._IO_FILE, ptr %103, i64 0, i32 2 %105 = load ptr, ptr %_IO_read_end.i.i308, align 8, !tbaa !34 %cmp.not.i.i309 = icmp ult ptr %104, %105 br i1 %cmp.not.i.i309, label %cond.false.i.i367, label %cond.true.i.i310, !prof !35 cond.true.i.i310: ; preds = %in.exit306 %call.i.i311 = tail call i32 @__uflow(ptr noundef nonnull %103) #9 %.pre469 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit.i312 cond.false.i.i367: ; preds = %in.exit306 %incdec.ptr.i.i368 = getelementptr inbounds i8, ptr %104, i64 1 store ptr %incdec.ptr.i.i368, ptr %_IO_read_ptr.i.i307, align 8, !tbaa !30 %106 = load i8, ptr %104, align 1, !tbaa !36 %conv3.i.i369 = zext i8 %106 to i32 br label %getchar_unlocked.exit.i312 getchar_unlocked.exit.i312: ; preds = %cond.false.i.i367, %cond.true.i.i310 %107 = phi ptr [ %.pre469, %cond.true.i.i310 ], [ %102, %cond.false.i.i367 ] %108 = phi ptr [ %.pre469, %cond.true.i.i310 ], [ %103, %cond.false.i.i367 ] %cond.i.i313 = phi i32 [ %call.i.i311, %cond.true.i.i310 ], [ %conv3.i.i369, %cond.false.i.i367 ] %cmp.i314 = icmp eq i32 %cond.i.i313, 45 br i1 %cmp.i314, label %if.then.i334, label %do.body4.i315 if.then.i334: ; preds = %getchar_unlocked.exit.i312 %_IO_read_ptr.i20.i335 = getelementptr inbounds %struct._IO_FILE, ptr %108, i64 0, i32 1 %109 = load ptr, ptr %_IO_read_ptr.i20.i335, align 8, !tbaa !30 %_IO_read_end.i21.i336 = getelementptr inbounds %struct._IO_FILE, ptr %108, i64 0, i32 2 %110 = load ptr, ptr %_IO_read_end.i21.i336, align 8, !tbaa !34 %cmp.not.i22.i337 = icmp ult ptr %109, %110 br i1 %cmp.not.i22.i337, label %cond.false.i26.i364, label %cond.true.i23.i338, !prof !35 cond.true.i23.i338: ; preds = %if.then.i334 %call.i24.i339 = tail call i32 @__uflow(ptr noundef nonnull %108) #9 %.pre52.pre.i340 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %do.body.i344.preheader cond.false.i26.i364: ; preds = %if.then.i334 %incdec.ptr.i27.i365 = getelementptr inbounds i8, ptr %109, i64 1 store ptr %incdec.ptr.i27.i365, ptr %_IO_read_ptr.i20.i335, align 8, !tbaa !30 %111 = load i8, ptr %109, align 1, !tbaa !36 %conv3.i28.i366 = zext i8 %111 to i32 br label %do.body.i344.preheader do.body.i344.preheader: ; preds = %cond.false.i26.i364, %cond.true.i23.i338 %.ph525 = phi ptr [ %107, %cond.false.i26.i364 ], [ %.pre52.pre.i340, %cond.true.i23.i338 ] %.ph526 = phi ptr [ %108, %cond.false.i26.i364 ], [ %.pre52.pre.i340, %cond.true.i23.i338 ] %c.0.i346.ph = phi i32 [ %conv3.i28.i366, %cond.false.i26.i364 ], [ %call.i24.i339, %cond.true.i23.i338 ] br label %do.body.i344 do.body.i344: ; preds = %do.body.i344.preheader, %getchar_unlocked.exit39.i356 %112 = phi ptr [ %117, %getchar_unlocked.exit39.i356 ], [ %.ph525, %do.body.i344.preheader ] %113 = phi ptr [ %118, %getchar_unlocked.exit39.i356 ], [ %.ph526, %do.body.i344.preheader ] %n.0.i345 = phi i32 [ %add.i349, %getchar_unlocked.exit39.i356 ], [ 0, %do.body.i344.preheader ] %c.0.i346 = phi i32 [ %cond.i35.i357, %getchar_unlocked.exit39.i356 ], [ %c.0.i346.ph, %do.body.i344.preheader ] %mul.i347 = mul nsw i32 %n.0.i345, 10 %and.i348 = and i32 %c.0.i346, 15 %add.i349 = add nsw i32 %and.i348, %mul.i347 %_IO_read_ptr.i30.i350 = getelementptr inbounds %struct._IO_FILE, ptr %113, i64 0, i32 1 %114 = load ptr, ptr %_IO_read_ptr.i30.i350, align 8, !tbaa !30 %_IO_read_end.i31.i351 = getelementptr inbounds %struct._IO_FILE, ptr %113, i64 0, i32 2 %115 = load ptr, ptr %_IO_read_end.i31.i351, align 8, !tbaa !34 %cmp.not.i32.i352 = icmp ult ptr %114, %115 br i1 %cmp.not.i32.i352, label %cond.false.i36.i361, label %cond.true.i33.i353, !prof !35 cond.true.i33.i353: ; preds = %do.body.i344 %call.i34.i354 = tail call i32 @__uflow(ptr noundef nonnull %113) #9 %.pre51.i355 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit39.i356 cond.false.i36.i361: ; preds = %do.body.i344 %incdec.ptr.i37.i362 = getelementptr inbounds i8, ptr %114, i64 1 store ptr %incdec.ptr.i37.i362, ptr %_IO_read_ptr.i30.i350, align 8, !tbaa !30 %116 = load i8, ptr %114, align 1, !tbaa !36 %conv3.i38.i363 = zext i8 %116 to i32 br label %getchar_unlocked.exit39.i356 getchar_unlocked.exit39.i356: ; preds = %cond.false.i36.i361, %cond.true.i33.i353 %117 = phi ptr [ %.pre51.i355, %cond.true.i33.i353 ], [ %112, %cond.false.i36.i361 ] %118 = phi ptr [ %.pre51.i355, %cond.true.i33.i353 ], [ %113, %cond.false.i36.i361 ] %cond.i35.i357 = phi i32 [ %call.i34.i354, %cond.true.i33.i353 ], [ %conv3.i38.i363, %cond.false.i36.i361 ] %cmp3.i358 = icmp sgt i32 %cond.i35.i357, 47 br i1 %cmp3.i358, label %do.body.i344, label %do.end.i359, !llvm.loop !37 do.end.i359: ; preds = %getchar_unlocked.exit39.i356 %sub.i360 = sub nsw i32 0, %add.i349 br label %in.exit370 do.body4.i315: ; preds = %getchar_unlocked.exit.i312, %getchar_unlocked.exit49.i327 %119 = phi ptr [ %124, %getchar_unlocked.exit49.i327 ], [ %107, %getchar_unlocked.exit.i312 ] %120 = phi ptr [ %125, %getchar_unlocked.exit49.i327 ], [ %108, %getchar_unlocked.exit.i312 ] %n.1.i316 = phi i32 [ %add7.i320, %getchar_unlocked.exit49.i327 ], [ 0, %getchar_unlocked.exit.i312 ] %c.1.i317 = phi i32 [ %cond.i45.i328, %getchar_unlocked.exit49.i327 ], [ %cond.i.i313, %getchar_unlocked.exit.i312 ] %mul5.i318 = mul nsw i32 %n.1.i316, 10 %and6.i319 = and i32 %c.1.i317, 15 %add7.i320 = add nsw i32 %and6.i319, %mul5.i318 %_IO_read_ptr.i40.i321 = getelementptr inbounds %struct._IO_FILE, ptr %120, i64 0, i32 1 %121 = load ptr, ptr %_IO_read_ptr.i40.i321, align 8, !tbaa !30 %_IO_read_end.i41.i322 = getelementptr inbounds %struct._IO_FILE, ptr %120, i64 0, i32 2 %122 = load ptr, ptr %_IO_read_end.i41.i322, align 8, !tbaa !34 %cmp.not.i42.i323 = icmp ult ptr %121, %122 br i1 %cmp.not.i42.i323, label %cond.false.i46.i331, label %cond.true.i43.i324, !prof !35 cond.true.i43.i324: ; preds = %do.body4.i315 %call.i44.i325 = tail call i32 @__uflow(ptr noundef nonnull %120) #9 %.pre.i326 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit49.i327 cond.false.i46.i331: ; preds = %do.body4.i315 %incdec.ptr.i47.i332 = getelementptr inbounds i8, ptr %121, i64 1 store ptr %incdec.ptr.i47.i332, ptr %_IO_read_ptr.i40.i321, align 8, !tbaa !30 %123 = load i8, ptr %121, align 1, !tbaa !36 %conv3.i48.i333 = zext i8 %123 to i32 br label %getchar_unlocked.exit49.i327 getchar_unlocked.exit49.i327: ; preds = %cond.false.i46.i331, %cond.true.i43.i324 %124 = phi ptr [ %.pre.i326, %cond.true.i43.i324 ], [ %119, %cond.false.i46.i331 ] %125 = phi ptr [ %.pre.i326, %cond.true.i43.i324 ], [ %120, %cond.false.i46.i331 ] %cond.i45.i328 = phi i32 [ %call.i44.i325, %cond.true.i43.i324 ], [ %conv3.i48.i333, %cond.false.i46.i331 ] %cmp10.i329 = icmp sgt i32 %cond.i45.i328, 47 br i1 %cmp10.i329, label %do.body4.i315, label %in.exit370, !llvm.loop !38 in.exit370: ; preds = %getchar_unlocked.exit49.i327, %do.end.i359 %126 = phi ptr [ %117, %do.end.i359 ], [ %124, %getchar_unlocked.exit49.i327 ] %127 = phi ptr [ %118, %do.end.i359 ], [ %125, %getchar_unlocked.exit49.i327 ] %retval.0.i330 = phi i32 [ %sub.i360, %do.end.i359 ], [ %add7.i320, %getchar_unlocked.exit49.i327 ] %arrayidx18 = getelementptr inbounds [6 x i32], ptr @c, i64 0, i64 %indvars.iv457 store i32 %retval.0.i330, ptr %arrayidx18, align 4, !tbaa !5 %_IO_read_ptr.i.i371 = getelementptr inbounds %struct._IO_FILE, ptr %127, i64 0, i32 1 %128 = load ptr, ptr %_IO_read_ptr.i.i371, align 8, !tbaa !30 %_IO_read_end.i.i372 = getelementptr inbounds %struct._IO_FILE, ptr %127, i64 0, i32 2 %129 = load ptr, ptr %_IO_read_end.i.i372, align 8, !tbaa !34 %cmp.not.i.i373 = icmp ult ptr %128, %129 br i1 %cmp.not.i.i373, label %cond.false.i.i431, label %cond.true.i.i374, !prof !35 cond.true.i.i374: ; preds = %in.exit370 %call.i.i375 = tail call i32 @__uflow(ptr noundef nonnull %127) #9 %.pre470 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit.i376 cond.false.i.i431: ; preds = %in.exit370 %incdec.ptr.i.i432 = getelementptr inbounds i8, ptr %128, i64 1 store ptr %incdec.ptr.i.i432, ptr %_IO_read_ptr.i.i371, align 8, !tbaa !30 %130 = load i8, ptr %128, align 1, !tbaa !36 %conv3.i.i433 = zext i8 %130 to i32 br label %getchar_unlocked.exit.i376 getchar_unlocked.exit.i376: ; preds = %cond.false.i.i431, %cond.true.i.i374 %131 = phi ptr [ %.pre470, %cond.true.i.i374 ], [ %126, %cond.false.i.i431 ] %cond.i.i377 = phi i32 [ %call.i.i375, %cond.true.i.i374 ], [ %conv3.i.i433, %cond.false.i.i431 ] %cmp.i378 = icmp eq i32 %cond.i.i377, 45 br i1 %cmp.i378, label %if.then.i398, label %do.body4.i379 if.then.i398: ; preds = %getchar_unlocked.exit.i376 %_IO_read_ptr.i20.i399 = getelementptr inbounds %struct._IO_FILE, ptr %131, i64 0, i32 1 %132 = load ptr, ptr %_IO_read_ptr.i20.i399, align 8, !tbaa !30 %_IO_read_end.i21.i400 = getelementptr inbounds %struct._IO_FILE, ptr %131, i64 0, i32 2 %133 = load ptr, ptr %_IO_read_end.i21.i400, align 8, !tbaa !34 %cmp.not.i22.i401 = icmp ult ptr %132, %133 br i1 %cmp.not.i22.i401, label %cond.false.i26.i428, label %cond.true.i23.i402, !prof !35 cond.true.i23.i402: ; preds = %if.then.i398 %call.i24.i403 = tail call i32 @__uflow(ptr noundef nonnull %131) #9 %.pre52.pre.i404 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %do.body.i408.preheader cond.false.i26.i428: ; preds = %if.then.i398 %incdec.ptr.i27.i429 = getelementptr inbounds i8, ptr %132, i64 1 store ptr %incdec.ptr.i27.i429, ptr %_IO_read_ptr.i20.i399, align 8, !tbaa !30 %134 = load i8, ptr %132, align 1, !tbaa !36 %conv3.i28.i430 = zext i8 %134 to i32 br label %do.body.i408.preheader do.body.i408.preheader: ; preds = %cond.false.i26.i428, %cond.true.i23.i402 %.ph524 = phi ptr [ %131, %cond.false.i26.i428 ], [ %.pre52.pre.i404, %cond.true.i23.i402 ] %c.0.i410.ph = phi i32 [ %conv3.i28.i430, %cond.false.i26.i428 ], [ %call.i24.i403, %cond.true.i23.i402 ] br label %do.body.i408 do.body.i408: ; preds = %do.body.i408.preheader, %getchar_unlocked.exit39.i420 %135 = phi ptr [ %140, %getchar_unlocked.exit39.i420 ], [ %.ph524, %do.body.i408.preheader ] %136 = phi ptr [ %141, %getchar_unlocked.exit39.i420 ], [ %.ph524, %do.body.i408.preheader ] %n.0.i409 = phi i32 [ %add.i413, %getchar_unlocked.exit39.i420 ], [ 0, %do.body.i408.preheader ] %c.0.i410 = phi i32 [ %cond.i35.i421, %getchar_unlocked.exit39.i420 ], [ %c.0.i410.ph, %do.body.i408.preheader ] %mul.i411 = mul nsw i32 %n.0.i409, 10 %and.i412 = and i32 %c.0.i410, 15 %add.i413 = add nsw i32 %and.i412, %mul.i411 %_IO_read_ptr.i30.i414 = getelementptr inbounds %struct._IO_FILE, ptr %136, i64 0, i32 1 %137 = load ptr, ptr %_IO_read_ptr.i30.i414, align 8, !tbaa !30 %_IO_read_end.i31.i415 = getelementptr inbounds %struct._IO_FILE, ptr %136, i64 0, i32 2 %138 = load ptr, ptr %_IO_read_end.i31.i415, align 8, !tbaa !34 %cmp.not.i32.i416 = icmp ult ptr %137, %138 br i1 %cmp.not.i32.i416, label %cond.false.i36.i425, label %cond.true.i33.i417, !prof !35 cond.true.i33.i417: ; preds = %do.body.i408 %call.i34.i418 = tail call i32 @__uflow(ptr noundef nonnull %136) #9 %.pre51.i419 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit39.i420 cond.false.i36.i425: ; preds = %do.body.i408 %incdec.ptr.i37.i426 = getelementptr inbounds i8, ptr %137, i64 1 store ptr %incdec.ptr.i37.i426, ptr %_IO_read_ptr.i30.i414, align 8, !tbaa !30 %139 = load i8, ptr %137, align 1, !tbaa !36 %conv3.i38.i427 = zext i8 %139 to i32 br label %getchar_unlocked.exit39.i420 getchar_unlocked.exit39.i420: ; preds = %cond.false.i36.i425, %cond.true.i33.i417 %140 = phi ptr [ %.pre51.i419, %cond.true.i33.i417 ], [ %135, %cond.false.i36.i425 ] %141 = phi ptr [ %.pre51.i419, %cond.true.i33.i417 ], [ %136, %cond.false.i36.i425 ] %cond.i35.i421 = phi i32 [ %call.i34.i418, %cond.true.i33.i417 ], [ %conv3.i38.i427, %cond.false.i36.i425 ] %cmp3.i422 = icmp sgt i32 %cond.i35.i421, 47 br i1 %cmp3.i422, label %do.body.i408, label %do.end.i423, !llvm.loop !37 do.end.i423: ; preds = %getchar_unlocked.exit39.i420 %sub.i424 = sub nsw i32 0, %add.i413 br label %in.exit434 do.body4.i379: ; preds = %getchar_unlocked.exit.i376, %getchar_unlocked.exit49.i391 %142 = phi ptr [ %147, %getchar_unlocked.exit49.i391 ], [ %131, %getchar_unlocked.exit.i376 ] %143 = phi ptr [ %148, %getchar_unlocked.exit49.i391 ], [ %131, %getchar_unlocked.exit.i376 ] %n.1.i380 = phi i32 [ %add7.i384, %getchar_unlocked.exit49.i391 ], [ 0, %getchar_unlocked.exit.i376 ] %c.1.i381 = phi i32 [ %cond.i45.i392, %getchar_unlocked.exit49.i391 ], [ %cond.i.i377, %getchar_unlocked.exit.i376 ] %mul5.i382 = mul nsw i32 %n.1.i380, 10 %and6.i383 = and i32 %c.1.i381, 15 %add7.i384 = add nsw i32 %and6.i383, %mul5.i382 %_IO_read_ptr.i40.i385 = getelementptr inbounds %struct._IO_FILE, ptr %143, i64 0, i32 1 %144 = load ptr, ptr %_IO_read_ptr.i40.i385, align 8, !tbaa !30 %_IO_read_end.i41.i386 = getelementptr inbounds %struct._IO_FILE, ptr %143, i64 0, i32 2 %145 = load ptr, ptr %_IO_read_end.i41.i386, align 8, !tbaa !34 %cmp.not.i42.i387 = icmp ult ptr %144, %145 br i1 %cmp.not.i42.i387, label %cond.false.i46.i395, label %cond.true.i43.i388, !prof !35 cond.true.i43.i388: ; preds = %do.body4.i379 %call.i44.i389 = tail call i32 @__uflow(ptr noundef nonnull %143) #9 %.pre.i390 = load ptr, ptr @stdin, align 8, !tbaa !28 br label %getchar_unlocked.exit49.i391 cond.false.i46.i395: ; preds = %do.body4.i379 %incdec.ptr.i47.i396 = getelementptr inbounds i8, ptr %144, i64 1 store ptr %incdec.ptr.i47.i396, ptr %_IO_read_ptr.i40.i385, align 8, !tbaa !30 %146 = load i8, ptr %144, align 1, !tbaa !36 %conv3.i48.i397 = zext i8 %146 to i32 br label %getchar_unlocked.exit49.i391 getchar_unlocked.exit49.i391: ; preds = %cond.false.i46.i395, %cond.true.i43.i388 %147 = phi ptr [ %.pre.i390, %cond.true.i43.i388 ], [ %142, %cond.false.i46.i395 ] %148 = phi ptr [ %.pre.i390, %cond.true.i43.i388 ], [ %143, %cond.false.i46.i395 ] %cond.i45.i392 = phi i32 [ %call.i44.i389, %cond.true.i43.i388 ], [ %conv3.i48.i397, %cond.false.i46.i395 ] %cmp10.i393 = icmp sgt i32 %cond.i45.i392, 47 br i1 %cmp10.i393, label %do.body4.i379, label %in.exit434, !llvm.loop !38 in.exit434: ; preds = %getchar_unlocked.exit49.i391, %do.end.i423 %149 = phi ptr [ %140, %do.end.i423 ], [ %147, %getchar_unlocked.exit49.i391 ] %150 = phi ptr [ %141, %do.end.i423 ], [ %148, %getchar_unlocked.exit49.i391 ] %retval.0.i394 = phi i32 [ %sub.i424, %do.end.i423 ], [ %add7.i384, %getchar_unlocked.exit49.i391 ] %arrayidx21 = getelementptr inbounds [6 x i32], ptr @f, i64 0, i64 %indvars.iv457 store i32 %retval.0.i394, ptr %arrayidx21, align 4, !tbaa !5 %indvars.iv.next458 = add nuw nsw i64 %indvars.iv457, 1 %151 = load i32, ptr @M, align 4, !tbaa !5 %152 = sext i32 %151 to i64 %cmp8 = icmp slt i64 %indvars.iv.next458, %152 br i1 %cmp8, label %for.body9, label %for.end24.loopexit, !llvm.loop !43 for.end24.loopexit: ; preds = %in.exit434 %.pre471 = load i32, ptr @N, align 4, !tbaa !5 br label %for.end24 for.end24: ; preds = %for.end24.loopexit, %for.cond7.preheader %153 = phi i32 [ %1, %for.cond7.preheader ], [ %.pre471, %for.end24.loopexit ] %.lcssa = phi i32 [ %2, %for.cond7.preheader ], [ %151, %for.end24.loopexit ] %add = add nsw i32 %153, %.lcssa store i32 %add, ptr @source, align 4, !tbaa !5 %add25 = add nsw i32 %add, 1 store i32 %add25, ptr @sink, align 4, !tbaa !5 %add26 = add nsw i32 %add, 2 store i32 %add26, ptr @V, align 4, !tbaa !5 %cmp28448.not = icmp eq i32 %.lcssa, 31 br i1 %cmp28448.not, label %for.end76, label %for.cond30.preheader.preheader for.cond30.preheader.preheader: ; preds = %for.end24 %shl = shl nuw nsw i32 1, %.lcssa %smax = tail call i32 @llvm.smax.i32(i32 %shl, i32 1) br label %for.cond30.preheader for.cond30.preheader: ; preds = %for.cond30.preheader.preheader, %for.inc74 %s.0450 = phi i32 [ %inc75, %for.inc74 ], [ 0, %for.cond30.preheader.preheader ] %ans.0449 = phi i32 [ %ans.1, %for.inc74 ], [ 269488144, %for.cond30.preheader.preheader ] %154 = load i32, ptr @M, align 4, !tbaa !5 %cmp31440 = icmp sgt i32 %154, 0 br i1 %cmp31440, label %for.body32.preheader, label %while.cond42.preheader for.body32.preheader: ; preds = %for.cond30.preheader %wide.trip.count = zext i32 %154 to i64 %xtraiter = and i64 %wide.trip.count, 1 %155 = icmp eq i32 %154, 1 br i1 %155, label %while.cond42.preheader.loopexit.unr-lcssa, label %for.body32.preheader.new for.body32.preheader.new: ; preds = %for.body32.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body32 while.cond42.preheader.loopexit.unr-lcssa: ; preds = %for.inc39.1, %for.body32.preheader %cnt.1.lcssa.ph = phi i32 [ undef, %for.body32.preheader ], [ %cnt.1.1, %for.inc39.1 ] %res.1.lcssa.ph = phi i32 [ undef, %for.body32.preheader ], [ %res.1.1, %for.inc39.1 ] %indvars.iv460.unr = phi i64 [ 0, %for.body32.preheader ], [ %indvars.iv.next461.1, %for.inc39.1 ] %res.0442.unr = phi i32 [ 0, %for.body32.preheader ], [ %res.1.1, %for.inc39.1 ] %cnt.0441.unr = phi i32 [ 0, %for.body32.preheader ], [ %cnt.1.1, %for.inc39.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.cond42.preheader, label %for.body32.epil for.body32.epil: ; preds = %while.cond42.preheader.loopexit.unr-lcssa %156 = trunc i64 %indvars.iv460.unr to i32 %shl33.epil = shl nuw i32 1, %156 %and.epil = and i32 %shl33.epil, %s.0450 %tobool34.not.epil = icmp eq i32 %and.epil, 0 br i1 %tobool34.not.epil, label %while.cond42.preheader, label %if.then.epil if.then.epil: ; preds = %for.body32.epil %arrayidx36.epil = getelementptr inbounds [6 x i32], ptr @f, i64 0, i64 %indvars.iv460.unr %157 = load i32, ptr %arrayidx36.epil, align 4, !tbaa !5 %add37.epil = add nsw i32 %157, %res.0442.unr %inc38.epil = add nsw i32 %cnt.0441.unr, 1 br label %while.cond42.preheader while.cond42.preheader: ; preds = %while.cond42.preheader.loopexit.unr-lcssa, %if.then.epil, %for.body32.epil, %for.cond30.preheader %cnt.0.lcssa = phi i32 [ 0, %for.cond30.preheader ], [ %cnt.1.lcssa.ph, %while.cond42.preheader.loopexit.unr-lcssa ], [ %inc38.epil, %if.then.epil ], [ %cnt.0441.unr, %for.body32.epil ] %res.0.lcssa = phi i32 [ 0, %for.cond30.preheader ], [ %res.1.lcssa.ph, %while.cond42.preheader.loopexit.unr-lcssa ], [ %add37.epil, %if.then.epil ], [ %res.0442.unr, %for.body32.epil ] %mul57 = mul i32 %cnt.0.lcssa, %call2 br label %if.end54 for.body32: ; preds = %for.inc39.1, %for.body32.preheader.new %indvars.iv460 = phi i64 [ 0, %for.body32.preheader.new ], [ %indvars.iv.next461.1, %for.inc39.1 ] %res.0442 = phi i32 [ 0, %for.body32.preheader.new ], [ %res.1.1, %for.inc39.1 ] %cnt.0441 = phi i32 [ 0, %for.body32.preheader.new ], [ %cnt.1.1, %for.inc39.1 ] %niter = phi i64 [ 0, %for.body32.preheader.new ], [ %niter.next.1, %for.inc39.1 ] %158 = trunc i64 %indvars.iv460 to i32 %shl33 = shl nuw i32 1, %158 %and = and i32 %shl33, %s.0450 %tobool34.not = icmp eq i32 %and, 0 br i1 %tobool34.not, label %for.inc39, label %if.then if.then: ; preds = %for.body32 %arrayidx36 = getelementptr inbounds [6 x i32], ptr @f, i64 0, i64 %indvars.iv460 %159 = load i32, ptr %arrayidx36, align 8, !tbaa !5 %add37 = add nsw i32 %159, %res.0442 %inc38 = add nsw i32 %cnt.0441, 1 br label %for.inc39 for.inc39: ; preds = %for.body32, %if.then %cnt.1 = phi i32 [ %inc38, %if.then ], [ %cnt.0441, %for.body32 ] %res.1 = phi i32 [ %add37, %if.then ], [ %res.0442, %for.body32 ] %indvars.iv.next461 = or i64 %indvars.iv460, 1 %160 = trunc i64 %indvars.iv.next461 to i32 %shl33.1 = shl nuw i32 1, %160 %and.1 = and i32 %shl33.1, %s.0450 %tobool34.not.1 = icmp eq i32 %and.1, 0 br i1 %tobool34.not.1, label %for.inc39.1, label %if.then.1 if.then.1: ; preds = %for.inc39 %arrayidx36.1 = getelementptr inbounds [6 x i32], ptr @f, i64 0, i64 %indvars.iv.next461 %161 = load i32, ptr %arrayidx36.1, align 4, !tbaa !5 %add37.1 = add nsw i32 %161, %res.1 %inc38.1 = add nsw i32 %cnt.1, 1 br label %for.inc39.1 for.inc39.1: ; preds = %if.then.1, %for.inc39 %cnt.1.1 = phi i32 [ %inc38.1, %if.then.1 ], [ %cnt.1, %for.inc39 ] %res.1.1 = phi i32 [ %add37.1, %if.then.1 ], [ %res.1, %for.inc39 ] %indvars.iv.next461.1 = add nuw nsw i64 %indvars.iv460, 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 %while.cond42.preheader.loopexit.unr-lcssa, label %for.body32, !llvm.loop !44 if.then46: ; preds = %if.end70 %call47 = tail call i32 @calc(i32 noundef %s.0450, i32 noundef %shr.lb.0) %mul48 = mul i32 %mul57, %shr.lb.0 %add49 = add i32 %mul48, %res.0.lcssa %add50 = add i32 %add49, %call47 %spec.select = tail call i32 @llvm.smin.i32(i32 %ans.0449, i32 %add50) br label %for.inc74 if.end54: ; preds = %while.cond42.preheader, %if.end70 %ub.0447 = phi i32 [ 4001, %while.cond42.preheader ], [ %ub.0.shr, %if.end70 ] %lb.0446 = phi i32 [ 0, %while.cond42.preheader ], [ %shr.lb.0, %if.end70 ] %add55 = add nsw i32 %ub.0447, %lb.0446 %shr = ashr i32 %add55, 1 %call56 = tail call i32 @calc(i32 noundef %s.0450, i32 noundef %shr) %mul58 = mul i32 %mul57, %shr %add59 = add nsw i32 %call56, %mul58 %cmp60 = icmp slt i32 %add59, 0 br i1 %cmp60, label %for.inc74, label %if.end62 if.end62: ; preds = %if.end54 %sub = add nsw i32 %shr, -1 %call63 = tail call i32 @calc(i32 noundef %s.0450, i32 noundef %sub) %mul66 = mul i32 %mul57, %sub %add67 = add nsw i32 %call63, %mul66 %cmp68 = icmp slt i32 %add67, 0 br i1 %cmp68, label %for.inc74, label %if.end70 if.end70: ; preds = %if.end62 %cmp71 = icmp ult i32 %add59, %add67 %shr.lb.0 = select i1 %cmp71, i32 %shr, i32 %lb.0446 %ub.0.shr = select i1 %cmp71, i32 %ub.0447, i32 %shr %add44 = add nsw i32 %shr.lb.0, 1 %cmp45.not = icmp slt i32 %add44, %ub.0.shr br i1 %cmp45.not, label %if.end54, label %if.then46 for.inc74: ; preds = %if.end54, %if.end62, %if.then46 %ans.1 = phi i32 [ %spec.select, %if.then46 ], [ %ans.0449, %if.end62 ], [ %ans.0449, %if.end54 ] %inc75 = add nuw nsw i32 %s.0450, 1 %exitcond463.not = icmp eq i32 %inc75, %smax br i1 %exitcond463.not, label %for.end76, label %for.cond30.preheader, !llvm.loop !45 for.end76: ; preds = %for.inc74, %for.end24 %ans.0.lcssa = phi i32 [ 269488144, %for.end24 ], [ %ans.1, %for.inc74 ] %call77 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa) %call = tail call i32 @in() store i32 %call, ptr @N, align 4, !tbaa !5 %tobool.not = icmp eq i32 %call, 0 br i1 %tobool.not, label %while.end78, label %while.body, !llvm.loop !46 while.end78: ; preds = %for.end76, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 declare i32 @__uflow(ptr noundef) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #8 attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { 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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree 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 = { "no-trapping-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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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 = !{!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 = !{!"", !6, i64 0, !6, i64 4} !11 = !{!10, !6, i64 4} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = !{!15, !6, i64 0} !15 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12} !16 = !{!15, !6, i64 8} !17 = !{!15, !6, i64 12} !18 = !{!15, !6, i64 4} !19 = distinct !{!19, !13} !20 = distinct !{!20, !13} !21 = distinct !{!21, !13} !22 = distinct !{!22, !13, !23, !24} !23 = !{!"llvm.loop.isvectorized", i32 1} !24 = !{!"llvm.loop.unroll.runtime.disable"} !25 = distinct !{!25, !13, !24, !23} !26 = distinct !{!26, !13} !27 = distinct !{!27, !13} !28 = !{!29, !29, i64 0} !29 = !{!"any pointer", !7, i64 0} !30 = !{!31, !29, i64 8} !31 = !{!"_IO_FILE", !6, i64 0, !29, i64 8, !29, i64 16, !29, i64 24, !29, i64 32, !29, i64 40, !29, i64 48, !29, i64 56, !29, i64 64, !29, i64 72, !29, i64 80, !29, i64 88, !29, i64 96, !29, i64 104, !6, i64 112, !6, i64 116, !32, i64 120, !33, i64 128, !7, i64 130, !7, i64 131, !29, i64 136, !32, i64 144, !29, i64 152, !29, i64 160, !29, i64 168, !29, i64 176, !32, i64 184, !6, i64 192, !7, i64 196} !32 = !{!"long", !7, i64 0} !33 = !{!"short", !7, i64 0} !34 = !{!31, !29, i64 16} !35 = !{!"branch_weights", i32 2000, i32 1} !36 = !{!7, !7, i64 0} !37 = distinct !{!37, !13} !38 = distinct !{!38, !13} !39 = distinct !{!39, !13} !40 = distinct !{!40, !13} !41 = distinct !{!41, !13} !42 = distinct !{!42, !13} !43 = distinct !{!43, !13} !44 = distinct !{!44, !13} !45 = distinct !{!45, !13} !46 = distinct !{!46, !13}
#include<stdio.h> int main(void) { char data[7][4] = { "thu","fri","sat","sun","mon","tue","wed" }; int X = 0; scanf("%d", &X); printf("%s\n", data[X%7]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171017/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171017/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" @__const.main.data = private unnamed_addr constant [7 x [4 x i8]] [[4 x i8] c"thu\00", [4 x i8] c"fri\00", [4 x i8] c"sat\00", [4 x i8] c"sun\00", [4 x i8] c"mon\00", [4 x i8] c"tue\00", [4 x i8] c"wed\00"], align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4 store i32 0, ptr %X, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %rem = srem i32 %0, 7 %idxprom = sext i32 %rem to i64 %arrayidx = getelementptr inbounds [7 x [4 x i8]], ptr @__const.main.data, i64 0, i64 %idxprom %puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #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"}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define ll long long void swap (int *x, int *y) { int temp; temp = *x; *x = *y; *y = temp; return; } //naosu long int gcd(long int a,long int b){ long int c; while (b > 0){ c = a % b; a = b; b = c; } return a; } 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; } void sortup(ll*a,int n){ qsort(a,n,sizeof(ll),upll); } void sortdown(ll*a,int n){ qsort(a,n,sizeof(ll),downll); } long int modpow(long int a,long int n,long int mod){ long int ans=1; while(n>0){ if(n & 1){ ans=ans*a%mod; } a=a*a%mod; n/=2; } return ans; } long int modinv(long int a,long int mod){ return modpow(a,mod-2,mod); } 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; } long int lcm(long int a,long int b){ return a/gcd(a,b)*b; } long int f(long int n,long int c,long int d){ long int cnt=n/c+n/d-n/lcm(c,d); return n-cnt; } /****************************************\ | Thank you for viewing my code:) | | Written by RedSpica a.k.a. RanseMirage | | Twitter:@asakaakasaka | \****************************************/ int main(void){ long int n,x,m; scanf("%ld%ld%ld",&n,&x,&m); if(x==1){ printf("%ld\n",n); return 0; } long int A[m]; long int B[m]; for(int i=0;i<m;i++){ A[i]=0; B[i]=0; } A[0]=x; B[x]++; int zero=0; int roopP=m; int roopV=0; long int all=0; for(int i=1;i<m;i++){ A[i]=modpow(A[i-1],2,m); B[A[i]]++; all+=A[i]; if(A[i]==0){ zero=1; break; } if(B[A[i]]==2){ roopP=i; roopV=A[i]; break; } } long int ans=0; if(n<=m){ for(int i=0;i<n;i++){ ans+=A[i]; } printf("%ld\n",ans); return 0; } if(zero==1){ for(int i=0;i<m;i++){ ans+=A[i]; } printf("%ld\n",ans); return 0; } int l=-1,r=-1; for(int i=0;i<m;i++){ if(A[i]==roopV && l==-1){ l=i; continue; } if(A[i]==roopV && r==-1){ r=i; } } for(int i=0;i<l;i++){ ans+=A[i]; } n-=l; if(roopP!=m){ all=0; for(int i=l;i<r;i++){ all+=A[i]; } } ans+=(n/(r-l))*all; n%=(r-l); for(int i=l;i<l+n;i++){ ans+=A[i]; } printf("%ld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171060/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171060/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 [10 x i8] c"%ld%ld%ld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\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 norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp4 = icmp sgt i64 %b, 0 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i64 %a.addr.06, %b.addr.05 %cmp = icmp sgt i64 %rem, 0 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i64 %a.addr.0.lcssa } ; 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) #3 { entry: %0 = load i64, ptr %a, align 8, !tbaa !11 %1 = load i64, ptr %b, align 8, !tbaa !11 %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) #3 { entry: %0 = load i64, ptr %a, align 8, !tbaa !11 %1 = load i64, ptr %b, align 8, !tbaa !11 %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: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #4 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #11 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #4 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #11 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @modpow(i64 noundef %a, i64 noundef %n, i64 noundef %mod) local_unnamed_addr #2 { entry: %cmp10 = icmp sgt i64 %n, 0 br i1 %cmp10, label %while.body, label %while.end while.body: ; preds = %entry, %if.end %ans.013 = phi i64 [ %ans.1, %if.end ], [ 1, %entry ] %a.addr.012 = phi i64 [ %rem2, %if.end ], [ %a, %entry ] %n.addr.011 = phi i64 [ %div9, %if.end ], [ %n, %entry ] %and = and i64 %n.addr.011, 1 %tobool.not = icmp eq i64 %and, 0 br i1 %tobool.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul nsw i64 %ans.013, %a.addr.012 %rem = srem i64 %mul, %mod br label %if.end if.end: ; preds = %if.then, %while.body %ans.1 = phi i64 [ %rem, %if.then ], [ %ans.013, %while.body ] %mul1 = mul nsw i64 %a.addr.012, %a.addr.012 %rem2 = srem i64 %mul1, %mod %div9 = lshr i64 %n.addr.011, 1 %cmp.not = icmp ult i64 %n.addr.011, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %if.end, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %ans.1, %if.end ] ret i64 %ans.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @modinv(i64 noundef %a, i64 noundef %mod) local_unnamed_addr #2 { entry: %cmp10.i = icmp sgt i64 %mod, 2 br i1 %cmp10.i, label %while.body.i.preheader, label %modpow.exit while.body.i.preheader: ; preds = %entry %sub = add nsw i64 %mod, -2 br label %while.body.i while.body.i: ; preds = %while.body.i.preheader, %if.end.i %ans.013.i = phi i64 [ %ans.1.i, %if.end.i ], [ 1, %while.body.i.preheader ] %a.addr.012.i = phi i64 [ %rem2.i, %if.end.i ], [ %a, %while.body.i.preheader ] %n.addr.011.i = phi i64 [ %div9.i, %if.end.i ], [ %sub, %while.body.i.preheader ] %and.i = and i64 %n.addr.011.i, 1 %tobool.not.i = icmp eq i64 %and.i, 0 br i1 %tobool.not.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %while.body.i %mul.i = mul nsw i64 %a.addr.012.i, %ans.013.i %rem.i = srem i64 %mul.i, %mod br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.i %ans.1.i = phi i64 [ %rem.i, %if.then.i ], [ %ans.013.i, %while.body.i ] %mul1.i = mul nsw i64 %a.addr.012.i, %a.addr.012.i %rem2.i = srem i64 %mul1.i, %mod %div9.i = lshr i64 %n.addr.011.i, 1 %cmp.not.i = icmp ult i64 %n.addr.011.i, 2 br i1 %cmp.not.i, label %modpow.exit, label %while.body.i, !llvm.loop !13 modpow.exit: ; preds = %if.end.i, %entry %ans.0.lcssa.i = phi i64 [ 1, %entry ], [ %ans.1.i, %if.end.i ] ret i64 %ans.0.lcssa.i } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #6 { 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 #6 { 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 norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp4.i = icmp sgt i64 %b, 0 br i1 %cmp4.i, label %while.body.i, label %gcd.exit while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i64 %a.addr.06.i, %b.addr.05.i %cmp.i = icmp sgt i64 %rem.i, 0 br i1 %cmp.i, label %while.body.i, label %gcd.exit, !llvm.loop !9 gcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i64 %a, %a.addr.0.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @f(i64 noundef %n, i64 noundef %c, i64 noundef %d) local_unnamed_addr #2 { entry: %cmp4.i.i = icmp sgt i64 %d, 0 br i1 %cmp4.i.i, label %while.body.i.i, label %lcm.exit while.body.i.i: ; preds = %entry, %while.body.i.i %a.addr.06.i.i = phi i64 [ %b.addr.05.i.i, %while.body.i.i ], [ %c, %entry ] %b.addr.05.i.i = phi i64 [ %rem.i.i, %while.body.i.i ], [ %d, %entry ] %rem.i.i = srem i64 %a.addr.06.i.i, %b.addr.05.i.i %cmp.i.i = icmp sgt i64 %rem.i.i, 0 br i1 %cmp.i.i, label %while.body.i.i, label %lcm.exit, !llvm.loop !9 lcm.exit: ; preds = %while.body.i.i, %entry %a.addr.0.lcssa.i.i = phi i64 [ %c, %entry ], [ %b.addr.05.i.i, %while.body.i.i ] %div = sdiv i64 %n, %c %div1 = sdiv i64 %n, %d %div.i = sdiv i64 %c, %a.addr.0.lcssa.i.i %mul.i = mul nsw i64 %div.i, %d %div2 = sdiv i64 %n, %mul.i %0 = add i64 %div, %div1 %sub.neg = sub i64 %n, %0 %sub3 = add i64 %sub.neg, %div2 ret i64 %sub3 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %n = alloca i64, align 8 %x = alloca i64, align 8 %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #11 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x, ptr noundef nonnull %m) %0 = load i64, ptr %x, align 8, !tbaa !14 %cmp = icmp eq i64 %0, 1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %1 = load i64, ptr %n, align 8, !tbaa !14 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %1) br label %cleanup179 if.end: ; preds = %entry %2 = load i64, ptr %m, align 8, !tbaa !14 %3 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %2, align 16 %4 = load i64, ptr %m, align 8, !tbaa !14 %vla2 = alloca i64, i64 %4, align 16 %cmp3232 = icmp sgt i64 %4, 0 br i1 %cmp3232, label %for.cond.cleanup, label %for.cond.cleanup.thread for.cond.cleanup.thread: ; preds = %if.end %5 = load i64, ptr %x, align 8, !tbaa !14 store i64 %5, ptr %vla, align 16, !tbaa !14 br label %cleanup for.cond.cleanup: ; preds = %if.end %6 = shl nuw i64 %4, 3 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla, i8 0, i64 %6, i1 false), !tbaa !14 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla2, i8 0, i64 %6, i1 false), !tbaa !14 %7 = load i64, ptr %x, align 8, !tbaa !14 store i64 %7, ptr %vla, align 16, !tbaa !14 %arrayidx8 = getelementptr inbounds i64, ptr %vla2, i64 %7 %8 = load i64, ptr %arrayidx8, align 8, !tbaa !14 %inc9 = add nsw i64 %8, 1 store i64 %inc9, ptr %arrayidx8, align 8, !tbaa !14 %cmp14235.not = icmp eq i64 %4, 1 br i1 %cmp14235.not, label %cleanup, label %if.end.i.1 if.end.i.1: ; preds = %for.cond.cleanup, %for.inc45 %9 = phi i64 [ %rem2.i, %for.inc45 ], [ %7, %for.cond.cleanup ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc45 ], [ 1, %for.cond.cleanup ] %all.0236 = phi i64 [ %add, %for.inc45 ], [ 0, %for.cond.cleanup ] %mul1.i = mul nsw i64 %9, %9 %rem2.i = srem i64 %mul1.i, %4 %arrayidx22 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv store i64 %rem2.i, ptr %arrayidx22, align 8, !tbaa !14 %arrayidx25 = getelementptr inbounds i64, ptr %vla2, i64 %rem2.i %10 = load i64, ptr %arrayidx25, align 8, !tbaa !14 %inc26 = add nsw i64 %10, 1 store i64 %inc26, ptr %arrayidx25, align 8, !tbaa !14 %add = add nuw nsw i64 %rem2.i, %all.0236 %cmp31 = icmp eq i64 %rem2.i, 0 br i1 %cmp31, label %cleanup, label %if.end34 if.end34: ; preds = %if.end.i.1 %cmp38 = icmp eq i64 %inc26, 2 br i1 %cmp38, label %if.then40, label %for.inc45 if.then40: ; preds = %if.end34 %sext = shl i64 %rem2.i, 32 %11 = ashr exact i64 %sext, 32 br label %cleanup for.inc45: ; preds = %if.end34 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %4 br i1 %exitcond.not, label %cleanup, label %if.end.i.1, !llvm.loop !16 cleanup: ; preds = %for.inc45, %if.end.i.1, %for.cond.cleanup.thread, %for.cond.cleanup, %if.then40 %cmp67 = phi i1 [ false, %if.then40 ], [ false, %for.cond.cleanup ], [ false, %for.cond.cleanup.thread ], [ %cmp31, %if.end.i.1 ], [ %cmp31, %for.inc45 ] %roopP.0.in = phi i64 [ %indvars.iv, %if.then40 ], [ 1, %for.cond.cleanup ], [ %4, %for.cond.cleanup.thread ], [ %4, %if.end.i.1 ], [ %4, %for.inc45 ] %roopV.0 = phi i64 [ %11, %if.then40 ], [ 0, %for.cond.cleanup ], [ 0, %for.cond.cleanup.thread ], [ 0, %if.end.i.1 ], [ 0, %for.inc45 ] %all.1 = phi i64 [ %add, %if.then40 ], [ 0, %for.cond.cleanup ], [ 0, %for.cond.cleanup.thread ], [ %add, %if.end.i.1 ], [ %add, %for.inc45 ] %12 = load i64, ptr %n, align 8, !tbaa !14 %cmp48.not = icmp sgt i64 %12, %4 br i1 %cmp48.not, label %if.end66, label %for.cond52.preheader for.cond52.preheader: ; preds = %cleanup %cmp54242 = icmp sgt i64 %12, 0 br i1 %cmp54242, label %for.body57.preheader, label %cleanup173 for.body57.preheader: ; preds = %for.cond52.preheader %min.iters.check = icmp ult i64 %12, 4 br i1 %min.iters.check, label %for.body57.preheader404, label %vector.ph vector.ph: ; preds = %for.body57.preheader %n.vec = and i64 %12, -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 ], [ %15, %vector.body ] %vec.phi320 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %13 = getelementptr inbounds i64, ptr %vla, i64 %index %wide.load = load <2 x i64>, ptr %13, align 16, !tbaa !14 %14 = getelementptr inbounds i64, ptr %13, i64 2 %wide.load321 = load <2 x i64>, ptr %14, align 16, !tbaa !14 %15 = add <2 x i64> %wide.load, %vec.phi %16 = add <2 x i64> %wide.load321, %vec.phi320 %index.next = add nuw i64 %index, 4 %17 = icmp eq i64 %index.next, %n.vec br i1 %17, label %middle.block, label %vector.body, !llvm.loop !17 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %16, %15 %18 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %12, %n.vec br i1 %cmp.n, label %cleanup173, label %for.body57.preheader404 for.body57.preheader404: ; preds = %for.body57.preheader, %middle.block %indvars.iv279.ph = phi i64 [ 0, %for.body57.preheader ], [ %n.vec, %middle.block ] %ans.0243.ph = phi i64 [ 0, %for.body57.preheader ], [ %18, %middle.block ] br label %for.body57 for.body57: ; preds = %for.body57.preheader404, %for.body57 %indvars.iv279 = phi i64 [ %indvars.iv.next280, %for.body57 ], [ %indvars.iv279.ph, %for.body57.preheader404 ] %ans.0243 = phi i64 [ %add60, %for.body57 ], [ %ans.0243.ph, %for.body57.preheader404 ] %arrayidx59 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv279 %19 = load i64, ptr %arrayidx59, align 8, !tbaa !14 %add60 = add nsw i64 %19, %ans.0243 %indvars.iv.next280 = add nuw nsw i64 %indvars.iv279, 1 %exitcond282.not = icmp eq i64 %indvars.iv.next280, %12 br i1 %exitcond282.not, label %cleanup173, label %for.body57, !llvm.loop !20 if.end66: ; preds = %cleanup br i1 %cmp67, label %for.cond71.preheader, label %for.cond87.preheader for.cond87.preheader: ; preds = %if.end66 br i1 %cmp3232, label %for.body92.preheader, label %for.cond.cleanup120 for.body92.preheader: ; preds = %for.cond87.preheader %xtraiter = and i64 %4, 1 %20 = icmp eq i64 %4, 1 br i1 %20, label %for.cond117.preheader.unr-lcssa, label %for.body92.preheader.new for.body92.preheader.new: ; preds = %for.body92.preheader %unroll_iter = and i64 %4, -2 br label %for.body92 for.cond71.preheader: ; preds = %if.end66 br i1 %cmp3232, label %for.body76.preheader, label %cleanup173 for.body76.preheader: ; preds = %for.cond71.preheader %min.iters.check377 = icmp ult i64 %4, 4 br i1 %min.iters.check377, label %for.body76.preheader392, label %vector.ph378 vector.ph378: ; preds = %for.body76.preheader %n.vec380 = and i64 %4, -4 br label %vector.body383 vector.body383: ; preds = %vector.body383, %vector.ph378 %index384 = phi i64 [ 0, %vector.ph378 ], [ %index.next389, %vector.body383 ] %vec.phi385 = phi <2 x i64> [ zeroinitializer, %vector.ph378 ], [ %23, %vector.body383 ] %vec.phi386 = phi <2 x i64> [ zeroinitializer, %vector.ph378 ], [ %24, %vector.body383 ] %21 = getelementptr inbounds i64, ptr %vla, i64 %index384 %wide.load387 = load <2 x i64>, ptr %21, align 16, !tbaa !14 %22 = getelementptr inbounds i64, ptr %21, i64 2 %wide.load388 = load <2 x i64>, ptr %22, align 16, !tbaa !14 %23 = add <2 x i64> %wide.load387, %vec.phi385 %24 = add <2 x i64> %wide.load388, %vec.phi386 %index.next389 = add nuw i64 %index384, 4 %25 = icmp eq i64 %index.next389, %n.vec380 br i1 %25, label %middle.block375, label %vector.body383, !llvm.loop !21 middle.block375: ; preds = %vector.body383 %bin.rdx390 = add <2 x i64> %24, %23 %26 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx390) %cmp.n382 = icmp eq i64 %4, %n.vec380 br i1 %cmp.n382, label %cleanup173, label %for.body76.preheader392 for.body76.preheader392: ; preds = %for.body76.preheader, %middle.block375 %indvars.iv299.ph = phi i64 [ 0, %for.body76.preheader ], [ %n.vec380, %middle.block375 ] %ans.1269.ph = phi i64 [ 0, %for.body76.preheader ], [ %26, %middle.block375 ] br label %for.body76 for.body76: ; preds = %for.body76.preheader392, %for.body76 %indvars.iv299 = phi i64 [ %indvars.iv.next300, %for.body76 ], [ %indvars.iv299.ph, %for.body76.preheader392 ] %ans.1269 = phi i64 [ %add79, %for.body76 ], [ %ans.1269.ph, %for.body76.preheader392 ] %arrayidx78 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv299 %27 = load i64, ptr %arrayidx78, align 8, !tbaa !14 %add79 = add nsw i64 %27, %ans.1269 %indvars.iv.next300 = add nuw nsw i64 %indvars.iv299, 1 %exitcond302.not = icmp eq i64 %indvars.iv.next300, %4 br i1 %exitcond302.not, label %cleanup173, label %for.body76, !llvm.loop !22 for.cond117.preheader.unr-lcssa: ; preds = %for.body92, %for.body92.preheader %l.1.lcssa.ph = phi i32 [ undef, %for.body92.preheader ], [ %l.1.1, %for.body92 ] %r.1.lcssa.ph = phi i32 [ undef, %for.body92.preheader ], [ %r.1.1, %for.body92 ] %indvars.iv283.unr = phi i64 [ 0, %for.body92.preheader ], [ %indvars.iv.next284.1, %for.body92 ] %r.0249.unr = phi i32 [ -1, %for.body92.preheader ], [ %r.1.1, %for.body92 ] %l.0248.unr = phi i32 [ -1, %for.body92.preheader ], [ %l.1.1, %for.body92 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond117.preheader, label %for.body92.epil for.body92.epil: ; preds = %for.cond117.preheader.unr-lcssa %arrayidx94.epil = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv283.unr %28 = load i64, ptr %arrayidx94.epil, align 8, !tbaa !14 %cmp96.epil = icmp eq i64 %28, %roopV.0 %cmp98.epil = icmp eq i32 %l.0248.unr, -1 %or.cond.epil = select i1 %cmp96.epil, i1 %cmp98.epil, i1 false %cmp108.epil = icmp eq i32 %r.0249.unr, -1 %or.cond182.epil = select i1 %cmp96.epil, i1 %cmp108.epil, i1 false %29 = trunc i64 %indvars.iv283.unr to i32 %spec.select.epil = select i1 %or.cond182.epil, i32 %29, i32 %r.0249.unr %l.1.epil = select i1 %or.cond.epil, i32 %29, i32 %l.0248.unr %r.1.epil = select i1 %or.cond.epil, i32 %r.0249.unr, i32 %spec.select.epil br label %for.cond117.preheader for.cond117.preheader: ; preds = %for.cond117.preheader.unr-lcssa, %for.body92.epil %l.1.lcssa = phi i32 [ %l.1.lcssa.ph, %for.cond117.preheader.unr-lcssa ], [ %l.1.epil, %for.body92.epil ] %r.1.lcssa = phi i32 [ %r.1.lcssa.ph, %for.cond117.preheader.unr-lcssa ], [ %r.1.epil, %for.body92.epil ] %cmp118254 = icmp sgt i32 %l.1.lcssa, 0 br i1 %cmp118254, label %for.body121.preheader, label %for.cond.cleanup120 for.body121.preheader: ; preds = %for.cond117.preheader %wide.trip.count = zext i32 %l.1.lcssa to i64 %min.iters.check324 = icmp ult i32 %l.1.lcssa, 4 br i1 %min.iters.check324, label %for.body121.preheader401, label %vector.ph325 vector.ph325: ; preds = %for.body121.preheader %n.vec327 = and i64 %wide.trip.count, 4294967292 br label %vector.body330 vector.body330: ; preds = %vector.body330, %vector.ph325 %index331 = phi i64 [ 0, %vector.ph325 ], [ %index.next336, %vector.body330 ] %vec.phi332 = phi <2 x i64> [ zeroinitializer, %vector.ph325 ], [ %32, %vector.body330 ] %vec.phi333 = phi <2 x i64> [ zeroinitializer, %vector.ph325 ], [ %33, %vector.body330 ] %30 = getelementptr inbounds i64, ptr %vla, i64 %index331 %wide.load334 = load <2 x i64>, ptr %30, align 16, !tbaa !14 %31 = getelementptr inbounds i64, ptr %30, i64 2 %wide.load335 = load <2 x i64>, ptr %31, align 16, !tbaa !14 %32 = add <2 x i64> %wide.load334, %vec.phi332 %33 = add <2 x i64> %wide.load335, %vec.phi333 %index.next336 = add nuw i64 %index331, 4 %34 = icmp eq i64 %index.next336, %n.vec327 br i1 %34, label %middle.block322, label %vector.body330, !llvm.loop !23 middle.block322: ; preds = %vector.body330 %bin.rdx337 = add <2 x i64> %33, %32 %35 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx337) %cmp.n329 = icmp eq i64 %n.vec327, %wide.trip.count br i1 %cmp.n329, label %for.cond.cleanup120, label %for.body121.preheader401 for.body121.preheader401: ; preds = %for.body121.preheader, %middle.block322 %indvars.iv287.ph = phi i64 [ 0, %for.body121.preheader ], [ %n.vec327, %middle.block322 ] %ans.2255.ph = phi i64 [ 0, %for.body121.preheader ], [ %35, %middle.block322 ] br label %for.body121 for.body92: ; preds = %for.body92, %for.body92.preheader.new %indvars.iv283 = phi i64 [ 0, %for.body92.preheader.new ], [ %indvars.iv.next284.1, %for.body92 ] %r.0249 = phi i32 [ -1, %for.body92.preheader.new ], [ %r.1.1, %for.body92 ] %l.0248 = phi i32 [ -1, %for.body92.preheader.new ], [ %l.1.1, %for.body92 ] %niter = phi i64 [ 0, %for.body92.preheader.new ], [ %niter.next.1, %for.body92 ] %arrayidx94 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv283 %36 = load i64, ptr %arrayidx94, align 16, !tbaa !14 %cmp96 = icmp eq i64 %36, %roopV.0 %cmp98 = icmp eq i32 %l.0248, -1 %or.cond = select i1 %cmp96, i1 %cmp98, i1 false %cmp108 = icmp eq i32 %r.0249, -1 %or.cond182 = select i1 %cmp96, i1 %cmp108, i1 false %37 = trunc i64 %indvars.iv283 to i32 %spec.select = select i1 %or.cond182, i32 %37, i32 %r.0249 %l.1 = select i1 %or.cond, i32 %37, i32 %l.0248 %r.1 = select i1 %or.cond, i32 %r.0249, i32 %spec.select %indvars.iv.next284 = or i64 %indvars.iv283, 1 %arrayidx94.1 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next284 %38 = load i64, ptr %arrayidx94.1, align 8, !tbaa !14 %cmp96.1 = icmp eq i64 %38, %roopV.0 %cmp98.1 = icmp eq i32 %l.1, -1 %or.cond.1 = select i1 %cmp96.1, i1 %cmp98.1, i1 false %cmp108.1 = icmp eq i32 %r.1, -1 %or.cond182.1 = select i1 %cmp96.1, i1 %cmp108.1, i1 false %39 = trunc i64 %indvars.iv.next284 to i32 %spec.select.1 = select i1 %or.cond182.1, i32 %39, i32 %r.1 %l.1.1 = select i1 %or.cond.1, i32 %39, i32 %l.1 %r.1.1 = select i1 %or.cond.1, i32 %r.1, i32 %spec.select.1 %indvars.iv.next284.1 = add nuw nsw i64 %indvars.iv283, 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.cond117.preheader.unr-lcssa, label %for.body92, !llvm.loop !24 for.cond.cleanup120: ; preds = %for.body121, %middle.block322, %for.cond87.preheader, %for.cond117.preheader %r.0.lcssa311 = phi i32 [ %r.1.lcssa, %for.cond117.preheader ], [ -1, %for.cond87.preheader ], [ %r.1.lcssa, %middle.block322 ], [ %r.1.lcssa, %for.body121 ] %l.0.lcssa310 = phi i32 [ %l.1.lcssa, %for.cond117.preheader ], [ -1, %for.cond87.preheader ], [ %l.1.lcssa, %middle.block322 ], [ %l.1.lcssa, %for.body121 ] %ans.2.lcssa = phi i64 [ 0, %for.cond117.preheader ], [ 0, %for.cond87.preheader ], [ %35, %middle.block322 ], [ %add124, %for.body121 ] %conv129 = sext i32 %l.0.lcssa310 to i64 %sub130 = sub nsw i64 %12, %conv129 %sext303 = shl i64 %roopP.0.in, 32 %conv131 = ashr exact i64 %sext303, 32 %cmp132.not = icmp eq i64 %4, %conv131 br i1 %cmp132.not, label %if.end148, label %for.cond136.preheader for.cond136.preheader: ; preds = %for.cond.cleanup120 %cmp137258 = icmp slt i32 %l.0.lcssa310, %r.0.lcssa311 br i1 %cmp137258, label %for.body140.preheader, label %if.end148 for.body140.preheader: ; preds = %for.cond136.preheader %wide.trip.count294 = sext i32 %r.0.lcssa311 to i64 %40 = sub nsw i64 %wide.trip.count294, %conv129 %min.iters.check341 = icmp ult i64 %40, 4 br i1 %min.iters.check341, label %for.body140.preheader398, label %vector.ph342 vector.ph342: ; preds = %for.body140.preheader %n.vec344 = and i64 %40, -4 %ind.end = add nsw i64 %n.vec344, %conv129 %invariant.gep = getelementptr i64, ptr %vla, i64 %conv129 br label %vector.body347 vector.body347: ; preds = %vector.body347, %vector.ph342 %index348 = phi i64 [ 0, %vector.ph342 ], [ %index.next353, %vector.body347 ] %vec.phi349 = phi <2 x i64> [ zeroinitializer, %vector.ph342 ], [ %42, %vector.body347 ] %vec.phi350 = phi <2 x i64> [ zeroinitializer, %vector.ph342 ], [ %43, %vector.body347 ] %gep = getelementptr i64, ptr %invariant.gep, i64 %index348 %wide.load351 = load <2 x i64>, ptr %gep, align 8, !tbaa !14 %41 = getelementptr inbounds i64, ptr %gep, i64 2 %wide.load352 = load <2 x i64>, ptr %41, align 8, !tbaa !14 %42 = add <2 x i64> %wide.load351, %vec.phi349 %43 = add <2 x i64> %wide.load352, %vec.phi350 %index.next353 = add nuw i64 %index348, 4 %44 = icmp eq i64 %index.next353, %n.vec344 br i1 %44, label %middle.block339, label %vector.body347, !llvm.loop !25 middle.block339: ; preds = %vector.body347 %bin.rdx354 = add <2 x i64> %43, %42 %45 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx354) %cmp.n346 = icmp eq i64 %40, %n.vec344 br i1 %cmp.n346, label %if.end148, label %for.body140.preheader398 for.body140.preheader398: ; preds = %for.body140.preheader, %middle.block339 %indvars.iv291.ph = phi i64 [ %conv129, %for.body140.preheader ], [ %ind.end, %middle.block339 ] %all.2259.ph = phi i64 [ 0, %for.body140.preheader ], [ %45, %middle.block339 ] br label %for.body140 for.body121: ; preds = %for.body121.preheader401, %for.body121 %indvars.iv287 = phi i64 [ %indvars.iv.next288, %for.body121 ], [ %indvars.iv287.ph, %for.body121.preheader401 ] %ans.2255 = phi i64 [ %add124, %for.body121 ], [ %ans.2255.ph, %for.body121.preheader401 ] %arrayidx123 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv287 %46 = load i64, ptr %arrayidx123, align 8, !tbaa !14 %add124 = add nsw i64 %46, %ans.2255 %indvars.iv.next288 = add nuw nsw i64 %indvars.iv287, 1 %exitcond290.not = icmp eq i64 %indvars.iv.next288, %wide.trip.count br i1 %exitcond290.not, label %for.cond.cleanup120, label %for.body121, !llvm.loop !26 for.body140: ; preds = %for.body140.preheader398, %for.body140 %indvars.iv291 = phi i64 [ %indvars.iv.next292, %for.body140 ], [ %indvars.iv291.ph, %for.body140.preheader398 ] %all.2259 = phi i64 [ %add143, %for.body140 ], [ %all.2259.ph, %for.body140.preheader398 ] %arrayidx142 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv291 %47 = load i64, ptr %arrayidx142, align 8, !tbaa !14 %add143 = add nsw i64 %47, %all.2259 %indvars.iv.next292 = add nsw i64 %indvars.iv291, 1 %exitcond295.not = icmp eq i64 %indvars.iv.next292, %wide.trip.count294 br i1 %exitcond295.not, label %if.end148, label %for.body140, !llvm.loop !27 if.end148: ; preds = %for.body140, %middle.block339, %for.cond136.preheader, %for.cond.cleanup120 %all.3 = phi i64 [ %all.1, %for.cond.cleanup120 ], [ 0, %for.cond136.preheader ], [ %45, %middle.block339 ], [ %add143, %for.body140 ] %sub149 = sub nsw i32 %r.0.lcssa311, %l.0.lcssa310 %conv150 = sext i32 %sub149 to i64 %div = sdiv i64 %sub130, %conv150 %mul = mul nsw i64 %div, %all.3 %add151 = add nsw i64 %mul, %ans.2.lcssa %rem = srem i64 %sub130, %conv150 store i64 %rem, ptr %n, align 8, !tbaa !14 %add158 = add i64 %rem, %conv129 %cmp159263 = icmp sgt i64 %rem, 0 br i1 %cmp159263, label %for.body162.preheader, label %cleanup173 for.body162.preheader: ; preds = %if.end148 %48 = add nsw i64 %conv129, 1 %smax = call i64 @llvm.smax.i64(i64 %add158, i64 %48) %49 = sub i64 %smax, %conv129 %min.iters.check358 = icmp ult i64 %49, 4 br i1 %min.iters.check358, label %for.body162.preheader394, label %vector.ph359 vector.ph359: ; preds = %for.body162.preheader %n.vec361 = and i64 %49, -4 %ind.end362 = add i64 %n.vec361, %conv129 %50 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %add151, i64 0 %invariant.gep427 = getelementptr i64, ptr %vla, i64 %conv129 br label %vector.body365 vector.body365: ; preds = %vector.body365, %vector.ph359 %index366 = phi i64 [ 0, %vector.ph359 ], [ %index.next372, %vector.body365 ] %vec.phi367 = phi <2 x i64> [ %50, %vector.ph359 ], [ %52, %vector.body365 ] %vec.phi368 = phi <2 x i64> [ zeroinitializer, %vector.ph359 ], [ %53, %vector.body365 ] %gep428 = getelementptr i64, ptr %invariant.gep427, i64 %index366 %wide.load370 = load <2 x i64>, ptr %gep428, align 8, !tbaa !14 %51 = getelementptr inbounds i64, ptr %gep428, i64 2 %wide.load371 = load <2 x i64>, ptr %51, align 8, !tbaa !14 %52 = add <2 x i64> %wide.load370, %vec.phi367 %53 = add <2 x i64> %wide.load371, %vec.phi368 %index.next372 = add nuw i64 %index366, 4 %54 = icmp eq i64 %index.next372, %n.vec361 br i1 %54, label %middle.block356, label %vector.body365, !llvm.loop !28 middle.block356: ; preds = %vector.body365 %bin.rdx373 = add <2 x i64> %53, %52 %55 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx373) %cmp.n364 = icmp eq i64 %49, %n.vec361 br i1 %cmp.n364, label %cleanup173, label %for.body162.preheader394 for.body162.preheader394: ; preds = %for.body162.preheader, %middle.block356 %indvars.iv296.ph = phi i64 [ %conv129, %for.body162.preheader ], [ %ind.end362, %middle.block356 ] %ans.3264.ph = phi i64 [ %add151, %for.body162.preheader ], [ %55, %middle.block356 ] br label %for.body162 for.body162: ; preds = %for.body162.preheader394, %for.body162 %indvars.iv296 = phi i64 [ %indvars.iv.next297, %for.body162 ], [ %indvars.iv296.ph, %for.body162.preheader394 ] %ans.3264 = phi i64 [ %add165, %for.body162 ], [ %ans.3264.ph, %for.body162.preheader394 ] %arrayidx164 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv296 %56 = load i64, ptr %arrayidx164, align 8, !tbaa !14 %add165 = add nsw i64 %56, %ans.3264 %indvars.iv.next297 = add nsw i64 %indvars.iv296, 1 %cmp159 = icmp sgt i64 %add158, %indvars.iv.next297 br i1 %cmp159, label %for.body162, label %cleanup173, !llvm.loop !29 cleanup173: ; preds = %for.body57, %for.body162, %for.body76, %middle.block, %middle.block356, %middle.block375, %if.end148, %for.cond71.preheader, %for.cond52.preheader %ans.3.lcssa.sink = phi i64 [ 0, %for.cond52.preheader ], [ 0, %for.cond71.preheader ], [ %add151, %if.end148 ], [ %26, %middle.block375 ], [ %55, %middle.block356 ], [ %18, %middle.block ], [ %add79, %for.body76 ], [ %add165, %for.body162 ], [ %add60, %for.body57 ] %call170 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.3.lcssa.sink) call void @llvm.stackrestore.p0(ptr %3) br label %cleanup179 cleanup179: ; preds = %cleanup173, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #8 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #9 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #9 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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 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 "no-trapping-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(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 "no-trapping-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 nocallback nofree nosync nounwind willreturn } attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #11 = { 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 = !{!12, !12, i64 0} !12 = !{!"long long", !7, i64 0} !13 = distinct !{!13, !10} !14 = !{!15, !15, i64 0} !15 = !{!"long", !7, i64 0} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !18, !19} !18 = !{!"llvm.loop.isvectorized", i32 1} !19 = !{!"llvm.loop.unroll.runtime.disable"} !20 = distinct !{!20, !10, !19, !18} !21 = distinct !{!21, !10, !18, !19} !22 = distinct !{!22, !10, !19, !18} !23 = distinct !{!23, !10, !18, !19} !24 = distinct !{!24, !10} !25 = distinct !{!25, !10, !18, !19} !26 = distinct !{!26, !10, !19, !18} !27 = distinct !{!27, !10, !19, !18} !28 = distinct !{!28, !10, !18, !19} !29 = distinct !{!29, !10, !19, !18}
#include <stdio.h> int main() { int a; scanf("%d",&a); if (a < 1200) printf("ABC"); else if (a < 2800) printf("ARC"); else printf("AGC"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171103/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171103/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"ABC\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"AGC\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 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 %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 1200 %cmp2 = icmp ult i32 %0, 2800 %.str.2..str.3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3 %.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) 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 a; scanf("%d",&a); if(a<1200)printf("ABC"); else if(a<2800)printf("ARC"); else printf("AGC"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171147/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171147/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"ABC\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"AGC\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 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 %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 1200 %cmp2 = icmp ult i32 %0, 2800 %.str.2..str.3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3 %.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) 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 r; scanf("%d",&r); if(r<1200) printf("ABC\n"); else if(r<2800) printf("ARC\n"); else printf("AGC\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171190/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171190/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"AGC\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"ABC\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load i32, ptr %r, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 1200 %cmp2 = icmp ult i32 %0, 2800 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts8 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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"}
#include<stdio.h> int main(void){ int a; scanf("%d", &a); if(a<1200) printf("ABC\n"); else if(a<2800) printf("ARC\n"); else printf("AGC\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171233/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171233/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"AGC\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"ABC\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 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 %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 1200 %cmp2 = icmp ult i32 %0, 2800 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts8 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int R; scanf("%d",&R); if (R<1200) { printf("ABC"); } else if (R<2800) { printf("ARC"); } else { printf("AGC"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171277/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171277/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"ABC\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"AGC\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %R = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R) %0 = load i32, ptr %R, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 1200 %cmp2 = icmp ult i32 %0, 2800 %.str.2..str.3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3 %.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #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 R; scanf("%d", &R); if(R<1200){ printf("ABC\n"); }else if(R<2800){ printf("ARC\n"); }else{ printf("AGC\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171327/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171327/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"AGC\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"ABC\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %R = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R) %0 = load i32, ptr %R, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 1200 %cmp2 = icmp ult i32 %0, 2800 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts8 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #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"}
#include <stdio.h> int main(){ int N; scanf("%d", &N); if(N<1200) printf("ABC"); else if(N<2800) printf("ARC"); else printf("AGC"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171370/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171370/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"ABC\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"AGC\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 %cmp = icmp slt i32 %0, 1200 %cmp2 = icmp ult i32 %0, 2800 %.str.2..str.3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3 %.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) 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> #include <stdlib.h> int main() { int b; int k=0,*a; scanf("%d",&b); int total=0; if(b%2==0) { k=b/2; a=(int *)malloc(k*sizeof(int)); for(int i=0 ; i<k ; i++) a[i]=2; b=0; } else { k=b/2; a=(int *)malloc(k*sizeof(int)); for(int i=0 ; i<k-1 ;i++) a[i]=2; a[k-1]=3; b=0; } printf("%d\n",k); for(int i=0 ; i<k ; i++) { printf("%d ",a[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17145/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17145/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 @.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: %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 %div = sdiv i32 %0, 2 %conv = sext i32 %div to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #6 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %cmp252 = icmp sgt i32 %0, 1 br i1 %cmp252, label %for.body.preheader, label %if.end for.body.preheader: ; preds = %if.then %wide.trip.count60 = zext i32 %div to i64 %min.iters.check69 = icmp ult i32 %div, 8 br i1 %min.iters.check69, label %for.body.preheader78, label %vector.ph70 vector.ph70: ; preds = %for.body.preheader %n.vec72 = and i64 %wide.trip.count60, 4294967288 br label %vector.body75 vector.body75: ; preds = %vector.body75, %vector.ph70 %index76 = phi i64 [ 0, %vector.ph70 ], [ %index.next77, %vector.body75 ] %2 = getelementptr inbounds i32, ptr %call1, i64 %index76 store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, ptr %2, align 4, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, ptr %3, align 4, !tbaa !5 %index.next77 = add nuw i64 %index76, 8 %4 = icmp eq i64 %index.next77, %n.vec72 br i1 %4, label %middle.block67, label %vector.body75, !llvm.loop !9 middle.block67: ; preds = %vector.body75 %cmp.n74 = icmp eq i64 %n.vec72, %wide.trip.count60 br i1 %cmp.n74, label %if.end, label %for.body.preheader78 for.body.preheader78: ; preds = %for.body.preheader, %middle.block67 %indvars.iv57.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec72, %middle.block67 ] br label %for.body for.body: ; preds = %for.body.preheader78, %for.body %indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.body ], [ %indvars.iv57.ph, %for.body.preheader78 ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv57 store i32 2, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60 br i1 %exitcond61.not, label %if.end, label %for.body, !llvm.loop !13 if.else: ; preds = %entry %sub = add nsw i32 %div, -1 %cmp1050 = icmp sgt i32 %0, 3 br i1 %cmp1050, label %for.body13.preheader, label %for.cond.cleanup12 for.body13.preheader: ; preds = %if.else %smax = call i32 @llvm.smax.i32(i32 %sub, i32 1) %wide.trip.count = zext i32 %smax to i64 %min.iters.check = icmp ult i32 %smax, 8 br i1 %min.iters.check, label %for.body13.preheader79, label %vector.ph vector.ph: ; preds = %for.body13.preheader %n.vec = and i64 %wide.trip.count, 2147483640 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %5 = getelementptr inbounds i32, ptr %call1, i64 %index store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, ptr %5, align 4, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, ptr %6, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %7 = icmp eq i64 %index.next, %n.vec br i1 %7, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup12, label %for.body13.preheader79 for.body13.preheader79: ; preds = %for.body13.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body13.preheader ], [ %n.vec, %middle.block ] br label %for.body13 for.cond.cleanup12: ; preds = %for.body13, %middle.block, %if.else %idxprom20 = sext i32 %sub to i64 %arrayidx21 = getelementptr inbounds i32, ptr %call1, i64 %idxprom20 store i32 3, ptr %arrayidx21, align 4, !tbaa !5 br label %if.end for.body13: ; preds = %for.body13.preheader79, %for.body13 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body13 ], [ %indvars.iv.ph, %for.body13.preheader79 ] %arrayidx15 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv store i32 2, ptr %arrayidx15, 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.cleanup12, label %for.body13, !llvm.loop !15 if.end: ; preds = %for.body, %middle.block67, %if.then, %for.cond.cleanup12 store i32 0, ptr %b, align 4, !tbaa !5 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) %cmp2554 = icmp sgt i32 %0, 1 br i1 %cmp2554, label %for.body28.preheader, label %for.cond.cleanup27 for.body28.preheader: ; preds = %if.end %wide.trip.count65 = zext i32 %div to i64 br label %for.body28 for.cond.cleanup27: ; preds = %for.body28, %if.end call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 ret i32 0 for.body28: ; preds = %for.body28.preheader, %for.body28 %indvars.iv62 = phi i64 [ 0, %for.body28.preheader ], [ %indvars.iv.next63, %for.body28 ] %arrayidx30 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv62 %8 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1 %exitcond66.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count65 br i1 %exitcond66.not, label %for.cond.cleanup27, label %for.body28, !llvm.loop !16 } ; 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: 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, 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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { 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, !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, !10}
#include <stdio.h> #include <math.h> #define PI 3.14159265358979323846264338327950L int main(void){ int A,B,H,M; double ans; scanf("%d%d%d%d",&A,&B,&H,&M); ans = cos(2*PI*(H/12.0 + (M/(60.0*12.0)) - M/60.0)); printf("%.20lf\n",sqrt(A*A+B*B-2*A*B*ans)); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171507/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171507/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%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%.20lf\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 %H = alloca i32, align 4 %M = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %H, ptr noundef nonnull %M) %0 = load i32, ptr %H, align 4, !tbaa !5 %1 = load i32, ptr %M, align 4, !tbaa !5 %2 = insertelement <2 x i32> poison, i32 %0, i64 0 %3 = insertelement <2 x i32> %2, i32 %1, i64 1 %4 = sitofp <2 x i32> %3 to <2 x double> %5 = extractelement <2 x double> %4, i64 1 %div2 = fdiv double %5, 7.200000e+02 %6 = fdiv <2 x double> %4, <double 1.200000e+01, double 6.000000e+01> %7 = extractelement <2 x double> %6, i64 0 %add = fadd double %7, %div2 %8 = extractelement <2 x double> %6, i64 1 %sub = fsub double %add, %8 %conv5 = fpext double %sub to x86_fp80 %mul = fmul x86_fp80 %conv5, 0xK4001C90FDAA22168C235 %conv6 = fptrunc x86_fp80 %mul to double %call7 = call double @cos(double noundef %conv6) #5 %9 = load i32, ptr %A, align 4, !tbaa !5 %mul8 = mul nsw i32 %9, %9 %10 = load i32, ptr %B, align 4, !tbaa !5 %mul9 = mul nsw i32 %10, %10 %add10 = add nuw nsw i32 %mul9, %mul8 %conv11 = sitofp i32 %add10 to double %mul12 = shl nsw i32 %9, 1 %mul13 = mul nsw i32 %mul12, %10 %conv14 = sitofp i32 %mul13 to double %neg = fneg double %conv14 %11 = call double @llvm.fmuladd.f64(double %neg, double %call7, double %conv11) %call16 = call double @sqrt(double noundef %11) #5 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call16) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #5 call void @llvm.lifetime.end.p0(i64 4, 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(write) declare double @cos(double noundef) local_unnamed_addr #3 ; 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 #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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 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"}
/* ex4_2 UMAboogie */ #include<stdio.h> #include<math.h> #define PI 3.14159265358979 //円周率を定義 int main(void){ int length_h, length_m, hour, minute; scanf("%d %d %d %d", &length_h, &length_m, &hour, &minute); //時針の長さと分針の長さと時間と分を入力 double angle_h = hour * PI / 6 + minute * PI / 360; //時針が進む角度を計算 double angle_m = minute * PI / 30; //分針が進む角度を計算 double angle_bet = fabs(angle_h - angle_m); //時針と分針の間の角度を計算 double answer = sqrt(length_h*length_h + length_m*length_m - 2*length_h*length_m*cos(angle_bet)); //余弦定理を用いて2本の針の端点の距離を計算 printf("%.10f",answer); //答えを出力(小数点以下10桁まで表示) return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171550/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171550/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"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%.10f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %length_h = alloca i32, align 4 %length_m = alloca i32, align 4 %hour = alloca i32, align 4 %minute = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %length_h) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %length_m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %hour) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %minute) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %length_h, ptr noundef nonnull %length_m, ptr noundef nonnull %hour, ptr noundef nonnull %minute) %0 = load i32, ptr %hour, align 4, !tbaa !5 %1 = load i32, ptr %minute, align 4, !tbaa !5 %2 = insertelement <2 x i32> poison, i32 %0, i64 0 %3 = insertelement <2 x i32> %2, i32 %1, i64 1 %4 = sitofp <2 x i32> %3 to <2 x double> %5 = fmul <2 x double> %4, <double 0x400921FB54442D11, double 0x400921FB54442D11> %6 = extractelement <2 x double> %5, i64 1 %div3 = fdiv double %6, 3.600000e+02 %7 = fdiv <2 x double> %5, <double 6.000000e+00, double 3.000000e+01> %8 = extractelement <2 x double> %7, i64 0 %add = fadd double %8, %div3 %9 = extractelement <2 x double> %7, i64 1 %sub = fsub double %add, %9 %10 = call double @llvm.fabs.f64(double %sub) %11 = load i32, ptr %length_h, align 4, !tbaa !5 %mul7 = mul nsw i32 %11, %11 %12 = load i32, ptr %length_m, align 4, !tbaa !5 %mul8 = mul nsw i32 %12, %12 %add9 = add nuw nsw i32 %mul8, %mul7 %conv10 = sitofp i32 %add9 to double %mul11 = shl nsw i32 %11, 1 %mul12 = mul nsw i32 %mul11, %12 %conv13 = sitofp i32 %mul12 to double %call14 = call double @cos(double noundef %10) #5 %neg = fneg double %conv13 %13 = call double @llvm.fmuladd.f64(double %neg, double %call14, double %conv10) %call16 = call double @sqrt(double noundef %13) #5 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call16) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %minute) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %hour) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %length_m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %length_h) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #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 @cos(double noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 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 = { 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"}
/* Kadai4_2 saitomo */ #include <stdio.h> #include <math.h> #define PI 3.14159265358979 //10^-9以下の誤差になるよう十分に PIを定義 int main(void){ double len_h,len_m,hour,min; //左から順に時針の長さ、分針の長さ、時、分 scanf("%lf%lf%lf%lf",&len_h,&len_m,&hour,&min); double angle,ans; //時針と分針の間の角度、答え angle=(0.5*(60*hour+min)-6*min)*PI/180; /*時針は1分に0.5度、分針は1分に6度動くことを利用し、差をとってからradに直している。  この際、cos(x)=cos(-x)より、正負は考えなくて良い*/ ans=sqrt(len_h*len_h+len_m*len_m-2*len_h*len_m*cos(angle)); //余弦定理の利用 printf("%.10lf\n",ans); //10^-9まで出す return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171594/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171594/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%lf%lf%lf\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%.10lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %len_h = alloca double, align 8 %len_m = alloca double, align 8 %hour = alloca double, align 8 %min = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %len_h) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %len_m) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %hour) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %min) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %len_h, ptr noundef nonnull %len_m, ptr noundef nonnull %hour, ptr noundef nonnull %min) %0 = load double, ptr %hour, align 8, !tbaa !5 %1 = load double, ptr %min, align 8, !tbaa !5 %2 = call double @llvm.fmuladd.f64(double %0, double 6.000000e+01, double %1) %neg = fmul double %1, -6.000000e+00 %3 = call double @llvm.fmuladd.f64(double %2, double 5.000000e-01, double %neg) %mul = fmul double %3, 0x400921FB54442D11 %div = fdiv double %mul, 1.800000e+02 %4 = load double, ptr %len_h, align 8, !tbaa !5 %5 = load double, ptr %len_m, align 8, !tbaa !5 %mul3 = fmul double %5, %5 %6 = call double @llvm.fmuladd.f64(double %4, double %4, double %mul3) %call6 = call double @cos(double noundef %div) #5 %7 = fmul double %4, -2.000000e+00 %neg8 = fmul double %7, %5 %8 = call double @llvm.fmuladd.f64(double %neg8, double %call6, double %6) %call9 = call double @sqrt(double noundef %8) #5 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call9) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %min) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %hour) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %len_m) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %len_h) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: 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 @cos(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 memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind 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 = { 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 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
/* ex4_2 takafumi_ueki */ #include <stdio.h> #include <math.h> #define PI 3.14159265358979 int main(void){ int hour_length,min_length,hour,min; double rad,distance; scanf("%d %d %d %d",&hour_length,&min_length,&hour,&min); //時針と分針の成す角を計算する rad = (PI*min/30)-(PI*(hour*60+min)/360); //余弦の定理を用いて端点の間の距離を計算する。 distance = sqrt((double)(pow(hour_length,2) + pow(min_length,2) - 2*hour_length*min_length*cos(rad))); //誤差の影響を考えて有効数字を設定する printf("%.9f\n",distance); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171637/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171637/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"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%.9f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %hour_length = alloca i32, align 4 %min_length = alloca i32, align 4 %hour = alloca i32, align 4 %min = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %hour_length) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %min_length) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %hour) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %min) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %hour_length, ptr noundef nonnull %min_length, ptr noundef nonnull %hour, ptr noundef nonnull %min) %0 = load i32, ptr %min, align 4, !tbaa !5 %1 = load i32, ptr %hour, align 4, !tbaa !5 %mul1 = mul nsw i32 %1, 60 %add = add nsw i32 %mul1, %0 %2 = insertelement <2 x i32> poison, i32 %0, i64 0 %3 = insertelement <2 x i32> %2, i32 %add, i64 1 %4 = sitofp <2 x i32> %3 to <2 x double> %5 = fmul <2 x double> %4, <double 0x400921FB54442D11, double 0x400921FB54442D11> %6 = fdiv <2 x double> %5, <double 3.000000e+01, double 3.600000e+02> %shift = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> <i32 1, i32 poison> %7 = fsub <2 x double> %6, %shift %sub = extractelement <2 x double> %7, i64 0 %8 = load i32, ptr %hour_length, align 4, !tbaa !5 %conv5 = sitofp i32 %8 to double %square = fmul double %conv5, %conv5 %9 = load i32, ptr %min_length, align 4, !tbaa !5 %conv7 = sitofp i32 %9 to double %square17 = fmul double %conv7, %conv7 %add9 = fadd double %square, %square17 %mul10 = shl nsw i32 %8, 1 %mul11 = mul nsw i32 %mul10, %9 %conv12 = sitofp i32 %mul11 to double %call13 = call double @cos(double noundef %sub) #5 %neg = fneg double %conv12 %10 = call double @llvm.fmuladd.f64(double %neg, double %call13, double %add9) %call15 = call double @sqrt(double noundef %10) #5 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call15) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %min) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %hour) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %min_length) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %hour_length) #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(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @cos(double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 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"}
#include <stdio.h> #include <math.h> #define PI 3.14159265358979323846264338327950L int main(void) { int a, b, h, m; scanf("%d%d%d%d", &a, &b, &h, &m); long double rad = PI * 2 * ( (long double)h / 12.0 + ((long double)m / 60.0) / 12.0 - (long double)m / 60.0); long double rsq = (long double)(a * a + b * b) - (long double)(2 * a * b) * cosl(rad); printf("%20.20Lf\n", sqrtl(rsq)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171680/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171680/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%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%20.20Lf\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 %h = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %h, ptr noundef nonnull %m) %0 = load i32, ptr %h, align 4, !tbaa !5 %conv = sitofp i32 %0 to x86_fp80 %div = fdiv x86_fp80 %conv, 0xK4002C000000000000000 %1 = load i32, ptr %m, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to x86_fp80 %div2 = fdiv x86_fp80 %conv1, 0xK4004F000000000000000 %div3 = fdiv x86_fp80 %div2, 0xK4002C000000000000000 %add = fadd x86_fp80 %div, %div3 %sub = fsub x86_fp80 %add, %div2 %mul = fmul x86_fp80 %sub, 0xK4001C90FDAA22168C235 %2 = load i32, ptr %a, align 4, !tbaa !5 %mul6 = mul nsw i32 %2, %2 %3 = load i32, ptr %b, align 4, !tbaa !5 %mul7 = mul nsw i32 %3, %3 %add8 = add nuw nsw i32 %mul7, %mul6 %conv9 = sitofp i32 %add8 to x86_fp80 %mul10 = shl nsw i32 %2, 1 %mul11 = mul nsw i32 %mul10, %3 %conv12 = sitofp i32 %mul11 to x86_fp80 %call13 = call x86_fp80 @cosl(x86_fp80 noundef %mul) #5 %neg = fneg x86_fp80 %conv12 %4 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %neg, x86_fp80 %call13, x86_fp80 %conv9) %call15 = call x86_fp80 @sqrtl(x86_fp80 noundef %4) #5 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, x86_fp80 noundef %call15) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, 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(write) declare x86_fp80 @cosl(x86_fp80 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare x86_fp80 @llvm.fmuladd.f80(x86_fp80, x86_fp80, x86_fp80) #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 x86_fp80 @sqrtl(x86_fp80 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 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 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"}
#include<stdio.h> #include<math.h> #define PI 3.14159265358979323846264338327950 int main(void){ double a,b,h,w; scanf("%lf%lf%lf%lf",&a,&b,&h,&w); double s; s=fabs(360*h/12+0.5*w-360*w/60); //if(s>180)s=360-s; double sita=s*PI/180; long double ans=sqrt(a*a+b*b-2*a*b*cosl(sita)); printf("%.20Lf",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171723/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171723/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%lf%lf%lf\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%.20Lf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca double, align 8 %b = alloca double, align 8 %h = alloca double, align 8 %w = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %w) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load double, ptr %h, align 8, !tbaa !5 %mul = fmul double %0, 3.600000e+02 %div = fdiv double %mul, 1.200000e+01 %1 = load double, ptr %w, align 8, !tbaa !5 %2 = call double @llvm.fmuladd.f64(double %1, double 5.000000e-01, double %div) %mul2 = fmul double %1, 3.600000e+02 %div3 = fdiv double %mul2, 6.000000e+01 %sub = fsub double %2, %div3 %3 = call double @llvm.fabs.f64(double %sub) %mul4 = fmul double %3, 0x400921FB54442D18 %div5 = fdiv double %mul4, 1.800000e+02 %4 = load double, ptr %a, align 8, !tbaa !5 %5 = load double, ptr %b, align 8, !tbaa !5 %mul7 = fmul double %5, %5 %6 = call double @llvm.fmuladd.f64(double %4, double %4, double %mul7) %conv = fpext double %6 to x86_fp80 %mul8 = fmul double %4, 2.000000e+00 %mul9 = fmul double %mul8, %5 %conv10 = fpext double %mul9 to x86_fp80 %conv11 = fpext double %div5 to x86_fp80 %call12 = call x86_fp80 @cosl(x86_fp80 noundef %conv11) #5 %neg = fneg x86_fp80 %conv10 %7 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %neg, x86_fp80 %call12, x86_fp80 %conv) %conv14 = fptrunc x86_fp80 %7 to double %call15 = call double @sqrt(double noundef %conv14) #5 %conv16 = fpext double %call15 to x86_fp80 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, x86_fp80 noundef %conv16) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %w) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #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 x86_fp80 @cosl(x86_fp80 noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare x86_fp80 @llvm.fmuladd.f80(x86_fp80, x86_fp80, x86_fp80) #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 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 = { 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 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define SIZE 100 #define PI acosl(-1)//3.14159265358979323846264338327950L #define rep(i, N) for (i = 0; i < N; i++) //制御変数iを用いてN回転 #define array(N, t) (t*)calloc(N, sizeof(t)) //t型N要素の1次元配列を動的確保後0クリア(freeを忘れずに) #define zero(a); {int iter; rep(iter, sizeof(a)/sizeof((a)[0])) (a)[iter]=0;} //1次元配列aのゼロ初期化? typedef long long ll; void print_log(); //とりあえず文字を出力してどこまで実行できているか確認(for debug) void printa_int(int *a, int size); //int型の1次元配列aを出力(for debug) int main() { long A, B, H, M; long double angle, dsq; scanf("%ld %ld %ld %ld", &A, &B, &H, &M); angle = 2.0L * PI * (H / 12.0L - 11.0L * M / 720.0L); dsq = (long double)(A * A + B * B) - (long double)(2 * A * B) * cosl(angle); printf("%.20llf\n", sqrtl(dsq)); return 0; } void print_log() { printf("===finish!===\n"); } void printa_int(int *a, int size) { int i; printf("["); for (i = 0; i < size; i++) printf("%d, ", a[i]); printf("]\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171767/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171767/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 [16 x i8] c"%ld %ld %ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%.20llf\0A\00", align 1 @.str.4 = private unnamed_addr constant [5 x i8] c"%d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"===finish!===\00", align 1 @str.6 = private unnamed_addr constant [2 x i8] c"]\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 %H = alloca i64, align 8 %M = 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 void @llvm.lifetime.start.p0(i64 8, ptr nonnull %H) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %M) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %H, ptr noundef nonnull %M) %call1 = call x86_fp80 @acosl(x86_fp80 noundef 0xKBFFF8000000000000000) #6 %mul = fmul x86_fp80 %call1, 0xK40008000000000000000 %0 = load i64, ptr %H, align 8, !tbaa !5 %conv = sitofp i64 %0 to x86_fp80 %div = fdiv x86_fp80 %conv, 0xK4002C000000000000000 %1 = load i64, ptr %M, align 8, !tbaa !5 %conv2 = sitofp i64 %1 to x86_fp80 %mul3 = fmul x86_fp80 %conv2, 0xK4002B000000000000000 %div4 = fdiv x86_fp80 %mul3, 0xK4008B400000000000000 %sub = fsub x86_fp80 %div, %div4 %mul5 = fmul x86_fp80 %mul, %sub %2 = load i64, ptr %A, align 8, !tbaa !5 %mul6 = mul nsw i64 %2, %2 %3 = load i64, ptr %B, align 8, !tbaa !5 %mul7 = mul nsw i64 %3, %3 %add = add nuw nsw i64 %mul7, %mul6 %conv8 = sitofp i64 %add to x86_fp80 %mul9 = shl nsw i64 %2, 1 %mul10 = mul nsw i64 %mul9, %3 %conv11 = sitofp i64 %mul10 to x86_fp80 %call12 = call x86_fp80 @cosl(x86_fp80 noundef %mul5) #6 %neg = fneg x86_fp80 %conv11 %4 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %neg, x86_fp80 %call12, x86_fp80 %conv8) %call14 = call x86_fp80 @sqrtl(x86_fp80 noundef %4) #6 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, x86_fp80 noundef %call14) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %M) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %H) #6 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: 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(write) declare x86_fp80 @acosl(x86_fp80 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare x86_fp80 @cosl(x86_fp80 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare x86_fp80 @llvm.fmuladd.f80(x86_fp80, x86_fp80, x86_fp80) #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 x86_fp80 @sqrtl(x86_fp80 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 uwtable define dso_local void @print_log() local_unnamed_addr #0 { entry: %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @printa_int(ptr nocapture noundef readonly %a, i32 noundef %size) local_unnamed_addr #0 { entry: %putchar = tail call i32 @putchar(i32 91) %cmp5 = icmp sgt i32 %size, 0 br i1 %cmp5, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %size 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 ] %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !9 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %0) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %entry %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.6) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 speculatable willreturn memory(none) } 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 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int m,n,i,j; scanf("%d %d",&n,&m); int d[n],f[m]; for(i=0;i<n;i++) { scanf("%d",&d[i]); } for(i=0;i<m;i++) { scanf("%d",&f[i]); } for(i=0;i<n;i++) { for(j=0;j<m;j++) { if(d[i]==f[j]) { printf("%d ",d[i]); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17181/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17181/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #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 %n, ptr noundef nonnull %m) %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 %m, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp43 = icmp sgt i32 %5, 0 br i1 %cmp43, label %for.body, label %for.cond3.preheader for.cond3.preheader.loopexit: ; preds = %for.body %.pre = load i32, ptr %m, align 4, !tbaa !5 br label %for.cond3.preheader for.cond3.preheader: ; preds = %for.cond3.preheader.loopexit, %entry %6 = phi i32 [ %8, %for.cond3.preheader.loopexit ], [ %5, %entry ] %7 = phi i32 [ %.pre, %for.cond3.preheader.loopexit ], [ %3, %entry ] %cmp445 = icmp sgt i32 %7, 0 br i1 %cmp445, label %for.body5, label %for.cond12.preheader 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 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp, label %for.body, label %for.cond3.preheader.loopexit, !llvm.loop !9 for.cond12.preheader.loopexit: ; preds = %for.body5 %.pre62 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond12.preheader for.cond12.preheader: ; preds = %for.cond12.preheader.loopexit, %for.cond3.preheader %10 = phi i32 [ %13, %for.cond12.preheader.loopexit ], [ %7, %for.cond3.preheader ] %11 = phi i32 [ %.pre62, %for.cond12.preheader.loopexit ], [ %6, %for.cond3.preheader ] %cmp1349 = icmp sgt i32 %11, 0 %12 = icmp sgt i32 %10, 0 %or.cond = and i1 %cmp1349, %12 br i1 %or.cond, label %for.cond15.preheader, label %for.end31 for.body5: ; preds = %for.cond3.preheader, %for.body5 %indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx7 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv53 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7) %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1 %13 = load i32, ptr %m, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp4 = icmp slt i64 %indvars.iv.next54, %14 br i1 %cmp4, label %for.body5, label %for.cond12.preheader.loopexit, !llvm.loop !11 for.cond15.preheader: ; preds = %for.cond12.preheader, %for.inc29 %15 = phi i32 [ %23, %for.inc29 ], [ %11, %for.cond12.preheader ] %16 = phi i32 [ %24, %for.inc29 ], [ %10, %for.cond12.preheader ] %17 = phi i32 [ %25, %for.inc29 ], [ %10, %for.cond12.preheader ] %indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.inc29 ], [ 0, %for.cond12.preheader ] %cmp1647 = icmp sgt i32 %17, 0 br i1 %cmp1647, label %for.body17.lr.ph, label %for.inc29 for.body17.lr.ph: ; preds = %for.cond15.preheader %arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv59 br label %for.body17 for.body17: ; preds = %for.body17.lr.ph, %for.inc26 %18 = phi i32 [ %16, %for.body17.lr.ph ], [ %21, %for.inc26 ] %indvars.iv56 = phi i64 [ 0, %for.body17.lr.ph ], [ %indvars.iv.next57, %for.inc26 ] %19 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %arrayidx21 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv56 %20 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22 = icmp eq i32 %19, %20 br i1 %cmp22, label %if.then, label %for.inc26 if.then: ; preds = %for.body17 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %.pre63 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc26 for.inc26: ; preds = %for.body17, %if.then %21 = phi i32 [ %18, %for.body17 ], [ %.pre63, %if.then ] %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1 %22 = sext i32 %21 to i64 %cmp16 = icmp slt i64 %indvars.iv.next57, %22 br i1 %cmp16, label %for.body17, label %for.inc29.loopexit, !llvm.loop !12 for.inc29.loopexit: ; preds = %for.inc26 %.pre64 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc29 for.inc29: ; preds = %for.inc29.loopexit, %for.cond15.preheader %23 = phi i32 [ %.pre64, %for.inc29.loopexit ], [ %15, %for.cond15.preheader ] %24 = phi i32 [ %21, %for.inc29.loopexit ], [ %16, %for.cond15.preheader ] %25 = phi i32 [ %21, %for.inc29.loopexit ], [ %17, %for.cond15.preheader ] %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1 %26 = sext i32 %23 to i64 %cmp13 = icmp slt i64 %indvars.iv.next60, %26 br i1 %cmp13, label %for.cond15.preheader, label %for.end31, !llvm.loop !13 for.end31: ; preds = %for.inc29, %for.cond12.preheader 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 %m) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14} !14 = !{!"llvm.loop.unswitch.partial.disable"}
#include <stdio.h> #include <string.h> #include <math.h> #define pi acos(-1) char s[1005]; int main(){ int a,b,h,m; scanf("%d%d%d%d",&a,&b,&h,&m); double are=30.0*h-5.5*m; double c=sqrt(1.0*a*a+1.0*b*b-2.0*a*b*cos(are/180*pi)); printf("%.11lf\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171853/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171853/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%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%.11lf\0A\00", align 1 @s = dso_local local_unnamed_addr global [1005 x i8] zeroinitializer, align 16 ; 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 %h = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %h, ptr noundef nonnull %m) %0 = load i32, ptr %h, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %1 = load i32, ptr %m, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to double %neg = fmul double %conv1, -5.500000e+00 %2 = call double @llvm.fmuladd.f64(double %conv, double 3.000000e+01, double %neg) %3 = load i32, ptr %a, align 4, !tbaa !5 %conv3 = sitofp i32 %3 to double %4 = load i32, ptr %b, align 4, !tbaa !5 %conv6 = sitofp i32 %4 to double %mul9 = fmul double %conv6, %conv6 %5 = call double @llvm.fmuladd.f64(double %conv3, double %conv3, double %mul9) %div = fdiv double %2, 1.800000e+02 %mul15 = fmul double %div, 0x400921FB54442D18 %call16 = call double @cos(double noundef %mul15) #5 %6 = fmul double %conv3, -2.000000e+00 %neg18 = fmul double %6, %conv6 %7 = call double @llvm.fmuladd.f64(double %neg18, double %call16, double %5) %call19 = call double @sqrt(double noundef %7) #5 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call19) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #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 @cos(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 memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind 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 = { 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(void) { char str1[64], str2[64]; int i,j=0; scanf("%s", str1); for (i = strlen(str1) - 1; i >= 0; i--){ str2[j] = str1[i]; j++; } str2[j] = '\0'; printf("%s\n", str2); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171903/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171903/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str1 = alloca [64 x i8], align 16 %str2 = alloca [64 x i8], align 16 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %str1) #5 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %str2) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str1) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str1) #6 %0 = trunc i64 %call2 to i32 %i.014 = add i32 %0, -1 %cmp15 = icmp sgt i32 %i.014, -1 br i1 %cmp15, label %iter.check, label %for.end iter.check: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %iter.check %1 = add nsw i64 %wide.trip.count, -1 %2 = trunc i64 %1 to i32 %3 = icmp ult i32 %i.014, %2 %4 = icmp ugt i64 %1, 4294967295 %5 = or i1 %3, %4 br i1 %5, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.scevcheck %min.iters.check19 = icmp ult i64 %wide.trip.count, 32 br i1 %min.iters.check19, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.mod.vf = and i64 %call2, 31 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %.cast = trunc i64 %index to i32 %offset.idx = sub i32 %i.014, %.cast %6 = zext i32 %offset.idx to i64 %7 = getelementptr inbounds [64 x i8], ptr %str1, i64 0, i64 %6 %8 = getelementptr inbounds i8, ptr %7, i64 -15 %wide.load = load <16 x i8>, ptr %8, align 1, !tbaa !5 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %9 = getelementptr inbounds i8, ptr %7, i64 -31 %wide.load20 = load <16 x i8>, ptr %9, align 1, !tbaa !5 %reverse21 = shufflevector <16 x i8> %wide.load20, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %10 = getelementptr inbounds [64 x i8], ptr %str2, i64 0, i64 %index store <16 x i8> %reverse, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds i8, ptr %10, i64 16 store <16 x i8> %reverse21, ptr %11, align 16, !tbaa !5 %index.next = add nuw i64 %index, 32 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.end.loopexit, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %.cast25 = trunc i64 %n.vec to i32 %ind.end26 = sub i32 %i.014, %.cast25 %min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.mod.vf22 = and i64 %call2, 7 %n.vec23 = sub nsw i64 %wide.trip.count, %n.mod.vf22 %.cast24 = trunc i64 %n.vec23 to i32 %ind.end = sub i32 %i.014, %.cast24 %invariant.gep = getelementptr i8, ptr %str1, i64 -7 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index29 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next34, %vec.epilog.vector.body ] %.cast30 = trunc i64 %index29 to i32 %offset.idx31 = sub i32 %i.014, %.cast30 %13 = zext i32 %offset.idx31 to i64 %gep = getelementptr [64 x i8], ptr %invariant.gep, i64 0, i64 %13 %wide.load32 = load <8 x i8>, ptr %gep, align 1, !tbaa !5 %reverse33 = shufflevector <8 x i8> %wide.load32, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %14 = getelementptr inbounds [64 x i8], ptr %str2, i64 0, i64 %index29 store <8 x i8> %reverse33, ptr %14, align 1, !tbaa !5 %index.next34 = add nuw i64 %index29, 8 %15 = icmp eq i64 %index.next34, %n.vec23 br i1 %15, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !12 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n28 = icmp eq i64 %n.mod.vf22, 0 br i1 %cmp.n28, label %for.end.loopexit, label %for.body.preheader for.body.preheader: ; preds = %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.scevcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec23, %vec.epilog.middle.block ] %i.017.ph = phi i32 [ %i.014, %iter.check ], [ %i.014, %vector.scevcheck ], [ %ind.end26, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %16 = sub i64 %call2, %indvars.iv.ph %17 = xor i64 %indvars.iv.ph, -1 %18 = add nsw i64 %wide.trip.count, %17 %xtraiter = and i64 %16, 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.preheader, %for.body.prol %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader ] %i.017.prol = phi i32 [ %i.0.prol, %for.body.prol ], [ %i.017.ph, %for.body.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader ] %idxprom.prol = zext i32 %i.017.prol to i64 %arrayidx.prol = getelementptr inbounds [64 x i8], ptr %str1, i64 0, i64 %idxprom.prol %19 = load i8, ptr %arrayidx.prol, align 1, !tbaa !5 %arrayidx5.prol = getelementptr inbounds [64 x i8], ptr %str2, i64 0, i64 %indvars.iv.prol store i8 %19, ptr %arrayidx5.prol, align 1, !tbaa !5 %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1 %i.0.prol = add nsw i32 %i.017.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 !13 for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %i.017.unr = phi i32 [ %i.017.ph, %for.body.preheader ], [ %i.0.prol, %for.body.prol ] %20 = icmp ult i64 %18, 3 br i1 %20, label %for.end.loopexit, label %for.body 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 ] %i.017 = phi i32 [ %i.0.3, %for.body ], [ %i.017.unr, %for.body.prol.loopexit ] %idxprom = zext i32 %i.017 to i64 %arrayidx = getelementptr inbounds [64 x i8], ptr %str1, i64 0, i64 %idxprom %21 = load i8, ptr %arrayidx, align 1, !tbaa !5 %arrayidx5 = getelementptr inbounds [64 x i8], ptr %str2, i64 0, i64 %indvars.iv store i8 %21, ptr %arrayidx5, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %i.0 = add nsw i32 %i.017, -1 %idxprom.1 = zext i32 %i.0 to i64 %arrayidx.1 = getelementptr inbounds [64 x i8], ptr %str1, i64 0, i64 %idxprom.1 %22 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %arrayidx5.1 = getelementptr inbounds [64 x i8], ptr %str2, i64 0, i64 %indvars.iv.next store i8 %22, ptr %arrayidx5.1, align 1, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %i.0.1 = add nsw i32 %i.017, -2 %idxprom.2 = zext i32 %i.0.1 to i64 %arrayidx.2 = getelementptr inbounds [64 x i8], ptr %str1, i64 0, i64 %idxprom.2 %23 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %arrayidx5.2 = getelementptr inbounds [64 x i8], ptr %str2, i64 0, i64 %indvars.iv.next.1 store i8 %23, ptr %arrayidx5.2, align 1, !tbaa !5 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %i.0.2 = add nsw i32 %i.017, -3 %idxprom.3 = zext i32 %i.0.2 to i64 %arrayidx.3 = getelementptr inbounds [64 x i8], ptr %str1, i64 0, i64 %idxprom.3 %24 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %arrayidx5.3 = getelementptr inbounds [64 x i8], ptr %str2, i64 0, i64 %indvars.iv.next.2 store i8 %24, ptr %arrayidx5.3, align 1, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %i.0.3 = add nsw i32 %i.017, -4 %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count br i1 %exitcond.not.3, label %for.end.loopexit, label %for.body, !llvm.loop !15 for.end.loopexit: ; preds = %for.body.prol.loopexit, %for.body, %vec.epilog.middle.block, %middle.block %25 = and i64 %call2, 4294967295 br label %for.end for.end: ; preds = %entry, %for.end.loopexit %j.0.lcssa = phi i64 [ %25, %for.end.loopexit ], [ 0, %entry ] %arrayidx7 = getelementptr inbounds [64 x i8], ptr %str2, i64 0, i64 %j.0.lcssa store i8 0, ptr %arrayidx7, align 1, !tbaa !5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str2) call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %str2) #5 call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %str1) #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, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !10, !11} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !9, !10}
#include<stdio.h> #include<string.h> int main(){ char s[22]; int i; scanf("%s",s); for(i=strlen(s)-1;i>-1;i--)printf("%c",s[i]); printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171954/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171954/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [22 x i8], align 16 call void @llvm.lifetime.start.p0(i64 22, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %0 = trunc i64 %call2 to i32 %i.010 = add i32 %0, -1 %cmp11 = icmp sgt i32 %i.010, -1 br i1 %cmp11, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.012 = phi i32 [ %i.0, %for.body ], [ %i.010, %entry ] %idxprom = zext i32 %i.012 to i64 %arrayidx = getelementptr inbounds [22 x i8], ptr %s, i64 0, i64 %idxprom %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv4 = sext i8 %1 to i32 %putchar9 = call i32 @putchar(i32 %conv4) %i.0 = add nsw i32 %i.012, -1 %cmp.not = icmp eq i32 %i.012, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 22, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int i,j; char mozi[21]; scanf("%s",mozi); for(i=0;mozi[i]!=0;i++); for(j=i-1;j>=0;j--)printf("%c",mozi[j]); printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171998/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171998/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %mozi = alloca [21 x i8], align 16 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %mozi) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %mozi) br label %for.cond for.cond: ; preds = %for.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [21 x i8], ptr %mozi, 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 br i1 %cmp.not, label %for.cond2.preheader, label %for.cond, !llvm.loop !8 for.cond2.preheader: ; preds = %for.cond %1 = and i64 %indvars.iv, 4294967295 %cmp318.not = icmp eq i64 %1, 0 br i1 %cmp318.not, label %for.end11, label %for.body5 for.body5: ; preds = %for.cond2.preheader, %for.body5 %indvars.iv21 = phi i64 [ %indvars.iv.next22, %for.body5 ], [ %indvars.iv, %for.cond2.preheader ] %indvars.iv.next22 = add nsw i64 %indvars.iv21, -1 %idxprom6 = and i64 %indvars.iv.next22, 4294967295 %arrayidx7 = getelementptr inbounds [21 x i8], ptr %mozi, i64 0, i64 %idxprom6 %2 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %conv8 = sext i8 %2 to i32 %putchar17 = call i32 @putchar(i32 %conv8) %3 = icmp sgt i64 %indvars.iv21, 1 br i1 %3, label %for.body5, label %for.end11, !llvm.loop !10 for.end11: ; preds = %for.body5, %for.cond2.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %mozi) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include<stdio.h> int main(void){ char std[21]; int i=0; scanf("%s",std); while(std[i]!=NULL) i++; for(i=i-1;i>=0;i--) printf("%c",std[i]); printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172047/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172047/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %std = alloca [21 x i8], align 16 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %std) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %std) br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [21 x i8], ptr %std, 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 br i1 %cmp.not, label %for.cond.preheader, label %while.cond, !llvm.loop !8 for.cond.preheader: ; preds = %while.cond %1 = and i64 %indvars.iv, 4294967295 %cmp215.not = icmp eq i64 %1, 0 br i1 %cmp215.not, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv18 = phi i64 [ %indvars.iv.next19, %for.body ], [ %indvars.iv, %for.cond.preheader ] %indvars.iv.next19 = add nsw i64 %indvars.iv18, -1 %idxprom4 = and i64 %indvars.iv.next19, 4294967295 %arrayidx5 = getelementptr inbounds [21 x i8], ptr %std, i64 0, i64 %idxprom4 %2 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %conv6 = sext i8 %2 to i32 %putchar14 = call i32 @putchar(i32 %conv6) %3 = icmp sgt i64 %indvars.iv18, 1 br i1 %3, label %for.body, label %for.end, !llvm.loop !10 for.end: ; preds = %for.body, %for.cond.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %std) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include <stdio.h> #include <string.h> int main(void){ char str[21]; char reverse[21]; int i,n; scanf("%s",str); n=strlen(str); for(i=0; i<n; i++){ reverse[i]=str[n-1-i]; } for(i=0;i<n;i++){ printf("%c",reverse[i]); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172090/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172090/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [21 x i8], align 16 %reverse = alloca [21 x i8], align 16 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %str) #5 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %reverse) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %conv = trunc i64 %call2 to i32 %cmp28 = icmp sgt i32 %conv, 0 br i1 %cmp28, label %iter.check, label %for.end17 iter.check: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %iter.check %0 = add nsw i64 %wide.trip.count, -1 %1 = add i32 %conv, -1 %2 = trunc i64 %0 to i32 %3 = sub i32 %1, %2 %4 = icmp sgt i32 %3, %1 %5 = icmp ugt i64 %0, 4294967295 %6 = or i1 %4, %5 br i1 %6, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.scevcheck %min.iters.check38 = icmp ult i64 %wide.trip.count, 32 br i1 %min.iters.check38, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.mod.vf = and i64 %call2, 31 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %7 = xor i64 %index, -1 %8 = add i64 %call2, %7 %9 = shl i64 %8, 32 %10 = ashr exact i64 %9, 32 %11 = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %10 %12 = getelementptr inbounds i8, ptr %11, i64 -15 %wide.load = load <16 x i8>, ptr %12, align 1, !tbaa !5 %reverse39 = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %13 = getelementptr inbounds i8, ptr %11, i64 -31 %wide.load40 = load <16 x i8>, ptr %13, align 1, !tbaa !5 %reverse41 = shufflevector <16 x i8> %wide.load40, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %14 = getelementptr inbounds [21 x i8], ptr %reverse, i64 0, i64 %index store <16 x i8> %reverse39, ptr %14, align 16, !tbaa !5 %15 = getelementptr inbounds i8, ptr %14, i64 16 store <16 x i8> %reverse41, ptr %15, align 16, !tbaa !5 %index.next = add nuw i64 %index, 32 %16 = icmp eq i64 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.cond7.preheader, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.mod.vf42 = and i64 %call2, 7 %n.vec43 = sub nsw i64 %wide.trip.count, %n.mod.vf42 %invariant.gep = getelementptr i8, ptr %str, i64 -7 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index45 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next48, %vec.epilog.vector.body ] %17 = xor i64 %index45, -1 %18 = add i64 %call2, %17 %19 = shl i64 %18, 32 %20 = ashr exact i64 %19, 32 %gep = getelementptr [21 x i8], ptr %invariant.gep, i64 0, i64 %20 %wide.load46 = load <8 x i8>, ptr %gep, align 1, !tbaa !5 %reverse47 = shufflevector <8 x i8> %wide.load46, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %21 = getelementptr inbounds [21 x i8], ptr %reverse, i64 0, i64 %index45 store <8 x i8> %reverse47, ptr %21, align 1, !tbaa !5 %index.next48 = add nuw i64 %index45, 8 %22 = icmp eq i64 %index.next48, %n.vec43 br i1 %22, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !12 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n44 = icmp eq i64 %n.mod.vf42, 0 br i1 %cmp.n44, label %for.cond7.preheader, label %for.body.preheader for.body.preheader: ; preds = %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.scevcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec43, %vec.epilog.middle.block ] %23 = sub i64 %call2, %indvars.iv.ph %.neg = add nsw i64 %indvars.iv.ph, 1 %xtraiter = and i64 %23, 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 %24 = xor i64 %indvars.iv.ph, -1 %sub4.prol = add i64 %call2, %24 %sext.prol = shl i64 %sub4.prol, 32 %idxprom.prol = ashr exact i64 %sext.prol, 32 %arrayidx.prol = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %idxprom.prol %25 = load i8, ptr %arrayidx.prol, align 1, !tbaa !5 %arrayidx6.prol = getelementptr inbounds [21 x i8], ptr %reverse, i64 0, i64 %indvars.iv.ph store i8 %25, ptr %arrayidx6.prol, align 1, !tbaa !5 %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.ph, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %26 = icmp eq i64 %wide.trip.count, %.neg br i1 %26, label %for.cond7.preheader, label %for.body for.cond7.preheader: ; preds = %for.body.prol.loopexit, %for.body, %vec.epilog.middle.block, %middle.block br i1 %cmp28, label %for.body10.preheader, label %for.end17 for.body10.preheader: ; preds = %for.cond7.preheader %wide.trip.count36 = and i64 %call2, 4294967295 br label %for.body10 for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %27 = xor i64 %indvars.iv, -1 %sub4 = add i64 %call2, %27 %sext = shl i64 %sub4, 32 %idxprom = ashr exact i64 %sext, 32 %arrayidx = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %idxprom %28 = load i8, ptr %arrayidx, align 1, !tbaa !5 %arrayidx6 = getelementptr inbounds [21 x i8], ptr %reverse, i64 0, i64 %indvars.iv store i8 %28, ptr %arrayidx6, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %reass.sub = sub i64 %call2, %indvars.iv %sub4.1 = shl i64 %reass.sub, 32 %sext.1 = add i64 %sub4.1, -8589934592 %idxprom.1 = ashr exact i64 %sext.1, 32 %arrayidx.1 = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %idxprom.1 %29 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %arrayidx6.1 = getelementptr inbounds [21 x i8], ptr %reverse, i64 0, i64 %indvars.iv.next store i8 %29, ptr %arrayidx6.1, align 1, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count br i1 %exitcond.not.1, label %for.cond7.preheader, label %for.body, !llvm.loop !13 for.body10: ; preds = %for.body10.preheader, %for.body10 %indvars.iv33 = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next34, %for.body10 ] %arrayidx12 = getelementptr inbounds [21 x i8], ptr %reverse, i64 0, i64 %indvars.iv33 %30 = load i8, ptr %arrayidx12, align 1, !tbaa !5 %conv13 = sext i8 %30 to i32 %putchar27 = call i32 @putchar(i32 %conv13) %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1 %exitcond37.not = icmp eq i64 %indvars.iv.next34, %wide.trip.count36 br i1 %exitcond37.not, label %for.end17, label %for.body10, !llvm.loop !14 for.end17: ; preds = %for.body10, %entry, %for.cond7.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %reverse) #5 call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %str) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !10, !11} !13 = distinct !{!13, !9, !10} !14 = distinct !{!14, !9}
#include<stdio.h> #include<string.h> int main(void){ int i; char a[256]; scanf("%s", a); for(i = strlen(a) - 1; i >= 0; i--){ printf("%c",a[i]); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172133/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172133/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [256 x i8], align 16 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6 %0 = trunc i64 %call2 to i32 %i.010 = add i32 %0, -1 %cmp11 = icmp sgt i32 %i.010, -1 br i1 %cmp11, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.012 = phi i32 [ %i.0, %for.body ], [ %i.010, %entry ] %idxprom = zext i32 %i.012 to i64 %arrayidx = getelementptr inbounds [256 x i8], ptr %a, i64 0, i64 %idxprom %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv4 = sext i8 %1 to i32 %putchar9 = call i32 @putchar(i32 %conv4) %i.0 = add nsw i32 %i.012, -1 %cmp.not = icmp eq i32 %i.012, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 256, 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 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main(void){ char str[21], ans[21]; int len, i; scanf("%s", str); len = strlen(str); for(i=0; i<len; i++){ ans[i] = str[len-1-i]; } ans[len]=str[len]; printf("%s\n", ans); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172184/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172184/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [21 x i8], align 16 %ans = alloca [21 x i8], align 16 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %str) #5 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %ans) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %conv = trunc i64 %call2 to i32 %cmp19 = icmp sgt i32 %conv, 0 br i1 %cmp19, label %iter.check, label %for.end iter.check: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %iter.check %0 = add nsw i64 %wide.trip.count, -1 %1 = add i32 %conv, -1 %2 = trunc i64 %0 to i32 %3 = sub i32 %1, %2 %4 = icmp sgt i32 %3, %1 %5 = icmp ugt i64 %0, 4294967295 %6 = or i1 %4, %5 br i1 %6, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.scevcheck %min.iters.check23 = icmp ult i64 %wide.trip.count, 32 br i1 %min.iters.check23, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.mod.vf = and i64 %call2, 31 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %7 = xor i64 %index, -1 %8 = add i64 %call2, %7 %9 = shl i64 %8, 32 %10 = ashr exact i64 %9, 32 %11 = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %10 %12 = getelementptr inbounds i8, ptr %11, i64 -15 %wide.load = load <16 x i8>, ptr %12, align 1, !tbaa !5 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %13 = getelementptr inbounds i8, ptr %11, i64 -31 %wide.load24 = load <16 x i8>, ptr %13, align 1, !tbaa !5 %reverse25 = shufflevector <16 x i8> %wide.load24, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %14 = getelementptr inbounds [21 x i8], ptr %ans, i64 0, i64 %index store <16 x i8> %reverse, ptr %14, align 16, !tbaa !5 %15 = getelementptr inbounds i8, ptr %14, i64 16 store <16 x i8> %reverse25, ptr %15, align 16, !tbaa !5 %index.next = add nuw i64 %index, 32 %16 = icmp eq i64 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.mod.vf26 = and i64 %call2, 7 %n.vec27 = sub nsw i64 %wide.trip.count, %n.mod.vf26 %invariant.gep = getelementptr i8, ptr %str, i64 -7 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index29 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next32, %vec.epilog.vector.body ] %17 = xor i64 %index29, -1 %18 = add i64 %call2, %17 %19 = shl i64 %18, 32 %20 = ashr exact i64 %19, 32 %gep = getelementptr [21 x i8], ptr %invariant.gep, i64 0, i64 %20 %wide.load30 = load <8 x i8>, ptr %gep, align 1, !tbaa !5 %reverse31 = shufflevector <8 x i8> %wide.load30, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %21 = getelementptr inbounds [21 x i8], ptr %ans, i64 0, i64 %index29 store <8 x i8> %reverse31, ptr %21, align 1, !tbaa !5 %index.next32 = add nuw i64 %index29, 8 %22 = icmp eq i64 %index.next32, %n.vec27 br i1 %22, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !12 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n28 = icmp eq i64 %n.mod.vf26, 0 br i1 %cmp.n28, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.scevcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec27, %vec.epilog.middle.block ] %23 = sub i64 %call2, %indvars.iv.ph %.neg = add nsw i64 %indvars.iv.ph, 1 %xtraiter = and i64 %23, 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 %24 = xor i64 %indvars.iv.ph, -1 %sub4.prol = add i64 %call2, %24 %sext22.prol = shl i64 %sub4.prol, 32 %idxprom.prol = ashr exact i64 %sext22.prol, 32 %arrayidx.prol = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %idxprom.prol %25 = load i8, ptr %arrayidx.prol, align 1, !tbaa !5 %arrayidx6.prol = getelementptr inbounds [21 x i8], ptr %ans, i64 0, i64 %indvars.iv.ph store i8 %25, ptr %arrayidx6.prol, align 1, !tbaa !5 %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.ph, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %26 = icmp eq i64 %wide.trip.count, %.neg br i1 %26, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %27 = xor i64 %indvars.iv, -1 %sub4 = add i64 %call2, %27 %sext22 = shl i64 %sub4, 32 %idxprom = ashr exact i64 %sext22, 32 %arrayidx = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %idxprom %28 = load i8, ptr %arrayidx, align 1, !tbaa !5 %arrayidx6 = getelementptr inbounds [21 x i8], ptr %ans, i64 0, i64 %indvars.iv store i8 %28, ptr %arrayidx6, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %reass.sub = sub i64 %call2, %indvars.iv %sub4.1 = shl i64 %reass.sub, 32 %sext22.1 = add i64 %sub4.1, -8589934592 %idxprom.1 = ashr exact i64 %sext22.1, 32 %arrayidx.1 = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %idxprom.1 %29 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %arrayidx6.1 = getelementptr inbounds [21 x i8], ptr %ans, i64 0, i64 %indvars.iv.next store i8 %29, ptr %arrayidx6.1, align 1, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %entry %sext = shl i64 %call2, 32 %idxprom7 = ashr exact i64 %sext, 32 %arrayidx8 = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %idxprom7 %30 = load i8, ptr %arrayidx8, align 1, !tbaa !5 %arrayidx10 = getelementptr inbounds [21 x i8], ptr %ans, i64 0, i64 %idxprom7 store i8 %30, ptr %arrayidx10, align 1, !tbaa !5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %ans) call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %ans) #5 call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %str) #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, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !10, !11} !13 = distinct !{!13, !9, !10}
#include <stdio.h> int main(void){ char str[21], *p = str; fgets(str, 21, stdin); for(; *p && *p != '\n'; ++p); while(--p >= str){ printf("%c", *p); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172292/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172292/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [21 x i8], align 16 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %str) #4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 21, ptr noundef %0) br label %for.cond for.cond: ; preds = %for.inc, %entry %p.0 = phi ptr [ %str, %entry ], [ %incdec.ptr, %for.inc ] %1 = load i8, ptr %p.0, align 1, !tbaa !9 switch i8 %1, label %for.inc [ i8 0, label %for.end i8 10, label %for.end ] for.inc: ; preds = %for.cond %incdec.ptr = getelementptr inbounds i8, ptr %p.0, i64 1 br label %for.cond, !llvm.loop !10 for.end: ; preds = %for.cond, %for.cond %incdec.ptr416 = getelementptr inbounds i8, ptr %p.0, i64 -1 %cmp6.not17 = icmp ult ptr %incdec.ptr416, %str br i1 %cmp6.not17, label %while.end, label %while.body while.body: ; preds = %for.end, %while.body %incdec.ptr418 = phi ptr [ %incdec.ptr4, %while.body ], [ %incdec.ptr416, %for.end ] %2 = load i8, ptr %incdec.ptr418, align 1, !tbaa !9 %conv8 = sext i8 %2 to i32 %putchar15 = call i32 @putchar(i32 %conv8) %incdec.ptr4 = getelementptr inbounds i8, ptr %incdec.ptr418, i64 -1 %cmp6.not = icmp ult ptr %incdec.ptr4, %str br i1 %cmp6.not, label %while.end, label %while.body, !llvm.loop !12 while.end: ; preds = %while.body, %for.end %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %str) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) 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 = !{!"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}
#include <stdio.h> #include <string.h> char str[21]; // •¶Žš—ñ char result[21]; // ”½“]‚µ‚½Œ‹‰Ê‚ð“ü‚ê‚é int n; // •¶Žš—ñ‚Ì’·‚³ int i; int main(void){ scanf("%s",str); //•¶Žš—ñ‚ðƒL[ƒ{[ƒh‚©‚ç“ǂݍž‚Þ n=strlen(str); //•¶Žš—ñ‚Ì’·‚³‚ðn‚É“ü‚ê‚é for(i=0;i<n;i++){ result[i]=str[n-i-1]; // •¶Žš—ñ‚𔽓]‚·‚é } printf("%s\n",result); // ”½“]‚µ‚½Œ‹‰Ê‚ð•\ަ return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172342/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172342/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 = dso_local global [21 x i8] zeroinitializer, align 16 @n = dso_local local_unnamed_addr global i32 0, align 4 @i = dso_local local_unnamed_addr global i32 0, align 4 @result = dso_local global [21 x i8] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str) %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @str) #4 %conv = trunc i64 %call1 to i32 store i32 %conv, ptr @n, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %conv, 0 br i1 %cmp8, label %iter.check, label %for.end iter.check: ; preds = %entry %wide.trip.count = and i64 %call1, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %iter.check %0 = add nsw i64 %wide.trip.count, -1 %1 = add i32 %conv, -1 %2 = trunc i64 %0 to i32 %3 = sub i32 %1, %2 %4 = icmp sgt i32 %3, %1 %5 = icmp ugt i64 %0, 4294967295 %6 = or i1 %4, %5 br i1 %6, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.scevcheck %min.iters.check11 = icmp ult i64 %wide.trip.count, 32 br i1 %min.iters.check11, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.mod.vf = and i64 %call1, 31 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %7 = xor i64 %index, -1 %8 = add i64 %call1, %7 %9 = shl i64 %8, 32 %10 = ashr exact i64 %9, 32 %11 = getelementptr inbounds [21 x i8], ptr @str, i64 0, i64 %10 %12 = getelementptr inbounds i8, ptr %11, i64 -15 %wide.load = load <16 x i8>, ptr %12, align 1, !tbaa !9 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %13 = getelementptr inbounds i8, ptr %11, i64 -31 %wide.load12 = load <16 x i8>, ptr %13, align 1, !tbaa !9 %reverse13 = shufflevector <16 x i8> %wide.load12, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %14 = getelementptr inbounds [21 x i8], ptr @result, i64 0, i64 %index store <16 x i8> %reverse, ptr %14, align 16, !tbaa !9 %15 = getelementptr inbounds i8, ptr %14, i64 16 store <16 x i8> %reverse13, ptr %15, align 16, !tbaa !9 %index.next = add nuw i64 %index, 32 %16 = icmp eq i64 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.mod.vf14 = and i64 %call1, 7 %n.vec15 = sub nsw i64 %wide.trip.count, %n.mod.vf14 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index17 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next20, %vec.epilog.vector.body ] %17 = xor i64 %index17, -1 %18 = add i64 %call1, %17 %19 = shl i64 %18, 32 %20 = ashr exact i64 %19, 32 %gep = getelementptr [21 x i8], ptr getelementptr (i8, ptr @str, i64 -7), i64 0, i64 %20 %wide.load18 = load <8 x i8>, ptr %gep, align 1, !tbaa !9 %reverse19 = shufflevector <8 x i8> %wide.load18, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %21 = getelementptr inbounds [21 x i8], ptr @result, i64 0, i64 %index17 store <8 x i8> %reverse19, ptr %21, align 1, !tbaa !9 %index.next20 = add nuw i64 %index17, 8 %22 = icmp eq i64 %index.next20, %n.vec15 br i1 %22, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n16 = icmp eq i64 %n.mod.vf14, 0 br i1 %cmp.n16, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.scevcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec15, %vec.epilog.middle.block ] %23 = sub i64 %call1, %indvars.iv.ph %.neg = add nsw i64 %indvars.iv.ph, 1 %xtraiter = and i64 %23, 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 %24 = xor i64 %indvars.iv.ph, -1 %sub3.prol = add i64 %call1, %24 %sext.prol = shl i64 %sub3.prol, 32 %idxprom.prol = ashr exact i64 %sext.prol, 32 %arrayidx.prol = getelementptr inbounds [21 x i8], ptr @str, i64 0, i64 %idxprom.prol %25 = load i8, ptr %arrayidx.prol, align 1, !tbaa !9 %arrayidx5.prol = getelementptr inbounds [21 x i8], ptr @result, i64 0, i64 %indvars.iv.ph store i8 %25, ptr %arrayidx5.prol, align 1, !tbaa !9 %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.ph, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %26 = icmp eq i64 %wide.trip.count, %.neg br i1 %26, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %27 = xor i64 %indvars.iv, -1 %sub3 = add i64 %call1, %27 %sext = shl i64 %sub3, 32 %idxprom = ashr exact i64 %sext, 32 %arrayidx = getelementptr inbounds [21 x i8], ptr @str, i64 0, i64 %idxprom %28 = load i8, ptr %arrayidx, align 1, !tbaa !9 %arrayidx5 = getelementptr inbounds [21 x i8], ptr @result, i64 0, i64 %indvars.iv store i8 %28, ptr %arrayidx5, align 1, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %reass.sub = sub i64 %call1, %indvars.iv %sub3.1 = shl i64 %reass.sub, 32 %sext.1 = add i64 %sub3.1, -8589934592 %idxprom.1 = ashr exact i64 %sext.1, 32 %arrayidx.1 = getelementptr inbounds [21 x i8], ptr @str, i64 0, i64 %idxprom.1 %29 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %arrayidx5.1 = getelementptr inbounds [21 x i8], ptr @result, i64 0, i64 %indvars.iv.next store i8 %29, ptr %arrayidx5.1, align 1, !tbaa !9 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !15 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %entry %storemerge.lcssa = phi i32 [ 0, %entry ], [ %conv, %vec.epilog.middle.block ], [ %conv, %middle.block ], [ %conv, %for.body ], [ %conv, %for.body.prol.loopexit ] store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !5 %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @result) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 = { 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 #3 = { nofree nounwind } attributes #4 = { 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, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !12, !13} !15 = distinct !{!15, !11, !12}
#include <stdio.h> #include <string.h> void reverse(char *string, int length) { int i; for(i = 0; i < length/2; i++) { char tmp; tmp = string[i]; string[i] = string[length - i - 1]; string[length - i - 1] = tmp; } } int main(int argc, char *argv[]) { char buffer[32]; memset(buffer, '\0', 32); scanf("%s", buffer); reverse(buffer, strlen(buffer)); printf("%s\n", buffer); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172386/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172386/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 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @reverse(ptr nocapture noundef %string, i32 noundef %length) local_unnamed_addr #0 { entry: %cmp20 = icmp sgt i32 %length, 1 br i1 %cmp20, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %div2324 = lshr i32 %length, 1 %wide.trip.count = zext i32 %div2324 to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %div2324, 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, 2147483646 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 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds i8, ptr %string, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = xor i32 %2, -1 %sub1 = add i32 %3, %length %idxprom2 = sext i32 %sub1 to i64 %arrayidx3 = getelementptr inbounds i8, ptr %string, i64 %idxprom2 %4 = load i8, ptr %arrayidx3, align 1, !tbaa !5 store i8 %4, ptr %arrayidx, align 1, !tbaa !5 store i8 %1, ptr %arrayidx3, align 1, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %string, i64 %indvars.iv.next %5 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %6 = trunc i64 %indvars.iv.next to i32 %7 = xor i32 %6, -1 %sub1.1 = add i32 %7, %length %idxprom2.1 = sext i32 %sub1.1 to i64 %arrayidx3.1 = getelementptr inbounds i8, ptr %string, i64 %idxprom2.1 %8 = load i8, ptr %arrayidx3.1, align 1, !tbaa !5 store i8 %8, ptr %arrayidx.1, align 1, !tbaa !5 store i8 %5, ptr %arrayidx3.1, align 1, !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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !8 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.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 i8, ptr %string, i64 %indvars.iv.unr %9 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 %10 = trunc i64 %indvars.iv.unr to i32 %11 = xor i32 %10, -1 %sub1.epil = add i32 %11, %length %idxprom2.epil = sext i32 %sub1.epil to i64 %arrayidx3.epil = getelementptr inbounds i8, ptr %string, i64 %idxprom2.epil %12 = load i8, ptr %arrayidx3.epil, align 1, !tbaa !5 store i8 %12, ptr %arrayidx.epil, align 1, !tbaa !5 store i8 %9, ptr %arrayidx3.epil, align 1, !tbaa !5 br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 { entry: %buffer = alloca [32 x i8], align 16 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %buffer) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %buffer, i8 0, i64 32, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %buffer) %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %buffer) #8 %conv = trunc i64 %call4 to i32 %cmp20.i = icmp sgt i32 %conv, 1 br i1 %cmp20.i, label %for.body.preheader.i, label %reverse.exit for.body.preheader.i: ; preds = %entry %div2324.i = lshr i64 %call4, 1 %wide.trip.count.i = and i64 %div2324.i, 2147483647 %xtraiter = and i64 %div2324.i, 1 %0 = icmp eq i64 %wide.trip.count.i, 1 br i1 %0, label %reverse.exit.loopexit.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = sub nsw i64 %wide.trip.count.i, %xtraiter 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 ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ] %arrayidx.i = getelementptr inbounds i8, ptr %buffer, i64 %indvars.iv.i %1 = load i8, ptr %arrayidx.i, align 2, !tbaa !5 %2 = xor i64 %indvars.iv.i, -1 %sub1.i = add i64 %call4, %2 %sext = shl i64 %sub1.i, 32 %idxprom2.i = ashr exact i64 %sext, 32 %arrayidx3.i = getelementptr inbounds i8, ptr %buffer, i64 %idxprom2.i %3 = load i8, ptr %arrayidx3.i, align 1, !tbaa !5 store i8 %3, ptr %arrayidx.i, align 2, !tbaa !5 store i8 %1, ptr %arrayidx3.i, align 1, !tbaa !5 %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %buffer, i64 %indvars.iv.next.i %4 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 %5 = xor i64 %indvars.iv.i, 4294967294 %sub1.i.1 = add i64 %call4, %5 %sext.1 = shl i64 %sub1.i.1, 32 %idxprom2.i.1 = ashr exact i64 %sext.1, 32 %arrayidx3.i.1 = getelementptr inbounds i8, ptr %buffer, i64 %idxprom2.i.1 %6 = load i8, ptr %arrayidx3.i.1, align 1, !tbaa !5 store i8 %6, ptr %arrayidx.i.1, align 1, !tbaa !5 store i8 %4, ptr %arrayidx3.i.1, align 1, !tbaa !5 %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 %reverse.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 reverse.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i %indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %reverse.exit, label %for.body.i.epil for.body.i.epil: ; preds = %reverse.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %buffer, i64 %indvars.iv.i.unr %7 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 %8 = xor i64 %indvars.iv.i.unr, -1 %sub1.i.epil = add i64 %call4, %8 %sext.epil = shl i64 %sub1.i.epil, 32 %idxprom2.i.epil = ashr exact i64 %sext.epil, 32 %arrayidx3.i.epil = getelementptr inbounds i8, ptr %buffer, i64 %idxprom2.i.epil %9 = load i8, ptr %arrayidx3.i.epil, align 1, !tbaa !5 store i8 %9, ptr %arrayidx.i.epil, align 1, !tbaa !5 store i8 %7, ptr %arrayidx3.i.epil, align 1, !tbaa !5 br label %reverse.exit reverse.exit: ; preds = %for.body.i.epil, %reverse.exit.loopexit.unr-lcssa, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %buffer) call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %buffer) #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) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 attributes #0 = { nofree 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn 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 #6 = { nofree nounwind } attributes #7 = { nounwind } attributes #8 = { 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"}
#include <stdio.h> #include <string.h> int main(void) { char str[100]; int l; scanf("%s", str); l = strlen(str); for (l = l - 1; l >= 0; l--){ printf("%c", str[l]); } printf("\n"); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172450/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172450/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %conv = trunc i64 %call2 to i32 %cmp11 = icmp sgt i32 %conv, 0 br i1 %cmp11, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = and i64 %call2, 4294967295 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 ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %idxprom = and i64 %indvars.iv.next, 4294967295 %arrayidx = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %idxprom %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv4 = sext i8 %1 to i32 %putchar10 = call i32 @putchar(i32 %conv4) %cmp = icmp ugt i64 %indvars.iv, 1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !8 for.end: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main (void){ char str[21] = ""; int i = 0; scanf("%s",str); while(1){ if(str[i] == NULL) break; i++; } while(1){ i--; printf("%c",str[i]); if(i == 0){ printf("\n"); break; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172500/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172500/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [21 x i8], align 16 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %str) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(21) %str, i8 0, i64 21, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp, label %while.cond2, label %while.cond while.cond2: ; preds = %while.cond, %while.cond2 %indvars.iv20 = phi i64 [ %indvars.iv.next21, %while.cond2 ], [ %indvars.iv, %while.cond ] %indvars.iv.next21 = add nsw i64 %indvars.iv20, -1 %arrayidx5 = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %indvars.iv.next21 %1 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %conv6 = sext i8 %1 to i32 %putchar = call i32 @putchar(i32 %conv6) %2 = icmp eq i64 %indvars.iv.next21, 0 br i1 %2, label %if.then10, label %while.cond2 if.then10: ; preds = %while.cond2 %putchar18 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %str) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 = { 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"}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { int i, n; char str[21]; scanf("%s", str); n = strlen(str); for (i = n - 1; i >= 0; i--) { putchar(str[i]); } putchar('\n'); return EXIT_SUCCESS; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172544/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172544/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 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [21 x i8], align 16 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %str) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #5 %conv = trunc i64 %call2 to i32 %cmp10 = icmp sgt i32 %conv, 0 br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = and i64 %call2, 4294967295 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 ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %idxprom = and i64 %indvars.iv.next, 4294967295 %arrayidx = getelementptr inbounds [21 x i8], ptr %str, i64 0, i64 %idxprom %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv4 = sext i8 %1 to i32 %2 = load ptr, ptr @stdout, align 8, !tbaa !8 %call.i = call i32 @putc(i32 noundef %conv4, ptr noundef %2) %cmp = icmp ugt i64 %indvars.iv, 1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10 for.end: ; preds = %for.body, %entry %3 = load ptr, ptr @stdout, align 8, !tbaa !8 %call.i9 = call i32 @putc(i32 noundef 10, ptr noundef %3) call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %str) #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 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 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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 = { nounwind } attributes #5 = { 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 = !{!"any pointer", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main (void) { char a[21],c[21]; int b=0,i; scanf("%s",a); for(i=0;a[i]!='\0';i++) { b++; } for(i=0;i<b;i++) { c[i]=a[b-i-1]; } c[b]='\0'; printf("%s\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172588/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172588/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [21 x i8], align 16 %c = alloca [21 x i8], align 16 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i8, ptr %a, align 16, !tbaa !5 %cmp.not27 = icmp eq i8 %0, 0 br i1 %cmp.not27, label %for.end14, label %for.body for.cond3.preheader: ; preds = %for.body %1 = and i64 %indvars.iv.next, 4294967295 %cmp430.not = icmp eq i64 %1, 0 br i1 %cmp430.not, label %for.end14, label %iter.check iter.check: ; preds = %for.cond3.preheader %sext = shl i64 %indvars.iv.next, 32 %2 = ashr exact i64 %sext, 32 %wide.trip.count = and i64 %indvars.iv.next, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body6.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check42 = icmp ult i64 %wide.trip.count, 32 br i1 %min.iters.check42, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.mod.vf = and i64 %indvars.iv.next, 31 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = xor i64 %index, -1 %4 = add nsw i64 %2, %3 %5 = getelementptr inbounds [21 x i8], ptr %a, i64 0, i64 %4 %6 = getelementptr inbounds i8, ptr %5, i64 -15 %wide.load = load <16 x i8>, ptr %6, align 1, !tbaa !5 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %7 = getelementptr inbounds i8, ptr %5, i64 -31 %wide.load43 = load <16 x i8>, ptr %7, align 1, !tbaa !5 %reverse44 = shufflevector <16 x i8> %wide.load43, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %8 = getelementptr inbounds [21 x i8], ptr %c, i64 0, i64 %index store <16 x i8> %reverse, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i8, ptr %8, i64 16 store <16 x i8> %reverse44, ptr %9, align 16, !tbaa !5 %index.next = add nuw i64 %index, 32 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.end14, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8 br i1 %min.epilog.iters.check, label %for.body6.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.mod.vf45 = and i64 %indvars.iv.next, 7 %n.vec46 = sub nsw i64 %wide.trip.count, %n.mod.vf45 %invariant.gep = getelementptr i8, ptr %a, i64 -7 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index48 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next51, %vec.epilog.vector.body ] %11 = xor i64 %index48, -1 %12 = add nsw i64 %2, %11 %gep = getelementptr [21 x i8], ptr %invariant.gep, i64 0, i64 %12 %wide.load49 = load <8 x i8>, ptr %gep, align 1, !tbaa !5 %reverse50 = shufflevector <8 x i8> %wide.load49, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %13 = getelementptr inbounds [21 x i8], ptr %c, i64 0, i64 %index48 store <8 x i8> %reverse50, ptr %13, align 1, !tbaa !5 %index.next51 = add nuw i64 %index48, 8 %14 = icmp eq i64 %index.next51, %n.vec46 br i1 %14, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !12 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n47 = icmp eq i64 %n.mod.vf45, 0 br i1 %cmp.n47, label %for.end14, label %for.body6.preheader for.body6.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv35.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec46, %vec.epilog.middle.block ] br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [21 x i8], ptr %a, i64 0, i64 %indvars.iv.next %15 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %15, 0 br i1 %cmp.not, label %for.cond3.preheader, label %for.body, !llvm.loop !13 for.body6: ; preds = %for.body6.preheader, %for.body6 %indvars.iv35 = phi i64 [ %indvars.iv.next36, %for.body6 ], [ %indvars.iv35.ph, %for.body6.preheader ] %16 = xor i64 %indvars.iv35, -1 %17 = add nsw i64 %2, %16 %arrayidx9 = getelementptr inbounds [21 x i8], ptr %a, i64 0, i64 %17 %18 = load i8, ptr %arrayidx9, align 1, !tbaa !5 %arrayidx11 = getelementptr inbounds [21 x i8], ptr %c, i64 0, i64 %indvars.iv35 store i8 %18, ptr %arrayidx11, align 1, !tbaa !5 %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1 %exitcond.not = icmp eq i64 %indvars.iv.next36, %wide.trip.count br i1 %exitcond.not, label %for.end14, label %for.body6, !llvm.loop !14 for.end14: ; preds = %for.body6, %middle.block, %vec.epilog.middle.block, %for.cond3.preheader, %entry %idxprom15.pre-phi = phi i64 [ 0, %entry ], [ 0, %for.cond3.preheader ], [ %wide.trip.count, %vec.epilog.middle.block ], [ %wide.trip.count, %middle.block ], [ %wide.trip.count, %for.body6 ] %arrayidx16 = getelementptr inbounds [21 x i8], ptr %c, i64 0, i64 %idxprom15.pre-phi store i8 0, ptr %arrayidx16, align 1, !tbaa !5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %c) call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !10, !11} !13 = distinct !{!13, !9} !14 = distinct !{!14, !9, !11, !10}
#include <stdio.h> #include <string.h> int main(void) { char str[20], ans[20]; int len, i; scanf("%s", str); len = strlen(str); for(i=0; i<len; i++) { printf("%c", str[len-i-1]); //-1は最後のEOFの分 } puts(""); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172638/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172638/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %str) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %conv = trunc i64 %call2 to i32 %cmp12 = icmp sgt i32 %conv, 0 br i1 %cmp12, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 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 ] %0 = xor i64 %indvars.iv, -1 %sub4 = add i64 %call2, %0 %sext = shl i64 %sub4, 32 %idxprom = ashr exact i64 %sext, 32 %arrayidx = getelementptr inbounds [20 x i8], ptr %str, i64 0, i64 %idxprom %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv5 = sext i8 %1 to i32 %putchar11 = call i32 @putchar(i32 %conv5) %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 !8 for.end: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %str) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int c1; void a(int x,int sum,int count,int limitc,int limits){ int i; if(sum == limits && count == limitc){ c1++; return; } if(sum > limits || count > limitc) return; for(i=x+1;i<10;i++) a(i,sum+i,count+1,limitc,limits); } int main(void){ int n,s,i,sum; for(;c1=0,scanf("%d %d",&n,&s),n;){ for(i=0;i<10;i++) if(s >= i){ sum=i; a(i,sum,1,n,s); } printf("%d\n",c1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172702/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172702/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" @c1 = dso_local local_unnamed_addr global i32 0, align 4 @.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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @a(i32 noundef %x, i32 noundef %sum, i32 noundef %count, i32 noundef %limitc, i32 noundef %limits) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %sum, %limits %cmp1 = icmp eq i32 %count, %limitc %or.cond = and i1 %cmp1, %cmp br i1 %or.cond, label %if.then, label %if.end if.then: ; preds = %entry %0 = load i32, ptr @c1, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @c1, align 4, !tbaa !5 br label %cleanup if.end: ; preds = %entry %cmp2 = icmp sle i32 %sum, %limits %cmp3 = icmp sle i32 %count, %limitc %or.cond21.not25 = and i1 %cmp3, %cmp2 %cmp622 = icmp slt i32 %x, 9 %or.cond24 = and i1 %or.cond21.not25, %cmp622 br i1 %or.cond24, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %if.end %add8 = add nsw i32 %count, 1 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %i.0.in23 = phi i32 [ %x, %for.body.lr.ph ], [ %i.0, %for.body ] %i.0 = add nsw i32 %i.0.in23, 1 %add7 = add nsw i32 %i.0, %sum tail call void @a(i32 noundef %i.0, i32 noundef %add7, i32 noundef %add8, i32 noundef %limitc, i32 noundef %limits) %exitcond.not = icmp eq i32 %i.0, 9 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !9 cleanup: ; preds = %for.body, %if.end, %if.then ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 store i32 0, ptr @c1, align 4, !tbaa !5 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not12 = icmp eq i32 %0, 0 br i1 %tobool.not12, label %for.end5, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc.9 %1 = phi i32 [ %13, %for.inc.9 ], [ %0, %entry ] %2 = load i32, ptr %s, align 4, !tbaa !5 %cmp3.not = icmp slt i32 %2, 0 br i1 %cmp3.not, label %for.inc.9, label %for.inc for.inc: ; preds = %for.cond1.preheader call void @a(i32 noundef 0, i32 noundef 0, i32 noundef 1, i32 noundef %1, i32 noundef %2) %.pre = load i32, ptr %s, align 4, !tbaa !5 %cmp3.not.1 = icmp slt i32 %.pre, 1 br i1 %cmp3.not.1, label %for.inc.9, label %for.inc.1 for.inc.1: ; preds = %for.inc %3 = load i32, ptr %n, align 4, !tbaa !5 call void @a(i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef %3, i32 noundef %.pre) %.pre13 = load i32, ptr %s, align 4, !tbaa !5 %cmp3.not.2 = icmp slt i32 %.pre13, 2 br i1 %cmp3.not.2, label %for.inc.9, label %for.inc.2 for.inc.2: ; preds = %for.inc.1 %4 = load i32, ptr %n, align 4, !tbaa !5 call void @a(i32 noundef 2, i32 noundef 2, i32 noundef 1, i32 noundef %4, i32 noundef %.pre13) %.pre14 = load i32, ptr %s, align 4, !tbaa !5 %cmp3.not.3 = icmp slt i32 %.pre14, 3 br i1 %cmp3.not.3, label %for.inc.9, label %for.inc.3 for.inc.3: ; preds = %for.inc.2 %5 = load i32, ptr %n, align 4, !tbaa !5 call void @a(i32 noundef 3, i32 noundef 3, i32 noundef 1, i32 noundef %5, i32 noundef %.pre14) %.pre15 = load i32, ptr %s, align 4, !tbaa !5 %cmp3.not.4 = icmp slt i32 %.pre15, 4 br i1 %cmp3.not.4, label %for.inc.9, label %for.inc.4 for.inc.4: ; preds = %for.inc.3 %6 = load i32, ptr %n, align 4, !tbaa !5 call void @a(i32 noundef 4, i32 noundef 4, i32 noundef 1, i32 noundef %6, i32 noundef %.pre15) %.pre16 = load i32, ptr %s, align 4, !tbaa !5 %cmp3.not.5 = icmp slt i32 %.pre16, 5 br i1 %cmp3.not.5, label %for.inc.9, label %for.inc.5 for.inc.5: ; preds = %for.inc.4 %7 = load i32, ptr %n, align 4, !tbaa !5 call void @a(i32 noundef 5, i32 noundef 5, i32 noundef 1, i32 noundef %7, i32 noundef %.pre16) %.pre17 = load i32, ptr %s, align 4, !tbaa !5 %cmp3.not.6 = icmp slt i32 %.pre17, 6 br i1 %cmp3.not.6, label %for.inc.9, label %for.inc.6 for.inc.6: ; preds = %for.inc.5 %8 = load i32, ptr %n, align 4, !tbaa !5 call void @a(i32 noundef 6, i32 noundef 6, i32 noundef 1, i32 noundef %8, i32 noundef %.pre17) %.pre18 = load i32, ptr %s, align 4, !tbaa !5 %cmp3.not.7 = icmp slt i32 %.pre18, 7 br i1 %cmp3.not.7, label %for.inc.9, label %for.inc.7 for.inc.7: ; preds = %for.inc.6 %9 = load i32, ptr %n, align 4, !tbaa !5 call void @a(i32 noundef 7, i32 noundef 7, i32 noundef 1, i32 noundef %9, i32 noundef %.pre18) %.pre19 = load i32, ptr %s, align 4, !tbaa !5 %cmp3.not.8 = icmp slt i32 %.pre19, 8 br i1 %cmp3.not.8, label %for.inc.9, label %for.inc.8 for.inc.8: ; preds = %for.inc.7 %10 = load i32, ptr %n, align 4, !tbaa !5 call void @a(i32 noundef 8, i32 noundef 8, i32 noundef 1, i32 noundef %10, i32 noundef %.pre19) %.pre20 = load i32, ptr %s, align 4, !tbaa !5 %cmp3.not.9 = icmp slt i32 %.pre20, 9 br i1 %cmp3.not.9, label %for.inc.9, label %if.then.9 if.then.9: ; preds = %for.inc.8 %11 = load i32, ptr %n, align 4, !tbaa !5 call void @a(i32 noundef 9, i32 noundef 9, i32 noundef 1, i32 noundef %11, i32 noundef %.pre20) br label %for.inc.9 for.inc.9: ; preds = %for.cond1.preheader, %for.inc, %for.inc.1, %for.inc.2, %for.inc.3, %for.inc.4, %for.inc.5, %for.inc.6, %for.inc.7, %if.then.9, %for.inc.8 %12 = load i32, ptr @c1, align 4, !tbaa !5 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12) store i32 0, ptr @c1, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %13 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %13, 0 br i1 %tobool.not, label %for.end5, label %for.cond1.preheader, !llvm.loop !11 for.end5: ; preds = %for.inc.9, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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> #define min(a,b) ( ((a) < (b)) ? (a) : (b) ) /*ˆø”•t‚«ƒ}ƒNƒ(ƒI[ƒo[Eƒwƒbƒh‚ª‚È‚¢‚̂ł·)*/ int goal_depth = 0; int correct_answer = 0; int DFS(int sum,int nowdepth,int node) /*recursive call(Ä‹AŒÄ‚яo‚µ)*/ { int count = 0; /* ¡‚̐[‚³‚̃JƒEƒ“ƒg */ int next_node = 0; /* ’Tõ‚·‚éƒm[ƒh‚ðŒˆ’è‚·‚é */ if(nowdepth == goal_depth){ /* ˆê”Ԑ[‚¢‚Æ‚±‚ë‚܂ŗˆ‚½‚ç */ if(sum == correct_answer){ return 1; /*count++‚ÉŽ—‚Ä‚é (count‚ÍŠO•”•ϐ”‚É‚µ‚Ă܂¹‚ñB‚µ‚½‚灩‚ɂȂé)*/ } else { return 0; } } /* Ž}Š ‚è */ for(next_node = min(node,correct_answer - sum) ; next_node >= 0 ; next_node--){ count += DFS( sum + next_node , nowdepth + 1 , next_node - 1 ); } return count; /*Å[•”‚É’B‚µ‚Ä‚¢‚È‚¢‚̂ɁAnext_node‚ª•‰‚Ì’l‚È‚çA‰Šú’l0‚ð•Ô‚·B*/ } int main() { int n,s; /*Œ©‚É‚­‚¢‚̂Ł«‚̂悤‚É‚µ‚Ă݂½*/ while(scanf("%d %d",&n,&s), !(n == 0 && s == 0) ){ int myanswer=0; goal_depth = n; correct_answer = s; myanswer = DFS(0,0,9); printf("%d\n",myanswer); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172753/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172753/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" @goal_depth = dso_local local_unnamed_addr global i32 0, align 4 @correct_answer = dso_local local_unnamed_addr global i32 0, align 4 @.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 nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @DFS(i32 noundef %sum, i32 noundef %nowdepth, i32 noundef %node) local_unnamed_addr #0 { entry: %0 = load i32, ptr @goal_depth, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %nowdepth %1 = load i32, ptr @correct_answer, align 4 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %cmp1 = icmp eq i32 %1, %sum %. = zext i1 %cmp1 to i32 br label %cleanup if.end: ; preds = %entry %sub = sub nsw i32 %1, %sum %cond = tail call i32 @llvm.smin.i32(i32 %sub, i32 %node) %cmp519 = icmp sgt i32 %cond, -1 br i1 %cmp519, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %if.end %add6 = add nsw i32 %nowdepth, 1 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %next_node.021 = phi i32 [ %cond, %for.body.lr.ph ], [ %sub7, %for.body ] %count.020 = phi i32 [ 0, %for.body.lr.ph ], [ %add8, %for.body ] %add = add nsw i32 %next_node.021, %sum %sub7 = add nsw i32 %next_node.021, -1 %call = tail call i32 @DFS(i32 noundef %add, i32 noundef %add6, i32 noundef %sub7) %add8 = add nsw i32 %call, %count.020 %cmp5.not = icmp eq i32 %next_node.021, 0 br i1 %cmp5.not, label %cleanup, label %for.body, !llvm.loop !9 cleanup: ; preds = %for.body, %if.end, %if.then %retval.0 = phi i32 [ %., %if.then ], [ 0, %if.end ], [ %add8, %for.body ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %s = 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 %s) #5 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp5 = icmp ne i32 %0, 0 %1 = load i32, ptr %s, align 4 %cmp16 = icmp ne i32 %1, 0 %.not7 = select i1 %cmp5, i1 true, i1 %cmp16 br i1 %.not7, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %2 = phi i32 [ %5, %while.body ], [ %1, %entry ] %3 = phi i32 [ %4, %while.body ], [ %0, %entry ] store i32 %3, ptr @goal_depth, align 4, !tbaa !5 store i32 %2, ptr @correct_answer, align 4, !tbaa !5 %call2 = call i32 @DFS(i32 noundef 0, i32 noundef 0, i32 noundef 9) %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call2) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp ne i32 %4, 0 %5 = load i32, ptr %s, align 4 %cmp1 = icmp ne i32 %5, 0 %.not = select i1 %cmp, i1 true, i1 %cmp1 br i1 %.not, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #5 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 #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree 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 #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 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}
#include<stdio.h> #include<math.h> int main(){ int a[1145][2],n,s,i,j,cnt,num,total; for(i=0;i<1024;i++){ for(j=1,cnt=0,num=0,total=0;cnt<10;j*=2,cnt++){ if(i&j){ total+=cnt;num++; } } a[i][0]=total; a[i][1]=num; } //for(i=0;i<1024;i++) printf("i=%d,total=%d,num=%d ",i,a[i][0],a[i][1]); while(1){ scanf("%d %d",&n,&s); if(n==0&&s==0) break; cnt=0; for(i=0;i<1024;i++){ if(a[i][1]==n){ if(a[i][0]==s)cnt++; } } printf("%d\n",cnt); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172810/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172810/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 [1145 x [2 x i32]], align 16 %n = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 9160, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 br label %vector.body vector.body: ; preds = %vector.body, %entry %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %entry ], [ %vec.ind.next, %vector.body ] %0 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1> %1 = lshr <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1> %2 = and <4 x i32> %1, <i32 1, i32 1, i32 1, i32 1> %3 = add nuw nsw <4 x i32> %0, %2 %4 = lshr <4 x i32> %vec.ind, <i32 2, i32 2, i32 2, i32 2> %5 = and <4 x i32> %4, <i32 1, i32 1, i32 1, i32 1> %6 = add nuw nsw <4 x i32> %3, %5 %7 = lshr <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1> %8 = and <4 x i32> %7, <i32 3, i32 3, i32 3, i32 3> %9 = and <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %10 = icmp eq <4 x i32> %9, zeroinitializer %11 = lshr exact <4 x i32> %9, <i32 3, i32 3, i32 3, i32 3> %12 = add nuw nsw <4 x i32> %6, %11 %13 = select <4 x i1> %10, <4 x i32> zeroinitializer, <4 x i32> <i32 3, i32 3, i32 3, i32 3> %14 = add nuw nsw <4 x i32> %8, %13 %15 = and <4 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16> %16 = lshr exact <4 x i32> %15, <i32 4, i32 4, i32 4, i32 4> %17 = add nuw nsw <4 x i32> %12, %16 %18 = lshr exact <4 x i32> %15, <i32 2, i32 2, i32 2, i32 2> %19 = add nuw nsw <4 x i32> %14, %18 %20 = and <4 x i32> %vec.ind, <i32 32, i32 32, i32 32, i32 32> %21 = icmp eq <4 x i32> %20, zeroinitializer %22 = lshr exact <4 x i32> %20, <i32 5, i32 5, i32 5, i32 5> %23 = add nuw nsw <4 x i32> %17, %22 %24 = select <4 x i1> %21, <4 x i32> zeroinitializer, <4 x i32> <i32 5, i32 5, i32 5, i32 5> %25 = add nuw nsw <4 x i32> %19, %24 %26 = and <4 x i32> %vec.ind, <i32 64, i32 64, i32 64, i32 64> %27 = icmp eq <4 x i32> %26, zeroinitializer %28 = lshr exact <4 x i32> %26, <i32 6, i32 6, i32 6, i32 6> %29 = add nuw nsw <4 x i32> %23, %28 %30 = select <4 x i1> %27, <4 x i32> zeroinitializer, <4 x i32> <i32 6, i32 6, i32 6, i32 6> %31 = add nuw nsw <4 x i32> %25, %30 %32 = and <4 x i32> %vec.ind, <i32 128, i32 128, i32 128, i32 128> %33 = icmp eq <4 x i32> %32, zeroinitializer %34 = lshr exact <4 x i32> %32, <i32 7, i32 7, i32 7, i32 7> %35 = add nuw nsw <4 x i32> %29, %34 %36 = select <4 x i1> %33, <4 x i32> zeroinitializer, <4 x i32> <i32 7, i32 7, i32 7, i32 7> %37 = add nuw nsw <4 x i32> %31, %36 %38 = and <4 x i32> %vec.ind, <i32 256, i32 256, i32 256, i32 256> %39 = lshr exact <4 x i32> %38, <i32 8, i32 8, i32 8, i32 8> %40 = add nuw nsw <4 x i32> %35, %39 %41 = lshr exact <4 x i32> %38, <i32 5, i32 5, i32 5, i32 5> %42 = add nuw nsw <4 x i32> %37, %41 %43 = and <4 x i32> %vec.ind, <i32 512, i32 512, i32 512, i32 512> %44 = icmp eq <4 x i32> %43, zeroinitializer %45 = lshr exact <4 x i32> %43, <i32 9, i32 9, i32 9, i32 9> %46 = add nuw nsw <4 x i32> %40, %45 %47 = select <4 x i1> %44, <4 x i32> zeroinitializer, <4 x i32> <i32 9, i32 9, i32 9, i32 9> %48 = add nuw nsw <4 x i32> %42, %47 %49 = getelementptr inbounds [1145 x [2 x i32]], ptr %a, i64 0, i64 %index %interleaved.vec = shufflevector <4 x i32> %48, <4 x i32> %46, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7> store <8 x i32> %interleaved.vec, ptr %49, align 16, !tbaa !5 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %50 = icmp eq i64 %index.next, 1024 br i1 %50, label %while.cond.preheader, label %vector.body, !llvm.loop !9 while.cond.preheader: ; preds = %vector.body %call58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %51 = load i32, ptr %n, align 4, !tbaa !5 %cmp1259 = icmp eq i32 %51, 0 %52 = load i32, ptr %s, align 4 %cmp1360 = icmp eq i32 %52, 0 %or.cond61 = select i1 %cmp1259, i1 %cmp1360, i1 false br i1 %or.cond61, label %while.end, label %for.cond16.preheader for.cond16.preheader: ; preds = %while.cond.preheader, %for.end34 %53 = phi i32 [ %60, %for.end34 ], [ %52, %while.cond.preheader ] %54 = phi i32 [ %59, %for.end34 ], [ %51, %while.cond.preheader ] br label %for.body18 for.body18: ; preds = %for.inc32.1, %for.cond16.preheader %indvars.iv63 = phi i64 [ 0, %for.cond16.preheader ], [ %indvars.iv.next64.1, %for.inc32.1 ] %cnt.157 = phi i32 [ 0, %for.cond16.preheader ], [ %cnt.2.1, %for.inc32.1 ] %arrayidx21 = getelementptr inbounds [1145 x [2 x i32]], ptr %a, i64 0, i64 %indvars.iv63, i64 1 %55 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22 = icmp eq i32 %55, %54 br i1 %cmp22, label %if.then23, label %for.inc32 if.then23: ; preds = %for.body18 %arrayidx20 = getelementptr inbounds [1145 x [2 x i32]], ptr %a, i64 0, i64 %indvars.iv63 %56 = load i32, ptr %arrayidx20, align 16, !tbaa !5 %cmp27 = icmp eq i32 %56, %53 %inc29 = zext i1 %cmp27 to i32 %spec.select = add nsw i32 %cnt.157, %inc29 br label %for.inc32 for.inc32: ; preds = %if.then23, %for.body18 %cnt.2 = phi i32 [ %cnt.157, %for.body18 ], [ %spec.select, %if.then23 ] %indvars.iv.next64 = or i64 %indvars.iv63, 1 %arrayidx21.1 = getelementptr inbounds [1145 x [2 x i32]], ptr %a, i64 0, i64 %indvars.iv.next64, i64 1 %57 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5 %cmp22.1 = icmp eq i32 %57, %54 br i1 %cmp22.1, label %if.then23.1, label %for.inc32.1 if.then23.1: ; preds = %for.inc32 %arrayidx20.1 = getelementptr inbounds [1145 x [2 x i32]], ptr %a, i64 0, i64 %indvars.iv.next64 %58 = load i32, ptr %arrayidx20.1, align 8, !tbaa !5 %cmp27.1 = icmp eq i32 %58, %53 %inc29.1 = zext i1 %cmp27.1 to i32 %spec.select.1 = add nsw i32 %cnt.2, %inc29.1 br label %for.inc32.1 for.inc32.1: ; preds = %if.then23.1, %for.inc32 %cnt.2.1 = phi i32 [ %cnt.2, %for.inc32 ], [ %spec.select.1, %if.then23.1 ] %indvars.iv.next64.1 = add nuw nsw i64 %indvars.iv63, 2 %exitcond66.not.1 = icmp eq i64 %indvars.iv.next64.1, 1024 br i1 %exitcond66.not.1, label %for.end34, label %for.body18, !llvm.loop !13 for.end34: ; preds = %for.inc32.1 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.2.1) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %59 = load i32, ptr %n, align 4, !tbaa !5 %cmp12 = icmp eq i32 %59, 0 %60 = load i32, ptr %s, align 4 %cmp13 = icmp eq i32 %60, 0 %or.cond = select i1 %cmp12, i1 %cmp13, i1 false br i1 %or.cond, label %while.end, label %for.cond16.preheader while.end: ; preds = %for.end34, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 9160, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10}
#include<stdio.h> int main(void) { int i=0,n, x[10000],max,min; long long int sum = 0; scanf("%d", &n); scanf("%d",&x[i]); max = x[i]; min = x[i]; sum = sum + x[i]; i++; while (i < n) { scanf("%d",&x[i]); sum = sum + x[i]; if (x[i]>max) { max = x[i]; } if (x[i] < min) { min = x[i]; } i++; } printf("%d %d %lld\n", min, max, sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172861/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172861/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 [12 x i8] c"%d %d %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 %x = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 16, !tbaa !5 %conv = sext i32 %0 to i64 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp49 = icmp sgt i32 %1, 1 br i1 %cmp49, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 1, %entry ] %sum.053 = phi i64 [ %add15, %while.body ], [ %conv, %entry ] %min.052 = phi i32 [ %min.1, %while.body ], [ %0, %entry ] %max.051 = phi i32 [ %spec.select, %while.body ], [ %0, %entry ] %arrayidx10 = getelementptr inbounds [10000 x i32], ptr %x, i64 0, i64 %indvars.iv %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10) %2 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %conv14 = sext i32 %2 to i64 %add15 = add nsw i64 %sum.053, %conv14 %spec.select = call i32 @llvm.smax.i32(i32 %2, i32 %max.051) %min.1 = call i32 @llvm.smin.i32(i32 %2, i32 %min.052) %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 %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry %max.0.lcssa = phi i32 [ %0, %entry ], [ %spec.select, %while.body ] %min.0.lcssa = phi i32 [ %0, %entry ], [ %min.1, %while.body ] %sum.0.lcssa = phi i64 [ %conv, %entry ], [ %add15, %while.body ] %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa, i32 noundef %max.0.lcssa, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int n; double b=0; int i,j; int a[10000],temp; scanf("%d",&n); for(i=1;i<=n;i++)scanf("%d",&a[i]); for(i=1;i<n;i++){ for(j=i+1;j<=n;j++){ if(a[i]>a[j]){ temp=a[i]; a[i]=a[j]; a[j]=temp; } } } printf("%d ",a[1]); for(i=1;i<n;i++){ for(j=i+1;j<=n;j++){ if(a[i]<a[j]){ temp=a[i]; a[i]=a[j]; a[j]=temp; } } } printf("%d ",a[1]); for(i=1;i<=n;i++)b+=a[i]; printf("%.0lf\n",b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172904/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172904/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 @.str.2 = private unnamed_addr constant [7 x i8] c"%.0lf\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 [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not100 = icmp slt i32 %0, 1 br i1 %cmp.not100, label %for.end26, label %for.body for.cond2.preheader: ; preds = %for.body %cmp3104 = icmp sgt i32 %2, 1 br i1 %cmp3104, label %for.body4.preheader, label %for.end26 for.body4.preheader: ; preds = %for.cond2.preheader %1 = add nuw i32 %2, 1 %wide.trip.count124 = zext i32 %2 to i64 %wide.trip.count = zext i32 %1 to i64 br label %for.body7.lr.ph for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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.not.not = icmp slt i64 %indvars.iv, %3 br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond2.loopexit: ; preds = %for.inc21 %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1 %exitcond125.not = icmp eq i64 %indvars.iv.next122, %wide.trip.count124 br i1 %exitcond125.not, label %for.end26, label %for.body7.lr.ph, !llvm.loop !11 for.body7.lr.ph: ; preds = %for.cond2.loopexit, %for.body4.preheader %indvars.iv121 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next122, %for.cond2.loopexit ] %indvars.iv116 = phi i64 [ 2, %for.body4.preheader ], [ %indvars.iv.next117, %for.cond2.loopexit ] %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1 %arrayidx9 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv121 br label %for.body7 for.body7: ; preds = %for.body7.lr.ph, %for.inc21 %indvars.iv118 = phi i64 [ %indvars.iv116, %for.body7.lr.ph ], [ %indvars.iv.next119, %for.inc21 ] %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv118 %5 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %4, %5 br i1 %cmp12, label %if.then, label %for.inc21 if.then: ; preds = %for.body7 store i32 %5, ptr %arrayidx9, align 4, !tbaa !5 store i32 %4, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.body7, %if.then %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1 %exitcond.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count br i1 %exitcond.not, label %for.cond2.loopexit, label %for.body7, !llvm.loop !12 for.end26: ; preds = %for.cond2.loopexit, %entry, %for.cond2.preheader %arrayidx27 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 1 %6 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6) %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp30108 = icmp sgt i32 %7, 1 br i1 %cmp30108, label %for.body31.preheader, label %for.end56 for.body31.preheader: ; preds = %for.end26 %8 = add nuw i32 %7, 1 %wide.trip.count136 = zext i32 %7 to i64 %wide.trip.count131 = zext i32 %8 to i64 br label %for.body35.lr.ph for.cond29.loopexit: ; preds = %for.inc51 %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1 %exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count136 br i1 %exitcond137.not, label %for.end56, label %for.body35.lr.ph, !llvm.loop !13 for.body35.lr.ph: ; preds = %for.cond29.loopexit, %for.body31.preheader %indvars.iv133 = phi i64 [ 1, %for.body31.preheader ], [ %indvars.iv.next134, %for.cond29.loopexit ] %indvars.iv126 = phi i64 [ 2, %for.body31.preheader ], [ %indvars.iv.next127, %for.cond29.loopexit ] %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %arrayidx37 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv133 br label %for.body35 for.body35: ; preds = %for.body35.lr.ph, %for.inc51 %indvars.iv128 = phi i64 [ %indvars.iv126, %for.body35.lr.ph ], [ %indvars.iv.next129, %for.inc51 ] %9 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %arrayidx39 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv128 %10 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %cmp40 = icmp slt i32 %9, %10 br i1 %cmp40, label %if.then41, label %for.inc51 if.then41: ; preds = %for.body35 store i32 %10, ptr %arrayidx37, align 4, !tbaa !5 store i32 %9, ptr %arrayidx39, align 4, !tbaa !5 br label %for.inc51 for.inc51: ; preds = %for.body35, %if.then41 %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1 %exitcond132.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count131 br i1 %exitcond132.not, label %for.cond29.loopexit, label %for.body35, !llvm.loop !14 for.end56: ; preds = %for.cond29.loopexit, %for.end26 %11 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11) %12 = load i32, ptr %n, align 4, !tbaa !5 %cmp60.not110 = icmp slt i32 %12, 1 br i1 %cmp60.not110, label %for.end67, label %for.body61.preheader for.body61.preheader: ; preds = %for.end56 %13 = add nuw i32 %12, 1 %wide.trip.count141 = zext i32 %13 to i64 %14 = add nsw i64 %wide.trip.count141, -1 %15 = add nsw i64 %wide.trip.count141, -2 %xtraiter = and i64 %14, 3 %16 = icmp ult i64 %15, 3 br i1 %16, label %for.end67.loopexit.unr-lcssa, label %for.body61.preheader.new for.body61.preheader.new: ; preds = %for.body61.preheader %unroll_iter = and i64 %14, -4 br label %for.body61 for.body61: ; preds = %for.body61, %for.body61.preheader.new %indvars.iv138 = phi i64 [ 1, %for.body61.preheader.new ], [ %indvars.iv.next139.3, %for.body61 ] %b.0111 = phi double [ 0.000000e+00, %for.body61.preheader.new ], [ %add64.3, %for.body61 ] %niter = phi i64 [ 0, %for.body61.preheader.new ], [ %niter.next.3, %for.body61 ] %arrayidx63 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv138 %17 = load i32, ptr %arrayidx63, align 4, !tbaa !5 %conv = sitofp i32 %17 to double %add64 = fadd double %b.0111, %conv %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1 %arrayidx63.1 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv.next139 %18 = load i32, ptr %arrayidx63.1, align 4, !tbaa !5 %conv.1 = sitofp i32 %18 to double %add64.1 = fadd double %add64, %conv.1 %indvars.iv.next139.1 = add nuw nsw i64 %indvars.iv138, 2 %arrayidx63.2 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv.next139.1 %19 = load i32, ptr %arrayidx63.2, align 4, !tbaa !5 %conv.2 = sitofp i32 %19 to double %add64.2 = fadd double %add64.1, %conv.2 %indvars.iv.next139.2 = add nuw nsw i64 %indvars.iv138, 3 %arrayidx63.3 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv.next139.2 %20 = load i32, ptr %arrayidx63.3, align 4, !tbaa !5 %conv.3 = sitofp i32 %20 to double %add64.3 = fadd double %add64.2, %conv.3 %indvars.iv.next139.3 = add nuw nsw i64 %indvars.iv138, 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.end67.loopexit.unr-lcssa, label %for.body61, !llvm.loop !15 for.end67.loopexit.unr-lcssa: ; preds = %for.body61, %for.body61.preheader %add64.lcssa.ph = phi double [ undef, %for.body61.preheader ], [ %add64.3, %for.body61 ] %indvars.iv138.unr = phi i64 [ 1, %for.body61.preheader ], [ %indvars.iv.next139.3, %for.body61 ] %b.0111.unr = phi double [ 0.000000e+00, %for.body61.preheader ], [ %add64.3, %for.body61 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end67, label %for.body61.epil for.body61.epil: ; preds = %for.end67.loopexit.unr-lcssa, %for.body61.epil %indvars.iv138.epil = phi i64 [ %indvars.iv.next139.epil, %for.body61.epil ], [ %indvars.iv138.unr, %for.end67.loopexit.unr-lcssa ] %b.0111.epil = phi double [ %add64.epil, %for.body61.epil ], [ %b.0111.unr, %for.end67.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body61.epil ], [ 0, %for.end67.loopexit.unr-lcssa ] %arrayidx63.epil = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv138.epil %21 = load i32, ptr %arrayidx63.epil, align 4, !tbaa !5 %conv.epil = sitofp i32 %21 to double %add64.epil = fadd double %b.0111.epil, %conv.epil %indvars.iv.next139.epil = add nuw nsw i64 %indvars.iv138.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.end67, label %for.body61.epil, !llvm.loop !16 for.end67: ; preds = %for.end67.loopexit.unr-lcssa, %for.body61.epil, %for.end56 %b.0.lcssa = phi double [ 0.000000e+00, %for.end56 ], [ %add64.lcssa.ph, %for.end67.loopexit.unr-lcssa ], [ %add64.epil, %for.body61.epil ] %call68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %b.0.lcssa) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> int main(){ int i, n; long a, max, min, sum = 0; scanf("%d\n", &n); if(n < 0 || n > 10000) return 0; for(i = 1; i <= n; i++){ scanf("%ld", &a); if(a < -1000000 || a > 1000000){ break; } if(i == 1){ max = a; min = a; sum = a; }else if(i > 1){ if(a > max){max = a;} if(a < min){min = a;} sum += a; } } printf("%ld %ld %ld\n", min, max, sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172948/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172948/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"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.2 = private unnamed_addr constant [13 x i8] c"%ld %ld %ld\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 i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4 %or.cond = icmp ugt i32 %0, 10000 br i1 %or.cond, label %cleanup, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp2.not35 = icmp ne i32 %0, 0 call void @llvm.assume(i1 %cmp2.not35) %call3.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %1 = load i64, ptr %a, align 8 %2 = add i64 %1, 1000000 %or.cond27.peel = icmp ult i64 %2, 2000001 call void @llvm.assume(i1 %or.cond27.peel) %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp2.not.not.peel = icmp sgt i32 %3, 1 br i1 %cmp2.not.not.peel, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.inc %sum.039 = phi i64 [ %add, %for.inc ], [ %1, %for.cond.preheader ] %min.038 = phi i64 [ %min.1, %for.inc ], [ %1, %for.cond.preheader ] %max.037 = phi i64 [ %spec.select, %for.inc ], [ %1, %for.cond.preheader ] %i.036 = phi i32 [ %inc, %for.inc ], [ 2, %for.cond.preheader ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %4 = load i64, ptr %a, align 8 %5 = add i64 %4, -1000001 %or.cond27 = icmp ult i64 %5, -2000001 br i1 %or.cond27, label %for.end, label %for.inc for.inc: ; preds = %for.body %add = add nsw i64 %4, %sum.039 %min.1 = call i64 @llvm.smin.i64(i64 %4, i64 %min.038) %spec.select = call i64 @llvm.smax.i64(i64 %4, i64 %max.037) %inc = add nuw nsw i32 %i.036, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp2.not.not = icmp slt i32 %i.036, %6 br i1 %cmp2.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %for.body, %for.cond.preheader %max.0.lcssa = phi i64 [ %1, %for.cond.preheader ], [ %max.037, %for.body ], [ %spec.select, %for.inc ] %min.0.lcssa = phi i64 [ %1, %for.cond.preheader ], [ %min.038, %for.body ], [ %min.1, %for.inc ] %sum.0.lcssa = phi i64 [ %1, %for.cond.preheader ], [ %sum.039, %for.body ], [ %add, %for.inc ] %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %min.0.lcssa, i64 noundef %max.0.lcssa, i64 noundef %sum.0.lcssa) br label %cleanup cleanup: ; preds = %entry, %for.end call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } 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, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> int main( ){ long long n,x,y,min,max,sum; sum=0; min=1000000; max=-1000000; scanf("%lld",&n); for(x=0;x<n;x++){scanf("%lld",&y); sum=sum+y; if(min>y){min=y;} if(max<y){max=y;} } printf("%lld %lld %lld\n",min,max,sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_172991/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_172991/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [16 x i8] c"%lld %lld %lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp12 = icmp sgt i64 %0, 0 br i1 %cmp12, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %sum.016 = phi i64 [ %add, %for.body ], [ 0, %entry ] %max.015 = phi i64 [ %max.1, %for.body ], [ -1000000, %entry ] %min.014 = phi i64 [ %spec.select, %for.body ], [ 1000000, %entry ] %x.013 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y) %1 = load i64, ptr %y, align 8, !tbaa !5 %add = add nsw i64 %1, %sum.016 %spec.select = call i64 @llvm.smin.i64(i64 %min.014, i64 %1) %max.1 = call i64 @llvm.smax.i64(i64 %max.015, i64 %1) %inc = add nuw nsw i64 %x.013, 1 %2 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %min.0.lcssa = phi i64 [ 1000000, %entry ], [ %spec.select, %for.body ] %max.0.lcssa = phi i64 [ -1000000, %entry ], [ %max.1, %for.body ] %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %min.0.lcssa, i64 noundef %max.0.lcssa, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int n; int a; int max,min; double sum=0.0; int i; double s; scanf("%d",&n); for(i = 0;i < n;i++){ scanf("%d",&a); if(i == 0){ min = a; max = a; } if(a > max){ max = a; }else if(a < min){ min = a; } sum+=(double)a; } printf("%d %d %.0f\n",min,max,sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_173033/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_173033/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 [12 x i8] c"%d %d %.0f\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 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 %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %0, 0 call void @llvm.assume(i1 %cmp17) %call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %1 = load i32, ptr %a, align 4 %conv.peel = sitofp i32 %1 to double %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp.peel = icmp sgt i32 %2, 1 br i1 %cmp.peel, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %max.021 = phi i32 [ %max.2, %for.body ], [ %1, %entry ] %i.020 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %sum.019 = phi double [ %add, %for.body ], [ %conv.peel, %entry ] %min.018 = phi i32 [ %min.2, %for.body ], [ %1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %3 = load i32, ptr %a, align 4 %cmp3 = icmp sgt i32 %3, %max.021 %spec.select16 = call i32 @llvm.smin.i32(i32 %3, i32 %min.018) %min.2 = select i1 %cmp3, i32 %min.018, i32 %spec.select16 %max.2 = call i32 @llvm.smax.i32(i32 %3, i32 %max.021) %conv = sitofp i32 %3 to double %add = fadd double %sum.019, %conv %inc = add nuw nsw i32 %i.020, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %min.2.lcssa = phi i32 [ %1, %entry ], [ %min.2, %for.body ] %max.2.lcssa = phi i32 [ %1, %entry ], [ %max.2, %for.body ] %add.lcssa = phi double [ %conv.peel, %entry ], [ %add, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.2.lcssa, i32 noundef %max.2.lcssa, double noundef %add.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #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: 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 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } 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, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #include <stdlib.h> #pragma warning (disable:4996) #define min(a, b) (((a)<(b)) ? (a) : (b)) #define max(a, b) (((a)>(b)) ? (a) : (b)) int main() { int n, i; scanf("%d", &n); int *c; c = malloc(sizeof(int)*n); int min = 1000001, max = -1000001; long long int sum = 0; for (i = 0; i < n; i++) { scanf("%d", &c[i]); min = min(c[i], min); max = max(c[i], max); sum += c[i]; } printf("%d %d %lld\n", min, max, sum); free(c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_173091/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_173091/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 [12 x i8] c"%d %d %lld\0A\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) #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 = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #7 %cmp43 = icmp sgt i32 %0, 0 br i1 %cmp43, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.047 = phi i64 [ %add, %for.body ], [ 0, %entry ] %max.046 = phi i32 [ %cond19, %for.body ], [ -1000001, %entry ] %min.045 = phi i32 [ %.min.0, %for.body ], [ 1000001, %entry ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %.min.0 = call i32 @llvm.smin.i32(i32 %1, i32 %min.045) %cond19 = call i32 @llvm.smax.i32(i32 %1, i32 %max.046) %conv22 = sext i32 %1 to i64 %add = add nsw i64 %sum.047, %conv22 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %min.0.lcssa = phi i32 [ 1000001, %entry ], [ %.min.0, %for.body ] %max.0.lcssa = phi i32 [ -1000001, %entry ], [ %cond19, %for.body ] %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa, i32 noundef %max.0.lcssa, i64 noundef %sum.0.lcssa) call void @free(ptr noundef %call1) #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: 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 nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree 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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ long n, a, i, max, min, sum; scanf("%ld", &n); scanf("%ld", &a); max = a; min = a; sum = a; for(i = 2; i <= n; i++) { scanf("%ld", &a); if(a > max) { max = a; } if(a < min) { min = a; } sum += a; } printf("%ld %ld %ld\n", min, max, sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_173141/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_173141/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%ld %ld %ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %a = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %n, align 8, !tbaa !5 %cmp.not13 = icmp slt i64 %1, 2 br i1 %cmp.not13, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %sum.017 = phi i64 [ %add, %for.body ], [ %0, %entry ] %min.016 = phi i64 [ %min.1, %for.body ], [ %0, %entry ] %max.015 = phi i64 [ %spec.select, %for.body ], [ %0, %entry ] %i.014 = phi i64 [ %inc, %for.body ], [ 2, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %2 = load i64, ptr %a, align 8, !tbaa !5 %spec.select = call i64 @llvm.smax.i64(i64 %2, i64 %max.015) %min.1 = call i64 @llvm.smin.i64(i64 %2, i64 %min.016) %add = add nsw i64 %2, %sum.017 %inc = add nuw nsw i64 %i.014, 1 %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp.not.not = icmp slt i64 %i.014, %3 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %max.0.lcssa = phi i64 [ %0, %entry ], [ %spec.select, %for.body ] %min.0.lcssa = phi i64 [ %0, %entry ], [ %min.1, %for.body ] %sum.0.lcssa = phi i64 [ %0, %entry ], [ %add, %for.body ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %min.0.lcssa, i64 noundef %max.0.lcssa, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int a,b,c; long d=1000000,e=-1000000,f=0; scanf("%d",&a); for(b=0;b<a;b++){ scanf("%d",&c); if(d>c){ d=c; } if(e<c){ e=c; } f+=c; } printf("%ld %ld %ld\n",d,e,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_173185/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_173185/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 [13 x i8] c"%ld %ld %ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %0, 0 br i1 %cmp17, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %f.021 = phi i64 [ %add, %for.body ], [ 0, %entry ] %e.020 = phi i64 [ %e.1, %for.body ], [ -1000000, %entry ] %d.019 = phi i64 [ %spec.select, %for.body ], [ 1000000, %entry ] %b.018 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %1 = load i32, ptr %c, align 4, !tbaa !5 %conv = sext i32 %1 to i64 %spec.select = call i64 @llvm.smin.i64(i64 %d.019, i64 %conv) %e.1 = call i64 @llvm.smax.i64(i64 %e.020, i64 %conv) %add = add nsw i64 %f.021, %conv %inc = add nuw nsw i32 %b.018, 1 %2 = load i32, ptr %a, 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 %d.0.lcssa = phi i64 [ 1000000, %entry ], [ %spec.select, %for.body ] %e.0.lcssa = phi i64 [ -1000000, %entry ], [ %e.1, %for.body ] %f.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %d.0.lcssa, i64 noundef %e.0.lcssa, i64 noundef %f.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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; int x; int i; long long sum; int min,max; scanf("%d",&n); sum=0; min=1000000; max=-1000000; for(i=0;i<n;i++){ scanf("%d",&x); sum+=x; if(x<min){ min=x; } if(x>max){ max=x; } } printf("%d %d %lld\n",min,max,sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_173228/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_173228/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 [12 x i8] c"%d %d %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 %x = 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 %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp14 = icmp sgt i32 %0, 0 br i1 %cmp14, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %max.018 = phi i32 [ %max.1, %for.body ], [ -1000000, %entry ] %min.017 = phi i32 [ %spec.select, %for.body ], [ 1000000, %entry ] %sum.016 = phi i64 [ %add, %for.body ], [ 0, %entry ] %i.015 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %1 = load i32, ptr %x, align 4, !tbaa !5 %conv = sext i32 %1 to i64 %add = add nsw i64 %sum.016, %conv %spec.select = call i32 @llvm.smin.i32(i32 %1, i32 %min.017) %max.1 = call i32 @llvm.smax.i32(i32 %1, i32 %max.018) %inc = add nuw nsw i32 %i.015, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ] %min.0.lcssa = phi i32 [ 1000000, %entry ], [ %spec.select, %for.body ] %max.0.lcssa = phi i32 [ -1000000, %entry ], [ %max.1, %for.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa, i32 noundef %max.0.lcssa, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int n, i, ai, min, max; long sum; sum=0; min=1000000; max=-1000000; scanf("%d",&n); for(i=1; i<=n; i++){ scanf("%d",&ai); sum+=ai; if(min>ai){ min=ai; } if(max<ai){ max=ai; } } printf("%d %d %lld\n",min, max, sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_173271/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_173271/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 [12 x i8] c"%d %d %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 %ai = 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 %ai) #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.not14 = icmp slt i32 %0, 1 br i1 %cmp.not14, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %sum.018 = phi i64 [ %add, %for.body ], [ 0, %entry ] %max.017 = phi i32 [ %max.1, %for.body ], [ -1000000, %entry ] %min.016 = phi i32 [ %spec.select, %for.body ], [ 1000000, %entry ] %i.015 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ai) %1 = load i32, ptr %ai, align 4, !tbaa !5 %conv = sext i32 %1 to i64 %add = add nsw i64 %sum.018, %conv %spec.select = call i32 @llvm.smin.i32(i32 %min.016, i32 %1) %max.1 = call i32 @llvm.smax.i32(i32 %max.017, i32 %1) %inc = add nuw nsw i32 %i.015, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.015, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %min.0.lcssa = phi i32 [ 1000000, %entry ], [ %spec.select, %for.body ] %max.0.lcssa = phi i32 [ -1000000, %entry ], [ %max.1, %for.body ] %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa, i32 noundef %max.0.lcssa, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ai) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int n,a[10000],i,max,min; long sum; max=0; sum=0; min=1000000; scanf("%d\n%d",&n,&a[0]); sum=min=max=a[0]; for(i=1;i<n;i++){ scanf("%d",&a[i]); if(max<a[i]) max=a[i]; if(min>a[i]) min=a[i]; sum+=a[i]; } printf("%d %d %ld\n",min,max,sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_173314/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_173314/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\0A%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [11 x i8] c"%d %d %ld\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 [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 16, !tbaa !5 %conv = sext i32 %0 to i64 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp34 = icmp sgt i32 %1, 1 br i1 %cmp34, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %sum.038 = phi i64 [ %add, %for.body ], [ %conv, %entry ] %min.037 = phi i32 [ %min.1, %for.body ], [ %0, %entry ] %max.036 = phi i32 [ %spec.select, %for.body ], [ %0, %entry ] %arrayidx3 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx3) %2 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %max.036, i32 %2) %min.1 = call i32 @llvm.smin.i32(i32 %min.037, i32 %2) %conv21 = sext i32 %2 to i64 %add = add nsw i64 %sum.038, %conv21 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %max.0.lcssa = phi i32 [ %0, %entry ], [ %spec.select, %for.body ] %min.0.lcssa = phi i32 [ %0, %entry ], [ %min.1, %for.body ] %sum.0.lcssa = phi i64 [ %conv, %entry ], [ %add, %for.body ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %min.0.lcssa, i32 noundef %max.0.lcssa, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 40000, 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: 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"}
#include<stdio.h> int main(void) { int i,n; int number; long long int sum=0; int min=0; int max=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&number); if(i==0) { min = number; max = number; } if(number<min) min = number; if(number>max) max = number; sum += number; } printf("%d %d %lld\n",min,max,sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_173358/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_173358/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 [12 x i8] c"%d %d %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 %number = 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 %number) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %0, 0 br i1 %cmp17, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %1 = load i32, ptr %number, align 4 %conv.peel = sext i32 %1 to i64 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp.peel = icmp sgt i32 %2, 1 br i1 %cmp.peel, label %for.body, label %for.end for.body: ; preds = %for.body.preheader, %for.body %max.021 = phi i32 [ %max.2, %for.body ], [ %1, %for.body.preheader ] %min.020 = phi i32 [ %min.2, %for.body ], [ %1, %for.body.preheader ] %sum.019 = phi i64 [ %add, %for.body ], [ %conv.peel, %for.body.preheader ] %i.018 = phi i32 [ %inc, %for.body ], [ 1, %for.body.preheader ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %3 = load i32, ptr %number, align 4 %min.2 = call i32 @llvm.smin.i32(i32 %3, i32 %min.020) %max.2 = call i32 @llvm.smax.i32(i32 %3, i32 %max.021) %conv = sext i32 %3 to i64 %add = add nsw i64 %sum.019, %conv %inc = add nuw nsw i32 %i.018, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.body.preheader, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %conv.peel, %for.body.preheader ], [ %add, %for.body ] %min.0.lcssa = phi i32 [ 0, %entry ], [ %1, %for.body.preheader ], [ %min.2, %for.body ] %max.0.lcssa = phi i32 [ 0, %entry ], [ %1, %for.body.preheader ], [ %max.2, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa, i32 noundef %max.0.lcssa, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %number) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> int main(){ int n,min,max,i; long int sum=0; int a[10000]; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); max=a[0],min=a[0]; for(i=0;i<n;i++){ if(max<a[i]) max=a[i]; else if(max>a[i] && min>a[i]) min=a[i]; sum=sum+a[i]; } printf("%d %d %ld\n",min,max,sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_173400/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_173400/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 [11 x i8] c"%d %d %ld\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 [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp42 = icmp sgt i32 %0, 0 call void @llvm.assume(i1 %cmp42) br label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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.end, !llvm.loop !9 for.end: ; preds = %for.body %.pre = load i32, ptr %a, align 16, !tbaa !5 %cmp544 = icmp sgt i32 %1, 0 br i1 %cmp544, label %for.body6.preheader, label %for.end26 for.body6.preheader: ; preds = %for.end %wide.trip.count = zext i32 %1 to i64 %xtraiter = and i64 %wide.trip.count, 1 %3 = icmp eq i32 %1, 1 br i1 %3, label %for.end26.loopexit.unr-lcssa, label %for.body6.preheader.new for.body6.preheader.new: ; preds = %for.body6.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body6 for.body6: ; preds = %for.body6, %for.body6.preheader.new %indvars.iv54 = phi i64 [ 0, %for.body6.preheader.new ], [ %indvars.iv.next55.1, %for.body6 ] %sum.048 = phi i64 [ 0, %for.body6.preheader.new ], [ %add.1, %for.body6 ] %max.046 = phi i32 [ %.pre, %for.body6.preheader.new ], [ %max.1.1, %for.body6 ] %min.045 = phi i32 [ %.pre, %for.body6.preheader.new ], [ %min.1.1, %for.body6 ] %niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.body6 ] %arrayidx8 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv54 %4 = load i32, ptr %arrayidx8, align 8, !tbaa !5 %cmp9 = icmp slt i32 %max.046, %4 %cmp14 = icmp sgt i32 %max.046, %4 %cmp17 = icmp sgt i32 %min.045, %4 %or.cond = select i1 %cmp14, i1 %cmp17, i1 false %spec.select = select i1 %or.cond, i32 %4, i32 %min.045 %min.1 = select i1 %cmp9, i32 %min.045, i32 %spec.select %max.1 = call i32 @llvm.smax.i32(i32 %max.046, i32 %4) %conv = sext i32 %4 to i64 %add = add nsw i64 %sum.048, %conv %indvars.iv.next55 = or i64 %indvars.iv54, 1 %arrayidx8.1 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv.next55 %5 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %cmp9.1 = icmp slt i32 %max.1, %5 %cmp14.1 = icmp sgt i32 %max.1, %5 %cmp17.1 = icmp sgt i32 %min.1, %5 %or.cond.1 = select i1 %cmp14.1, i1 %cmp17.1, i1 false %spec.select.1 = select i1 %or.cond.1, i32 %5, i32 %min.1 %min.1.1 = select i1 %cmp9.1, i32 %min.1, i32 %spec.select.1 %max.1.1 = call i32 @llvm.smax.i32(i32 %max.1, i32 %5) %conv.1 = sext i32 %5 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next55.1 = add nuw nsw i64 %indvars.iv54, 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.loopexit.unr-lcssa, label %for.body6, !llvm.loop !11 for.end26.loopexit.unr-lcssa: ; preds = %for.body6, %for.body6.preheader %min.1.lcssa.ph = phi i32 [ undef, %for.body6.preheader ], [ %min.1.1, %for.body6 ] %max.1.lcssa.ph = phi i32 [ undef, %for.body6.preheader ], [ %max.1.1, %for.body6 ] %add.lcssa.ph = phi i64 [ undef, %for.body6.preheader ], [ %add.1, %for.body6 ] %indvars.iv54.unr = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next55.1, %for.body6 ] %sum.048.unr = phi i64 [ 0, %for.body6.preheader ], [ %add.1, %for.body6 ] %max.046.unr = phi i32 [ %.pre, %for.body6.preheader ], [ %max.1.1, %for.body6 ] %min.045.unr = phi i32 [ %.pre, %for.body6.preheader ], [ %min.1.1, %for.body6 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end26, label %for.body6.epil for.body6.epil: ; preds = %for.end26.loopexit.unr-lcssa %arrayidx8.epil = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv54.unr %6 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5 %cmp9.epil = icmp slt i32 %max.046.unr, %6 %cmp14.epil = icmp sgt i32 %max.046.unr, %6 %cmp17.epil = icmp sgt i32 %min.045.unr, %6 %or.cond.epil = select i1 %cmp14.epil, i1 %cmp17.epil, i1 false %spec.select.epil = select i1 %or.cond.epil, i32 %6, i32 %min.045.unr %min.1.epil = select i1 %cmp9.epil, i32 %min.045.unr, i32 %spec.select.epil %max.1.epil = call i32 @llvm.smax.i32(i32 %max.046.unr, i32 %6) %conv.epil = sext i32 %6 to i64 %add.epil = add nsw i64 %sum.048.unr, %conv.epil br label %for.end26 for.end26: ; preds = %for.body6.epil, %for.end26.loopexit.unr-lcssa, %for.end %min.0.lcssa = phi i32 [ %.pre, %for.end ], [ %min.1.lcssa.ph, %for.end26.loopexit.unr-lcssa ], [ %min.1.epil, %for.body6.epil ] %max.0.lcssa = phi i32 [ %.pre, %for.end ], [ %max.1.lcssa.ph, %for.end26.loopexit.unr-lcssa ], [ %max.1.epil, %for.body6.epil ] %sum.0.lcssa = phi i64 [ 0, %for.end ], [ %add.lcssa.ph, %for.end26.loopexit.unr-lcssa ], [ %add.epil, %for.body6.epil ] %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa, i32 noundef %max.0.lcssa, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #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: 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 willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } 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() { int n, i, max=-1000000, min=1000000; double sum=0; scanf("%d",&n); int a; for(i=0;i<n;i++){ scanf("%d",&a); if(a<min){min=a;} if(a>max){max=a;} sum = sum + a; } printf("%d %d %.0f\n", min, max, sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_173444/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_173444/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 [12 x i8] c"%d %d %.0f\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 i32, align 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 %n) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %0, 0 br i1 %cmp12, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %sum.016 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ] %min.015 = phi i32 [ %spec.select, %for.body ], [ 1000000, %entry ] %max.014 = phi i32 [ %max.1, %for.body ], [ -1000000, %entry ] %i.013 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %1 = load i32, ptr %a, align 4, !tbaa !5 %spec.select = call i32 @llvm.smin.i32(i32 %1, i32 %min.015) %max.1 = call i32 @llvm.smax.i32(i32 %1, i32 %max.014) %conv = sitofp i32 %1 to double %add = fadd double %sum.016, %conv %inc = add nuw nsw i32 %i.013, 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 %max.0.lcssa = phi i32 [ -1000000, %entry ], [ %max.1, %for.body ] %min.0.lcssa = phi i32 [ 1000000, %entry ], [ %spec.select, %for.body ] %sum.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa, i32 noundef %max.0.lcssa, double noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}