Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> int main(void){ char masu[7] ={}; for(int i=0;i<7;i++){ scanf("%c",&masu[i]); } if(masu[0]==masu[6]&&masu[1]==masu[5]&&masu[2]==masu[4]) printf("YES"); else printf("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149469/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149469/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %masu = alloca [7 x i8], align 1 call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %masu) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %masu, i8 0, i64 7, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %masu) %arrayidx.1 = getelementptr inbounds [7 x i8], ptr %masu, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [7 x i8], ptr %masu, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [7 x i8], ptr %masu, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [7 x i8], ptr %masu, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [7 x i8], ptr %masu, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %arrayidx.6 = getelementptr inbounds [7 x i8], ptr %masu, i64 0, i64 6 %call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.6) %0 = load i8, ptr %masu, align 1, !tbaa !5 %1 = load i8, ptr %arrayidx.6, align 1, !tbaa !5 %cmp4 = icmp eq i8 %0, %1 br i1 %cmp4, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %entry %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %3 = load i8, ptr %arrayidx.5, align 1, !tbaa !5 %cmp10 = icmp eq i8 %2, %3 br i1 %cmp10, label %land.lhs.true12, label %if.else land.lhs.true12: ; preds = %land.lhs.true %4 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %5 = load i8, ptr %arrayidx.4, align 1, !tbaa !5 %cmp17 = icmp eq i8 %4, %5 br i1 %cmp17, label %if.end, label %if.else if.else: ; preds = %land.lhs.true12, %land.lhs.true, %entry br label %if.end if.end: ; preds = %land.lhs.true12, %if.else %.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true12 ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %masu) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main(void){ char m[4]; char n[4]; int i; int cnt = 0; scanf("%s",m); scanf("%s",n); for(i=0;i<3;i++){ if(m[i] == n[2-i]){ cnt++; } } if(cnt == 3){ printf("YES"); }else{ printf("NO"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149519/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149519/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca [4 x i8], align 1 %n = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i8, ptr %m, align 1, !tbaa !5 %arrayidx4 = getelementptr inbounds [4 x i8], ptr %n, i64 0, i64 2 %1 = load i8, ptr %arrayidx4, align 1, !tbaa !5 %cmp6 = icmp eq i8 %0, %1 %inc = zext i1 %cmp6 to i32 %arrayidx.1 = getelementptr inbounds [4 x i8], ptr %m, i64 0, i64 1 %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %arrayidx4.1 = getelementptr inbounds [4 x i8], ptr %n, i64 0, i64 1 %3 = load i8, ptr %arrayidx4.1, align 1, !tbaa !5 %cmp6.1 = icmp eq i8 %2, %3 %inc.1 = zext i1 %cmp6.1 to i32 %spec.select.1 = add nuw nsw i32 %inc, %inc.1 %arrayidx.2 = getelementptr inbounds [4 x i8], ptr %m, i64 0, i64 2 %4 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %5 = load i8, ptr %n, align 1, !tbaa !5 %cmp6.2 = icmp eq i8 %4, %5 %inc.2 = zext i1 %cmp6.2 to i32 %spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.2 %cmp9 = icmp eq i32 %spec.select.2, 3 %.str.1..str.2 = select i1 %cmp9, ptr @.str.1, ptr @.str.2 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int w; int h; int k; scanf("%d %d %d", &w, &h, &k); int sum = 0; while (w > 0 && h > 0 && k > 0) { sum += 2*(w + h); sum = sum - 4; h = h - 4; w = w - 4; k = k - 1; } printf("%d\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14957/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14957/source.c" target datalayout = "e-m:e-p270: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: %w = alloca i32, align 4 %h = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %k) %w.promoted = load i32, ptr %w, align 4, !tbaa !5 %h.promoted = load i32, ptr %h, align 4 %k.promoted = load i32, ptr %k, align 4 %k.promoted.fr = freeze i32 %k.promoted %cmp13 = icmp sgt i32 %w.promoted, 0 %cmp114 = icmp sgt i32 %h.promoted, 0 %or.cond15 = select i1 %cmp13, i1 %cmp114, i1 false %cmp216 = icmp sgt i32 %k.promoted.fr, 0 %or.cond817 = and i1 %or.cond15, %cmp216 br i1 %or.cond817, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %entry %0 = add nsw i32 %k.promoted.fr, -1 %1 = add nuw i32 %h.promoted, 3 %smin = call i32 @llvm.smin.i32(i32 %h.promoted, i32 4) %2 = sub nuw i32 %1, %smin %.fr = freeze i32 %2 %3 = lshr i32 %.fr, 2 %umin = call i32 @llvm.umin.i32(i32 %0, i32 %3) %4 = add nuw i32 %w.promoted, 3 %smin20 = call i32 @llvm.smin.i32(i32 %w.promoted, i32 4) %5 = sub nuw i32 %4, %smin20 %6 = lshr i32 %5, 2 %umin21 = call i32 @llvm.umin.i32(i32 %umin, i32 %6) %7 = add nuw i32 %h.promoted, %w.promoted %8 = shl i32 %7, 1 %9 = add i32 %8, -20 %10 = mul i32 %umin21, %9 %11 = add i32 %10, %8 %12 = add i32 %11, -4 %13 = lshr i32 %.fr, 2 %14 = call i32 @llvm.umin.i32(i32 %0, i32 %13) %15 = lshr i32 %5, 2 %16 = call i32 @llvm.umin.i32(i32 %14, i32 %15) %17 = add nuw nsw i32 %umin21, 536870911 %18 = mul i32 %16, %17 %19 = shl i32 %18, 3 %20 = and i32 %19, -16 %21 = sub i32 %12, %20 %22 = shl nuw i32 %umin21, 2 %23 = add nsw i32 %w.promoted, -4 %24 = add nsw i32 %h.promoted, -4 %25 = sub i32 %24, %22 %26 = sub i32 %23, %22 %27 = sub nsw i32 %0, %umin21 store i32 %25, ptr %h, align 4, !tbaa !5 store i32 %26, ptr %w, align 4, !tbaa !5 store i32 %27, ptr %k, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.body.preheader, %entry %sum.0.lcssa = phi i32 [ %21, %while.body.preheader ], [ 0, %entry ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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.umin.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; scanf("%d",&A); scanf("%d",&B); if(A<=8&&B<=8) { printf("Yay!"); }else{ printf(":("); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149612/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149612/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c":(\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 9 %1 = load i32, ptr %B, align 4 %cmp2 = icmp slt i32 %1, 9 %or.cond = select i1 %cmp, i1 %cmp2, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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; scanf("%d%d",&a,&b); if(a>8||b>8) printf(":("); else printf("Yay!"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149656/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149656/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c":(\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 8 %1 = load i32, ptr %b, align 4 %cmp1 = icmp sgt i32 %1, 8 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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> #include<stdlib.h> #include<math.h> #define REP(i,a,b) for(i=a;i<b;i++) #define rep(i,n) REP(i,0,n) int n; int mi[10][10], mx[10][10], ac[10][10]; int ind[10]; int now[10]; int res, res_cost; void solve(int a,int b,int cost){ int i,j,send; int aa = ind[a], bb = ind[b]; if(a>=n){ if(now[n-1] < 0) return; if(now[n-1] == res && cost > res_cost) res++; if(now[n-1] < res) res = now[n-1], res_cost = cost; return; } if(b>=n){ if(aa!=0 && aa!=n-1 && now[aa]) return; solve(a+1,a+2,cost); return; } REP(i,-mx[aa][bb],mx[aa][bb]+1){ if(-mi[aa][bb]<i && i<mi[aa][bb]) continue; if( (bb-aa)*i < 0 ) continue; send = cost; if(i) send += ac[aa][bb]; send += i*i; now[aa]-=i; now[bb]+=i; solve(a,b+1,send); now[aa]+=i; now[bb]-=i; } } int main(){ int i,j,k,l,m; int a,b,c; while(scanf("%d",&n)==1){ m = n*(n-1)/2; while(m--){ scanf("%d%d%d%d%d",&i,&j,&a,&b,&c); i--; j--; mi[i][j] = mi[j][i] = a; mx[i][j] = mx[j][i] = b; ac[i][j] = ac[j][i] = c; } REP(i,1,n-1) ind[i-1] = i; ind[n-2]=0; ind[n-1]=n-1; rep(i,n) now[i] = 0; res = 1000000; solve(0,1,0); if(res == 1000000) res = res_cost = -1; printf("%d %d\n",res, res_cost); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1497/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1497/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @ind = dso_local local_unnamed_addr global [10 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @now = dso_local local_unnamed_addr global [10 x i32] zeroinitializer, align 16 @res = dso_local local_unnamed_addr global i32 0, align 4 @res_cost = dso_local local_unnamed_addr global i32 0, align 4 @mx = dso_local local_unnamed_addr global [10 x [10 x i32]] zeroinitializer, align 16 @mi = dso_local local_unnamed_addr global [10 x [10 x i32]] zeroinitializer, align 16 @ac = dso_local local_unnamed_addr global [10 x [10 x i32]] zeroinitializer, align 16 @.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%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @solve(i32 noundef %a, i32 noundef %b, i32 noundef %cost) local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not154 = icmp sgt i32 %0, %a %sub28 = add nsw i32 %0, -1 br i1 %cmp.not154, label %if.end23.lr.ph, label %if.then if.end23.lr.ph: ; preds = %entry %1 = sext i32 %a to i64 br label %if.end23 if.then: ; preds = %if.end34, %entry %idxprom3 = sext i32 %sub28 to i64 %arrayidx4 = getelementptr inbounds [10 x i32], ptr @now, i64 0, i64 %idxprom3 %2 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp5 = icmp slt i32 %2, 0 br i1 %cmp5, label %cleanup, label %if.end if.end: ; preds = %if.then %3 = load i32, ptr @res, align 4, !tbaa !5 %cmp10 = icmp eq i32 %2, %3 %4 = load i32, ptr @res_cost, align 4 %cmp11 = icmp slt i32 %4, %cost %or.cond = select i1 %cmp10, i1 %cmp11, i1 false %cmp17 = icmp slt i32 %2, %3 %or.cond178 = or i1 %or.cond, %cmp17 br i1 %or.cond178, label %if.then18, label %cleanup if.then18: ; preds = %if.end store i32 %2, ptr @res, align 4, !tbaa !5 store i32 %cost, ptr @res_cost, align 4, !tbaa !5 br label %cleanup if.end23: ; preds = %if.end23.lr.ph, %if.end34 %indvars.iv = phi i64 [ %1, %if.end23.lr.ph ], [ %indvars.iv.next, %if.end34 ] %b.tr156 = phi i32 [ %b, %if.end23.lr.ph ], [ %8, %if.end34 ] %.in = getelementptr inbounds [10 x i32], ptr @ind, i64 0, i64 %indvars.iv %5 = load i32, ptr %.in, align 4, !tbaa !5 %cmp24.not = icmp sgt i32 %0, %b.tr156 br i1 %cmp24.not, label %if.end36, label %if.then25 if.then25: ; preds = %if.end23 %cmp26.not = icmp eq i32 %5, 0 %cmp29.not = icmp eq i32 %5, %sub28 %or.cond137 = select i1 %cmp26.not, i1 true, i1 %cmp29.not br i1 %or.cond137, label %if.end34, label %land.lhs.true30 land.lhs.true30: ; preds = %if.then25 %idxprom31 = sext i32 %5 to i64 %arrayidx32 = getelementptr inbounds [10 x i32], ptr @now, i64 0, i64 %idxprom31 %6 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %tobool.not = icmp eq i32 %6, 0 br i1 %tobool.not, label %if.end34, label %cleanup if.end34: ; preds = %land.lhs.true30, %if.then25 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %7 = trunc i64 %indvars.iv to i32 %8 = add i32 %7, 2 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %0, %lftr.wideiv br i1 %exitcond.not, label %if.then, label %if.end23 if.end36: ; preds = %if.end23 %9 = trunc i64 %indvars.iv to i32 %idxprom1.le = sext i32 %b.tr156 to i64 %arrayidx2.le = getelementptr inbounds [10 x i32], ptr @ind, i64 0, i64 %idxprom1.le %10 = load i32, ptr %arrayidx2.le, align 4, !tbaa !5 %idxprom37 = sext i32 %5 to i64 %idxprom39 = sext i32 %10 to i64 %arrayidx40 = getelementptr inbounds [10 x [10 x i32]], ptr @mx, i64 0, i64 %idxprom37, i64 %idxprom39 %11 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp47.not157 = icmp slt i32 %11, 0 br i1 %cmp47.not157, label %cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %if.end36 %sub41 = sub nsw i32 0, %11 %arrayidx51 = getelementptr inbounds [10 x [10 x i32]], ptr @mi, i64 0, i64 %idxprom37, i64 %idxprom39 %sub62 = sub nsw i32 %10, %5 %arrayidx71 = getelementptr inbounds [10 x [10 x i32]], ptr @ac, i64 0, i64 %idxprom37, i64 %idxprom39 %arrayidx77 = getelementptr inbounds [10 x i32], ptr @now, i64 0, i64 %idxprom37 %arrayidx80 = getelementptr inbounds [10 x i32], ptr @now, i64 0, i64 %idxprom39 %add82 = add nsw i32 %b.tr156, 1 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %12 = phi i32 [ %11, %for.body.lr.ph ], [ %19, %for.inc ] %i.0158 = phi i32 [ %sub41, %for.body.lr.ph ], [ %inc89, %for.inc ] %13 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %sub52 = sub nsw i32 0, %13 %cmp53 = icmp sgt i32 %i.0158, %sub52 %cmp59 = icmp slt i32 %i.0158, %13 %or.cond138 = and i1 %cmp53, %cmp59 %mul = mul nsw i32 %i.0158, %sub62 %cmp63 = icmp slt i32 %mul, 0 %or.cond159 = select i1 %or.cond138, i1 true, i1 %cmp63 br i1 %or.cond159, label %for.inc, label %if.end65 if.end65: ; preds = %for.body %tobool66.not = icmp eq i32 %i.0158, 0 br i1 %tobool66.not, label %if.end73, label %if.then67 if.then67: ; preds = %if.end65 %14 = load i32, ptr %arrayidx71, align 4, !tbaa !5 %add72 = add nsw i32 %14, %cost br label %if.end73 if.end73: ; preds = %if.then67, %if.end65 %send.0 = phi i32 [ %add72, %if.then67 ], [ %cost, %if.end65 ] %mul74 = mul nsw i32 %i.0158, %i.0158 %add75 = add nsw i32 %send.0, %mul74 %15 = load i32, ptr %arrayidx77, align 4, !tbaa !5 %sub78 = sub nsw i32 %15, %i.0158 store i32 %sub78, ptr %arrayidx77, align 4, !tbaa !5 %16 = load i32, ptr %arrayidx80, align 4, !tbaa !5 %add81 = add nsw i32 %16, %i.0158 store i32 %add81, ptr %arrayidx80, align 4, !tbaa !5 tail call void @solve(i32 noundef %9, i32 noundef %add82, i32 noundef %add75) %17 = load i32, ptr %arrayidx77, align 4, !tbaa !5 %add85 = add nsw i32 %17, %i.0158 store i32 %add85, ptr %arrayidx77, align 4, !tbaa !5 %18 = load i32, ptr %arrayidx80, align 4, !tbaa !5 %sub88 = sub nsw i32 %18, %i.0158 store i32 %sub88, ptr %arrayidx80, align 4, !tbaa !5 %.pre = load i32, ptr %arrayidx40, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.end73 %19 = phi i32 [ %12, %for.body ], [ %.pre, %if.end73 ] %inc89 = add nsw i32 %i.0158, 1 %cmp47.not.not = icmp slt i32 %i.0158, %19 br i1 %cmp47.not.not, label %for.body, label %cleanup, !llvm.loop !9 cleanup: ; preds = %land.lhs.true30, %for.inc, %if.end, %if.end36, %if.then18, %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: %i = alloca i32, align 4 %j = alloca i32, align 4 %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 %i) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #5 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 %c) #5 %call62 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %cmp63 = icmp eq i32 %call62, 1 br i1 %cmp63, label %while.body, label %while.end50 while.body: ; preds = %entry, %if.end %0 = load i32, ptr @n, align 4, !tbaa !5 %sub = add i32 %0, -1 %mul = mul nsw i32 %sub, %0 %mul.off = add i32 %mul, 1 %tobool.not53 = icmp ult i32 %mul.off, 3 br i1 %tobool.not53, label %for.cond.preheader, label %while.body2.preheader while.body2.preheader: ; preds = %while.body %div = sdiv i32 %mul, 2 br label %while.body2 for.cond.preheader.loopexit: ; preds = %while.body2 %.pre = load i32, ptr @n, align 4, !tbaa !5 %.pre72 = add i32 %.pre, -1 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %while.body %sub28.pre-phi = phi i32 [ %.pre72, %for.cond.preheader.loopexit ], [ %sub, %while.body ] %1 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ %0, %while.body ] %cmp2955 = icmp sgt i32 %1, 2 br i1 %cmp2955, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %sub28.pre-phi to i64 %2 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i64 %2, 8 br i1 %min.iters.check, label %for.body.preheader74, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %2, -8 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %3 = getelementptr inbounds [10 x i32], ptr @ind, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> %step.add, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %2, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader74 for.body.preheader74: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body while.body2: ; preds = %while.body2.preheader, %while.body2 %m.054 = phi i32 [ %dec, %while.body2 ], [ %div, %while.body2.preheader ] %dec = add nsw i32 %m.054, -1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i, ptr noundef nonnull %j, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %6 = load i32, ptr %i, align 4, !tbaa !5 %dec4 = add nsw i32 %6, -1 store i32 %dec4, ptr %i, align 4, !tbaa !5 %7 = load i32, ptr %j, align 4, !tbaa !5 %dec5 = add nsw i32 %7, -1 store i32 %dec5, ptr %j, align 4, !tbaa !5 %8 = load i32, ptr %a, align 4, !tbaa !5 %idxprom = sext i32 %dec5 to i64 %idxprom6 = sext i32 %dec4 to i64 %arrayidx7 = getelementptr inbounds [10 x [10 x i32]], ptr @mi, i64 0, i64 %idxprom, i64 %idxprom6 store i32 %8, ptr %arrayidx7, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [10 x [10 x i32]], ptr @mi, i64 0, i64 %idxprom6, i64 %idxprom store i32 %8, ptr %arrayidx11, align 4, !tbaa !5 %9 = load i32, ptr %b, align 4, !tbaa !5 %arrayidx15 = getelementptr inbounds [10 x [10 x i32]], ptr @mx, i64 0, i64 %idxprom, i64 %idxprom6 store i32 %9, ptr %arrayidx15, align 4, !tbaa !5 %arrayidx19 = getelementptr inbounds [10 x [10 x i32]], ptr @mx, i64 0, i64 %idxprom6, i64 %idxprom store i32 %9, ptr %arrayidx19, align 4, !tbaa !5 %10 = load i32, ptr %c, align 4, !tbaa !5 %arrayidx23 = getelementptr inbounds [10 x [10 x i32]], ptr @ac, i64 0, i64 %idxprom, i64 %idxprom6 store i32 %10, ptr %arrayidx23, align 4, !tbaa !5 %arrayidx27 = getelementptr inbounds [10 x [10 x i32]], ptr @ac, i64 0, i64 %idxprom6, i64 %idxprom store i32 %10, ptr %arrayidx27, align 4, !tbaa !5 %tobool.not = icmp eq i32 %dec, 0 br i1 %tobool.not, label %for.cond.preheader.loopexit, label %while.body2, !llvm.loop !14 for.body: ; preds = %for.body.preheader74, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader74 ] %11 = add nsw i64 %indvars.iv, -1 %arrayidx32 = getelementptr inbounds [10 x i32], ptr @ind, i64 0, i64 %11 %12 = trunc i64 %indvars.iv to i32 store i32 %12, ptr %arrayidx32, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !15 for.end: ; preds = %for.body, %middle.block, %for.cond.preheader %sub33 = add nsw i32 %1, -2 %idxprom34 = sext i32 %sub33 to i64 %arrayidx35 = getelementptr inbounds [10 x i32], ptr @ind, i64 0, i64 %idxprom34 store i32 0, ptr %arrayidx35, align 4, !tbaa !5 %idxprom38 = sext i32 %sub28.pre-phi to i64 %arrayidx39 = getelementptr inbounds [10 x i32], ptr @ind, i64 0, i64 %idxprom38 store i32 %sub28.pre-phi, ptr %arrayidx39, align 4, !tbaa !5 %cmp4159 = icmp sgt i32 %1, 0 br i1 %cmp4159, label %for.body42.preheader, label %for.end47 for.body42.preheader: ; preds = %for.end %13 = zext i32 %1 to i64 %14 = shl nuw nsw i64 %13, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @now, i8 0, i64 %14, i1 false), !tbaa !5 %15 = add i32 %sub28.pre-phi, 1 br label %for.end47 for.end47: ; preds = %for.body42.preheader, %for.end %storemerge52.lcssa = phi i32 [ 0, %for.end ], [ %15, %for.body42.preheader ] store i32 %storemerge52.lcssa, ptr %i, align 4, !tbaa !5 store i32 1000000, ptr @res, align 4, !tbaa !5 call void @solve(i32 noundef 0, i32 noundef 1, i32 noundef 0) %16 = load i32, ptr @res, align 4, !tbaa !5 %cmp48 = icmp eq i32 %16, 1000000 br i1 %cmp48, label %if.then, label %for.end47.if.end_crit_edge for.end47.if.end_crit_edge: ; preds = %for.end47 %.pre71 = load i32, ptr @res_cost, align 4, !tbaa !5 br label %if.end if.then: ; preds = %for.end47 store i32 -1, ptr @res_cost, align 4, !tbaa !5 store i32 -1, ptr @res, align 4, !tbaa !5 br label %if.end if.end: ; preds = %for.end47.if.end_crit_edge, %if.then %17 = phi i32 [ -1, %if.then ], [ %.pre71, %for.end47.if.end_crit_edge ] %18 = phi i32 [ -1, %if.then ], [ %16, %for.end47.if.end_crit_edge ] %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18, i32 noundef %17) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %cmp = icmp eq i32 %call, 1 br i1 %cmp, label %while.body, label %while.end50, !llvm.loop !16 while.end50: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #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 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { nocallback nofree nounwind willreturn memory(argmem: 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, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !13, !12} !16 = distinct !{!16, !10}
#include <stdio.h> #include <stdlib.h> int main(){ int a = 0, b = 0,soma = 0; scanf("%i %i", &a, &b); soma = a + b; if(a < 9 && b < 9){ printf("Yay!"); } else printf(":("); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149742/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149742/source.c" target datalayout = "e-m:e-p270: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"%i %i\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c":(\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 store i32 0, ptr %a, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 store i32 0, ptr %b, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4 %cmp = icmp slt i32 %0, 9 %cmp1 = icmp slt i32 %1, 9 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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; scanf("%d %d",&A,&B); if(A<=8 &&B<=8) printf("Yay!"); else printf(":("); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149786/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149786/source.c" target datalayout = "e-m:e-p270: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 [5 x i8] c"Yay!\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c":(\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 9 %1 = load i32, ptr %B, align 4 %cmp1 = icmp slt i32 %1, 9 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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; scanf("%d %d", &a, &b); if(a<=8 && b<=8){ printf("Yay!"); }else{ printf(":("); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149887/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149887/source.c" target datalayout = "e-m:e-p270: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 [5 x i8] c"Yay!\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c":(\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 9 %1 = load i32, ptr %b, align 4 %cmp1 = icmp slt i32 %1, 9 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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> #include<math.h> #include<string.h> int comparefunc (const void * a, const void * b) { return (*(int*)b)-(*(int*)a); } int main() { long long int w,p,q,i,j,m=1,n,c0,c1,h,t; scanf("%lld", &t); while(t--){ scanf("%lld%lld%lld", &w,&h,&n); int temp=w,temp2=h; while(1){ if(w%2==0){ w/=2; } else break; } int ans1=temp/w; while(1){ if(h%2==0){ h/=2; } else break; } int ans2=temp2/h; //printf("%d\n", ans1*ans2); if(ans1*ans2>=n)printf("YES\n"); else printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14993/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14993/source.c" target datalayout = "e-m:e-p270: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 [13 x i8] c"%lld%lld%lld\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comparefunc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %w = alloca i64, align 8 %n = alloca i64, align 8 %h = alloca i64, align 8 %t = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %w) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i64, ptr %t, align 8, !tbaa !9 %dec42 = add nsw i64 %0, -1 store i64 %dec42, ptr %t, align 8, !tbaa !9 %tobool.not43 = icmp eq i64 %0, 0 br i1 %tobool.not43, label %while.end30, label %while.body while.body: ; preds = %entry, %while.end18 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %n) %1 = load i64, ptr %w, align 8, !tbaa !9 %2 = load i64, ptr %h, align 8, !tbaa !9 %3 = and i64 %1, 1 %cmp36 = icmp eq i64 %3, 0 br i1 %cmp36, label %if.then, label %while.end if.then: ; preds = %while.body, %if.then %div3537 = phi i64 [ %div, %if.then ], [ %1, %while.body ] %div = sdiv i64 %div3537, 2 %4 = and i64 %div, 1 %cmp = icmp eq i64 %4, 0 br i1 %cmp, label %if.then, label %while.cond3.while.end_crit_edge while.cond3.while.end_crit_edge: ; preds = %if.then store i64 %div, ptr %w, align 8, !tbaa !9 br label %while.end while.end: ; preds = %while.cond3.while.end_crit_edge, %while.body %.lcssa = phi i64 [ %div, %while.cond3.while.end_crit_edge ], [ %1, %while.body ] %sext = shl i64 %1, 32 %conv6 = ashr exact i64 %sext, 32 %div7 = sdiv i64 %conv6, %.lcssa %5 = and i64 %2, 1 %cmp1239 = icmp eq i64 %5, 0 br i1 %cmp1239, label %if.then14, label %while.end18 if.then14: ; preds = %while.end, %if.then14 %div153840 = phi i64 [ %div15, %if.then14 ], [ %2, %while.end ] %div15 = sdiv i64 %div153840, 2 %6 = and i64 %div15, 1 %cmp12 = icmp eq i64 %6, 0 br i1 %cmp12, label %if.then14, label %while.cond9.while.end18_crit_edge while.cond9.while.end18_crit_edge: ; preds = %if.then14 store i64 %div15, ptr %h, align 8, !tbaa !9 br label %while.end18 while.end18: ; preds = %while.cond9.while.end18_crit_edge, %while.end %.lcssa34 = phi i64 [ %div15, %while.cond9.while.end18_crit_edge ], [ %2, %while.end ] %sext31 = shl i64 %2, 32 %conv19 = ashr exact i64 %sext31, 32 %div20 = sdiv i64 %conv19, %.lcssa34 %mul = shl i64 %div7, 32 %sext32 = mul i64 %mul, %div20 %conv22 = ashr exact i64 %sext32, 32 %7 = load i64, ptr %n, align 8, !tbaa !9 %cmp23.not = icmp slt i64 %conv22, %7 %str.str.4 = select i1 %cmp23.not, ptr @str, ptr @str.4 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4) %8 = load i64, ptr %t, align 8, !tbaa !9 %dec = add nsw i64 %8, -1 store i64 %dec, ptr %t, align 8, !tbaa !9 %tobool.not = icmp eq i64 %8, 0 br i1 %tobool.not, label %while.end30, label %while.body, !llvm.loop !11 while.end30: ; preds = %while.end18, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %w) #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) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int n,m; scanf("%d %d",&n,&m); if((n>8)||(m>8))printf(":("); else printf("Yay!"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149973/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149973/source.c" target datalayout = "e-m:e-p270: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":(\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 8 %1 = load i32, ptr %m, align 4 %cmp1 = icmp sgt i32 %1, 8 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b; scanf("%d %d",&a,&b); if(a>8 || b>8){ printf(":("); }else{ printf("Yay!"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150021/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150021/source.c" target datalayout = "e-m:e-p270: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":(\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 8 %1 = load i32, ptr %b, align 4 %cmp1 = icmp sgt i32 %1, 8 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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; scanf("%d %d",&a,&b); if(a>8||b>8)printf(":(\n"); else printf("Yay!\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150065/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150065/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c":(\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 8 %1 = load i32, ptr %b, align 4 %cmp1 = icmp sgt i32 %1, 8 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a[10000],b[10000]; int i,n; while(1){ scanf("%d",&n); if(n==0)break; int aa=0,ba=0; for(i=0;i<n;i++){ scanf("%d %d",&a[i],&b[i]); } for(i=0;i<n;i++){ if(a[i]>b[i])aa=aa+a[i]+b[i]; else if(a[i]<b[i])ba=ba+a[i]+b[i]; else if(a[i]=b[i])aa=aa+a[i],ba=ba+b[i]; } printf("%d %d\n",aa,ba); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150108/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150108/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [10000 x i32], align 16 %b = alloca [10000 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call81 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp82 = icmp eq i32 %0, 0 br i1 %cmp82, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end48 %1 = phi i32 [ %68, %for.end48 ], [ %0, %entry ] %cmp173 = icmp sgt i32 %1, 0 br i1 %cmp173, label %for.body, label %for.end48 for.cond5.preheader: ; preds = %for.body %cmp675 = icmp sgt i32 %64, 0 br i1 %cmp675, label %for.body7.preheader, label %for.end48 for.body7.preheader: ; preds = %for.cond5.preheader %wide.trip.count = zext i32 %64 to i64 %min.iters.check = icmp ult i32 %64, 8 br i1 %min.iters.check, label %for.body7.preheader123, label %vector.ph vector.ph: ; preds = %for.body7.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %pred.store.continue109, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue109 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi119, %pred.store.continue109 ] %vec.phi90 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi120, %pred.store.continue109 ] %vec.phi91 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi113, %pred.store.continue109 ] %vec.phi92 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi114, %pred.store.continue109 ] %2 = or i64 %index, 4 %3 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 %wide.load93 = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %index %wide.load94 = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 %wide.load95 = load <4 x i32>, ptr %6, align 16, !tbaa !5 %7 = icmp slt <4 x i32> %wide.load, %wide.load94 %8 = icmp slt <4 x i32> %wide.load93, %wide.load95 %9 = icmp eq <4 x i32> %wide.load, %wide.load94 %10 = icmp eq <4 x i32> %wide.load93, %wide.load95 %11 = extractelement <4 x i1> %9, i64 0 br i1 %11, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %12 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %index %13 = extractelement <4 x i32> %wide.load94, i64 0 store i32 %13, ptr %12, align 16, !tbaa !5 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %14 = extractelement <4 x i1> %9, i64 1 br i1 %14, label %pred.store.if96, label %pred.store.continue97 pred.store.if96: ; preds = %pred.store.continue %15 = or i64 %index, 1 %16 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %15 %17 = extractelement <4 x i32> %wide.load94, i64 1 store i32 %17, ptr %16, align 4, !tbaa !5 br label %pred.store.continue97 pred.store.continue97: ; preds = %pred.store.if96, %pred.store.continue %18 = extractelement <4 x i1> %9, i64 2 br i1 %18, label %pred.store.if98, label %pred.store.continue99 pred.store.if98: ; preds = %pred.store.continue97 %19 = or i64 %index, 2 %20 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %19 %21 = extractelement <4 x i32> %wide.load94, i64 2 store i32 %21, ptr %20, align 8, !tbaa !5 br label %pred.store.continue99 pred.store.continue99: ; preds = %pred.store.if98, %pred.store.continue97 %22 = extractelement <4 x i1> %9, i64 3 br i1 %22, label %pred.store.if100, label %pred.store.continue101 pred.store.if100: ; preds = %pred.store.continue99 %23 = or i64 %index, 3 %24 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %23 %25 = extractelement <4 x i32> %wide.load94, i64 3 store i32 %25, ptr %24, align 4, !tbaa !5 br label %pred.store.continue101 pred.store.continue101: ; preds = %pred.store.if100, %pred.store.continue99 %26 = extractelement <4 x i1> %10, i64 0 br i1 %26, label %pred.store.if102, label %pred.store.continue103 pred.store.if102: ; preds = %pred.store.continue101 %27 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %2 %28 = extractelement <4 x i32> %wide.load95, i64 0 store i32 %28, ptr %27, align 16, !tbaa !5 br label %pred.store.continue103 pred.store.continue103: ; preds = %pred.store.if102, %pred.store.continue101 %29 = extractelement <4 x i1> %10, i64 1 br i1 %29, label %pred.store.if104, label %pred.store.continue105 pred.store.if104: ; preds = %pred.store.continue103 %30 = or i64 %index, 5 %31 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %30 %32 = extractelement <4 x i32> %wide.load95, i64 1 store i32 %32, ptr %31, align 4, !tbaa !5 br label %pred.store.continue105 pred.store.continue105: ; preds = %pred.store.if104, %pred.store.continue103 %33 = extractelement <4 x i1> %10, i64 2 br i1 %33, label %pred.store.if106, label %pred.store.continue107 pred.store.if106: ; preds = %pred.store.continue105 %34 = or i64 %index, 6 %35 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %34 %36 = extractelement <4 x i32> %wide.load95, i64 2 store i32 %36, ptr %35, align 8, !tbaa !5 br label %pred.store.continue107 pred.store.continue107: ; preds = %pred.store.if106, %pred.store.continue105 %37 = extractelement <4 x i1> %10, i64 3 br i1 %37, label %pred.store.if108, label %pred.store.continue109 pred.store.if108: ; preds = %pred.store.continue107 %38 = or i64 %index, 7 %39 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %38 %40 = extractelement <4 x i32> %wide.load95, i64 3 store i32 %40, ptr %39, align 4, !tbaa !5 br label %pred.store.continue109 pred.store.continue109: ; preds = %pred.store.if108, %pred.store.continue107 %41 = icmp eq <4 x i32> %wide.load94, zeroinitializer %42 = icmp eq <4 x i32> %wide.load95, zeroinitializer %43 = add <4 x i32> %wide.load94, %vec.phi91 %44 = add <4 x i32> %wide.load95, %vec.phi92 %45 = add <4 x i32> %wide.load94, %vec.phi %46 = add <4 x i32> %wide.load95, %vec.phi90 %47 = add <4 x i32> %wide.load94, %vec.phi %48 = add <4 x i32> %wide.load95, %vec.phi90 %49 = add <4 x i32> %47, %wide.load %50 = add <4 x i32> %48, %wide.load93 %51 = add <4 x i32> %wide.load94, %vec.phi91 %52 = add <4 x i32> %wide.load95, %vec.phi92 %53 = add <4 x i32> %51, %wide.load %54 = add <4 x i32> %52, %wide.load93 %55 = xor <4 x i1> %41, <i1 true, i1 true, i1 true, i1 true> %56 = xor <4 x i1> %42, <i1 true, i1 true, i1 true, i1 true> %57 = and <4 x i1> %9, %55 %58 = and <4 x i1> %10, %56 %59 = and <4 x i1> %9, %41 %60 = and <4 x i1> %10, %42 %predphi = select <4 x i1> %7, <4 x i32> %vec.phi91, <4 x i32> %53 %predphi110 = select <4 x i1> %8, <4 x i32> %vec.phi92, <4 x i32> %54 %predphi111 = select <4 x i1> %57, <4 x i32> %43, <4 x i32> %predphi %predphi112 = select <4 x i1> %58, <4 x i32> %44, <4 x i32> %predphi110 %predphi113 = select <4 x i1> %59, <4 x i32> %vec.phi91, <4 x i32> %predphi111 %predphi114 = select <4 x i1> %60, <4 x i32> %vec.phi92, <4 x i32> %predphi112 %predphi115 = select <4 x i1> %7, <4 x i32> %49, <4 x i32> %vec.phi %predphi116 = select <4 x i1> %8, <4 x i32> %50, <4 x i32> %vec.phi90 %predphi117 = select <4 x i1> %57, <4 x i32> %45, <4 x i32> %predphi115 %predphi118 = select <4 x i1> %58, <4 x i32> %46, <4 x i32> %predphi116 %predphi119 = select <4 x i1> %59, <4 x i32> %vec.phi, <4 x i32> %predphi117 %predphi120 = select <4 x i1> %60, <4 x i32> %vec.phi90, <4 x i32> %predphi118 %index.next = add nuw i64 %index, 8 %61 = icmp eq i64 %index.next, %n.vec br i1 %61, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %pred.store.continue109 %bin.rdx121 = add <4 x i32> %predphi114, %predphi113 %62 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx121) %bin.rdx = add <4 x i32> %predphi120, %predphi119 %63 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end48, label %for.body7.preheader123 for.body7.preheader123: ; preds = %for.body7.preheader, %middle.block %indvars.iv85.ph = phi i64 [ 0, %for.body7.preheader ], [ %n.vec, %middle.block ] %ba.078.ph = phi i32 [ 0, %for.body7.preheader ], [ %63, %middle.block ] %aa.077.ph = phi i32 [ 0, %for.body7.preheader ], [ %62, %middle.block ] br label %for.body7 for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv %arrayidx3 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %indvars.iv %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %64 = load i32, ptr %n, align 4, !tbaa !5 %65 = sext i32 %64 to i64 %cmp1 = icmp slt i64 %indvars.iv.next, %65 br i1 %cmp1, label %for.body, label %for.cond5.preheader, !llvm.loop !13 for.body7: ; preds = %for.body7.preheader123, %for.inc46 %indvars.iv85 = phi i64 [ %indvars.iv.next86, %for.inc46 ], [ %indvars.iv85.ph, %for.body7.preheader123 ] %ba.078 = phi i32 [ %ba.1, %for.inc46 ], [ %ba.078.ph, %for.body7.preheader123 ] %aa.077 = phi i32 [ %aa.1, %for.inc46 ], [ %aa.077.ph, %for.body7.preheader123 ] %arrayidx9 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv85 %66 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %indvars.iv85 %67 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %66, %67 br i1 %cmp12, label %if.then13, label %if.else if.then13: ; preds = %for.body7 %add = add i32 %67, %aa.077 %add18 = add i32 %add, %66 br label %for.inc46 if.else: ; preds = %for.body7 %cmp23 = icmp slt i32 %66, %67 br i1 %cmp23, label %if.then24, label %if.else31 if.then24: ; preds = %if.else %add27 = add i32 %67, %ba.078 %add30 = add i32 %add27, %66 br label %for.inc46 if.else31: ; preds = %if.else store i32 %67, ptr %arrayidx9, align 4, !tbaa !5 %tobool.not = icmp eq i32 %67, 0 br i1 %tobool.not, label %for.inc46, label %if.then36 if.then36: ; preds = %if.else31 %add39 = add nsw i32 %67, %aa.077 %add42 = add nsw i32 %67, %ba.078 br label %for.inc46 for.inc46: ; preds = %if.then13, %if.else31, %if.then36, %if.then24 %aa.1 = phi i32 [ %add18, %if.then13 ], [ %aa.077, %if.then24 ], [ %add39, %if.then36 ], [ %aa.077, %if.else31 ] %ba.1 = phi i32 [ %ba.078, %if.then13 ], [ %add30, %if.then24 ], [ %add42, %if.then36 ], [ %ba.078, %if.else31 ] %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1 %exitcond.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count br i1 %exitcond.not, label %for.end48, label %for.body7, !llvm.loop !14 for.end48: ; preds = %for.inc46, %middle.block, %for.cond.preheader, %for.cond5.preheader %aa.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %for.cond.preheader ], [ %62, %middle.block ], [ %aa.1, %for.inc46 ] %ba.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %for.cond.preheader ], [ %63, %middle.block ], [ %ba.1, %for.inc46 ] %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %aa.0.lcssa, i32 noundef %ba.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %68 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %68, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end48, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 40000, 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.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11}
#include <stdio.h> #define NUM 10000 void input(int *p1, int *p2, int t); void output(int *p1, int *p2); void comp(int *p1, int *p2, char *p_c, int t); void score(int *p1, int *p2, int t); int a[NUM] = {0}, b[NUM] = {0}, score_a[NUM] = {0}, score_b[NUM] = {0}; char tmp[NUM]; int cnt = 0; int main() { int n; while(1) { scanf("%d", &n); if(n == 0) { break; } input(a, b, n); comp(a, b, tmp, n); score(score_a, score_b, n); cnt++; } output(score_a, score_b); return 0; } // ???????????\?????????prog void input(int *p1, int *p2, int t) { int i = 0; while(1) { if (i == t) { break; } scanf("%d %d", &*(p1 + i), &*(p2 + i)); i++; } } // ??????????????? void output(int *p1, int *p2) { int i = 0; for (i = 0; i < cnt; i++) { printf("%d %d\n", *(p1 + i), *(p2 + i)); } } // ?????? void comp(int *p1, int *p2, char *p_c, int t) { int i = 0; while(1) { if (i == t) { break; } if (*(p1 + i) > *(p2 + i)) { *(p_c + i) = 'a'; } if (*(p1 + i) < *(p2 + i)) { *(p_c + i) = 'b'; } if (*(p1 + i) == *(p2 + i)) { *(p_c + i) = 'e'; } i++; } } // ?¨???? void score(int *p1, int*p2, int t) { int sum_a = 0, sum_b = 0, i = 0; while(1) { if (i == t) { break; } if(tmp[i] == 'a') { sum_a = sum_a + a[i] + b[i]; } if(tmp[i] == 'b') { sum_b = sum_b + a[i] + b[i]; } if(tmp[i] == 'e') { sum_a = sum_a + a[i]; sum_b = sum_b + b[i]; } i++; } *(p1+cnt) = sum_a; *(p2+cnt) = sum_b; sum_a = 0; sum_b = 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150151/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150151/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @a = dso_local global [10000 x i32] zeroinitializer, align 16 @b = dso_local global [10000 x i32] zeroinitializer, align 16 @score_a = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @score_b = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @cnt = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @tmp = dso_local local_unnamed_addr global [10000 x i8] zeroinitializer, align 16 @.str.1 = 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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp22 = icmp eq i32 %0, 0 br i1 %cmp22, label %while.end, label %if.end.preheader.i if.end.preheader.i: ; preds = %entry, %score.exit %1 = phi i32 [ %15, %score.exit ], [ %0, %entry ] %2 = zext i32 %1 to i64 br label %if.end.i if.end.i: ; preds = %if.end.i, %if.end.preheader.i %indvars.iv.i = phi i64 [ 0, %if.end.preheader.i ], [ %indvars.iv.next.i, %if.end.i ] %add.ptr.i = getelementptr inbounds i32, ptr @a, i64 %indvars.iv.i %add.ptr2.i = getelementptr inbounds i32, ptr @b, i64 %indvars.iv.i %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr.i, ptr noundef nonnull %add.ptr2.i) %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %cmp.i = icmp eq i64 %indvars.iv.next.i, %2 br i1 %cmp.i, label %input.exit, label %if.end.i input.exit: ; preds = %if.end.i %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp42.i = icmp eq i32 %3, 0 br i1 %cmp42.i, label %score.exit, label %if.end.preheader.i1 if.end.preheader.i1: ; preds = %input.exit %4 = zext i32 %3 to i64 br label %if.end.i2 if.end.i2: ; preds = %if.end25.i, %if.end.preheader.i1 %indvars.iv.i3 = phi i64 [ 0, %if.end.preheader.i1 ], [ %indvars.iv.next.i6, %if.end25.i ] %add.ptr.i4 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv.i3 %5 = load i32, ptr %add.ptr.i4, align 4, !tbaa !5 %add.ptr2.i5 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv.i3 %6 = load i32, ptr %add.ptr2.i5, align 4, !tbaa !5 %cmp3.i = icmp sgt i32 %5, %6 br i1 %cmp3.i, label %if.then4.i, label %if.end7.i if.then4.i: ; preds = %if.end.i2 %add.ptr6.i = getelementptr inbounds i8, ptr @tmp, i64 %indvars.iv.i3 store i8 97, ptr %add.ptr6.i, align 1, !tbaa !9 br label %if.end7.i if.end7.i: ; preds = %if.then4.i, %if.end.i2 %cmp12.i = icmp slt i32 %5, %6 br i1 %cmp12.i, label %if.then13.i, label %if.end16.i if.then13.i: ; preds = %if.end7.i %add.ptr15.i = getelementptr inbounds i8, ptr @tmp, i64 %indvars.iv.i3 store i8 98, ptr %add.ptr15.i, align 1, !tbaa !9 br label %if.end16.i if.end16.i: ; preds = %if.then13.i, %if.end7.i %cmp21.i = icmp eq i32 %5, %6 br i1 %cmp21.i, label %if.then22.i, label %if.end25.i if.then22.i: ; preds = %if.end16.i %add.ptr24.i = getelementptr inbounds i8, ptr @tmp, i64 %indvars.iv.i3 store i8 101, ptr %add.ptr24.i, align 1, !tbaa !9 br label %if.end25.i if.end25.i: ; preds = %if.then22.i, %if.end16.i %indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i3, 1 %cmp.i7 = icmp eq i64 %indvars.iv.next.i6, %4 br i1 %cmp.i7, label %if.end.i9, label %if.end.i2 if.end.i9: ; preds = %if.end25.i, %if.end35.i %indvars.iv.i10 = phi i64 [ %indvars.iv.next.i11, %if.end35.i ], [ 0, %if.end25.i ] %sum_b.060.i = phi i32 [ %sum_b.2.i, %if.end35.i ], [ 0, %if.end25.i ] %sum_a.059.i = phi i32 [ %sum_a.2.i, %if.end35.i ], [ 0, %if.end25.i ] %arrayidx.i = getelementptr inbounds [10000 x i8], ptr @tmp, i64 0, i64 %indvars.iv.i10 %7 = load i8, ptr %arrayidx.i, align 1, !tbaa !9 switch i8 %7, label %if.end35.i [ i8 97, label %if.end9.thread.i i8 98, label %if.then15.i i8 101, label %if.then28.i ] if.end9.thread.i: ; preds = %if.end.i9 %arrayidx5.i = getelementptr inbounds [10000 x i32], ptr @a, i64 0, i64 %indvars.iv.i10 %8 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %add.i = add nsw i32 %8, %sum_a.059.i %arrayidx7.i = getelementptr inbounds [10000 x i32], ptr @b, i64 0, i64 %indvars.iv.i10 %9 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5 %add8.i = add nsw i32 %add.i, %9 br label %if.end35.i if.then15.i: ; preds = %if.end.i9 %arrayidx17.i = getelementptr inbounds [10000 x i32], ptr @a, i64 0, i64 %indvars.iv.i10 %10 = load i32, ptr %arrayidx17.i, align 4, !tbaa !5 %add18.i = add nsw i32 %10, %sum_b.060.i %arrayidx20.i = getelementptr inbounds [10000 x i32], ptr @b, i64 0, i64 %indvars.iv.i10 %11 = load i32, ptr %arrayidx20.i, align 4, !tbaa !5 %add21.i = add nsw i32 %add18.i, %11 br label %if.end35.i if.then28.i: ; preds = %if.end.i9 %arrayidx30.i = getelementptr inbounds [10000 x i32], ptr @a, i64 0, i64 %indvars.iv.i10 %12 = load i32, ptr %arrayidx30.i, align 4, !tbaa !5 %add31.i = add nsw i32 %12, %sum_a.059.i %arrayidx33.i = getelementptr inbounds [10000 x i32], ptr @b, i64 0, i64 %indvars.iv.i10 %13 = load i32, ptr %arrayidx33.i, align 4, !tbaa !5 %add34.i = add nsw i32 %13, %sum_b.060.i br label %if.end35.i if.end35.i: ; preds = %if.then28.i, %if.then15.i, %if.end9.thread.i, %if.end.i9 %sum_a.2.i = phi i32 [ %add31.i, %if.then28.i ], [ %add8.i, %if.end9.thread.i ], [ %sum_a.059.i, %if.then15.i ], [ %sum_a.059.i, %if.end.i9 ] %sum_b.2.i = phi i32 [ %add34.i, %if.then28.i ], [ %sum_b.060.i, %if.end9.thread.i ], [ %add21.i, %if.then15.i ], [ %sum_b.060.i, %if.end.i9 ] %indvars.iv.next.i11 = add nuw nsw i64 %indvars.iv.i10, 1 %cmp.i12 = icmp eq i64 %indvars.iv.next.i11, %4 br i1 %cmp.i12, label %score.exit, label %if.end.i9 score.exit: ; preds = %if.end35.i, %input.exit %sum_a.0.lcssa.i = phi i32 [ 0, %input.exit ], [ %sum_a.2.i, %if.end35.i ] %sum_b.0.lcssa.i = phi i32 [ 0, %input.exit ], [ %sum_b.2.i, %if.end35.i ] %14 = load i32, ptr @cnt, align 4, !tbaa !5 %idx.ext.i = sext i32 %14 to i64 %add.ptr.i13 = getelementptr inbounds i32, ptr @score_a, i64 %idx.ext.i store i32 %sum_a.0.lcssa.i, ptr %add.ptr.i13, align 4, !tbaa !5 %add.ptr37.i = getelementptr inbounds i32, ptr @score_b, i64 %idx.ext.i store i32 %sum_b.0.lcssa.i, ptr %add.ptr37.i, align 4, !tbaa !5 %inc = add nsw i32 %14, 1 store i32 %inc, ptr @cnt, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %15 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %15, 0 br i1 %cmp, label %while.end, label %if.end.preheader.i while.end: ; preds = %score.exit, %entry %16 = load i32, ptr @cnt, align 4, !tbaa !5 %cmp6.i14 = icmp sgt i32 %16, 0 br i1 %cmp6.i14, label %for.body.i, label %output.exit for.body.i: ; preds = %while.end, %for.body.i %indvars.iv.i15 = phi i64 [ %indvars.iv.next.i19, %for.body.i ], [ 0, %while.end ] %add.ptr.i16 = getelementptr inbounds i32, ptr @score_a, i64 %indvars.iv.i15 %17 = load i32, ptr %add.ptr.i16, align 4, !tbaa !5 %add.ptr2.i17 = getelementptr inbounds i32, ptr @score_b, i64 %indvars.iv.i15 %18 = load i32, ptr %add.ptr2.i17, align 4, !tbaa !5 %call.i18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17, i32 noundef %18) %indvars.iv.next.i19 = add nuw nsw i64 %indvars.iv.i15, 1 %19 = load i32, ptr @cnt, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp.i20 = icmp slt i64 %indvars.iv.next.i19, %20 br i1 %cmp.i20, label %for.body.i, label %output.exit, !llvm.loop !10 output.exit: ; preds = %for.body.i, %while.end 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 uwtable define dso_local void @input(ptr noundef %p1, ptr noundef %p2, i32 noundef %t) local_unnamed_addr #0 { entry: %cmp6 = icmp eq i32 %t, 0 br i1 %cmp6, label %while.end, label %if.end.preheader if.end.preheader: ; preds = %entry %0 = zext i32 %t to i64 br label %if.end if.end: ; preds = %if.end.preheader, %if.end %indvars.iv = phi i64 [ 0, %if.end.preheader ], [ %indvars.iv.next, %if.end ] %add.ptr = getelementptr inbounds i32, ptr %p1, i64 %indvars.iv %add.ptr2 = getelementptr inbounds i32, ptr %p2, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %add.ptr, ptr noundef %add.ptr2) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp = icmp eq i64 %indvars.iv.next, %0 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %if.end, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @comp(ptr nocapture noundef readonly %p1, ptr nocapture noundef readonly %p2, ptr nocapture noundef writeonly %p_c, i32 noundef %t) local_unnamed_addr #3 { entry: %cmp42 = icmp eq i32 %t, 0 br i1 %cmp42, label %while.end, label %if.end.preheader if.end.preheader: ; preds = %entry %0 = zext i32 %t to i64 br label %if.end if.end: ; preds = %if.end.preheader, %if.end25 %indvars.iv = phi i64 [ 0, %if.end.preheader ], [ %indvars.iv.next, %if.end25 ] %add.ptr = getelementptr inbounds i32, ptr %p1, i64 %indvars.iv %1 = load i32, ptr %add.ptr, align 4, !tbaa !5 %add.ptr2 = getelementptr inbounds i32, ptr %p2, i64 %indvars.iv %2 = load i32, ptr %add.ptr2, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %1, %2 br i1 %cmp3, label %if.then4, label %if.end7 if.then4: ; preds = %if.end %add.ptr6 = getelementptr inbounds i8, ptr %p_c, i64 %indvars.iv store i8 97, ptr %add.ptr6, align 1, !tbaa !9 %.pre = load i32, ptr %add.ptr, align 4, !tbaa !5 %.pre45 = load i32, ptr %add.ptr2, align 4, !tbaa !5 br label %if.end7 if.end7: ; preds = %if.then4, %if.end %3 = phi i32 [ %.pre45, %if.then4 ], [ %2, %if.end ] %4 = phi i32 [ %.pre, %if.then4 ], [ %1, %if.end ] %cmp12 = icmp slt i32 %4, %3 br i1 %cmp12, label %if.then13, label %if.end16 if.then13: ; preds = %if.end7 %add.ptr15 = getelementptr inbounds i8, ptr %p_c, i64 %indvars.iv store i8 98, ptr %add.ptr15, align 1, !tbaa !9 %.pre46 = load i32, ptr %add.ptr, align 4, !tbaa !5 %.pre47 = load i32, ptr %add.ptr2, align 4, !tbaa !5 br label %if.end16 if.end16: ; preds = %if.then13, %if.end7 %5 = phi i32 [ %.pre47, %if.then13 ], [ %3, %if.end7 ] %6 = phi i32 [ %.pre46, %if.then13 ], [ %4, %if.end7 ] %cmp21 = icmp eq i32 %6, %5 br i1 %cmp21, label %if.then22, label %if.end25 if.then22: ; preds = %if.end16 %add.ptr24 = getelementptr inbounds i8, ptr %p_c, i64 %indvars.iv store i8 101, ptr %add.ptr24, align 1, !tbaa !9 br label %if.end25 if.end25: ; preds = %if.then22, %if.end16 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp = icmp eq i64 %indvars.iv.next, %0 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %if.end25, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: write, inaccessiblemem: none) uwtable define dso_local void @score(ptr nocapture noundef writeonly %p1, ptr nocapture noundef writeonly %p2, i32 noundef %t) local_unnamed_addr #4 { entry: %cmp58 = icmp eq i32 %t, 0 br i1 %cmp58, label %while.end, label %if.end.preheader if.end.preheader: ; preds = %entry %0 = zext i32 %t to i64 br label %if.end if.end: ; preds = %if.end.preheader, %if.end35 %indvars.iv = phi i64 [ 0, %if.end.preheader ], [ %indvars.iv.next, %if.end35 ] %sum_b.060 = phi i32 [ 0, %if.end.preheader ], [ %sum_b.2, %if.end35 ] %sum_a.059 = phi i32 [ 0, %if.end.preheader ], [ %sum_a.2, %if.end35 ] %arrayidx = getelementptr inbounds [10000 x i8], ptr @tmp, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 switch i8 %1, label %if.end35 [ i8 97, label %if.end9.thread i8 98, label %if.then15 i8 101, label %if.then28 ] if.end9.thread: ; preds = %if.end %arrayidx5 = getelementptr inbounds [10000 x i32], ptr @a, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %add = add nsw i32 %2, %sum_a.059 %arrayidx7 = getelementptr inbounds [10000 x i32], ptr @b, i64 0, i64 %indvars.iv %3 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add8 = add nsw i32 %add, %3 br label %if.end35 if.then15: ; preds = %if.end %arrayidx17 = getelementptr inbounds [10000 x i32], ptr @a, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %add18 = add nsw i32 %4, %sum_b.060 %arrayidx20 = getelementptr inbounds [10000 x i32], ptr @b, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %add21 = add nsw i32 %add18, %5 br label %if.end35 if.then28: ; preds = %if.end %arrayidx30 = getelementptr inbounds [10000 x i32], ptr @a, i64 0, i64 %indvars.iv %6 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %add31 = add nsw i32 %6, %sum_a.059 %arrayidx33 = getelementptr inbounds [10000 x i32], ptr @b, i64 0, i64 %indvars.iv %7 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %add34 = add nsw i32 %7, %sum_b.060 br label %if.end35 if.end35: ; preds = %if.end, %if.then15, %if.end9.thread, %if.then28 %sum_a.2 = phi i32 [ %add31, %if.then28 ], [ %add8, %if.end9.thread ], [ %sum_a.059, %if.then15 ], [ %sum_a.059, %if.end ] %sum_b.2 = phi i32 [ %add34, %if.then28 ], [ %sum_b.060, %if.end9.thread ], [ %add21, %if.then15 ], [ %sum_b.060, %if.end ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp = icmp eq i64 %indvars.iv.next, %0 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %if.end35, %entry %sum_a.0.lcssa = phi i32 [ 0, %entry ], [ %sum_a.2, %if.end35 ] %sum_b.0.lcssa = phi i32 [ 0, %entry ], [ %sum_b.2, %if.end35 ] %8 = load i32, ptr @cnt, align 4, !tbaa !5 %idx.ext = sext i32 %8 to i64 %add.ptr = getelementptr inbounds i32, ptr %p1, i64 %idx.ext store i32 %sum_a.0.lcssa, ptr %add.ptr, align 4, !tbaa !5 %9 = load i32, ptr @cnt, align 4, !tbaa !5 %idx.ext36 = sext i32 %9 to i64 %add.ptr37 = getelementptr inbounds i32, ptr %p2, i64 %idx.ext36 store i32 %sum_b.0.lcssa, ptr %add.ptr37, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @output(ptr nocapture noundef readonly %p1, ptr nocapture noundef readonly %p2) local_unnamed_addr #0 { entry: %0 = load i32, ptr @cnt, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %0, 0 br i1 %cmp6, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %p1, i64 %indvars.iv %1 = load i32, ptr %add.ptr, align 4, !tbaa !5 %add.ptr2 = getelementptr inbounds i32, ptr %p2, i64 %indvars.iv %2 = load i32, ptr %add.ptr2, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1, i32 noundef %2) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @cnt, 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 !10 for.end: ; preds = %for.body, %entry 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 @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 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(read, argmem: write, 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int n, a, b; int suma = 0; int sumb = 0; while (1) { scanf("%d", &n); if (n == 0) { return 0; } int i; for (i = n; i > 0; i--) { scanf("%d %d", &a, &b); if (a > b) { suma = suma + a + b; } else if (b > a) { sumb = sumb + a + b; } else { suma = suma + a; sumb = sumb + b; } } printf("%d %d\n", suma, sumb); suma = 0; sumb = 0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150201/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150201/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp30 = icmp eq i32 %0, 0 br i1 %cmp30, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %4, %for.end ], [ %0, %entry ] %cmp124 = icmp sgt i32 %1, 0 br i1 %cmp124, label %for.body, label %for.end if.then: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.body: ; preds = %for.cond.preheader, %for.inc %i.027 = phi i32 [ %dec, %for.inc ], [ %1, %for.cond.preheader ] %sumb.126 = phi i32 [ %sumb.2, %for.inc ], [ 0, %for.cond.preheader ] %suma.125 = phi i32 [ %suma.2, %for.inc ], [ 0, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %2 = load i32, ptr %a, align 4, !tbaa !5 %3 = load i32, ptr %b, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %2, %3 br i1 %cmp3, label %if.then4, label %if.else if.then4: ; preds = %for.body %add = add nsw i32 %2, %suma.125 %add5 = add nsw i32 %add, %3 br label %for.inc if.else: ; preds = %for.body %cmp6 = icmp sgt i32 %3, %2 br i1 %cmp6, label %if.then7, label %if.else10 if.then7: ; preds = %if.else %add8 = add i32 %3, %sumb.126 %add9 = add i32 %add8, %2 br label %for.inc if.else10: ; preds = %if.else %add11 = add nsw i32 %2, %suma.125 %add12 = add nsw i32 %3, %sumb.126 br label %for.inc for.inc: ; preds = %if.then4, %if.else10, %if.then7 %suma.2 = phi i32 [ %add5, %if.then4 ], [ %suma.125, %if.then7 ], [ %add11, %if.else10 ] %sumb.2 = phi i32 [ %sumb.126, %if.then4 ], [ %add9, %if.then7 ], [ %add12, %if.else10 ] %dec = add nsw i32 %i.027, -1 %cmp1 = icmp sgt i32 %i.027, 1 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %for.cond.preheader %suma.1.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %suma.2, %for.inc ] %sumb.1.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %sumb.2, %for.inc ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %suma.1.lcssa, i32 noundef %sumb.1.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %4, 0 br i1 %cmp, label %if.then, label %for.cond.preheader } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int i, n, a, b, scoreA, scoreB; while(1){ scanf("%d", &n); if(n == 0) break; scoreA = 0; scoreB = 0; for(i=0; i<n; i++){ scanf("%d %d", &a, &b); if(a == b){ scoreA += a; scoreB += b; }else if(a > b){ scoreA += (a + b); }else{ scoreB += (a + b); } } printf("%d %d\n", scoreA, scoreB); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150252/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150252/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp29 = icmp eq i32 %0, 0 br i1 %cmp29, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %5, %for.end ], [ %0, %entry ] %cmp123 = icmp sgt i32 %1, 0 br i1 %cmp123, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.inc %scoreB.026 = phi i32 [ %scoreB.1, %for.inc ], [ 0, %for.cond.preheader ] %scoreA.025 = phi i32 [ %scoreA.1, %for.inc ], [ 0, %for.cond.preheader ] %i.024 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %2 = load i32, ptr %a, align 4, !tbaa !5 %3 = load i32, ptr %b, align 4, !tbaa !5 %cmp3 = icmp eq i32 %2, %3 br i1 %cmp3, label %if.then4, label %if.else if.then4: ; preds = %for.body %add = add nsw i32 %2, %scoreA.025 %add5 = add nsw i32 %2, %scoreB.026 br label %for.inc if.else: ; preds = %for.body %cmp6 = icmp sgt i32 %2, %3 br i1 %cmp6, label %if.then7, label %if.else10 if.then7: ; preds = %if.else %add8 = add i32 %2, %scoreA.025 %add9 = add i32 %add8, %3 br label %for.inc if.else10: ; preds = %if.else %add11 = add i32 %3, %scoreB.026 %add12 = add i32 %add11, %2 br label %for.inc for.inc: ; preds = %if.then4, %if.else10, %if.then7 %scoreA.1 = phi i32 [ %add, %if.then4 ], [ %add9, %if.then7 ], [ %scoreA.025, %if.else10 ] %scoreB.1 = phi i32 [ %add5, %if.then4 ], [ %scoreB.026, %if.then7 ], [ %add12, %if.else10 ] %inc = add nuw nsw i32 %i.024, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp1 = icmp slt i32 %inc, %4 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %for.cond.preheader %scoreA.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %scoreA.1, %for.inc ] %scoreB.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %scoreB.1, %for.inc ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %scoreA.0.lcssa, i32 noundef %scoreB.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %5, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 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 A,B; int n; int i; int PointA,PointB; while(1){ PointA = 0; PointB = 0; scanf("%d" ,&n); if( n == 0 ) break; for( i = 0 ; i < n ; i++ ){ scanf("%d %d" ,&A ,&B); if( A < B ) PointB += A + B; if( A > B ) PointA += B + A; if( A == B ){ PointA += A; PointB += B; } } printf("%d %d\n" ,PointA ,PointB); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150296/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150296/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %n = 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 %n) #3 %call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp34 = icmp eq i32 %0, 0 br i1 %cmp34, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %5, %for.end ], [ %0, %entry ] %cmp128 = icmp sgt i32 %1, 0 br i1 %cmp128, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.body %PointB.031 = phi i32 [ %PointB.2, %for.body ], [ 0, %for.cond.preheader ] %PointA.030 = phi i32 [ %PointA.2, %for.body ], [ 0, %for.cond.preheader ] %i.029 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A, ptr noundef nonnull %B) %2 = load i32, ptr %A, align 4, !tbaa !5 %3 = load i32, ptr %B, align 4, !tbaa !5 %cmp3 = icmp slt i32 %2, %3 %add = add nsw i32 %3, %2 %add5 = select i1 %cmp3, i32 %add, i32 0 %PointB.1 = add nsw i32 %add5, %PointB.031 %cmp7 = icmp sgt i32 %2, %3 %add10 = select i1 %cmp7, i32 %add, i32 0 %PointA.1 = add nsw i32 %add10, %PointA.030 %cmp12 = icmp eq i32 %2, %3 %add14 = select i1 %cmp12, i32 %2, i32 0 %PointA.2 = add nsw i32 %PointA.1, %add14 %add15 = select i1 %cmp12, i32 %3, i32 0 %PointB.2 = add nsw i32 %PointB.1, %add15 %inc = add nuw nsw i32 %i.029, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp1 = icmp slt i32 %inc, %4 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond.preheader %PointA.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %PointA.2, %for.body ] %PointB.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %PointB.2, %for.body ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %PointA.0.lcssa, i32 noundef %PointB.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %5, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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, a, b, total_a, total_b; while(1){ scanf("%d", &n); if(n == 0){ break; } total_a = 0; total_b = 0; for(int i=1; i<=n; i++){ scanf("%d %d", &a, &b); if(a > b){ total_a += a + b; } else if(b > a){ total_b += a + b; } else{ total_a += a; total_b += b; } } printf("%d %d\n", total_a, total_b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150339/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150339/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp29 = icmp eq i32 %0, 0 br i1 %cmp29, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.cleanup %1 = phi i32 [ %2, %for.cond.cleanup ], [ %0, %entry ] %cmp1.not23 = icmp slt i32 %1, 1 br i1 %cmp1.not23, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.inc, %for.cond.preheader %total_a.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %total_a.1, %for.inc ] %total_b.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %total_b.1, %for.inc ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %total_a.0.lcssa, i32 noundef %total_b.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %2, 0 br i1 %cmp, label %while.end, label %for.cond.preheader for.body: ; preds = %for.cond.preheader, %for.inc %i.026 = phi i32 [ %inc, %for.inc ], [ 1, %for.cond.preheader ] %total_b.025 = phi i32 [ %total_b.1, %for.inc ], [ 0, %for.cond.preheader ] %total_a.024 = phi i32 [ %total_a.1, %for.inc ], [ 0, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %3 = load i32, ptr %a, align 4, !tbaa !5 %4 = load i32, ptr %b, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %3, %4 br i1 %cmp3, label %if.then4, label %if.else if.then4: ; preds = %for.body %add = add i32 %3, %total_a.024 %add5 = add i32 %add, %4 br label %for.inc if.else: ; preds = %for.body %cmp6 = icmp sgt i32 %4, %3 br i1 %cmp6, label %if.then7, label %if.else10 if.then7: ; preds = %if.else %add8 = add i32 %4, %total_b.025 %add9 = add i32 %add8, %3 br label %for.inc if.else10: ; preds = %if.else %add11 = add nsw i32 %3, %total_a.024 %add12 = add nsw i32 %4, %total_b.025 br label %for.inc for.inc: ; preds = %if.then4, %if.else10, %if.then7 %total_a.1 = phi i32 [ %add5, %if.then4 ], [ %total_a.024, %if.then7 ], [ %add11, %if.else10 ] %total_b.1 = phi i32 [ %total_b.025, %if.then4 ], [ %add9, %if.then7 ], [ %add12, %if.else10 ] %inc = add nuw nsw i32 %i.026, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp1.not.not = icmp slt i32 %i.026, %5 br i1 %cmp1.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !9 while.end: ; preds = %for.cond.cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #define ll long long #define rep(i,l,r)for(ll i=(l);i<(r);i++) //block linked list #define Bsize 900 /*2sqrt(n)*/ typedef struct block{ int cnt; ll a[Bsize+1]; struct block*pre; struct block*nxt; }block; void Bpush(block*b,ll x){ //リストにxを追加する if((*b).nxt&&(*(*b).nxt).a[0]<x){ //次へ Bpush((*b).nxt,x); return; } int i=(*b).cnt; for(;i>0&&(*b).a[i-1]>x;i--)(*b).a[i]=(*b).a[i-1]; (*b).a[i]=x; (*b).cnt++; if((*b).cnt>=Bsize){ //分割 block*nn=(block*)malloc(sizeof(block)); (*nn).cnt=Bsize-Bsize/2; rep(i,0,Bsize-Bsize/2)(*nn).a[i]=(*b).a[i+Bsize/2]; (*nn).pre=b; (*nn).nxt=(*b).nxt; if((*b).nxt)(*(*b).nxt).pre=nn; (*b).cnt=Bsize/2; (*b).nxt=nn; } } ll Bans(block*b,int k){ //リストのk番目を返す //リストにk個未満しかなければ適当に返す if((*b).cnt<=k){ if((*b).nxt)return Bans((*b).nxt,k-(*b).cnt); else return -1; } return (*b).a[k]; } int Bdel(block*b,int k){ //リストからkを(存在すれば)1個削除する //存在すれば1、しなければ0を返す if((*b).cnt==0||(*b).a[(*b).cnt-1]<k){ if((*b).nxt)return Bdel((*b).nxt,k); else return 0; } int i=0; for(;(*b).a[i]<k;i++); if((*b).a[i]!=k)return 0; for(;i<(*b).cnt-1;i++)(*b).a[i]=(*b).a[i+1]; (*b).cnt--; if((*b).cnt==0&&(*b).pre){ (*(*b).pre).nxt=(*b).nxt; if((*b).nxt)(*(*b).nxt).pre=(*b).pre; free(b); }else if((*b).pre&&(*(*b).pre).cnt+(*b).cnt<Bsize/4){ //まとめる rep(i,0,(*b).cnt)(*(*b).pre).a[(*(*b).pre).cnt+i]=(*b).a[i]; (*(*b).pre).cnt+=(*b).cnt; (*(*b).pre).nxt=(*b).nxt; if((*b).nxt)(*(*b).nxt).pre=(*b).pre; free(b); }else if((*b).nxt&&(*(*b).nxt).cnt+(*b).cnt<Bsize/4){ //まとめる block*p=b,*q=(*b).nxt; rep(i,0,(*q).cnt)(*p).a[(*p).cnt+i]=(*q).a[i]; (*p).cnt+=(*q).cnt; (*p).nxt=(*q).nxt; if((*q).nxt)(*(*q).nxt).pre=p; free(q); } return 1; } ll a[400010],x[200010]; int c(const void*p,const void*q){ if(a[*(ll*)p]<a[*(ll*)q])return -1; return 1; } block b; ll idx[400010]; int main(){ ll n,q; scanf("%lld%lld",&n,&q); rep(i,0,n){ ll s,t; scanf("%lld%lld%lld",&s,&t,x+i); a[2*i ]=s-x[i]; a[2*i+1]=t-x[i]; } rep(i,0,2*n)idx[i]=i; qsort(idx,2*n,sizeof(ll),c); ll crr=0; rep(_,0,q){ ll d; scanf("%lld",&d); while(crr<2*n&&a[idx[crr]]<=d){ if(idx[crr]%2)Bdel(&b,x[idx[crr]/2]); else Bpush(&b,x[idx[crr]/2]); crr++; } printf("%lld\n",Bans(&b,0)); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150382/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150382/source.c" target datalayout = "e-m:e-p270: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.block = type { i32, [901 x i64], ptr, ptr } @a = dso_local local_unnamed_addr global [400010 x i64] zeroinitializer, align 16 @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1 @x = dso_local global [200010 x i64] zeroinitializer, align 16 @idx = dso_local global [400010 x i64] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @b = dso_local global %struct.block zeroinitializer, align 8 @.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @Bpush(ptr noundef %b, i64 noundef %x) local_unnamed_addr #0 { entry: br label %tailrecurse tailrecurse: ; preds = %land.lhs.true, %entry %b.tr = phi ptr [ %b, %entry ], [ %0, %land.lhs.true ] %nxt = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 3 %0 = load ptr, ptr %nxt, align 8, !tbaa !5 %tobool.not = icmp eq ptr %0, null br i1 %tobool.not, label %if.end, label %land.lhs.true land.lhs.true: ; preds = %tailrecurse %a = getelementptr inbounds %struct.block, ptr %0, i64 0, i32 1 %1 = load i64, ptr %a, align 8, !tbaa !11 %cmp = icmp slt i64 %1, %x br i1 %cmp, label %tailrecurse, label %if.end if.end: ; preds = %land.lhs.true, %tailrecurse %b.tr.lcssa95 = ptrtoint ptr %b.tr to i64 %nxt.le = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 3 %2 = load i32, ptr %b.tr, align 8, !tbaa !13 %cmp379 = icmp sgt i32 %2, 0 br i1 %cmp379, label %land.rhs.preheader, label %for.end.thread for.end.thread: ; preds = %if.end %idxprom1586 = sext i32 %2 to i64 %arrayidx1687 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %idxprom1586 store i64 %x, ptr %arrayidx1687, align 8, !tbaa !11 %inc88 = add nsw i32 %2, 1 store i32 %inc88, ptr %b.tr, align 8, !tbaa !13 br label %return land.rhs.preheader: ; preds = %if.end %3 = zext i32 %2 to i64 br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %for.body %indvars.iv = phi i64 [ %3, %land.rhs.preheader ], [ %indvars.iv.next, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %idxprom = and i64 %indvars.iv.next, 4294967295 %arrayidx5 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %idxprom %4 = load i64, ptr %arrayidx5, align 8, !tbaa !11 %cmp6 = icmp sgt i64 %4, %x br i1 %cmp6, label %for.body, label %for.end.split.loop.exit for.body: ; preds = %land.rhs %arrayidx13 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv store i64 %4, ptr %arrayidx13, align 8, !tbaa !11 %cmp3 = icmp ugt i64 %indvars.iv, 1 br i1 %cmp3, label %land.rhs, label %for.end, !llvm.loop !14 for.end.split.loop.exit: ; preds = %land.rhs %sext = shl i64 %indvars.iv, 32 %5 = ashr exact i64 %sext, 32 br label %for.end for.end: ; preds = %for.body, %for.end.split.loop.exit %i.0.lcssa = phi i64 [ %5, %for.end.split.loop.exit ], [ 0, %for.body ] %arrayidx16 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %i.0.lcssa store i64 %x, ptr %arrayidx16, align 8, !tbaa !11 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %b.tr, align 8, !tbaa !13 %cmp19 = icmp sgt i32 %2, 898 br i1 %cmp19, label %if.then20, label %return if.then20: ; preds = %for.end %call = tail call noalias dereferenceable_or_null(7232) ptr @malloc(i64 noundef 7232) #10 store i32 450, ptr %call, align 8, !tbaa !13 %call94 = ptrtoint ptr %call to i64 %6 = sub i64 %call94, %b.tr.lcssa95 %7 = add i64 %6, -3632 %diff.check = icmp ult i64 %7, -32 br i1 %diff.check, label %vector.body, label %for.body25.prol.preheader for.body25.prol.preheader: ; preds = %if.then20, %vector.body %i22.082.ph = phi i64 [ 0, %if.then20 ], [ 448, %vector.body ] br label %for.body25.prol for.body25.prol: ; preds = %for.body25.prol, %for.body25.prol.preheader %i22.082.prol = phi i64 [ %inc31.prol, %for.body25.prol ], [ %i22.082.ph, %for.body25.prol.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body25.prol ], [ 0, %for.body25.prol.preheader ] %add.prol = add nuw nsw i64 %i22.082.prol, 450 %arrayidx27.prol = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %add.prol %8 = load i64, ptr %arrayidx27.prol, align 8, !tbaa !11 %arrayidx29.prol = getelementptr inbounds %struct.block, ptr %call, i64 0, i32 1, i64 %i22.082.prol store i64 %8, ptr %arrayidx29.prol, align 8, !tbaa !11 %inc31.prol = add nuw nsw i64 %i22.082.prol, 1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, 2 br i1 %prol.iter.cmp.not, label %for.body25.prol.loopexit, label %for.body25.prol, !llvm.loop !16 for.body25.prol.loopexit: ; preds = %for.body25.prol br i1 %diff.check, label %for.cond.cleanup, label %for.body25 vector.body: ; preds = %if.then20, %vector.body %index = phi i64 [ %index.next.1, %vector.body ], [ 0, %if.then20 ] %9 = add nuw nsw i64 %index, 450 %10 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %9 %wide.load = load <2 x i64>, ptr %10, align 8, !tbaa !11 %11 = getelementptr inbounds i64, ptr %10, i64 2 %wide.load96 = load <2 x i64>, ptr %11, align 8, !tbaa !11 %12 = getelementptr inbounds %struct.block, ptr %call, i64 0, i32 1, i64 %index store <2 x i64> %wide.load, ptr %12, align 8, !tbaa !11 %13 = getelementptr inbounds i64, ptr %12, i64 2 store <2 x i64> %wide.load96, ptr %13, align 8, !tbaa !11 %index.next = or i64 %index, 4 %14 = add nuw nsw i64 %index, 454 %15 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %14 %wide.load.1 = load <2 x i64>, ptr %15, align 8, !tbaa !11 %16 = getelementptr inbounds i64, ptr %15, i64 2 %wide.load96.1 = load <2 x i64>, ptr %16, align 8, !tbaa !11 %17 = getelementptr inbounds %struct.block, ptr %call, i64 0, i32 1, i64 %index.next store <2 x i64> %wide.load.1, ptr %17, align 8, !tbaa !11 %18 = getelementptr inbounds i64, ptr %17, i64 2 store <2 x i64> %wide.load96.1, ptr %18, align 8, !tbaa !11 %index.next.1 = add nuw nsw i64 %index, 8 %19 = icmp eq i64 %index.next.1, 448 br i1 %19, label %for.body25.prol.preheader, label %vector.body, !llvm.loop !18 for.cond.cleanup: ; preds = %for.body25, %for.body25.prol.loopexit %pre = getelementptr inbounds %struct.block, ptr %call, i64 0, i32 2 store ptr %b.tr, ptr %pre, align 8, !tbaa !21 %nxt34 = getelementptr inbounds %struct.block, ptr %call, i64 0, i32 3 store ptr %0, ptr %nxt34, align 8, !tbaa !5 br i1 %tobool.not, label %if.end40, label %if.then37 for.body25: ; preds = %for.body25.prol.loopexit, %for.body25 %i22.082 = phi i64 [ %inc31.3, %for.body25 ], [ %inc31.prol, %for.body25.prol.loopexit ] %add = add nuw nsw i64 %i22.082, 450 %arrayidx27 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %add %20 = load i64, ptr %arrayidx27, align 8, !tbaa !11 %arrayidx29 = getelementptr inbounds %struct.block, ptr %call, i64 0, i32 1, i64 %i22.082 store i64 %20, ptr %arrayidx29, align 8, !tbaa !11 %inc31 = add nuw nsw i64 %i22.082, 1 %add.1 = add nuw nsw i64 %i22.082, 451 %arrayidx27.1 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %add.1 %21 = load i64, ptr %arrayidx27.1, align 8, !tbaa !11 %arrayidx29.1 = getelementptr inbounds %struct.block, ptr %call, i64 0, i32 1, i64 %inc31 store i64 %21, ptr %arrayidx29.1, align 8, !tbaa !11 %inc31.1 = add nuw nsw i64 %i22.082, 2 %add.2 = add nuw nsw i64 %i22.082, 452 %arrayidx27.2 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %add.2 %22 = load i64, ptr %arrayidx27.2, align 8, !tbaa !11 %arrayidx29.2 = getelementptr inbounds %struct.block, ptr %call, i64 0, i32 1, i64 %inc31.1 store i64 %22, ptr %arrayidx29.2, align 8, !tbaa !11 %inc31.2 = add nuw nsw i64 %i22.082, 3 %add.3 = add nuw nsw i64 %i22.082, 453 %arrayidx27.3 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %add.3 %23 = load i64, ptr %arrayidx27.3, align 8, !tbaa !11 %arrayidx29.3 = getelementptr inbounds %struct.block, ptr %call, i64 0, i32 1, i64 %inc31.2 store i64 %23, ptr %arrayidx29.3, align 8, !tbaa !11 %inc31.3 = add nuw nsw i64 %i22.082, 4 %exitcond.not.3 = icmp eq i64 %inc31.3, 450 br i1 %exitcond.not.3, label %for.cond.cleanup, label %for.body25, !llvm.loop !22 if.then37: ; preds = %for.cond.cleanup %pre39 = getelementptr inbounds %struct.block, ptr %0, i64 0, i32 2 store ptr %call, ptr %pre39, align 8, !tbaa !21 br label %if.end40 if.end40: ; preds = %if.then37, %for.cond.cleanup store i32 450, ptr %b.tr, align 8, !tbaa !13 store ptr %call, ptr %nxt.le, align 8, !tbaa !5 br label %return return: ; preds = %for.end.thread, %for.end, %if.end40 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 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 norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i64 @Bans(ptr nocapture noundef readonly %b, i32 noundef %k) local_unnamed_addr #3 { entry: %0 = load i32, ptr %b, align 8, !tbaa !13 %cmp.not13 = icmp sgt i32 %0, %k br i1 %cmp.not13, label %if.end, label %if.then if.then: ; preds = %entry, %if.then1 %1 = phi i32 [ %3, %if.then1 ], [ %0, %entry ] %k.tr15 = phi i32 [ %sub, %if.then1 ], [ %k, %entry ] %b.tr14 = phi ptr [ %2, %if.then1 ], [ %b, %entry ] %nxt = getelementptr inbounds %struct.block, ptr %b.tr14, i64 0, i32 3 %2 = load ptr, ptr %nxt, align 8, !tbaa !5 %tobool.not = icmp eq ptr %2, null br i1 %tobool.not, label %return, label %if.then1 if.then1: ; preds = %if.then %sub = sub nsw i32 %k.tr15, %1 %3 = load i32, ptr %2, align 8, !tbaa !13 %cmp.not = icmp sgt i32 %3, %sub br i1 %cmp.not, label %if.end, label %if.then if.end: ; preds = %if.then1, %entry %b.tr.lcssa = phi ptr [ %b, %entry ], [ %2, %if.then1 ] %k.tr.lcssa = phi i32 [ %k, %entry ], [ %sub, %if.then1 ] %idxprom = sext i32 %k.tr.lcssa to i64 %arrayidx = getelementptr inbounds %struct.block, ptr %b.tr.lcssa, i64 0, i32 1, i64 %idxprom %4 = load i64, ptr %arrayidx, align 8, !tbaa !11 br label %return return: ; preds = %if.then, %if.end %retval.0 = phi i64 [ %4, %if.end ], [ -1, %if.then ] ret i64 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local i32 @Bdel(ptr noundef %b, i32 noundef %k) local_unnamed_addr #4 { entry: %conv = sext i32 %k to i64 br label %tailrecurse tailrecurse: ; preds = %if.then, %entry %b.tr = phi ptr [ %b, %entry ], [ %2, %if.then ] %0 = load i32, ptr %b.tr, align 8, !tbaa !13 %cmp = icmp eq i32 %0, 0 br i1 %cmp, label %if.then, label %lor.lhs.false lor.lhs.false: ; preds = %tailrecurse %sub = add nsw i32 %0, -1 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !11 %cmp2 = icmp slt i64 %1, %conv br i1 %cmp2, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %lor.lhs.false %b.tr.lcssa238 = ptrtoint ptr %b.tr to i64 br label %for.cond if.then: ; preds = %lor.lhs.false, %tailrecurse %nxt = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 3 %2 = load ptr, ptr %nxt, align 8, !tbaa !5 %tobool.not = icmp eq ptr %2, null br i1 %tobool.not, label %return, label %tailrecurse for.cond: ; preds = %for.cond, %for.cond.preheader %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %for.cond.preheader ] %arrayidx8 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv %3 = load i64, ptr %arrayidx8, align 8, !tbaa !11 %cmp10 = icmp slt i64 %3, %conv %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp10, label %for.cond, label %for.end, !llvm.loop !23 for.end: ; preds = %for.cond %cmp16.not = icmp eq i64 %3, %conv br i1 %cmp16.not, label %for.cond20.preheader, label %return for.cond20.preheader: ; preds = %for.end %4 = trunc i64 %indvars.iv to i32 %cmp23211 = icmp sgt i32 %sub, %4 br i1 %cmp23211, label %for.body25.preheader, label %for.end34 for.body25.preheader: ; preds = %for.cond20.preheader %wide.trip.count = zext i32 %sub to i64 %5 = sub i64 %wide.trip.count, %indvars.iv %min.iters.check = icmp ult i64 %5, 14 br i1 %min.iters.check, label %for.body25.preheader272, label %vector.ph vector.ph: ; preds = %for.body25.preheader %n.vec = and i64 %5, -4 %ind.end = add i64 %indvars.iv, %n.vec br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %indvars.iv, %index %6 = add nuw i64 %offset.idx, 1 %7 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %6 %wide.load = load <2 x i64>, ptr %7, align 8, !tbaa !11 %8 = getelementptr inbounds i64, ptr %7, i64 2 %wide.load241 = load <2 x i64>, ptr %8, align 8, !tbaa !11 %9 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %offset.idx store <2 x i64> %wide.load, ptr %9, align 8, !tbaa !11 %10 = getelementptr inbounds i64, ptr %9, i64 2 store <2 x i64> %wide.load241, ptr %10, align 8, !tbaa !11 %index.next = add nuw i64 %index, 4 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !24 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %5, %n.vec br i1 %cmp.n, label %for.end34, label %for.body25.preheader272 for.body25.preheader272: ; preds = %for.body25.preheader, %middle.block %indvars.iv222.ph = phi i64 [ %indvars.iv, %for.body25.preheader ], [ %ind.end, %middle.block ] %12 = sub i64 %wide.trip.count, %indvars.iv222.ph %13 = xor i64 %indvars.iv222.ph, -1 %14 = add i64 %13, %wide.trip.count %xtraiter = and i64 %12, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body25.prol.loopexit, label %for.body25.prol for.body25.prol: ; preds = %for.body25.preheader272, %for.body25.prol %indvars.iv222.prol = phi i64 [ %indvars.iv.next223.prol, %for.body25.prol ], [ %indvars.iv222.ph, %for.body25.preheader272 ] %prol.iter = phi i64 [ %prol.iter.next, %for.body25.prol ], [ 0, %for.body25.preheader272 ] %indvars.iv.next223.prol = add nuw i64 %indvars.iv222.prol, 1 %arrayidx28.prol = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv.next223.prol %15 = load i64, ptr %arrayidx28.prol, align 8, !tbaa !11 %arrayidx31.prol = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv222.prol store i64 %15, ptr %arrayidx31.prol, align 8, !tbaa !11 %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.body25.prol.loopexit, label %for.body25.prol, !llvm.loop !25 for.body25.prol.loopexit: ; preds = %for.body25.prol, %for.body25.preheader272 %indvars.iv222.unr = phi i64 [ %indvars.iv222.ph, %for.body25.preheader272 ], [ %indvars.iv.next223.prol, %for.body25.prol ] %16 = icmp ult i64 %14, 3 br i1 %16, label %for.end34, label %for.body25 for.body25: ; preds = %for.body25.prol.loopexit, %for.body25 %indvars.iv222 = phi i64 [ %indvars.iv.next223.3, %for.body25 ], [ %indvars.iv222.unr, %for.body25.prol.loopexit ] %indvars.iv.next223 = add nuw i64 %indvars.iv222, 1 %arrayidx28 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv.next223 %17 = load i64, ptr %arrayidx28, align 8, !tbaa !11 %arrayidx31 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv222 store i64 %17, ptr %arrayidx31, align 8, !tbaa !11 %indvars.iv.next223.1 = add nuw i64 %indvars.iv222, 2 %arrayidx28.1 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv.next223.1 %18 = load i64, ptr %arrayidx28.1, align 8, !tbaa !11 %arrayidx31.1 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv.next223 store i64 %18, ptr %arrayidx31.1, align 8, !tbaa !11 %indvars.iv.next223.2 = add nuw i64 %indvars.iv222, 3 %arrayidx28.2 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv.next223.2 %19 = load i64, ptr %arrayidx28.2, align 8, !tbaa !11 %arrayidx31.2 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv.next223.1 store i64 %19, ptr %arrayidx31.2, align 8, !tbaa !11 %indvars.iv.next223.3 = add nuw i64 %indvars.iv222, 4 %arrayidx28.3 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv.next223.3 %20 = load i64, ptr %arrayidx28.3, align 8, !tbaa !11 %arrayidx31.3 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %indvars.iv.next223.2 store i64 %20, ptr %arrayidx31.3, align 8, !tbaa !11 %exitcond.not.3 = icmp eq i64 %indvars.iv.next223.3, %wide.trip.count br i1 %exitcond.not.3, label %for.end34, label %for.body25, !llvm.loop !26 for.end34: ; preds = %for.body25.prol.loopexit, %for.body25, %middle.block, %for.cond20.preheader store i32 %sub, ptr %b.tr, align 8, !tbaa !13 %cmp37 = icmp eq i32 %sub, 0 %pre = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 2 %21 = load ptr, ptr %pre, align 8, !tbaa !21 %22 = ptrtoint ptr %21 to i64 %tobool39.not = icmp eq ptr %21, null br i1 %cmp37, label %land.lhs.true, label %if.else51 land.lhs.true: ; preds = %for.end34 br i1 %tobool39.not, label %if.else95, label %if.then40 if.then40: ; preds = %land.lhs.true %nxt41 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 3 %23 = load ptr, ptr %nxt41, align 8, !tbaa !5 %nxt43 = getelementptr inbounds %struct.block, ptr %21, i64 0, i32 3 store ptr %23, ptr %nxt43, align 8, !tbaa !5 %24 = load ptr, ptr %nxt41, align 8, !tbaa !5 %tobool45.not = icmp eq ptr %24, null br i1 %tobool45.not, label %return.sink.split, label %return.sink.split.sink.split if.else51: ; preds = %for.end34 br i1 %tobool39.not, label %if.else95, label %land.lhs.true54 land.lhs.true54: ; preds = %if.else51 %25 = load i32, ptr %21, align 8, !tbaa !13 %add58 = add nsw i32 %25, %sub %cmp59 = icmp slt i32 %add58, 225 br i1 %cmp59, label %for.cond63.preheader, label %if.else95 for.cond63.preheader: ; preds = %land.lhs.true54 %cmp66213 = icmp sgt i32 %0, 1 br i1 %cmp66213, label %for.body68.lr.ph, label %for.cond.cleanup for.body68.lr.ph: ; preds = %for.cond63.preheader %conv75 = sext i32 %25 to i64 %smax = tail call i64 @llvm.smax.i64(i64 %idxprom, i64 1) %min.iters.check245 = icmp ult i64 %smax, 12 br i1 %min.iters.check245, label %for.body68.preheader, label %vector.memcheck242 vector.memcheck242: ; preds = %for.body68.lr.ph %26 = shl nsw i64 %conv75, 3 %27 = add i64 %26, %22 %28 = sub i64 %27, %b.tr.lcssa238 %diff.check = icmp ult i64 %28, 32 br i1 %diff.check, label %for.body68.preheader, label %vector.ph246 vector.ph246: ; preds = %vector.memcheck242 %n.vec248 = and i64 %smax, 9223372036854775804 br label %vector.body251 vector.body251: ; preds = %vector.body251, %vector.ph246 %index252 = phi i64 [ 0, %vector.ph246 ], [ %index.next255, %vector.body251 ] %29 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %index252 %wide.load253 = load <2 x i64>, ptr %29, align 8, !tbaa !11 %30 = getelementptr inbounds i64, ptr %29, i64 2 %wide.load254 = load <2 x i64>, ptr %30, align 8, !tbaa !11 %31 = add nsw i64 %index252, %conv75 %32 = getelementptr inbounds %struct.block, ptr %21, i64 0, i32 1, i64 %31 store <2 x i64> %wide.load253, ptr %32, align 8, !tbaa !11 %33 = getelementptr inbounds i64, ptr %32, i64 2 store <2 x i64> %wide.load254, ptr %33, align 8, !tbaa !11 %index.next255 = add nuw i64 %index252, 4 %34 = icmp eq i64 %index.next255, %n.vec248 br i1 %34, label %middle.block243, label %vector.body251, !llvm.loop !27 middle.block243: ; preds = %vector.body251 %cmp.n250 = icmp eq i64 %smax, %n.vec248 br i1 %cmp.n250, label %for.cond.cleanup, label %for.body68.preheader for.body68.preheader: ; preds = %vector.memcheck242, %for.body68.lr.ph, %middle.block243 %i62.0214.ph = phi i64 [ 0, %vector.memcheck242 ], [ 0, %for.body68.lr.ph ], [ %n.vec248, %middle.block243 ] %35 = xor i64 %i62.0214.ph, -1 %36 = add nsw i64 %smax, %35 %xtraiter276 = and i64 %smax, 3 %lcmp.mod277.not = icmp eq i64 %xtraiter276, 0 br i1 %lcmp.mod277.not, label %for.body68.prol.loopexit, label %for.body68.prol for.body68.prol: ; preds = %for.body68.preheader, %for.body68.prol %i62.0214.prol = phi i64 [ %inc79.prol, %for.body68.prol ], [ %i62.0214.ph, %for.body68.preheader ] %prol.iter278 = phi i64 [ %prol.iter278.next, %for.body68.prol ], [ 0, %for.body68.preheader ] %arrayidx70.prol = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %i62.0214.prol %37 = load i64, ptr %arrayidx70.prol, align 8, !tbaa !11 %add76.prol = add nsw i64 %i62.0214.prol, %conv75 %arrayidx77.prol = getelementptr inbounds %struct.block, ptr %21, i64 0, i32 1, i64 %add76.prol store i64 %37, ptr %arrayidx77.prol, align 8, !tbaa !11 %inc79.prol = add nuw nsw i64 %i62.0214.prol, 1 %prol.iter278.next = add i64 %prol.iter278, 1 %prol.iter278.cmp.not = icmp eq i64 %prol.iter278.next, %xtraiter276 br i1 %prol.iter278.cmp.not, label %for.body68.prol.loopexit, label %for.body68.prol, !llvm.loop !28 for.body68.prol.loopexit: ; preds = %for.body68.prol, %for.body68.preheader %i62.0214.unr = phi i64 [ %i62.0214.ph, %for.body68.preheader ], [ %inc79.prol, %for.body68.prol ] %38 = icmp ult i64 %36, 3 br i1 %38, label %for.cond.cleanup, label %for.body68 for.cond.cleanup: ; preds = %for.body68.prol.loopexit, %for.body68, %middle.block243, %for.cond63.preheader store i32 %add58, ptr %21, align 8, !tbaa !13 %nxt85 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 3 %39 = load ptr, ptr %nxt85, align 8, !tbaa !5 %nxt87 = getelementptr inbounds %struct.block, ptr %21, i64 0, i32 3 store ptr %39, ptr %nxt87, align 8, !tbaa !5 %40 = load ptr, ptr %nxt85, align 8, !tbaa !5 %tobool89.not = icmp eq ptr %40, null br i1 %tobool89.not, label %return.sink.split, label %return.sink.split.sink.split for.body68: ; preds = %for.body68.prol.loopexit, %for.body68 %i62.0214 = phi i64 [ %inc79.3, %for.body68 ], [ %i62.0214.unr, %for.body68.prol.loopexit ] %arrayidx70 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %i62.0214 %41 = load i64, ptr %arrayidx70, align 8, !tbaa !11 %add76 = add nsw i64 %i62.0214, %conv75 %arrayidx77 = getelementptr inbounds %struct.block, ptr %21, i64 0, i32 1, i64 %add76 store i64 %41, ptr %arrayidx77, align 8, !tbaa !11 %inc79 = add nuw nsw i64 %i62.0214, 1 %arrayidx70.1 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %inc79 %42 = load i64, ptr %arrayidx70.1, align 8, !tbaa !11 %add76.1 = add nsw i64 %inc79, %conv75 %arrayidx77.1 = getelementptr inbounds %struct.block, ptr %21, i64 0, i32 1, i64 %add76.1 store i64 %42, ptr %arrayidx77.1, align 8, !tbaa !11 %inc79.1 = add nuw nsw i64 %i62.0214, 2 %arrayidx70.2 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %inc79.1 %43 = load i64, ptr %arrayidx70.2, align 8, !tbaa !11 %add76.2 = add nsw i64 %inc79.1, %conv75 %arrayidx77.2 = getelementptr inbounds %struct.block, ptr %21, i64 0, i32 1, i64 %add76.2 store i64 %43, ptr %arrayidx77.2, align 8, !tbaa !11 %inc79.2 = add nuw nsw i64 %i62.0214, 3 %arrayidx70.3 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %inc79.2 %44 = load i64, ptr %arrayidx70.3, align 8, !tbaa !11 %add76.3 = add nsw i64 %inc79.2, %conv75 %arrayidx77.3 = getelementptr inbounds %struct.block, ptr %21, i64 0, i32 1, i64 %add76.3 store i64 %44, ptr %arrayidx77.3, align 8, !tbaa !11 %inc79.3 = add nuw nsw i64 %i62.0214, 4 %exitcond226.not.3 = icmp eq i64 %inc79.3, %smax br i1 %exitcond226.not.3, label %for.cond.cleanup, label %for.body68, !llvm.loop !29 if.else95: ; preds = %land.lhs.true, %land.lhs.true54, %if.else51 %nxt96 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 3 %45 = load ptr, ptr %nxt96, align 8, !tbaa !5 %46 = ptrtoint ptr %45 to i64 %tobool97.not = icmp eq ptr %45, null br i1 %tobool97.not, label %return, label %land.lhs.true98 land.lhs.true98: ; preds = %if.else95 %47 = load i32, ptr %45, align 8, !tbaa !13 %add102 = add nsw i32 %47, %sub %cmp103 = icmp slt i32 %add102, 225 br i1 %cmp103, label %for.cond108.preheader, label %return for.cond108.preheader: ; preds = %land.lhs.true98 %conv110 = sext i32 %47 to i64 %cmp111215 = icmp sgt i32 %47, 0 br i1 %cmp111215, label %for.body114.preheader, label %for.cond.cleanup113 for.body114.preheader: ; preds = %for.cond108.preheader %min.iters.check260 = icmp ult i32 %47, 12 br i1 %min.iters.check260, label %for.body114.preheader271, label %vector.memcheck256 vector.memcheck256: ; preds = %for.body114.preheader %48 = add i64 %b.tr.lcssa238, 8 %49 = shl nsw i64 %idxprom, 3 %50 = add i64 %48, %49 %51 = add i64 %46, 8 %52 = sub i64 %50, %51 %diff.check257 = icmp ult i64 %52, 32 br i1 %diff.check257, label %for.body114.preheader271, label %vector.ph261 vector.ph261: ; preds = %vector.memcheck256 %n.vec263 = and i64 %conv110, -4 br label %vector.body266 vector.body266: ; preds = %vector.body266, %vector.ph261 %index267 = phi i64 [ 0, %vector.ph261 ], [ %index.next270, %vector.body266 ] %53 = getelementptr inbounds %struct.block, ptr %45, i64 0, i32 1, i64 %index267 %wide.load268 = load <2 x i64>, ptr %53, align 8, !tbaa !11 %54 = getelementptr inbounds i64, ptr %53, i64 2 %wide.load269 = load <2 x i64>, ptr %54, align 8, !tbaa !11 %55 = add nsw i64 %index267, %idxprom %56 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %55 store <2 x i64> %wide.load268, ptr %56, align 8, !tbaa !11 %57 = getelementptr inbounds i64, ptr %56, i64 2 store <2 x i64> %wide.load269, ptr %57, align 8, !tbaa !11 %index.next270 = add nuw i64 %index267, 4 %58 = icmp eq i64 %index.next270, %n.vec263 br i1 %58, label %middle.block258, label %vector.body266, !llvm.loop !30 middle.block258: ; preds = %vector.body266 %cmp.n265 = icmp eq i64 %n.vec263, %conv110 br i1 %cmp.n265, label %for.cond.cleanup113, label %for.body114.preheader271 for.body114.preheader271: ; preds = %vector.memcheck256, %for.body114.preheader, %middle.block258 %i107.0216.ph = phi i64 [ 0, %vector.memcheck256 ], [ 0, %for.body114.preheader ], [ %n.vec263, %middle.block258 ] %59 = xor i64 %i107.0216.ph, -1 %60 = add nsw i64 %59, %conv110 %xtraiter279 = and i64 %conv110, 3 %lcmp.mod280.not = icmp eq i64 %xtraiter279, 0 br i1 %lcmp.mod280.not, label %for.body114.prol.loopexit, label %for.body114.prol for.body114.prol: ; preds = %for.body114.preheader271, %for.body114.prol %i107.0216.prol = phi i64 [ %inc123.prol, %for.body114.prol ], [ %i107.0216.ph, %for.body114.preheader271 ] %prol.iter281 = phi i64 [ %prol.iter281.next, %for.body114.prol ], [ 0, %for.body114.preheader271 ] %arrayidx116.prol = getelementptr inbounds %struct.block, ptr %45, i64 0, i32 1, i64 %i107.0216.prol %61 = load i64, ptr %arrayidx116.prol, align 8, !tbaa !11 %add120.prol = add nsw i64 %i107.0216.prol, %idxprom %arrayidx121.prol = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %add120.prol store i64 %61, ptr %arrayidx121.prol, align 8, !tbaa !11 %inc123.prol = add nuw nsw i64 %i107.0216.prol, 1 %prol.iter281.next = add i64 %prol.iter281, 1 %prol.iter281.cmp.not = icmp eq i64 %prol.iter281.next, %xtraiter279 br i1 %prol.iter281.cmp.not, label %for.body114.prol.loopexit, label %for.body114.prol, !llvm.loop !31 for.body114.prol.loopexit: ; preds = %for.body114.prol, %for.body114.preheader271 %i107.0216.unr = phi i64 [ %i107.0216.ph, %for.body114.preheader271 ], [ %inc123.prol, %for.body114.prol ] %62 = icmp ult i64 %60, 3 br i1 %62, label %for.cond.cleanup113, label %for.body114 for.cond.cleanup113: ; preds = %for.body114.prol.loopexit, %for.body114, %middle.block258, %for.cond108.preheader store i32 %add102, ptr %b.tr, align 8, !tbaa !13 %nxt128 = getelementptr inbounds %struct.block, ptr %45, i64 0, i32 3 %63 = load ptr, ptr %nxt128, align 8, !tbaa !5 store ptr %63, ptr %nxt96, align 8, !tbaa !5 %64 = load ptr, ptr %nxt128, align 8, !tbaa !5 %tobool131.not = icmp eq ptr %64, null br i1 %tobool131.not, label %return.sink.split, label %return.sink.split.sink.split for.body114: ; preds = %for.body114.prol.loopexit, %for.body114 %i107.0216 = phi i64 [ %inc123.3, %for.body114 ], [ %i107.0216.unr, %for.body114.prol.loopexit ] %arrayidx116 = getelementptr inbounds %struct.block, ptr %45, i64 0, i32 1, i64 %i107.0216 %65 = load i64, ptr %arrayidx116, align 8, !tbaa !11 %add120 = add nsw i64 %i107.0216, %idxprom %arrayidx121 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %add120 store i64 %65, ptr %arrayidx121, align 8, !tbaa !11 %inc123 = add nuw nsw i64 %i107.0216, 1 %arrayidx116.1 = getelementptr inbounds %struct.block, ptr %45, i64 0, i32 1, i64 %inc123 %66 = load i64, ptr %arrayidx116.1, align 8, !tbaa !11 %add120.1 = add nsw i64 %inc123, %idxprom %arrayidx121.1 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %add120.1 store i64 %66, ptr %arrayidx121.1, align 8, !tbaa !11 %inc123.1 = add nuw nsw i64 %i107.0216, 2 %arrayidx116.2 = getelementptr inbounds %struct.block, ptr %45, i64 0, i32 1, i64 %inc123.1 %67 = load i64, ptr %arrayidx116.2, align 8, !tbaa !11 %add120.2 = add nsw i64 %inc123.1, %idxprom %arrayidx121.2 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %add120.2 store i64 %67, ptr %arrayidx121.2, align 8, !tbaa !11 %inc123.2 = add nuw nsw i64 %i107.0216, 3 %arrayidx116.3 = getelementptr inbounds %struct.block, ptr %45, i64 0, i32 1, i64 %inc123.2 %68 = load i64, ptr %arrayidx116.3, align 8, !tbaa !11 %add120.3 = add nsw i64 %inc123.2, %idxprom %arrayidx121.3 = getelementptr inbounds %struct.block, ptr %b.tr, i64 0, i32 1, i64 %add120.3 store i64 %68, ptr %arrayidx121.3, align 8, !tbaa !11 %inc123.3 = add nuw nsw i64 %i107.0216, 4 %exitcond229.not.3 = icmp eq i64 %inc123.3, %conv110 br i1 %exitcond229.not.3, label %for.cond.cleanup113, label %for.body114, !llvm.loop !32 return.sink.split.sink.split: ; preds = %for.cond.cleanup113, %for.cond.cleanup, %if.then40 %.sink = phi ptr [ %24, %if.then40 ], [ %40, %for.cond.cleanup ], [ %64, %for.cond.cleanup113 ] %b.tr.lcssa.sink234 = phi ptr [ %21, %if.then40 ], [ %21, %for.cond.cleanup ], [ %b.tr, %for.cond.cleanup113 ] %b.tr.lcssa.sink.ph = phi ptr [ %b.tr, %if.then40 ], [ %b.tr, %for.cond.cleanup ], [ %45, %for.cond.cleanup113 ] %pre134 = getelementptr inbounds %struct.block, ptr %.sink, i64 0, i32 2 store ptr %b.tr.lcssa.sink234, ptr %pre134, align 8, !tbaa !21 br label %return.sink.split return.sink.split: ; preds = %return.sink.split.sink.split, %for.cond.cleanup113, %for.cond.cleanup, %if.then40 %b.tr.lcssa.sink = phi ptr [ %b.tr, %if.then40 ], [ %b.tr, %for.cond.cleanup ], [ %45, %for.cond.cleanup113 ], [ %b.tr.lcssa.sink.ph, %return.sink.split.sink.split ] tail call void @free(ptr noundef nonnull %b.tr.lcssa.sink) #11 br label %return return: ; preds = %if.then, %return.sink.split, %for.end, %land.lhs.true98, %if.else95 %retval.1 = phi i32 [ 0, %for.end ], [ 1, %land.lhs.true98 ], [ 1, %if.else95 ], [ 1, %return.sink.split ], [ 0, %if.then ] ret i32 %retval.1 } ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @c(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #6 { entry: %0 = load i64, ptr %p, align 8, !tbaa !11 %arrayidx = getelementptr inbounds [400010 x i64], ptr @a, i64 0, i64 %0 %1 = load i64, ptr %arrayidx, align 8, !tbaa !11 %2 = load i64, ptr %q, align 8, !tbaa !11 %arrayidx1 = getelementptr inbounds [400010 x i64], ptr @a, i64 0, i64 %2 %3 = load i64, ptr %arrayidx1, align 8, !tbaa !11 %cmp = icmp slt i64 %1, %3 %. = select i1 %cmp, i32 -1, i32 1 ret i32 %. } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %n = alloca i64, align 8 %q = alloca i64, align 8 %s = alloca i64, align 8 %t = alloca i64, align 8 %d = 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 %q) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q) %0 = load i64, ptr %n, align 8, !tbaa !11 %cmp85 = icmp sgt i64 %0, 0 br i1 %cmp85, label %for.body, label %for.cond8.preheader.thread for.cond8.preheader.thread: ; preds = %entry %mul9115 = shl i64 %0, 1 br label %for.cond.cleanup11 for.cond8.preheader: ; preds = %for.body %mul9 = shl i64 %7, 1 %cmp1087 = icmp sgt i64 %7, 0 br i1 %cmp1087, label %for.body12.preheader, label %for.cond.cleanup11 for.body12.preheader: ; preds = %for.cond8.preheader %smax = call i64 @llvm.smax.i64(i64 %mul9, i64 1) %min.iters.check = icmp ult i64 %smax, 4 br i1 %min.iters.check, label %for.body12.preheader201, label %vector.ph vector.ph: ; preds = %for.body12.preheader %n.vec = and i64 %smax, 9223372036854775804 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2> %1 = getelementptr inbounds [400010 x i64], ptr @idx, i64 0, i64 %index store <2 x i64> %vec.ind, ptr %1, align 16, !tbaa !11 %2 = getelementptr inbounds i64, ptr %1, i64 2 store <2 x i64> %step.add, ptr %2, align 16, !tbaa !11 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %3 = icmp eq i64 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !33 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %smax, %n.vec br i1 %cmp.n, label %for.cond.cleanup11, label %for.body12.preheader201 for.body12.preheader201: ; preds = %for.body12.preheader, %middle.block %i7.088.ph = phi i64 [ 0, %for.body12.preheader ], [ %n.vec, %middle.block ] br label %for.body12 for.body: ; preds = %entry, %for.body %i.086 = phi i64 [ %inc, %for.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s) #11 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #11 %add.ptr = getelementptr inbounds i64, ptr @x, i64 %i.086 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %t, ptr noundef nonnull %add.ptr) %4 = load i64, ptr %s, align 8, !tbaa !11 %5 = load i64, ptr %add.ptr, align 8, !tbaa !11 %sub = sub nsw i64 %4, %5 %mul = shl nuw nsw i64 %i.086, 1 %arrayidx2 = getelementptr inbounds [400010 x i64], ptr @a, i64 0, i64 %mul store i64 %sub, ptr %arrayidx2, align 16, !tbaa !11 %6 = load i64, ptr %t, align 8, !tbaa !11 %sub4 = sub nsw i64 %6, %5 %add = or i64 %mul, 1 %arrayidx6 = getelementptr inbounds [400010 x i64], ptr @a, i64 0, i64 %add store i64 %sub4, ptr %arrayidx6, align 8, !tbaa !11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %s) #11 %inc = add nuw nsw i64 %i.086, 1 %7 = load i64, ptr %n, align 8, !tbaa !11 %cmp = icmp slt i64 %inc, %7 br i1 %cmp, label %for.body, label %for.cond8.preheader, !llvm.loop !34 for.cond.cleanup11: ; preds = %for.body12, %middle.block, %for.cond8.preheader.thread, %for.cond8.preheader %mul9117 = phi i64 [ %mul9115, %for.cond8.preheader.thread ], [ %mul9, %for.cond8.preheader ], [ %mul9, %middle.block ], [ %mul9, %for.body12 ] call void @qsort(ptr noundef nonnull @idx, i64 noundef %mul9117, i64 noundef 8, ptr noundef nonnull @c) #11 %8 = load i64, ptr %q, align 8, !tbaa !11 %cmp1996 = icmp sgt i64 %8, 0 br i1 %cmp1996, label %for.body21, label %for.cond.cleanup20 for.body12: ; preds = %for.body12.preheader201, %for.body12 %i7.088 = phi i64 [ %inc15, %for.body12 ], [ %i7.088.ph, %for.body12.preheader201 ] %arrayidx13 = getelementptr inbounds [400010 x i64], ptr @idx, i64 0, i64 %i7.088 store i64 %i7.088, ptr %arrayidx13, align 8, !tbaa !11 %inc15 = add nuw nsw i64 %i7.088, 1 %exitcond.not = icmp eq i64 %inc15, %smax br i1 %exitcond.not, label %for.cond.cleanup11, label %for.body12, !llvm.loop !35 for.cond.cleanup20: ; preds = %Bans.exit, %for.cond.cleanup11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #11 ret i32 0 for.body21: ; preds = %for.cond.cleanup11, %Bans.exit %_.098 = phi i64 [ %inc39, %Bans.exit ], [ 0, %for.cond.cleanup11 ] %crr.097 = phi i64 [ %crr.1.lcssa, %Bans.exit ], [ 0, %for.cond.cleanup11 ] call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #11 %call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %d) %9 = load i64, ptr %n, align 8, !tbaa !11 %mul2391 = shl nsw i64 %9, 1 %cmp2492 = icmp slt i64 %crr.097, %mul2391 br i1 %cmp2492, label %land.rhs, label %while.end land.rhs: ; preds = %for.body21, %if.end %crr.193 = phi i64 [ %inc35, %if.end ], [ %crr.097, %for.body21 ] %arrayidx25 = getelementptr inbounds [400010 x i64], ptr @idx, i64 0, i64 %crr.193 %10 = load i64, ptr %arrayidx25, align 8, !tbaa !11 %arrayidx26 = getelementptr inbounds [400010 x i64], ptr @a, i64 0, i64 %10 %11 = load i64, ptr %arrayidx26, align 8, !tbaa !11 %12 = load i64, ptr %d, align 8, !tbaa !11 %cmp27.not = icmp sgt i64 %11, %12 br i1 %cmp27.not, label %while.end, label %while.body while.body: ; preds = %land.rhs %13 = and i64 %10, 1 %tobool.not = icmp eq i64 %13, 0 %div33 = sdiv i64 %10, 2 %arrayidx34 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %div33 %14 = load i64, ptr %arrayidx34, align 8, !tbaa !11 br i1 %tobool.not, label %tailrecurse.i56, label %if.then if.then: ; preds = %while.body %sext = shl i64 %14, 32 %conv.i = ashr exact i64 %sext, 32 br label %tailrecurse.i tailrecurse.i: ; preds = %if.then.i, %if.then %b.tr.i = phi ptr [ @b, %if.then ], [ %17, %if.then.i ] %15 = load i32, ptr %b.tr.i, align 8, !tbaa !13 %cmp.i = icmp eq i32 %15, 0 br i1 %cmp.i, label %if.then.i, label %lor.lhs.false.i lor.lhs.false.i: ; preds = %tailrecurse.i %sub.i = add nsw i32 %15, -1 %idxprom.i = sext i32 %sub.i to i64 %arrayidx.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %idxprom.i %16 = load i64, ptr %arrayidx.i, align 8, !tbaa !11 %cmp2.i = icmp slt i64 %16, %conv.i br i1 %cmp2.i, label %if.then.i, label %for.cond.i.preheader for.cond.i.preheader: ; preds = %lor.lhs.false.i %b.tr.i.lcssa147 = ptrtoint ptr %b.tr.i to i64 br label %for.cond.i if.then.i: ; preds = %lor.lhs.false.i, %tailrecurse.i %nxt.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 3 %17 = load ptr, ptr %nxt.i, align 8, !tbaa !5 %tobool.not.i = icmp eq ptr %17, null br i1 %tobool.not.i, label %if.end, label %tailrecurse.i for.cond.i: ; preds = %for.cond.i.preheader, %for.cond.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.cond.i ], [ 0, %for.cond.i.preheader ] %arrayidx8.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv.i %18 = load i64, ptr %arrayidx8.i, align 8, !tbaa !11 %cmp10.i = icmp slt i64 %18, %conv.i %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 br i1 %cmp10.i, label %for.cond.i, label %for.end.i, !llvm.loop !23 for.end.i: ; preds = %for.cond.i %cmp16.not.i = icmp eq i64 %18, %conv.i br i1 %cmp16.not.i, label %for.cond20.preheader.i, label %if.end for.cond20.preheader.i: ; preds = %for.end.i %19 = trunc i64 %indvars.iv.i to i32 %cmp23211.i = icmp sgt i32 %sub.i, %19 br i1 %cmp23211.i, label %for.body25.preheader.i, label %for.end34.i for.body25.preheader.i: ; preds = %for.cond20.preheader.i %wide.trip.count.i = zext i32 %sub.i to i64 %20 = sub i64 %wide.trip.count.i, %indvars.iv.i %min.iters.check182 = icmp ult i64 %20, 14 br i1 %min.iters.check182, label %for.body25.i.preheader, label %vector.ph183 vector.ph183: ; preds = %for.body25.preheader.i %n.vec185 = and i64 %20, -4 %ind.end = add i64 %indvars.iv.i, %n.vec185 br label %vector.body188 vector.body188: ; preds = %vector.body188, %vector.ph183 %index189 = phi i64 [ 0, %vector.ph183 ], [ %index.next192, %vector.body188 ] %offset.idx = add i64 %indvars.iv.i, %index189 %21 = add nuw i64 %offset.idx, 1 %22 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %21 %wide.load190 = load <2 x i64>, ptr %22, align 8, !tbaa !11 %23 = getelementptr inbounds i64, ptr %22, i64 2 %wide.load191 = load <2 x i64>, ptr %23, align 8, !tbaa !11 %24 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %offset.idx store <2 x i64> %wide.load190, ptr %24, align 8, !tbaa !11 %25 = getelementptr inbounds i64, ptr %24, i64 2 store <2 x i64> %wide.load191, ptr %25, align 8, !tbaa !11 %index.next192 = add nuw i64 %index189, 4 %26 = icmp eq i64 %index.next192, %n.vec185 br i1 %26, label %middle.block180, label %vector.body188, !llvm.loop !36 middle.block180: ; preds = %vector.body188 %cmp.n187 = icmp eq i64 %20, %n.vec185 br i1 %cmp.n187, label %for.end34.i, label %for.body25.i.preheader for.body25.i.preheader: ; preds = %for.body25.preheader.i, %middle.block180 %indvars.iv222.i.ph = phi i64 [ %indvars.iv.i, %for.body25.preheader.i ], [ %ind.end, %middle.block180 ] %27 = sub i64 %wide.trip.count.i, %indvars.iv222.i.ph %28 = xor i64 %indvars.iv222.i.ph, -1 %29 = add i64 %28, %wide.trip.count.i %xtraiter = and i64 %27, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body25.i.prol.loopexit, label %for.body25.i.prol for.body25.i.prol: ; preds = %for.body25.i.preheader, %for.body25.i.prol %indvars.iv222.i.prol = phi i64 [ %indvars.iv.next223.i.prol, %for.body25.i.prol ], [ %indvars.iv222.i.ph, %for.body25.i.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body25.i.prol ], [ 0, %for.body25.i.preheader ] %indvars.iv.next223.i.prol = add nuw i64 %indvars.iv222.i.prol, 1 %arrayidx28.i.prol = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv.next223.i.prol %30 = load i64, ptr %arrayidx28.i.prol, align 8, !tbaa !11 %arrayidx31.i.prol = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv222.i.prol store i64 %30, ptr %arrayidx31.i.prol, align 8, !tbaa !11 %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.body25.i.prol.loopexit, label %for.body25.i.prol, !llvm.loop !37 for.body25.i.prol.loopexit: ; preds = %for.body25.i.prol, %for.body25.i.preheader %indvars.iv222.i.unr = phi i64 [ %indvars.iv222.i.ph, %for.body25.i.preheader ], [ %indvars.iv.next223.i.prol, %for.body25.i.prol ] %31 = icmp ult i64 %29, 3 br i1 %31, label %for.end34.i, label %for.body25.i for.body25.i: ; preds = %for.body25.i.prol.loopexit, %for.body25.i %indvars.iv222.i = phi i64 [ %indvars.iv.next223.i.3, %for.body25.i ], [ %indvars.iv222.i.unr, %for.body25.i.prol.loopexit ] %indvars.iv.next223.i = add nuw i64 %indvars.iv222.i, 1 %arrayidx28.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv.next223.i %32 = load i64, ptr %arrayidx28.i, align 8, !tbaa !11 %arrayidx31.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv222.i store i64 %32, ptr %arrayidx31.i, align 8, !tbaa !11 %indvars.iv.next223.i.1 = add nuw i64 %indvars.iv222.i, 2 %arrayidx28.i.1 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv.next223.i.1 %33 = load i64, ptr %arrayidx28.i.1, align 8, !tbaa !11 %arrayidx31.i.1 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv.next223.i store i64 %33, ptr %arrayidx31.i.1, align 8, !tbaa !11 %indvars.iv.next223.i.2 = add nuw i64 %indvars.iv222.i, 3 %arrayidx28.i.2 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv.next223.i.2 %34 = load i64, ptr %arrayidx28.i.2, align 8, !tbaa !11 %arrayidx31.i.2 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv.next223.i.1 store i64 %34, ptr %arrayidx31.i.2, align 8, !tbaa !11 %indvars.iv.next223.i.3 = add nuw i64 %indvars.iv222.i, 4 %arrayidx28.i.3 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv.next223.i.3 %35 = load i64, ptr %arrayidx28.i.3, align 8, !tbaa !11 %arrayidx31.i.3 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %indvars.iv.next223.i.2 store i64 %35, ptr %arrayidx31.i.3, align 8, !tbaa !11 %exitcond.not.i.3 = icmp eq i64 %indvars.iv.next223.i.3, %wide.trip.count.i br i1 %exitcond.not.i.3, label %for.end34.i, label %for.body25.i, !llvm.loop !38 for.end34.i: ; preds = %for.body25.i.prol.loopexit, %for.body25.i, %middle.block180, %for.cond20.preheader.i store i32 %sub.i, ptr %b.tr.i, align 8, !tbaa !13 %cmp37.i = icmp eq i32 %sub.i, 0 %pre.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 2 %36 = load ptr, ptr %pre.i, align 8, !tbaa !21 %37 = ptrtoint ptr %36 to i64 %tobool39.not.i = icmp eq ptr %36, null br i1 %cmp37.i, label %land.lhs.true.i, label %if.else51.i land.lhs.true.i: ; preds = %for.end34.i br i1 %tobool39.not.i, label %if.else95.i, label %if.then40.i if.then40.i: ; preds = %land.lhs.true.i %nxt41.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 3 %38 = load ptr, ptr %nxt41.i, align 8, !tbaa !5 %nxt43.i = getelementptr inbounds %struct.block, ptr %36, i64 0, i32 3 store ptr %38, ptr %nxt43.i, align 8, !tbaa !5 %39 = load ptr, ptr %nxt41.i, align 8, !tbaa !5 %tobool45.not.i = icmp eq ptr %39, null br i1 %tobool45.not.i, label %return.sink.split.i, label %return.sink.split.sink.split.i if.else51.i: ; preds = %for.end34.i br i1 %tobool39.not.i, label %if.else95.i, label %land.lhs.true54.i land.lhs.true54.i: ; preds = %if.else51.i %40 = load i32, ptr %36, align 8, !tbaa !13 %add58.i = add nsw i32 %40, %sub.i %cmp59.i = icmp slt i32 %add58.i, 225 br i1 %cmp59.i, label %for.cond63.preheader.i, label %if.else95.i for.cond63.preheader.i: ; preds = %land.lhs.true54.i %cmp66213.i = icmp sgt i32 %15, 1 br i1 %cmp66213.i, label %for.body68.lr.ph.i, label %for.cond.cleanup.i for.body68.lr.ph.i: ; preds = %for.cond63.preheader.i %conv75.i = sext i32 %40 to i64 %smax.i = call i64 @llvm.smax.i64(i64 %idxprom.i, i64 1) %min.iters.check166 = icmp ult i64 %smax.i, 12 br i1 %min.iters.check166, label %for.body68.i.preheader, label %vector.memcheck162 vector.memcheck162: ; preds = %for.body68.lr.ph.i %41 = add i64 %37, 8 %42 = shl nsw i64 %conv75.i, 3 %43 = add i64 %41, %42 %44 = add i64 %b.tr.i.lcssa147, 8 %45 = sub i64 %43, %44 %diff.check163 = icmp ult i64 %45, 32 br i1 %diff.check163, label %for.body68.i.preheader, label %vector.ph167 vector.ph167: ; preds = %vector.memcheck162 %n.vec169 = and i64 %smax.i, 9223372036854775804 br label %vector.body172 vector.body172: ; preds = %vector.body172, %vector.ph167 %index173 = phi i64 [ 0, %vector.ph167 ], [ %index.next176, %vector.body172 ] %46 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %index173 %wide.load174 = load <2 x i64>, ptr %46, align 8, !tbaa !11 %47 = getelementptr inbounds i64, ptr %46, i64 2 %wide.load175 = load <2 x i64>, ptr %47, align 8, !tbaa !11 %48 = add nsw i64 %index173, %conv75.i %49 = getelementptr inbounds %struct.block, ptr %36, i64 0, i32 1, i64 %48 store <2 x i64> %wide.load174, ptr %49, align 8, !tbaa !11 %50 = getelementptr inbounds i64, ptr %49, i64 2 store <2 x i64> %wide.load175, ptr %50, align 8, !tbaa !11 %index.next176 = add nuw i64 %index173, 4 %51 = icmp eq i64 %index.next176, %n.vec169 br i1 %51, label %middle.block164, label %vector.body172, !llvm.loop !39 middle.block164: ; preds = %vector.body172 %cmp.n171 = icmp eq i64 %smax.i, %n.vec169 br i1 %cmp.n171, label %for.cond.cleanup.i, label %for.body68.i.preheader for.body68.i.preheader: ; preds = %vector.memcheck162, %for.body68.lr.ph.i, %middle.block164 %i62.0214.i.ph = phi i64 [ 0, %vector.memcheck162 ], [ 0, %for.body68.lr.ph.i ], [ %n.vec169, %middle.block164 ] %52 = xor i64 %i62.0214.i.ph, -1 %53 = add nsw i64 %smax.i, %52 %xtraiter203 = and i64 %smax.i, 3 %lcmp.mod204.not = icmp eq i64 %xtraiter203, 0 br i1 %lcmp.mod204.not, label %for.body68.i.prol.loopexit, label %for.body68.i.prol for.body68.i.prol: ; preds = %for.body68.i.preheader, %for.body68.i.prol %i62.0214.i.prol = phi i64 [ %inc79.i.prol, %for.body68.i.prol ], [ %i62.0214.i.ph, %for.body68.i.preheader ] %prol.iter205 = phi i64 [ %prol.iter205.next, %for.body68.i.prol ], [ 0, %for.body68.i.preheader ] %arrayidx70.i.prol = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %i62.0214.i.prol %54 = load i64, ptr %arrayidx70.i.prol, align 8, !tbaa !11 %add76.i.prol = add nsw i64 %i62.0214.i.prol, %conv75.i %arrayidx77.i.prol = getelementptr inbounds %struct.block, ptr %36, i64 0, i32 1, i64 %add76.i.prol store i64 %54, ptr %arrayidx77.i.prol, align 8, !tbaa !11 %inc79.i.prol = add nuw nsw i64 %i62.0214.i.prol, 1 %prol.iter205.next = add i64 %prol.iter205, 1 %prol.iter205.cmp.not = icmp eq i64 %prol.iter205.next, %xtraiter203 br i1 %prol.iter205.cmp.not, label %for.body68.i.prol.loopexit, label %for.body68.i.prol, !llvm.loop !40 for.body68.i.prol.loopexit: ; preds = %for.body68.i.prol, %for.body68.i.preheader %i62.0214.i.unr = phi i64 [ %i62.0214.i.ph, %for.body68.i.preheader ], [ %inc79.i.prol, %for.body68.i.prol ] %55 = icmp ult i64 %53, 3 br i1 %55, label %for.cond.cleanup.i, label %for.body68.i for.cond.cleanup.i: ; preds = %for.body68.i.prol.loopexit, %for.body68.i, %middle.block164, %for.cond63.preheader.i store i32 %add58.i, ptr %36, align 8, !tbaa !13 %nxt85.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 3 %56 = load ptr, ptr %nxt85.i, align 8, !tbaa !5 %nxt87.i = getelementptr inbounds %struct.block, ptr %36, i64 0, i32 3 store ptr %56, ptr %nxt87.i, align 8, !tbaa !5 %57 = load ptr, ptr %nxt85.i, align 8, !tbaa !5 %tobool89.not.i = icmp eq ptr %57, null br i1 %tobool89.not.i, label %return.sink.split.i, label %return.sink.split.sink.split.i for.body68.i: ; preds = %for.body68.i.prol.loopexit, %for.body68.i %i62.0214.i = phi i64 [ %inc79.i.3, %for.body68.i ], [ %i62.0214.i.unr, %for.body68.i.prol.loopexit ] %arrayidx70.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %i62.0214.i %58 = load i64, ptr %arrayidx70.i, align 8, !tbaa !11 %add76.i = add nsw i64 %i62.0214.i, %conv75.i %arrayidx77.i = getelementptr inbounds %struct.block, ptr %36, i64 0, i32 1, i64 %add76.i store i64 %58, ptr %arrayidx77.i, align 8, !tbaa !11 %inc79.i = add nuw nsw i64 %i62.0214.i, 1 %arrayidx70.i.1 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %inc79.i %59 = load i64, ptr %arrayidx70.i.1, align 8, !tbaa !11 %add76.i.1 = add nsw i64 %inc79.i, %conv75.i %arrayidx77.i.1 = getelementptr inbounds %struct.block, ptr %36, i64 0, i32 1, i64 %add76.i.1 store i64 %59, ptr %arrayidx77.i.1, align 8, !tbaa !11 %inc79.i.1 = add nuw nsw i64 %i62.0214.i, 2 %arrayidx70.i.2 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %inc79.i.1 %60 = load i64, ptr %arrayidx70.i.2, align 8, !tbaa !11 %add76.i.2 = add nsw i64 %inc79.i.1, %conv75.i %arrayidx77.i.2 = getelementptr inbounds %struct.block, ptr %36, i64 0, i32 1, i64 %add76.i.2 store i64 %60, ptr %arrayidx77.i.2, align 8, !tbaa !11 %inc79.i.2 = add nuw nsw i64 %i62.0214.i, 3 %arrayidx70.i.3 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %inc79.i.2 %61 = load i64, ptr %arrayidx70.i.3, align 8, !tbaa !11 %add76.i.3 = add nsw i64 %inc79.i.2, %conv75.i %arrayidx77.i.3 = getelementptr inbounds %struct.block, ptr %36, i64 0, i32 1, i64 %add76.i.3 store i64 %61, ptr %arrayidx77.i.3, align 8, !tbaa !11 %inc79.i.3 = add nuw nsw i64 %i62.0214.i, 4 %exitcond226.not.i.3 = icmp eq i64 %inc79.i.3, %smax.i br i1 %exitcond226.not.i.3, label %for.cond.cleanup.i, label %for.body68.i, !llvm.loop !41 if.else95.i: ; preds = %land.lhs.true54.i, %if.else51.i, %land.lhs.true.i %nxt96.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 3 %62 = load ptr, ptr %nxt96.i, align 8, !tbaa !5 %63 = ptrtoint ptr %62 to i64 %tobool97.not.i = icmp eq ptr %62, null br i1 %tobool97.not.i, label %if.end, label %land.lhs.true98.i land.lhs.true98.i: ; preds = %if.else95.i %64 = load i32, ptr %62, align 8, !tbaa !13 %add102.i = add nsw i32 %64, %sub.i %cmp103.i = icmp slt i32 %add102.i, 225 br i1 %cmp103.i, label %for.cond108.preheader.i, label %if.end for.cond108.preheader.i: ; preds = %land.lhs.true98.i %conv110.i = sext i32 %64 to i64 %cmp111215.i = icmp sgt i32 %64, 0 br i1 %cmp111215.i, label %for.body114.i.preheader, label %for.cond.cleanup113.i for.body114.i.preheader: ; preds = %for.cond108.preheader.i %min.iters.check151 = icmp ult i32 %64, 12 br i1 %min.iters.check151, label %for.body114.i.preheader193, label %vector.memcheck146 vector.memcheck146: ; preds = %for.body114.i.preheader %65 = add i64 %b.tr.i.lcssa147, 8 %66 = shl nsw i64 %idxprom.i, 3 %67 = add i64 %65, %66 %68 = add i64 %63, 8 %69 = sub i64 %67, %68 %diff.check148 = icmp ult i64 %69, 32 br i1 %diff.check148, label %for.body114.i.preheader193, label %vector.ph152 vector.ph152: ; preds = %vector.memcheck146 %n.vec154 = and i64 %conv110.i, -4 br label %vector.body157 vector.body157: ; preds = %vector.body157, %vector.ph152 %index158 = phi i64 [ 0, %vector.ph152 ], [ %index.next161, %vector.body157 ] %70 = getelementptr inbounds %struct.block, ptr %62, i64 0, i32 1, i64 %index158 %wide.load159 = load <2 x i64>, ptr %70, align 8, !tbaa !11 %71 = getelementptr inbounds i64, ptr %70, i64 2 %wide.load160 = load <2 x i64>, ptr %71, align 8, !tbaa !11 %72 = add nsw i64 %index158, %idxprom.i %73 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %72 store <2 x i64> %wide.load159, ptr %73, align 8, !tbaa !11 %74 = getelementptr inbounds i64, ptr %73, i64 2 store <2 x i64> %wide.load160, ptr %74, align 8, !tbaa !11 %index.next161 = add nuw i64 %index158, 4 %75 = icmp eq i64 %index.next161, %n.vec154 br i1 %75, label %middle.block149, label %vector.body157, !llvm.loop !42 middle.block149: ; preds = %vector.body157 %cmp.n156 = icmp eq i64 %n.vec154, %conv110.i br i1 %cmp.n156, label %for.cond.cleanup113.i, label %for.body114.i.preheader193 for.body114.i.preheader193: ; preds = %vector.memcheck146, %for.body114.i.preheader, %middle.block149 %i107.0216.i.ph = phi i64 [ 0, %vector.memcheck146 ], [ 0, %for.body114.i.preheader ], [ %n.vec154, %middle.block149 ] %76 = xor i64 %i107.0216.i.ph, -1 %77 = add nsw i64 %76, %conv110.i %xtraiter206 = and i64 %conv110.i, 3 %lcmp.mod207.not = icmp eq i64 %xtraiter206, 0 br i1 %lcmp.mod207.not, label %for.body114.i.prol.loopexit, label %for.body114.i.prol for.body114.i.prol: ; preds = %for.body114.i.preheader193, %for.body114.i.prol %i107.0216.i.prol = phi i64 [ %inc123.i.prol, %for.body114.i.prol ], [ %i107.0216.i.ph, %for.body114.i.preheader193 ] %prol.iter208 = phi i64 [ %prol.iter208.next, %for.body114.i.prol ], [ 0, %for.body114.i.preheader193 ] %arrayidx116.i.prol = getelementptr inbounds %struct.block, ptr %62, i64 0, i32 1, i64 %i107.0216.i.prol %78 = load i64, ptr %arrayidx116.i.prol, align 8, !tbaa !11 %add120.i.prol = add nsw i64 %i107.0216.i.prol, %idxprom.i %arrayidx121.i.prol = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %add120.i.prol store i64 %78, ptr %arrayidx121.i.prol, align 8, !tbaa !11 %inc123.i.prol = add nuw nsw i64 %i107.0216.i.prol, 1 %prol.iter208.next = add i64 %prol.iter208, 1 %prol.iter208.cmp.not = icmp eq i64 %prol.iter208.next, %xtraiter206 br i1 %prol.iter208.cmp.not, label %for.body114.i.prol.loopexit, label %for.body114.i.prol, !llvm.loop !43 for.body114.i.prol.loopexit: ; preds = %for.body114.i.prol, %for.body114.i.preheader193 %i107.0216.i.unr = phi i64 [ %i107.0216.i.ph, %for.body114.i.preheader193 ], [ %inc123.i.prol, %for.body114.i.prol ] %79 = icmp ult i64 %77, 3 br i1 %79, label %for.cond.cleanup113.i, label %for.body114.i for.cond.cleanup113.i: ; preds = %for.body114.i.prol.loopexit, %for.body114.i, %middle.block149, %for.cond108.preheader.i store i32 %add102.i, ptr %b.tr.i, align 8, !tbaa !13 %nxt128.i = getelementptr inbounds %struct.block, ptr %62, i64 0, i32 3 %80 = load ptr, ptr %nxt128.i, align 8, !tbaa !5 store ptr %80, ptr %nxt96.i, align 8, !tbaa !5 %81 = load ptr, ptr %nxt128.i, align 8, !tbaa !5 %tobool131.not.i = icmp eq ptr %81, null br i1 %tobool131.not.i, label %return.sink.split.i, label %return.sink.split.sink.split.i for.body114.i: ; preds = %for.body114.i.prol.loopexit, %for.body114.i %i107.0216.i = phi i64 [ %inc123.i.3, %for.body114.i ], [ %i107.0216.i.unr, %for.body114.i.prol.loopexit ] %arrayidx116.i = getelementptr inbounds %struct.block, ptr %62, i64 0, i32 1, i64 %i107.0216.i %82 = load i64, ptr %arrayidx116.i, align 8, !tbaa !11 %add120.i = add nsw i64 %i107.0216.i, %idxprom.i %arrayidx121.i = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %add120.i store i64 %82, ptr %arrayidx121.i, align 8, !tbaa !11 %inc123.i = add nuw nsw i64 %i107.0216.i, 1 %arrayidx116.i.1 = getelementptr inbounds %struct.block, ptr %62, i64 0, i32 1, i64 %inc123.i %83 = load i64, ptr %arrayidx116.i.1, align 8, !tbaa !11 %add120.i.1 = add nsw i64 %inc123.i, %idxprom.i %arrayidx121.i.1 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %add120.i.1 store i64 %83, ptr %arrayidx121.i.1, align 8, !tbaa !11 %inc123.i.1 = add nuw nsw i64 %i107.0216.i, 2 %arrayidx116.i.2 = getelementptr inbounds %struct.block, ptr %62, i64 0, i32 1, i64 %inc123.i.1 %84 = load i64, ptr %arrayidx116.i.2, align 8, !tbaa !11 %add120.i.2 = add nsw i64 %inc123.i.1, %idxprom.i %arrayidx121.i.2 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %add120.i.2 store i64 %84, ptr %arrayidx121.i.2, align 8, !tbaa !11 %inc123.i.2 = add nuw nsw i64 %i107.0216.i, 3 %arrayidx116.i.3 = getelementptr inbounds %struct.block, ptr %62, i64 0, i32 1, i64 %inc123.i.2 %85 = load i64, ptr %arrayidx116.i.3, align 8, !tbaa !11 %add120.i.3 = add nsw i64 %inc123.i.2, %idxprom.i %arrayidx121.i.3 = getelementptr inbounds %struct.block, ptr %b.tr.i, i64 0, i32 1, i64 %add120.i.3 store i64 %85, ptr %arrayidx121.i.3, align 8, !tbaa !11 %inc123.i.3 = add nuw nsw i64 %i107.0216.i, 4 %exitcond229.not.i.3 = icmp eq i64 %inc123.i.3, %conv110.i br i1 %exitcond229.not.i.3, label %for.cond.cleanup113.i, label %for.body114.i, !llvm.loop !44 return.sink.split.sink.split.i: ; preds = %for.cond.cleanup113.i, %for.cond.cleanup.i, %if.then40.i %.sink.i = phi ptr [ %39, %if.then40.i ], [ %57, %for.cond.cleanup.i ], [ %81, %for.cond.cleanup113.i ] %b.tr.lcssa.sink234.i = phi ptr [ %36, %if.then40.i ], [ %36, %for.cond.cleanup.i ], [ %b.tr.i, %for.cond.cleanup113.i ] %b.tr.lcssa.sink.ph.i = phi ptr [ %b.tr.i, %if.then40.i ], [ %b.tr.i, %for.cond.cleanup.i ], [ %62, %for.cond.cleanup113.i ] %pre134.i = getelementptr inbounds %struct.block, ptr %.sink.i, i64 0, i32 2 store ptr %b.tr.lcssa.sink234.i, ptr %pre134.i, align 8, !tbaa !21 br label %return.sink.split.i return.sink.split.i: ; preds = %return.sink.split.sink.split.i, %for.cond.cleanup113.i, %for.cond.cleanup.i, %if.then40.i %b.tr.lcssa.sink.i = phi ptr [ %b.tr.i, %if.then40.i ], [ %b.tr.i, %for.cond.cleanup.i ], [ %62, %for.cond.cleanup113.i ], [ %b.tr.lcssa.sink.ph.i, %return.sink.split.sink.split.i ] call void @free(ptr noundef nonnull %b.tr.lcssa.sink.i) #11 br label %if.end tailrecurse.i56: ; preds = %while.body, %land.lhs.true.i60 %b.tr.i57 = phi ptr [ %86, %land.lhs.true.i60 ], [ @b, %while.body ] %nxt.i58 = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 3 %86 = load ptr, ptr %nxt.i58, align 8, !tbaa !5 %tobool.not.i59 = icmp eq ptr %86, null br i1 %tobool.not.i59, label %if.end.i, label %land.lhs.true.i60 land.lhs.true.i60: ; preds = %tailrecurse.i56 %a.i = getelementptr inbounds %struct.block, ptr %86, i64 0, i32 1 %87 = load i64, ptr %a.i, align 8, !tbaa !11 %cmp.i61 = icmp slt i64 %87, %14 br i1 %cmp.i61, label %tailrecurse.i56, label %if.end.i if.end.i: ; preds = %land.lhs.true.i60, %tailrecurse.i56 %b.tr.i57.lcssa137 = ptrtoint ptr %b.tr.i57 to i64 %nxt.i58.le = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 3 %88 = load i32, ptr %b.tr.i57, align 8, !tbaa !13 %cmp379.i = icmp sgt i32 %88, 0 br i1 %cmp379.i, label %land.rhs.preheader.i, label %for.end.thread.i for.end.thread.i: ; preds = %if.end.i %idxprom1586.i = sext i32 %88 to i64 %arrayidx1687.i = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %idxprom1586.i store i64 %14, ptr %arrayidx1687.i, align 8, !tbaa !11 %inc88.i = add nsw i32 %88, 1 store i32 %inc88.i, ptr %b.tr.i57, align 8, !tbaa !13 br label %if.end land.rhs.preheader.i: ; preds = %if.end.i %89 = zext i32 %88 to i64 br label %land.rhs.i land.rhs.i: ; preds = %for.body.i, %land.rhs.preheader.i %indvars.iv.i62 = phi i64 [ %89, %land.rhs.preheader.i ], [ %indvars.iv.next.i63, %for.body.i ] %indvars.iv.next.i63 = add nsw i64 %indvars.iv.i62, -1 %idxprom.i64 = and i64 %indvars.iv.next.i63, 4294967295 %arrayidx5.i = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %idxprom.i64 %90 = load i64, ptr %arrayidx5.i, align 8, !tbaa !11 %cmp6.i = icmp sgt i64 %90, %14 br i1 %cmp6.i, label %for.body.i, label %for.end.split.loop.exit.i for.body.i: ; preds = %land.rhs.i %arrayidx13.i = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %indvars.iv.i62 store i64 %90, ptr %arrayidx13.i, align 8, !tbaa !11 %cmp3.i = icmp ugt i64 %indvars.iv.i62, 1 br i1 %cmp3.i, label %land.rhs.i, label %for.end.i65, !llvm.loop !14 for.end.split.loop.exit.i: ; preds = %land.rhs.i %sext.i = shl i64 %indvars.iv.i62, 32 %91 = ashr exact i64 %sext.i, 32 br label %for.end.i65 for.end.i65: ; preds = %for.body.i, %for.end.split.loop.exit.i %i.0.lcssa.i = phi i64 [ %91, %for.end.split.loop.exit.i ], [ 0, %for.body.i ] %arrayidx16.i = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %i.0.lcssa.i store i64 %14, ptr %arrayidx16.i, align 8, !tbaa !11 %inc.i = add nsw i32 %88, 1 store i32 %inc.i, ptr %b.tr.i57, align 8, !tbaa !13 %cmp19.i = icmp sgt i32 %88, 898 br i1 %cmp19.i, label %if.then20.i, label %if.end if.then20.i: ; preds = %for.end.i65 %call.i = call noalias dereferenceable_or_null(7232) ptr @malloc(i64 noundef 7232) #10 store i32 450, ptr %call.i, align 8, !tbaa !13 %call.i136 = ptrtoint ptr %call.i to i64 %92 = sub i64 %call.i136, %b.tr.i57.lcssa137 %93 = add i64 %92, -3632 %diff.check = icmp ult i64 %93, -32 br i1 %diff.check, label %vector.body142, label %for.body25.i66.prol.preheader for.body25.i66.prol.preheader: ; preds = %if.then20.i, %vector.body142 %i22.082.i.ph = phi i64 [ 0, %if.then20.i ], [ 448, %vector.body142 ] br label %for.body25.i66.prol for.body25.i66.prol: ; preds = %for.body25.i66.prol, %for.body25.i66.prol.preheader %i22.082.i.prol = phi i64 [ %inc31.i.prol, %for.body25.i66.prol ], [ %i22.082.i.ph, %for.body25.i66.prol.preheader ] %prol.iter211 = phi i64 [ %prol.iter211.next, %for.body25.i66.prol ], [ 0, %for.body25.i66.prol.preheader ] %add.i.prol = add nuw nsw i64 %i22.082.i.prol, 450 %arrayidx27.i.prol = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %add.i.prol %94 = load i64, ptr %arrayidx27.i.prol, align 8, !tbaa !11 %arrayidx29.i.prol = getelementptr inbounds %struct.block, ptr %call.i, i64 0, i32 1, i64 %i22.082.i.prol store i64 %94, ptr %arrayidx29.i.prol, align 8, !tbaa !11 %inc31.i.prol = add nuw nsw i64 %i22.082.i.prol, 1 %prol.iter211.next = add i64 %prol.iter211, 1 %prol.iter211.cmp.not = icmp eq i64 %prol.iter211.next, 2 br i1 %prol.iter211.cmp.not, label %for.body25.i66.prol.loopexit, label %for.body25.i66.prol, !llvm.loop !45 for.body25.i66.prol.loopexit: ; preds = %for.body25.i66.prol br i1 %diff.check, label %for.cond.cleanup.i68, label %for.body25.i66 vector.body142: ; preds = %if.then20.i, %vector.body142 %index143 = phi i64 [ %index.next145.1, %vector.body142 ], [ 0, %if.then20.i ] %95 = add nuw nsw i64 %index143, 450 %96 = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %95 %wide.load = load <2 x i64>, ptr %96, align 8, !tbaa !11 %97 = getelementptr inbounds i64, ptr %96, i64 2 %wide.load144 = load <2 x i64>, ptr %97, align 8, !tbaa !11 %98 = getelementptr inbounds %struct.block, ptr %call.i, i64 0, i32 1, i64 %index143 store <2 x i64> %wide.load, ptr %98, align 8, !tbaa !11 %99 = getelementptr inbounds i64, ptr %98, i64 2 store <2 x i64> %wide.load144, ptr %99, align 8, !tbaa !11 %index.next145 = or i64 %index143, 4 %100 = add nuw nsw i64 %index143, 454 %101 = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %100 %wide.load.1 = load <2 x i64>, ptr %101, align 8, !tbaa !11 %102 = getelementptr inbounds i64, ptr %101, i64 2 %wide.load144.1 = load <2 x i64>, ptr %102, align 8, !tbaa !11 %103 = getelementptr inbounds %struct.block, ptr %call.i, i64 0, i32 1, i64 %index.next145 store <2 x i64> %wide.load.1, ptr %103, align 8, !tbaa !11 %104 = getelementptr inbounds i64, ptr %103, i64 2 store <2 x i64> %wide.load144.1, ptr %104, align 8, !tbaa !11 %index.next145.1 = add nuw nsw i64 %index143, 8 %105 = icmp eq i64 %index.next145.1, 448 br i1 %105, label %for.body25.i66.prol.preheader, label %vector.body142, !llvm.loop !46 for.cond.cleanup.i68: ; preds = %for.body25.i66, %for.body25.i66.prol.loopexit %pre.i69 = getelementptr inbounds %struct.block, ptr %call.i, i64 0, i32 2 store ptr %b.tr.i57, ptr %pre.i69, align 8, !tbaa !21 %nxt34.i = getelementptr inbounds %struct.block, ptr %call.i, i64 0, i32 3 store ptr %86, ptr %nxt34.i, align 8, !tbaa !5 br i1 %tobool.not.i59, label %if.end40.i, label %if.then37.i for.body25.i66: ; preds = %for.body25.i66.prol.loopexit, %for.body25.i66 %i22.082.i = phi i64 [ %inc31.i.3, %for.body25.i66 ], [ %inc31.i.prol, %for.body25.i66.prol.loopexit ] %add.i = add nuw nsw i64 %i22.082.i, 450 %arrayidx27.i = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %add.i %106 = load i64, ptr %arrayidx27.i, align 8, !tbaa !11 %arrayidx29.i = getelementptr inbounds %struct.block, ptr %call.i, i64 0, i32 1, i64 %i22.082.i store i64 %106, ptr %arrayidx29.i, align 8, !tbaa !11 %inc31.i = add nuw nsw i64 %i22.082.i, 1 %add.i.1 = add nuw nsw i64 %i22.082.i, 451 %arrayidx27.i.1 = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %add.i.1 %107 = load i64, ptr %arrayidx27.i.1, align 8, !tbaa !11 %arrayidx29.i.1 = getelementptr inbounds %struct.block, ptr %call.i, i64 0, i32 1, i64 %inc31.i store i64 %107, ptr %arrayidx29.i.1, align 8, !tbaa !11 %inc31.i.1 = add nuw nsw i64 %i22.082.i, 2 %add.i.2 = add nuw nsw i64 %i22.082.i, 452 %arrayidx27.i.2 = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %add.i.2 %108 = load i64, ptr %arrayidx27.i.2, align 8, !tbaa !11 %arrayidx29.i.2 = getelementptr inbounds %struct.block, ptr %call.i, i64 0, i32 1, i64 %inc31.i.1 store i64 %108, ptr %arrayidx29.i.2, align 8, !tbaa !11 %inc31.i.2 = add nuw nsw i64 %i22.082.i, 3 %add.i.3 = add nuw nsw i64 %i22.082.i, 453 %arrayidx27.i.3 = getelementptr inbounds %struct.block, ptr %b.tr.i57, i64 0, i32 1, i64 %add.i.3 %109 = load i64, ptr %arrayidx27.i.3, align 8, !tbaa !11 %arrayidx29.i.3 = getelementptr inbounds %struct.block, ptr %call.i, i64 0, i32 1, i64 %inc31.i.2 store i64 %109, ptr %arrayidx29.i.3, align 8, !tbaa !11 %inc31.i.3 = add nuw nsw i64 %i22.082.i, 4 %exitcond.not.i67.3 = icmp eq i64 %inc31.i.3, 450 br i1 %exitcond.not.i67.3, label %for.cond.cleanup.i68, label %for.body25.i66, !llvm.loop !47 if.then37.i: ; preds = %for.cond.cleanup.i68 %pre39.i = getelementptr inbounds %struct.block, ptr %86, i64 0, i32 2 store ptr %call.i, ptr %pre39.i, align 8, !tbaa !21 br label %if.end40.i if.end40.i: ; preds = %if.then37.i, %for.cond.cleanup.i68 store i32 450, ptr %b.tr.i57, align 8, !tbaa !13 store ptr %call.i, ptr %nxt.i58.le, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then.i, %if.end40.i, %for.end.i65, %for.end.thread.i, %return.sink.split.i, %land.lhs.true98.i, %if.else95.i, %for.end.i %inc35 = add nsw i64 %crr.193, 1 %110 = load i64, ptr %n, align 8, !tbaa !11 %mul23 = shl nsw i64 %110, 1 %cmp24 = icmp slt i64 %inc35, %mul23 br i1 %cmp24, label %land.rhs, label %while.end, !llvm.loop !48 while.end: ; preds = %land.rhs, %if.end, %for.body21 %crr.1.lcssa = phi i64 [ %crr.097, %for.body21 ], [ %inc35, %if.end ], [ %crr.193, %land.rhs ] %111 = load i32, ptr @b, align 8, !tbaa !13 %cmp.not13.i = icmp sgt i32 %111, 0 br i1 %cmp.not13.i, label %if.end.i74, label %if.then.i70 if.then.i70: ; preds = %while.end, %if.then1.i %112 = phi i32 [ %114, %if.then1.i ], [ %111, %while.end ] %k.tr15.i = phi i32 [ %sub.i73, %if.then1.i ], [ 0, %while.end ] %b.tr14.i = phi ptr [ %113, %if.then1.i ], [ @b, %while.end ] %nxt.i71 = getelementptr inbounds %struct.block, ptr %b.tr14.i, i64 0, i32 3 %113 = load ptr, ptr %nxt.i71, align 8, !tbaa !5 %tobool.not.i72 = icmp eq ptr %113, null br i1 %tobool.not.i72, label %Bans.exit, label %if.then1.i if.then1.i: ; preds = %if.then.i70 %sub.i73 = sub nsw i32 %k.tr15.i, %112 %114 = load i32, ptr %113, align 8, !tbaa !13 %cmp.not.i = icmp sgt i32 %114, %sub.i73 br i1 %cmp.not.i, label %if.end.i74, label %if.then.i70 if.end.i74: ; preds = %if.then1.i, %while.end %b.tr.lcssa.i = phi ptr [ @b, %while.end ], [ %113, %if.then1.i ] %k.tr.lcssa.i = phi i32 [ 0, %while.end ], [ %sub.i73, %if.then1.i ] %idxprom.i75 = sext i32 %k.tr.lcssa.i to i64 %arrayidx.i76 = getelementptr inbounds %struct.block, ptr %b.tr.lcssa.i, i64 0, i32 1, i64 %idxprom.i75 %115 = load i64, ptr %arrayidx.i76, align 8, !tbaa !11 br label %Bans.exit Bans.exit: ; preds = %if.then.i70, %if.end.i74 %retval.0.i = phi i64 [ %115, %if.end.i74 ], [ -1, %if.then.i70 ] %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %retval.0.i) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #11 %inc39 = add nuw nsw i64 %_.098, 1 %116 = load i64, ptr %q, align 8, !tbaa !11 %cmp19 = icmp slt i64 %inc39, %116 br i1 %cmp19, label %for.body21, label %for.cond.cleanup20, !llvm.loop !49 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #9 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 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 #3 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind allocsize(0) } 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, !10, i64 7224} !6 = !{!"block", !7, i64 0, !8, i64 8, !10, i64 7216, !10, i64 7224} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!"any pointer", !8, i64 0} !11 = !{!12, !12, i64 0} !12 = !{!"long long", !8, i64 0} !13 = !{!6, !7, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !15, !19, !20} !19 = !{!"llvm.loop.isvectorized", i32 1} !20 = !{!"llvm.loop.unroll.runtime.disable"} !21 = !{!6, !10, i64 7216} !22 = distinct !{!22, !15, !19} !23 = distinct !{!23, !15} !24 = distinct !{!24, !15, !19, !20} !25 = distinct !{!25, !17} !26 = distinct !{!26, !15, !19} !27 = distinct !{!27, !15, !19, !20} !28 = distinct !{!28, !17} !29 = distinct !{!29, !15, !19} !30 = distinct !{!30, !15, !19, !20} !31 = distinct !{!31, !17} !32 = distinct !{!32, !15, !19} !33 = distinct !{!33, !15, !19, !20} !34 = distinct !{!34, !15} !35 = distinct !{!35, !15, !20, !19} !36 = distinct !{!36, !15, !19, !20} !37 = distinct !{!37, !17} !38 = distinct !{!38, !15, !19} !39 = distinct !{!39, !15, !19, !20} !40 = distinct !{!40, !17} !41 = distinct !{!41, !15, !19} !42 = distinct !{!42, !15, !19, !20} !43 = distinct !{!43, !17} !44 = distinct !{!44, !15, !19} !45 = distinct !{!45, !17} !46 = distinct !{!46, !15, !19, !20} !47 = distinct !{!47, !15, !19} !48 = distinct !{!48, !15} !49 = distinct !{!49, !15}
#include<stdio.h> #include<string.h> void a(char *s){ int l=strlen(s),i; for(i = 0;i<l/2;i++){ char t=s[i]; s[i] = s[l - i -1]; s[l-1-i]=t; } } char T[4][8]={"dream","dreamer","erase","eraser"}; int main(){ int i =0,c,l; char s[100001]; for(i=0;i<4;i++)a(T[i]); scanf("%s",s); l = strlen(s); a(s); for(;c<l;){ int k=-1; for(i = 0;i < 4;i++){ if(!strncmp(s+c,T[i],strlen(T[i]))){ k = strlen(T[i]); break; } } if(k < 0){ puts("NO"); return 0; } c += k; } puts("YES"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150432/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150432/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @T = dso_local global [4 x [8 x i8]] [[8 x i8] c"dream\00\00\00", [8 x i8] c"dreamer\00", [8 x i8] c"erase\00\00\00", [8 x i8] c"eraser\00\00"], align 16 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable define dso_local void @a(ptr nocapture noundef %s) local_unnamed_addr #0 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5 %conv = trunc i64 %call to i32 %cmp22 = icmp sgt i32 %conv, 1 br i1 %cmp22, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %div2526 = lshr i64 %call, 1 %wide.trip.count = and i64 %div2526, 2147483647 %xtraiter = and i64 %div2526, 1 %0 = icmp eq i64 %wide.trip.count, 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 = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %2 = xor i64 %indvars.iv, -1 %sub2 = add i64 %call, %2 %sext = shl i64 %sub2, 32 %idxprom3 = ashr exact i64 %sext, 32 %arrayidx4 = getelementptr inbounds i8, ptr %s, i64 %idxprom3 %3 = load i8, ptr %arrayidx4, align 1, !tbaa !5 store i8 %3, ptr %arrayidx, align 1, !tbaa !5 store i8 %1, ptr %arrayidx4, align 1, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %5 = xor i64 %indvars.iv, 4294967294 %sub2.1 = add i64 %call, %5 %sext.1 = shl i64 %sub2.1, 32 %idxprom3.1 = ashr exact i64 %sext.1, 32 %arrayidx4.1 = getelementptr inbounds i8, ptr %s, i64 %idxprom3.1 %6 = load i8, ptr %arrayidx4.1, align 1, !tbaa !5 store i8 %6, ptr %arrayidx.1, align 1, !tbaa !5 store i8 %4, ptr %arrayidx4.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 %s, i64 %indvars.iv.unr %7 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 %8 = xor i64 %indvars.iv.unr, -1 %sub2.epil = add i64 %call, %8 %sext.epil = shl i64 %sub2.epil, 32 %idxprom3.epil = ashr exact i64 %sext.epil, 32 %arrayidx4.epil = getelementptr inbounds i8, ptr %s, i64 %idxprom3.epil %9 = load i8, ptr %arrayidx4.epil, align 1, !tbaa !5 store i8 %9, ptr %arrayidx.epil, align 1, !tbaa !5 store i8 %7, ptr %arrayidx4.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 nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(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 uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %s = alloca [100001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #6 %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @T) #5 %conv.i = trunc i64 %call.i to i32 %cmp22.i = icmp sgt i32 %conv.i, 1 br i1 %cmp22.i, label %for.body.preheader.i, label %a.exit for.body.preheader.i: ; preds = %entry %div2526.i = lshr i64 %call.i, 1 %wide.trip.count.i = and i64 %div2526.i, 2147483647 %xtraiter = and i64 %div2526.i, 1 %0 = icmp eq i64 %wide.trip.count.i, 1 br i1 %0, label %a.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.184, %for.body.i ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ] %arrayidx.i = getelementptr inbounds i8, ptr @T, i64 %indvars.iv.i %1 = load i8, ptr %arrayidx.i, align 2, !tbaa !5 %2 = xor i64 %indvars.iv.i, -1 %sub2.i = add i64 %call.i, %2 %sext.i = shl i64 %sub2.i, 32 %idxprom3.i = ashr exact i64 %sext.i, 32 %arrayidx4.i = getelementptr inbounds i8, ptr @T, i64 %idxprom3.i %3 = load i8, ptr %arrayidx4.i, align 1, !tbaa !5 store i8 %3, ptr %arrayidx.i, align 2, !tbaa !5 store i8 %1, ptr %arrayidx4.i, align 1, !tbaa !5 %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.179 = getelementptr inbounds i8, ptr @T, i64 %indvars.iv.next.i %4 = load i8, ptr %arrayidx.i.179, align 1, !tbaa !5 %5 = xor i64 %indvars.iv.i, 4294967294 %sub2.i.180 = add i64 %call.i, %5 %sext.i.181 = shl i64 %sub2.i.180, 32 %idxprom3.i.182 = ashr exact i64 %sext.i.181, 32 %arrayidx4.i.183 = getelementptr inbounds i8, ptr @T, i64 %idxprom3.i.182 %6 = load i8, ptr %arrayidx4.i.183, align 1, !tbaa !5 store i8 %6, ptr %arrayidx.i.179, align 1, !tbaa !5 store i8 %4, ptr %arrayidx4.i.183, align 1, !tbaa !5 %indvars.iv.next.i.184 = 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 %a.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 a.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.184, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %a.exit, label %for.body.i.epil for.body.i.epil: ; preds = %a.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr @T, i64 %indvars.iv.i.unr %7 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 %8 = xor i64 %indvars.iv.i.unr, -1 %sub2.i.epil = add i64 %call.i, %8 %sext.i.epil = shl i64 %sub2.i.epil, 32 %idxprom3.i.epil = ashr exact i64 %sext.i.epil, 32 %arrayidx4.i.epil = getelementptr inbounds i8, ptr @T, i64 %idxprom3.i.epil %9 = load i8, ptr %arrayidx4.i.epil, align 1, !tbaa !5 store i8 %9, ptr %arrayidx.i.epil, align 1, !tbaa !5 store i8 %7, ptr %arrayidx4.i.epil, align 1, !tbaa !5 br label %a.exit a.exit: ; preds = %for.body.i.epil, %a.exit.loopexit.unr-lcssa, %entry %call.i.1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 1)) #5 %conv.i.1 = trunc i64 %call.i.1 to i32 %cmp22.i.1 = icmp sgt i32 %conv.i.1, 1 br i1 %cmp22.i.1, label %for.body.preheader.i.1, label %a.exit.1 for.body.preheader.i.1: ; preds = %a.exit %div2526.i.1 = lshr i64 %call.i.1, 1 %wide.trip.count.i.1 = and i64 %div2526.i.1, 2147483647 %xtraiter87 = and i64 %div2526.i.1, 1 %10 = icmp eq i64 %wide.trip.count.i.1, 1 br i1 %10, label %a.exit.1.loopexit.unr-lcssa, label %for.body.preheader.i.1.new for.body.preheader.i.1.new: ; preds = %for.body.preheader.i.1 %unroll_iter89 = sub nsw i64 %wide.trip.count.i.1, %xtraiter87 br label %for.body.i.1 for.body.i.1: ; preds = %for.body.i.1, %for.body.preheader.i.1.new %indvars.iv.i.1 = phi i64 [ 0, %for.body.preheader.i.1.new ], [ %indvars.iv.next.i.1.1, %for.body.i.1 ] %niter90 = phi i64 [ 0, %for.body.preheader.i.1.new ], [ %niter90.next.1, %for.body.i.1 ] %arrayidx.i.1 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 1), i64 %indvars.iv.i.1 %11 = load i8, ptr %arrayidx.i.1, align 2, !tbaa !5 %12 = xor i64 %indvars.iv.i.1, -1 %sub2.i.1 = add i64 %call.i.1, %12 %sext.i.1 = shl i64 %sub2.i.1, 32 %idxprom3.i.1 = ashr exact i64 %sext.i.1, 32 %arrayidx4.i.1 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 1), i64 %idxprom3.i.1 %13 = load i8, ptr %arrayidx4.i.1, align 1, !tbaa !5 store i8 %13, ptr %arrayidx.i.1, align 2, !tbaa !5 store i8 %11, ptr %arrayidx4.i.1, align 1, !tbaa !5 %indvars.iv.next.i.1 = or i64 %indvars.iv.i.1, 1 %arrayidx.i.1.1 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 1), i64 %indvars.iv.next.i.1 %14 = load i8, ptr %arrayidx.i.1.1, align 1, !tbaa !5 %15 = xor i64 %indvars.iv.i.1, 4294967294 %sub2.i.1.1 = add i64 %call.i.1, %15 %sext.i.1.1 = shl i64 %sub2.i.1.1, 32 %idxprom3.i.1.1 = ashr exact i64 %sext.i.1.1, 32 %arrayidx4.i.1.1 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 1), i64 %idxprom3.i.1.1 %16 = load i8, ptr %arrayidx4.i.1.1, align 1, !tbaa !5 store i8 %16, ptr %arrayidx.i.1.1, align 1, !tbaa !5 store i8 %14, ptr %arrayidx4.i.1.1, align 1, !tbaa !5 %indvars.iv.next.i.1.1 = add nuw nsw i64 %indvars.iv.i.1, 2 %niter90.next.1 = add i64 %niter90, 2 %niter90.ncmp.1 = icmp eq i64 %niter90.next.1, %unroll_iter89 br i1 %niter90.ncmp.1, label %a.exit.1.loopexit.unr-lcssa, label %for.body.i.1, !llvm.loop !8 a.exit.1.loopexit.unr-lcssa: ; preds = %for.body.i.1, %for.body.preheader.i.1 %indvars.iv.i.1.unr = phi i64 [ 0, %for.body.preheader.i.1 ], [ %indvars.iv.next.i.1.1, %for.body.i.1 ] %lcmp.mod88.not = icmp eq i64 %xtraiter87, 0 br i1 %lcmp.mod88.not, label %a.exit.1, label %for.body.i.1.epil for.body.i.1.epil: ; preds = %a.exit.1.loopexit.unr-lcssa %arrayidx.i.1.epil = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 1), i64 %indvars.iv.i.1.unr %17 = load i8, ptr %arrayidx.i.1.epil, align 1, !tbaa !5 %18 = xor i64 %indvars.iv.i.1.unr, -1 %sub2.i.1.epil = add i64 %call.i.1, %18 %sext.i.1.epil = shl i64 %sub2.i.1.epil, 32 %idxprom3.i.1.epil = ashr exact i64 %sext.i.1.epil, 32 %arrayidx4.i.1.epil = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 1), i64 %idxprom3.i.1.epil %19 = load i8, ptr %arrayidx4.i.1.epil, align 1, !tbaa !5 store i8 %19, ptr %arrayidx.i.1.epil, align 1, !tbaa !5 store i8 %17, ptr %arrayidx4.i.1.epil, align 1, !tbaa !5 br label %a.exit.1 a.exit.1: ; preds = %for.body.i.1.epil, %a.exit.1.loopexit.unr-lcssa, %a.exit %call.i.2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 2)) #5 %conv.i.2 = trunc i64 %call.i.2 to i32 %cmp22.i.2 = icmp sgt i32 %conv.i.2, 1 br i1 %cmp22.i.2, label %for.body.preheader.i.2, label %a.exit.2 for.body.preheader.i.2: ; preds = %a.exit.1 %div2526.i.2 = lshr i64 %call.i.2, 1 %wide.trip.count.i.2 = and i64 %div2526.i.2, 2147483647 %xtraiter91 = and i64 %div2526.i.2, 1 %20 = icmp eq i64 %wide.trip.count.i.2, 1 br i1 %20, label %a.exit.2.loopexit.unr-lcssa, label %for.body.preheader.i.2.new for.body.preheader.i.2.new: ; preds = %for.body.preheader.i.2 %unroll_iter93 = sub nsw i64 %wide.trip.count.i.2, %xtraiter91 br label %for.body.i.2 for.body.i.2: ; preds = %for.body.i.2, %for.body.preheader.i.2.new %indvars.iv.i.2 = phi i64 [ 0, %for.body.preheader.i.2.new ], [ %indvars.iv.next.i.2.1, %for.body.i.2 ] %niter94 = phi i64 [ 0, %for.body.preheader.i.2.new ], [ %niter94.next.1, %for.body.i.2 ] %arrayidx.i.2 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 2), i64 %indvars.iv.i.2 %21 = load i8, ptr %arrayidx.i.2, align 2, !tbaa !5 %22 = xor i64 %indvars.iv.i.2, -1 %sub2.i.2 = add i64 %call.i.2, %22 %sext.i.2 = shl i64 %sub2.i.2, 32 %idxprom3.i.2 = ashr exact i64 %sext.i.2, 32 %arrayidx4.i.2 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 2), i64 %idxprom3.i.2 %23 = load i8, ptr %arrayidx4.i.2, align 1, !tbaa !5 store i8 %23, ptr %arrayidx.i.2, align 2, !tbaa !5 store i8 %21, ptr %arrayidx4.i.2, align 1, !tbaa !5 %indvars.iv.next.i.2 = or i64 %indvars.iv.i.2, 1 %arrayidx.i.2.1 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 2), i64 %indvars.iv.next.i.2 %24 = load i8, ptr %arrayidx.i.2.1, align 1, !tbaa !5 %25 = xor i64 %indvars.iv.i.2, 4294967294 %sub2.i.2.1 = add i64 %call.i.2, %25 %sext.i.2.1 = shl i64 %sub2.i.2.1, 32 %idxprom3.i.2.1 = ashr exact i64 %sext.i.2.1, 32 %arrayidx4.i.2.1 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 2), i64 %idxprom3.i.2.1 %26 = load i8, ptr %arrayidx4.i.2.1, align 1, !tbaa !5 store i8 %26, ptr %arrayidx.i.2.1, align 1, !tbaa !5 store i8 %24, ptr %arrayidx4.i.2.1, align 1, !tbaa !5 %indvars.iv.next.i.2.1 = add nuw nsw i64 %indvars.iv.i.2, 2 %niter94.next.1 = add i64 %niter94, 2 %niter94.ncmp.1 = icmp eq i64 %niter94.next.1, %unroll_iter93 br i1 %niter94.ncmp.1, label %a.exit.2.loopexit.unr-lcssa, label %for.body.i.2, !llvm.loop !8 a.exit.2.loopexit.unr-lcssa: ; preds = %for.body.i.2, %for.body.preheader.i.2 %indvars.iv.i.2.unr = phi i64 [ 0, %for.body.preheader.i.2 ], [ %indvars.iv.next.i.2.1, %for.body.i.2 ] %lcmp.mod92.not = icmp eq i64 %xtraiter91, 0 br i1 %lcmp.mod92.not, label %a.exit.2, label %for.body.i.2.epil for.body.i.2.epil: ; preds = %a.exit.2.loopexit.unr-lcssa %arrayidx.i.2.epil = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 2), i64 %indvars.iv.i.2.unr %27 = load i8, ptr %arrayidx.i.2.epil, align 1, !tbaa !5 %28 = xor i64 %indvars.iv.i.2.unr, -1 %sub2.i.2.epil = add i64 %call.i.2, %28 %sext.i.2.epil = shl i64 %sub2.i.2.epil, 32 %idxprom3.i.2.epil = ashr exact i64 %sext.i.2.epil, 32 %arrayidx4.i.2.epil = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 2), i64 %idxprom3.i.2.epil %29 = load i8, ptr %arrayidx4.i.2.epil, align 1, !tbaa !5 store i8 %29, ptr %arrayidx.i.2.epil, align 1, !tbaa !5 store i8 %27, ptr %arrayidx4.i.2.epil, align 1, !tbaa !5 br label %a.exit.2 a.exit.2: ; preds = %for.body.i.2.epil, %a.exit.2.loopexit.unr-lcssa, %a.exit.1 %call.i.3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 3)) #5 %conv.i.3 = trunc i64 %call.i.3 to i32 %cmp22.i.3 = icmp sgt i32 %conv.i.3, 1 br i1 %cmp22.i.3, label %for.body.preheader.i.3, label %a.exit.3 for.body.preheader.i.3: ; preds = %a.exit.2 %div2526.i.3 = lshr i64 %call.i.3, 1 %wide.trip.count.i.3 = and i64 %div2526.i.3, 2147483647 %xtraiter95 = and i64 %div2526.i.3, 1 %30 = icmp eq i64 %wide.trip.count.i.3, 1 br i1 %30, label %a.exit.3.loopexit.unr-lcssa, label %for.body.preheader.i.3.new for.body.preheader.i.3.new: ; preds = %for.body.preheader.i.3 %unroll_iter97 = sub nsw i64 %wide.trip.count.i.3, %xtraiter95 br label %for.body.i.3 for.body.i.3: ; preds = %for.body.i.3, %for.body.preheader.i.3.new %indvars.iv.i.3 = phi i64 [ 0, %for.body.preheader.i.3.new ], [ %indvars.iv.next.i.3.1, %for.body.i.3 ] %niter98 = phi i64 [ 0, %for.body.preheader.i.3.new ], [ %niter98.next.1, %for.body.i.3 ] %arrayidx.i.3 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 3), i64 %indvars.iv.i.3 %31 = load i8, ptr %arrayidx.i.3, align 2, !tbaa !5 %32 = xor i64 %indvars.iv.i.3, -1 %sub2.i.3 = add i64 %call.i.3, %32 %sext.i.3 = shl i64 %sub2.i.3, 32 %idxprom3.i.3 = ashr exact i64 %sext.i.3, 32 %arrayidx4.i.3 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 3), i64 %idxprom3.i.3 %33 = load i8, ptr %arrayidx4.i.3, align 1, !tbaa !5 store i8 %33, ptr %arrayidx.i.3, align 2, !tbaa !5 store i8 %31, ptr %arrayidx4.i.3, align 1, !tbaa !5 %indvars.iv.next.i.3 = or i64 %indvars.iv.i.3, 1 %arrayidx.i.3.1 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 3), i64 %indvars.iv.next.i.3 %34 = load i8, ptr %arrayidx.i.3.1, align 1, !tbaa !5 %35 = xor i64 %indvars.iv.i.3, 4294967294 %sub2.i.3.1 = add i64 %call.i.3, %35 %sext.i.3.1 = shl i64 %sub2.i.3.1, 32 %idxprom3.i.3.1 = ashr exact i64 %sext.i.3.1, 32 %arrayidx4.i.3.1 = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 3), i64 %idxprom3.i.3.1 %36 = load i8, ptr %arrayidx4.i.3.1, align 1, !tbaa !5 store i8 %36, ptr %arrayidx.i.3.1, align 1, !tbaa !5 store i8 %34, ptr %arrayidx4.i.3.1, align 1, !tbaa !5 %indvars.iv.next.i.3.1 = add nuw nsw i64 %indvars.iv.i.3, 2 %niter98.next.1 = add i64 %niter98, 2 %niter98.ncmp.1 = icmp eq i64 %niter98.next.1, %unroll_iter97 br i1 %niter98.ncmp.1, label %a.exit.3.loopexit.unr-lcssa, label %for.body.i.3, !llvm.loop !8 a.exit.3.loopexit.unr-lcssa: ; preds = %for.body.i.3, %for.body.preheader.i.3 %indvars.iv.i.3.unr = phi i64 [ 0, %for.body.preheader.i.3 ], [ %indvars.iv.next.i.3.1, %for.body.i.3 ] %lcmp.mod96.not = icmp eq i64 %xtraiter95, 0 br i1 %lcmp.mod96.not, label %a.exit.3, label %for.body.i.3.epil for.body.i.3.epil: ; preds = %a.exit.3.loopexit.unr-lcssa %arrayidx.i.3.epil = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 3), i64 %indvars.iv.i.3.unr %37 = load i8, ptr %arrayidx.i.3.epil, align 1, !tbaa !5 %38 = xor i64 %indvars.iv.i.3.unr, -1 %sub2.i.3.epil = add i64 %call.i.3, %38 %sext.i.3.epil = shl i64 %sub2.i.3.epil, 32 %idxprom3.i.3.epil = ashr exact i64 %sext.i.3.epil, 32 %arrayidx4.i.3.epil = getelementptr inbounds i8, ptr getelementptr inbounds ([4 x [8 x i8]], ptr @T, i64 0, i64 3), i64 %idxprom3.i.3.epil %39 = load i8, ptr %arrayidx4.i.3.epil, align 1, !tbaa !5 store i8 %39, ptr %arrayidx.i.3.epil, align 1, !tbaa !5 store i8 %37, ptr %arrayidx4.i.3.epil, align 1, !tbaa !5 br label %a.exit.3 a.exit.3: ; preds = %for.body.i.3.epil, %a.exit.3.loopexit.unr-lcssa, %a.exit.2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5 %conv = trunc i64 %call3 to i32 %cmp22.i53 = icmp sgt i32 %conv, 1 br i1 %cmp22.i53, label %for.body.preheader.i54, label %for.end35 for.body.preheader.i54: ; preds = %a.exit.3 %div2526.i55 = lshr i64 %call3, 1 %wide.trip.count.i56 = and i64 %div2526.i55, 2147483647 %xtraiter99 = and i64 %div2526.i55, 1 %40 = icmp eq i64 %wide.trip.count.i56, 1 br i1 %40, label %for.end35.loopexit.unr-lcssa, label %for.body.preheader.i54.new for.body.preheader.i54.new: ; preds = %for.body.preheader.i54 %unroll_iter101 = sub nsw i64 %wide.trip.count.i56, %xtraiter99 br label %for.body.i57 for.body.i57: ; preds = %for.body.i57, %for.body.preheader.i54.new %indvars.iv.i58 = phi i64 [ 0, %for.body.preheader.i54.new ], [ %indvars.iv.next.i64.1, %for.body.i57 ] %niter102 = phi i64 [ 0, %for.body.preheader.i54.new ], [ %niter102.next.1, %for.body.i57 ] %arrayidx.i59 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.i58 %41 = load i8, ptr %arrayidx.i59, align 2, !tbaa !5 %42 = xor i64 %indvars.iv.i58, -1 %sub2.i60 = add i64 %call3, %42 %sext.i61 = shl i64 %sub2.i60, 32 %idxprom3.i62 = ashr exact i64 %sext.i61, 32 %arrayidx4.i63 = getelementptr inbounds i8, ptr %s, i64 %idxprom3.i62 %43 = load i8, ptr %arrayidx4.i63, align 1, !tbaa !5 store i8 %43, ptr %arrayidx.i59, align 2, !tbaa !5 store i8 %41, ptr %arrayidx4.i63, align 1, !tbaa !5 %indvars.iv.next.i64 = or i64 %indvars.iv.i58, 1 %arrayidx.i59.1 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next.i64 %44 = load i8, ptr %arrayidx.i59.1, align 1, !tbaa !5 %45 = xor i64 %indvars.iv.i58, 4294967294 %sub2.i60.1 = add i64 %call3, %45 %sext.i61.1 = shl i64 %sub2.i60.1, 32 %idxprom3.i62.1 = ashr exact i64 %sext.i61.1, 32 %arrayidx4.i63.1 = getelementptr inbounds i8, ptr %s, i64 %idxprom3.i62.1 %46 = load i8, ptr %arrayidx4.i63.1, align 1, !tbaa !5 store i8 %46, ptr %arrayidx.i59.1, align 1, !tbaa !5 store i8 %44, ptr %arrayidx4.i63.1, align 1, !tbaa !5 %indvars.iv.next.i64.1 = add nuw nsw i64 %indvars.iv.i58, 2 %niter102.next.1 = add i64 %niter102, 2 %niter102.ncmp.1 = icmp eq i64 %niter102.next.1, %unroll_iter101 br i1 %niter102.ncmp.1, label %for.end35.loopexit.unr-lcssa, label %for.body.i57, !llvm.loop !8 for.end35.loopexit.unr-lcssa: ; preds = %for.body.i57, %for.body.preheader.i54 %indvars.iv.i58.unr = phi i64 [ 0, %for.body.preheader.i54 ], [ %indvars.iv.next.i64.1, %for.body.i57 ] %lcmp.mod100.not = icmp eq i64 %xtraiter99, 0 br i1 %lcmp.mod100.not, label %for.end35, label %for.body.i57.epil for.body.i57.epil: ; preds = %for.end35.loopexit.unr-lcssa %arrayidx.i59.epil = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.i58.unr %47 = load i8, ptr %arrayidx.i59.epil, align 1, !tbaa !5 %48 = xor i64 %indvars.iv.i58.unr, -1 %sub2.i60.epil = add i64 %call3, %48 %sext.i61.epil = shl i64 %sub2.i60.epil, 32 %idxprom3.i62.epil = ashr exact i64 %sext.i61.epil, 32 %arrayidx4.i63.epil = getelementptr inbounds i8, ptr %s, i64 %idxprom3.i62.epil %49 = load i8, ptr %arrayidx4.i63.epil, align 1, !tbaa !5 store i8 %49, ptr %arrayidx.i59.epil, align 1, !tbaa !5 store i8 %47, ptr %arrayidx4.i63.epil, align 1, !tbaa !5 br label %for.end35 for.end35: ; preds = %for.body.i57.epil, %for.end35.loopexit.unr-lcssa, %a.exit.3 %call36 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind willreturn memory(read) } 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> #define MAXSIZE 100000 int main(void){ char s[MAXSIZE],d[]="dream",e[]="erase"; scanf("%s",s); int len_s=strlen(s),p=0,i; while(p<len_s){ if(s[p]=='d'){ for(i=0;i<5;i++){ if(s[p]==d[i]){ p++; }else{ printf("NO\n"); return 0; } } if(s[p]=='e'){ p++; if(s[p]=='r'){ p++; if(s[p]=='a') p-=2; } } }else if(s[p]=='e'){ for(i=0;i<5;i++){ if(s[p]==e[i]){ p++; }else{ printf("NO\n"); return 0; } } if(s[p]=='r'){ p++; } }else{ printf("NO\n"); return 0; } } printf("YES\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150476/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150476/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.5 = 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: %s = alloca [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100000, 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 %conv = trunc i64 %call2 to i32 %cmp117 = icmp sgt i32 %conv, 0 br i1 %cmp117, label %while.body, label %cleanup while.body: ; preds = %entry, %if.end81 %p.0118 = phi i32 [ %p.3, %if.end81 ], [ 0, %entry ] %idxprom = sext i32 %p.0118 to i64 %arrayidx = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %idxprom %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %0, label %cleanup [ i8 100, label %if.then17 i8 101, label %if.then62 ] if.then17: ; preds = %while.body %1 = add i32 %p.0118, 5 %2 = add nsw i64 %idxprom, 4 %indvars.iv.next126 = add nsw i64 %idxprom, 1 %arrayidx10.1 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv.next126 %3 = load i8, ptr %arrayidx10.1, align 1, !tbaa !5 %cmp15.1 = icmp eq i8 %3, 114 br i1 %cmp15.1, label %if.then17.1, label %cleanup if.then17.1: ; preds = %if.then17 %indvars.iv.next126.1 = add nsw i64 %idxprom, 2 %arrayidx10.2 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv.next126.1 %4 = load i8, ptr %arrayidx10.2, align 1, !tbaa !5 %cmp15.2 = icmp eq i8 %4, 101 br i1 %cmp15.2, label %if.then17.2, label %cleanup if.then17.2: ; preds = %if.then17.1 %indvars.iv.next126.2 = add nsw i64 %idxprom, 3 %arrayidx10.3 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv.next126.2 %5 = load i8, ptr %arrayidx10.3, align 1, !tbaa !5 %cmp15.3 = icmp eq i8 %5, 97 br i1 %cmp15.3, label %if.then17.3, label %cleanup if.then17.3: ; preds = %if.then17.2 %arrayidx10.4 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %2 %6 = load i8, ptr %arrayidx10.4, align 1, !tbaa !5 %cmp15.4 = icmp eq i8 %6, 109 br i1 %cmp15.4, label %if.then17.4, label %cleanup if.then17.4: ; preds = %if.then17.3 %7 = trunc i64 %2 to i32 %idxprom20 = sext i32 %1 to i64 %arrayidx21 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %idxprom20 %8 = load i8, ptr %arrayidx21, align 1, !tbaa !5 %cmp23 = icmp eq i8 %8, 101 br i1 %cmp23, label %if.then25, label %if.end81 if.then25: ; preds = %if.then17.4 %inc26 = add nsw i32 %7, 2 %idxprom27 = sext i32 %inc26 to i64 %arrayidx28 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %idxprom27 %9 = load i8, ptr %arrayidx28, align 1, !tbaa !5 %cmp30 = icmp eq i8 %9, 114 br i1 %cmp30, label %if.then32, label %if.end81 if.then32: ; preds = %if.then25 %inc33 = add nsw i32 %7, 3 %idxprom34 = sext i32 %inc33 to i64 %arrayidx35 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %idxprom34 %10 = load i8, ptr %arrayidx35, align 1, !tbaa !5 %cmp37 = icmp eq i8 %10, 97 %spec.select = select i1 %cmp37, i32 %1, i32 %inc33 br label %if.end81 if.then62: ; preds = %while.body %11 = add i32 %p.0118, 5 %indvars.iv.next121 = add nsw i64 %idxprom, 1 %arrayidx55.1 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv.next121 %12 = load i8, ptr %arrayidx55.1, align 1, !tbaa !5 %cmp60.1 = icmp eq i8 %12, 114 br i1 %cmp60.1, label %if.then62.1, label %cleanup if.then62.1: ; preds = %if.then62 %indvars.iv.next121.1 = add nsw i64 %idxprom, 2 %arrayidx55.2 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv.next121.1 %13 = load i8, ptr %arrayidx55.2, align 1, !tbaa !5 %cmp60.2 = icmp eq i8 %13, 97 br i1 %cmp60.2, label %if.then62.2, label %cleanup if.then62.2: ; preds = %if.then62.1 %indvars.iv.next121.2 = add nsw i64 %idxprom, 3 %arrayidx55.3 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv.next121.2 %14 = load i8, ptr %arrayidx55.3, align 1, !tbaa !5 %cmp60.3 = icmp eq i8 %14, 115 br i1 %cmp60.3, label %if.then62.3, label %cleanup if.then62.3: ; preds = %if.then62.2 %indvars.iv.next121.3 = add nsw i64 %idxprom, 4 %arrayidx55.4 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv.next121.3 %15 = load i8, ptr %arrayidx55.4, align 1, !tbaa !5 %cmp60.4 = icmp eq i8 %15, 101 br i1 %cmp60.4, label %if.then62.4, label %cleanup if.then62.4: ; preds = %if.then62.3 %idxprom70 = sext i32 %11 to i64 %arrayidx71 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %idxprom70 %16 = load i8, ptr %arrayidx71, align 1, !tbaa !5 %cmp73 = icmp eq i8 %16, 114 %inc76 = zext i1 %cmp73 to i32 %spec.select110 = add nsw i32 %11, %inc76 br label %if.end81 if.end81: ; preds = %if.then62.4, %if.then32, %if.then17.4, %if.then25 %p.3 = phi i32 [ %inc26, %if.then25 ], [ %1, %if.then17.4 ], [ %spec.select, %if.then32 ], [ %spec.select110, %if.then62.4 ] %cmp = icmp slt i32 %p.3, %conv br i1 %cmp, label %while.body, label %cleanup, !llvm.loop !8 cleanup: ; preds = %if.end81, %while.body, %if.then62, %if.then62.1, %if.then62.2, %if.then62.3, %if.then17, %if.then17.1, %if.then17.2, %if.then17.3, %entry %str.sink = phi ptr [ @str, %entry ], [ @str.5, %if.then17.3 ], [ @str.5, %if.then17.2 ], [ @str.5, %if.then17.1 ], [ @str.5, %if.then17 ], [ @str.5, %if.then62.3 ], [ @str.5, %if.then62.2 ], [ @str.5, %if.then62.1 ], [ @str.5, %if.then62 ], [ @str.5, %while.body ], [ @str, %if.end81 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 100000, 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { char *buf=(char*)malloc(sizeof(char) * 20000); scanf("%[^\n]", buf); char* cur = buf; int length = strlen(buf); char l1[] = "dream"; char l2[] = "dreamer"; char l3[] = "erase"; char l4[] = "eraser"; int a1 = 5; int a2 = 7; int a3 = 5; int a4 = 6; while (length > 0) { if (strstr(cur, l4) == cur) { length -= a4; if(length <= 0) { break; } cur = cur + a4; } else if (strstr(cur, l3) == cur) { length -= a3; if(length <= 0) { break; } cur = cur + a3; } else if (strstr(cur, "dreamerase") == cur) { length -= a1; if(length <= 0) { break; } cur = cur + a1; } else if (strstr(cur, l2) == cur) { length -= a2; if(length <= 0) { break; } cur = cur + a2; } else if (strstr(cur, l1) == cur) { length -= a1; if(length <= 0) { break; } cur = cur + a1; } else { break; } } if (length == 0) { printf("YES\n"); } else { printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150519/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150519/source.c" target datalayout = "e-m:e-p270: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"%[^\0A]\00", align 1 @__const.main.l1 = private unnamed_addr constant [6 x i8] c"dream\00", align 1 @__const.main.l2 = private unnamed_addr constant [8 x i8] c"dreamer\00", align 1 @__const.main.l3 = private unnamed_addr constant [6 x i8] c"erase\00", align 1 @__const.main.l4 = private unnamed_addr constant [7 x i8] c"eraser\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"dreamerase\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call noalias dereferenceable_or_null(20000) ptr @malloc(i64 noundef 20000) #6 %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %call) %call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %call) #7 %conv = trunc i64 %call2 to i32 %cmp118 = icmp sgt i32 %conv, 0 br i1 %cmp118, label %while.body, label %while.end while.body: ; preds = %entry, %if.end65 %cur.0120 = phi ptr [ %add.ptr21, %if.end65 ], [ %call, %entry ] %length.0119 = phi i32 [ %length.1, %if.end65 ], [ %conv, %entry ] %strncmp = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %cur.0120, ptr noundef nonnull dereferenceable(7) @__const.main.l4, i64 6) %cmp106 = icmp eq i32 %strncmp, 0 br i1 %cmp106, label %if.then, label %if.else if.then: ; preds = %while.body %sub = add nsw i32 %length.0119, -6 %cmp7 = icmp ult i32 %length.0119, 7 br i1 %cmp7, label %while.end, label %if.end65 if.else: ; preds = %while.body %strncmp107 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %cur.0120, ptr noundef nonnull dereferenceable(6) @__const.main.l3, i64 5) %cmp108 = icmp eq i32 %strncmp107, 0 br i1 %cmp108, label %if.then14, label %if.else22 if.then14: ; preds = %if.else %sub15 = add nsw i32 %length.0119, -5 %cmp16 = icmp ult i32 %length.0119, 6 br i1 %cmp16, label %while.end, label %if.end65 if.else22: ; preds = %if.else %strncmp109 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %cur.0120, ptr noundef nonnull dereferenceable(11) @.str.1, i64 10) %cmp110 = icmp eq i32 %strncmp109, 0 br i1 %cmp110, label %if.then26, label %if.else34 if.then26: ; preds = %if.else22 %sub27 = add nsw i32 %length.0119, -5 %cmp28 = icmp ult i32 %length.0119, 6 br i1 %cmp28, label %while.end, label %if.end65 if.else34: ; preds = %if.else22 %strncmp111 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %cur.0120, ptr noundef nonnull dereferenceable(8) @__const.main.l2, i64 7) %cmp112 = icmp eq i32 %strncmp111, 0 br i1 %cmp112, label %if.then39, label %if.else47 if.then39: ; preds = %if.else34 %sub40 = add nsw i32 %length.0119, -7 %cmp41 = icmp ult i32 %length.0119, 8 br i1 %cmp41, label %while.end, label %if.end65 if.else47: ; preds = %if.else34 %strncmp113 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %cur.0120, ptr noundef nonnull dereferenceable(6) @__const.main.l1, i64 5) %cmp114 = icmp eq i32 %strncmp113, 0 br i1 %cmp114, label %if.then52, label %if.else70 if.then52: ; preds = %if.else47 %sub53 = add nsw i32 %length.0119, -5 %cmp54 = icmp ult i32 %length.0119, 6 br i1 %cmp54, label %while.end, label %if.end65 if.end65: ; preds = %if.then52, %if.then39, %if.then26, %if.then14, %if.then %.sink = phi i64 [ 6, %if.then ], [ 5, %if.then14 ], [ 5, %if.then26 ], [ 7, %if.then39 ], [ 5, %if.then52 ] %length.1 = phi i32 [ %sub, %if.then ], [ %sub15, %if.then14 ], [ %sub27, %if.then26 ], [ %sub40, %if.then39 ], [ %sub53, %if.then52 ] %add.ptr21 = getelementptr inbounds i8, ptr %cur.0120, i64 %.sink %cmp = icmp sgt i32 %length.1, 0 br i1 %cmp, label %while.body, label %if.else70, !llvm.loop !5 while.end: ; preds = %if.then, %if.then14, %if.then26, %if.then39, %if.then52, %entry %length.2 = phi i32 [ %conv, %entry ], [ %sub53, %if.then52 ], [ %sub40, %if.then39 ], [ %sub27, %if.then26 ], [ %sub15, %if.then14 ], [ %sub, %if.then ] %cmp66 = icmp eq i32 %length.2, 0 br i1 %cmp66, label %if.end72, label %if.else70 if.else70: ; preds = %if.end65, %if.else47, %while.end br label %if.end72 if.end72: ; preds = %while.end, %if.else70 %str.sink = phi ptr [ @str, %if.else70 ], [ @str.4, %while.end ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) ret i32 0 } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @strncmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress 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 #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 willreturn memory(argmem: read) } attributes #5 = { nofree nounwind } attributes #6 = { nounwind allocsize(0) } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int a,b,x; scanf("%d %d %d",&a,&b,&x); if((a<=x)&& (a+b)>x) printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150562/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150562/source.c" target datalayout = "e-m:e-p270: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 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %x = 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 %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %x, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 br i1 %cmp.not, label %if.else, label %land.lhs.true land.lhs.true: ; preds = %entry %2 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %2, %0 %cmp1 = icmp sgt i32 %add, %1 br i1 %cmp1, label %if.end, label %if.else if.else: ; preds = %land.lhs.true, %entry br label %if.end if.end: ; preds = %land.lhs.true, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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 @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 a, b, x; scanf("%d %d %d",&a, &b, &x); if(x < a || x > a + b) printf("NO\n"); else printf("YES\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150605/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150605/source.c" target datalayout = "e-m:e-p270: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 = 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: %a = alloca i32, align 4 %b = alloca i32, align 4 %x = 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 %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %b, align 4 %add = add nsw i32 %2, %1 %cmp1 = icmp sgt i32 %0, %add %3 = select i1 %cmp, i1 true, i1 %cmp1 %str.sink = select i1 %3, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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 @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,b,c; scanf("%d %d %d",&a,&b,&c); if(a>c){printf("NO\n");} else if(a+b<c){printf("NO\n");} else{printf("YES\n");} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150649/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150649/source.c" target datalayout = "e-m:e-p270: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 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %c, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %2 = load i32, ptr %b, align 4 %add = add nsw i32 %2, %0 %cmp2 = icmp slt i32 %add, %1 %str.3.str = select i1 %cmp2, ptr @str.4, ptr @str %str.3.sink = select i1 %cmp, ptr @str.4, ptr %str.3.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink) 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 @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 <string.h> #include <math.h> #include <time.h> #define _CRT_SECURE_NO_WARNINGS #define TLong long long // fact(n) int fact(int n){ if(n == 1) return 1; else return (n * fact(n - 1)); } // combination(n,r) int combination(int n, int r){ if(r == 0 || r == n) return 1; else if(r == 1) return n; return (combination(n - 1, r - 1) + combination(n - 1, r)); } // gcd(a,b) int gcd(int a,int b){ int ret; ret = (b == 0) ? a : gcd(b, a % b); return ret; } // lcm(a.b) int lcm(int a,int b){ return (a * b) / gcd(a,b); } // qsort(array, size, sizeof(int),comp); int comp(const int *a,const int *b){ return (*a - *b); } // append(array,*size,addNum) void append(int *array,int *size,int num){ realloc(array, sizeof(int) * (*size + 1)); array[(*size)] = num; ++(*size); } // pop(array,*size) & nongetpop(array,*size) int pop(int *array,int *size){ int temp = array[(*size - 1)]; realloc(array,sizeof(int) * (*size - 1)); --(*size); return temp; } void nongetpop(int *array,int *size){ realloc(array,sizeof(int) * (*size - 1)); --(*size); } int main(int argc, char const *argv[]) { int a,b,x; scanf("%d%d%d",&a,&b,&x); if(a <= x && x <= a + b) puts("YES"); else puts("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150692/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150692/source.c" target datalayout = "e-m:e-p270: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"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @fact(i32 noundef %n) local_unnamed_addr #0 { entry: %cmp3 = icmp eq i32 %n, 1 br i1 %cmp3, label %return, label %if.else.preheader if.else.preheader: ; preds = %entry %0 = add i32 %n, -1 %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %if.else.preheader8, label %vector.ph vector.ph: ; preds = %if.else.preheader %n.vec = and i32 %0, -8 %ind.end = sub i32 %n, %n.vec %.splatinsert = insertelement <4 x i32> poison, i32 %n, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %induction = add <4 x i32> %.splat, <i32 0, i32 -1, i32 -2, i32 -3> br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %2, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 -4, i32 -4, i32 -4, i32 -4> %1 = mul <4 x i32> %vec.ind, %vec.phi %2 = mul <4 x i32> %step.add, %vec.phi7 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 -8, i32 -8, i32 -8, i32 -8> %3 = icmp eq i32 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !5 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %2, %1 %4 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %0, %n.vec br i1 %cmp.n, label %return, label %if.else.preheader8 if.else.preheader8: ; preds = %if.else.preheader, %middle.block %n.tr5.ph = phi i32 [ %n, %if.else.preheader ], [ %ind.end, %middle.block ] %accumulator.tr4.ph = phi i32 [ 1, %if.else.preheader ], [ %4, %middle.block ] br label %if.else if.else: ; preds = %if.else.preheader8, %if.else %n.tr5 = phi i32 [ %sub, %if.else ], [ %n.tr5.ph, %if.else.preheader8 ] %accumulator.tr4 = phi i32 [ %mul, %if.else ], [ %accumulator.tr4.ph, %if.else.preheader8 ] %sub = add nsw i32 %n.tr5, -1 %mul = mul nsw i32 %n.tr5, %accumulator.tr4 %cmp = icmp eq i32 %sub, 1 br i1 %cmp, label %return, label %if.else, !llvm.loop !8 return: ; preds = %if.else, %middle.block, %entry %accumulator.tr.lcssa = phi i32 [ 1, %entry ], [ %4, %middle.block ], [ %mul, %if.else ] ret i32 %accumulator.tr.lcssa } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @combination(i32 noundef %n, i32 noundef %r) local_unnamed_addr #1 { entry: %cmp = icmp eq i32 %r, 0 %cmp115 = icmp eq i32 %r, %n %or.cond16 = or i1 %cmp, %cmp115 br i1 %or.cond16, label %return, label %if.else.lr.ph if.else.lr.ph: ; preds = %entry %cmp2 = icmp eq i32 %r, 1 %sub5 = add nsw i32 %r, -1 br i1 %cmp2, label %return, label %if.else if.else: ; preds = %if.else.lr.ph, %if.else %n.tr18 = phi i32 [ %sub, %if.else ], [ %n, %if.else.lr.ph ] %accumulator.tr17 = phi i32 [ %add, %if.else ], [ 0, %if.else.lr.ph ] %sub = add nsw i32 %n.tr18, -1 %call = tail call i32 @combination(i32 noundef %sub, i32 noundef %sub5) %add = add nsw i32 %call, %accumulator.tr17 %cmp1 = icmp eq i32 %sub, %r br i1 %cmp1, label %return, label %if.else return: ; preds = %if.else, %if.else.lr.ph, %entry %accumulator.tr.lcssa = phi i32 [ 0, %entry ], [ 0, %if.else.lr.ph ], [ %add, %if.else ] %retval.0 = phi i32 [ 1, %entry ], [ %n, %if.else.lr.ph ], [ 1, %if.else ] %accumulator.ret.tr = add nsw i32 %retval.0, %accumulator.tr.lcssa ret i32 %accumulator.ret.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp4 = icmp eq i32 %b, 0 br i1 %cmp4, label %cond.end, label %cond.false cond.false: ; preds = %entry, %cond.false %b.tr6 = phi i32 [ %rem, %cond.false ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %cond.false ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %cond.end, label %cond.false cond.end: ; preds = %cond.false, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %cond.false ] ret i32 %a.tr.lcssa } ; 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 i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp4.i = icmp eq i32 %b, 0 br i1 %cmp4.i, label %gcd.exit, label %cond.false.i cond.false.i: ; preds = %entry, %cond.false.i %b.tr6.i = phi i32 [ %rem.i, %cond.false.i ], [ %b, %entry ] %a.tr5.i = phi i32 [ %b.tr6.i, %cond.false.i ], [ %a, %entry ] %rem.i = srem i32 %a.tr5.i, %b.tr6.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %gcd.exit, label %cond.false.i gcd.exit: ; preds = %cond.false.i, %entry %a.tr.lcssa.i = phi i32 [ %a, %entry ], [ %b.tr6.i, %cond.false.i ] %mul = mul nsw i32 %b, %a %div = sdiv i32 %mul, %a.tr.lcssa.i ret i32 %div } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 { entry: %0 = load i32, ptr %a, align 4, !tbaa !9 %1 = load i32, ptr %b, align 4, !tbaa !9 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable define dso_local void @append(ptr nocapture noundef %array, ptr nocapture noundef %size, i32 noundef %num) local_unnamed_addr #4 { entry: %0 = load i32, ptr %size, align 4, !tbaa !9 %add = add nsw i32 %0, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call = tail call ptr @realloc(ptr noundef %array, i64 noundef %mul) #9 %1 = load i32, ptr %size, align 4, !tbaa !9 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom store i32 %num, ptr %arrayidx, align 4, !tbaa !9 %2 = load i32, ptr %size, align 4, !tbaa !9 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %size, align 4, !tbaa !9 ret void } ; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable define dso_local i32 @pop(ptr nocapture noundef %array, ptr nocapture noundef %size) local_unnamed_addr #4 { entry: %0 = load i32, ptr %size, align 4, !tbaa !9 %sub = add nsw i32 %0, -1 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !9 %mul = shl nsw i64 %idxprom, 2 %call = tail call ptr @realloc(ptr noundef %array, i64 noundef %mul) #9 %2 = load i32, ptr %size, align 4, !tbaa !9 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %size, align 4, !tbaa !9 ret i32 %1 } ; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable define dso_local void @nongetpop(ptr nocapture noundef %array, ptr nocapture noundef %size) local_unnamed_addr #4 { entry: %0 = load i32, ptr %size, align 4, !tbaa !9 %sub = add nsw i32 %0, -1 %conv = sext i32 %sub to i64 %mul = shl nsw i64 %conv, 2 %call = tail call ptr @realloc(ptr noundef %array, i64 noundef %mul) #9 %1 = load i32, ptr %size, align 4, !tbaa !9 %dec = add nsw i32 %1, -1 store i32 %dec, ptr %size, align 4, !tbaa !9 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #6 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x) %0 = load i32, ptr %a, align 4, !tbaa !9 %1 = load i32, ptr %x, align 4, !tbaa !9 %cmp.not = icmp sgt i32 %0, %1 br i1 %cmp.not, label %if.else, label %land.lhs.true land.lhs.true: ; preds = %entry %2 = load i32, ptr %b, align 4, !tbaa !9 %add = add nsw i32 %2, %0 %cmp1.not = icmp sgt i32 %1, %add br i1 %cmp1.not, label %if.else, label %if.end if.else: ; preds = %land.lhs.true, %entry br label %if.end if.end: ; preds = %land.lhs.true, %if.else %.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ] %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #10 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #8 attributes #0 = { 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 #1 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 = { mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nounwind allocsize(1) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6, !7} !6 = !{!"llvm.loop.isvectorized", i32 1} !7 = !{!"llvm.loop.unroll.runtime.disable"} !8 = distinct !{!8, !7, !6} !9 = !{!10, !10, i64 0} !10 = !{!"int", !11, i64 0} !11 = !{!"omnipotent char", !12, i64 0} !12 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,x; scanf("%d%d%d",&a,&b,&x); if(a+b>=x&&a<=x)puts("YES"); else puts("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150735/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150735/source.c" target datalayout = "e-m:e-p270: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"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %x = 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 %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x) %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 %x, align 4, !tbaa !5 %cmp.not = icmp slt i32 %add, %2 %cmp1.not = icmp sgt i32 %0, %2 %or.cond = or i1 %cmp.not, %cmp1.not %.str.2..str.1 = select i1 %or.cond, ptr @.str.2, ptr @.str.1 %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(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,x; scanf("%d %d %d",&a,&b,&x); if(x>=a && x<=a+b) printf("YES"); else printf("NO"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150793/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150793/source.c" target datalayout = "e-m:e-p270: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"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %x = 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 %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 br i1 %cmp.not, label %if.else, label %land.lhs.true land.lhs.true: ; preds = %entry %2 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %2, %1 %cmp1.not = icmp sgt i32 %0, %add br i1 %cmp1.not, label %if.else, label %if.end if.else: ; preds = %land.lhs.true, %entry br label %if.end if.end: ; preds = %land.lhs.true, %if.else %.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int A, B, X; scanf("%d %d %d", &A, &B, &X); if (A <= X && A + B >= X) { printf("YES"); } else { printf("NO"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150836/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150836/source.c" target datalayout = "e-m:e-p270: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"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %X = 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 %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %X) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %X, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 br i1 %cmp.not, label %if.else, label %land.lhs.true land.lhs.true: ; preds = %entry %2 = load i32, ptr %B, align 4, !tbaa !5 %add = add nsw i32 %2, %0 %cmp1.not = icmp slt i32 %add, %1 br i1 %cmp1.not, label %if.else, label %if.end if.else: ; preds = %land.lhs.true, %entry br label %if.end if.end: ; preds = %land.lhs.true, %if.else %.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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); int n, m; for (; t > 0; t--) { scanf("%d %d", &n, &m); if (n % m > 0) printf("NO\n"); else printf("YES\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15088/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15088/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %.pr = load i32, ptr %t, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %.pr, 0 br i1 %cmp6, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %m, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp2 = icmp sgt i32 %rem, 0 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %puts5 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) %2 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %cmp = icmp sgt i32 %2, 1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int x,a,b; scanf("%d %d %d",&x,&a,&b); int ans1,ans2; ans1=a>b?b:a; ans2=x>a+b?0:a+b-x; printf("%d %d",ans1,ans2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150937/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150937/source.c" target datalayout = "e-m:e-p270: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 [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4 %1 = load i32, ptr %b, align 4 %2 = load i32, ptr %x, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp1 = icmp sgt i32 %2, %add %sub = sub nsw i32 %add, %2 %spec.select = select i1 %cmp1, i32 0, i32 %sub %cond = call i32 @llvm.smin.i32(i32 %0, i32 %1) %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 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: 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(void) { int N,A,B; int x,y; scanf("%d%d%d",&N,&A,&B); if(A>B){ x=B; }else{ x=A; } if(A+B-N>0){ y=A+B-N; }else{ y=0; } printf("%d %d",x,y); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150980/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150980/source.c" target datalayout = "e-m:e-p270: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 [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca i32, align 4 %B = 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 %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %. = call i32 @llvm.smin.i32(i32 %0, i32 %1) %add = add nsw i32 %1, %0 %2 = load i32, ptr %N, align 4, !tbaa !5 %sub = sub i32 %add, %2 %y.0 = call i32 @llvm.smax.i32(i32 %sub, i32 0) %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %., i32 noundef %y.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 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"}
#include <stdio.h> int max(int a,int b){ if(a>b){ return a; } return b; } int min(int a,int b){ if(a>b){ return b; } return a; } int main(void){ int N,A,B; scanf("%d%d%d",&N,&A,&B); printf("%d %d\n",min(A,B),max(A+B-N,0)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151022/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151022/source.c" target datalayout = "e-m:e-p270: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 [7 x i8] c"%d %d\0A\00", align 1 ; 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: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; 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: %b.a = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %b.a } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %N = alloca i32, align 4 %A = alloca i32, align 4 %B = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %b.a.i = call i32 @llvm.smin.i32(i32 %0, i32 %1) %add = add nsw i32 %1, %0 %2 = load i32, ptr %N, align 4, !tbaa !5 %sub = sub i32 %add, %2 %a.b.i = call i32 @llvm.smax.i32(i32 %sub, i32 0) %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %b.a.i, i32 noundef %a.b.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #5 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) #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.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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 MAX 1000 int main(){ int i,j; int n; int k = 0; int total = 0; int t, p; int v[MAX]; char T[MAX],P[MAX]; scanf("%s%s",T,P); t=strlen(T); p=strlen(P); for(i = 0;i < t;i++){ if(T[i] == P[0]){ j = i+1; n = 1; while(n < p){ if(T[j] != P[n]) break; j++; n++; } if(n == p){ v[k] = i; total++; k++; } } } for(k = 0;k < total;k++){ printf("%d\n",v[k]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151073/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151073/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %v = alloca [1000 x i32], align 16 %T = alloca [1000 x i8], align 16 %P = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %v) #4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %T) #4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %P) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T, ptr noundef nonnull %P) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %T) #5 %conv = trunc i64 %call3 to i32 %call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %P) #5 %call5.fr = freeze i64 %call5 %conv6 = trunc i64 %call5.fr to i32 %cmp64 = icmp sgt i32 %conv, 0 br i1 %cmp64, label %for.body.lr.ph, label %for.end44 for.body.lr.ph: ; preds = %entry %0 = load i8, ptr %P, align 16, !tbaa !5 %cmp1360 = icmp sgt i32 %conv6, 1 br i1 %cmp1360, label %for.body.us.preheader, label %for.body.lr.ph.split for.body.us.preheader: ; preds = %for.body.lr.ph %wide.trip.count106 = and i64 %call3, 4294967295 %wide.trip.count103 = and i64 %call5.fr, 4294967295 br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %for.inc.us %indvars.iv94 = phi i64 [ 0, %for.body.us.preheader ], [ %indvars.iv.next95, %for.inc.us ] %total.066.us = phi i32 [ 0, %for.body.us.preheader ], [ %total.1.us, %for.inc.us ] %k.065.us = phi i32 [ 0, %for.body.us.preheader ], [ %k.1.us, %for.inc.us ] %arrayidx.us = getelementptr inbounds [1000 x i8], ptr %T, i64 0, i64 %indvars.iv94 %1 = load i8, ptr %arrayidx.us, align 1, !tbaa !5 %cmp11.us = icmp eq i8 %1, %0 br i1 %cmp11.us, label %while.body.us, label %for.inc.us while.body.us: ; preds = %for.body.us, %if.end.us %indvars.iv98 = phi i64 [ %indvars.iv.next99, %if.end.us ], [ 1, %for.body.us ] %indvars.iv96 = phi i64 [ %indvars.iv.next97, %if.end.us ], [ %indvars.iv94, %for.body.us ] %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1 %arrayidx16.us = getelementptr inbounds [1000 x i8], ptr %T, i64 0, i64 %indvars.iv.next97 %2 = load i8, ptr %arrayidx16.us, align 1, !tbaa !5 %arrayidx19.us = getelementptr inbounds [1000 x i8], ptr %P, i64 0, i64 %indvars.iv98 %3 = load i8, ptr %arrayidx19.us, align 1, !tbaa !5 %cmp21.not.us = icmp eq i8 %2, %3 br i1 %cmp21.not.us, label %if.end.us, label %while.end.us while.end.us: ; preds = %while.body.us %4 = trunc i64 %indvars.iv98 to i32 %cmp25.us = icmp eq i32 %4, %conv6 br i1 %cmp25.us, label %if.then27.us, label %for.inc.us if.then27.us: ; preds = %if.end.us, %while.end.us %idxprom28.us = sext i32 %k.065.us to i64 %arrayidx29.us = getelementptr inbounds [1000 x i32], ptr %v, i64 0, i64 %idxprom28.us %5 = trunc i64 %indvars.iv94 to i32 store i32 %5, ptr %arrayidx29.us, align 4, !tbaa !8 %inc30.us = add nsw i32 %total.066.us, 1 %inc31.us = add nsw i32 %k.065.us, 1 br label %for.inc.us for.inc.us: ; preds = %if.then27.us, %while.end.us, %for.body.us %k.1.us = phi i32 [ %inc31.us, %if.then27.us ], [ %k.065.us, %while.end.us ], [ %k.065.us, %for.body.us ] %total.1.us = phi i32 [ %inc30.us, %if.then27.us ], [ %total.066.us, %while.end.us ], [ %total.066.us, %for.body.us ] %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %exitcond107.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count106 br i1 %exitcond107.not, label %for.cond35.preheader, label %for.body.us, !llvm.loop !10 if.end.us: ; preds = %while.body.us %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %exitcond104.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count103 br i1 %exitcond104.not, label %if.then27.us, label %while.body.us, !llvm.loop !12 for.body.lr.ph.split: ; preds = %for.body.lr.ph %cmp25 = icmp eq i32 %conv6, 1 br i1 %cmp25, label %for.body.us69.preheader, label %for.end44 for.body.us69.preheader: ; preds = %for.body.lr.ph.split %wide.trip.count = and i64 %call3, 4294967295 %xtraiter = and i64 %call3, 1 %6 = icmp eq i64 %wide.trip.count, 1 br i1 %6, label %for.cond35.preheader.loopexit122.unr-lcssa, label %for.body.us69.preheader.new for.body.us69.preheader.new: ; preds = %for.body.us69.preheader %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body.us69 for.body.us69: ; preds = %for.inc.us81.1, %for.body.us69.preheader.new %indvars.iv = phi i64 [ 0, %for.body.us69.preheader.new ], [ %indvars.iv.next.1, %for.inc.us81.1 ] %total.066.us71 = phi i32 [ 0, %for.body.us69.preheader.new ], [ %total.1.us83.1, %for.inc.us81.1 ] %k.065.us72 = phi i32 [ 0, %for.body.us69.preheader.new ], [ %k.1.us82.1, %for.inc.us81.1 ] %niter = phi i64 [ 0, %for.body.us69.preheader.new ], [ %niter.next.1, %for.inc.us81.1 ] %arrayidx.us74 = getelementptr inbounds [1000 x i8], ptr %T, i64 0, i64 %indvars.iv %7 = load i8, ptr %arrayidx.us74, align 2, !tbaa !5 %cmp11.us75 = icmp eq i8 %7, %0 br i1 %cmp11.us75, label %while.cond.preheader.us86, label %for.inc.us81 for.inc.us81: ; preds = %while.cond.preheader.us86, %for.body.us69 %k.1.us82 = phi i32 [ %inc31.us80, %while.cond.preheader.us86 ], [ %k.065.us72, %for.body.us69 ] %total.1.us83 = phi i32 [ %inc30.us79, %while.cond.preheader.us86 ], [ %total.066.us71, %for.body.us69 ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.us74.1 = getelementptr inbounds [1000 x i8], ptr %T, i64 0, i64 %indvars.iv.next %8 = load i8, ptr %arrayidx.us74.1, align 1, !tbaa !5 %cmp11.us75.1 = icmp eq i8 %8, %0 br i1 %cmp11.us75.1, label %while.cond.preheader.us86.1, label %for.inc.us81.1 while.cond.preheader.us86.1: ; preds = %for.inc.us81 %idxprom28.us77.1 = sext i32 %k.1.us82 to i64 %arrayidx29.us78.1 = getelementptr inbounds [1000 x i32], ptr %v, i64 0, i64 %idxprom28.us77.1 %9 = trunc i64 %indvars.iv.next to i32 store i32 %9, ptr %arrayidx29.us78.1, align 4, !tbaa !8 %inc30.us79.1 = add nsw i32 %total.1.us83, 1 %inc31.us80.1 = add nsw i32 %k.1.us82, 1 br label %for.inc.us81.1 for.inc.us81.1: ; preds = %while.cond.preheader.us86.1, %for.inc.us81 %k.1.us82.1 = phi i32 [ %inc31.us80.1, %while.cond.preheader.us86.1 ], [ %k.1.us82, %for.inc.us81 ] %total.1.us83.1 = phi i32 [ %inc30.us79.1, %while.cond.preheader.us86.1 ], [ %total.1.us83, %for.inc.us81 ] %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.cond35.preheader.loopexit122.unr-lcssa.loopexit, label %for.body.us69, !llvm.loop !10 while.cond.preheader.us86: ; preds = %for.body.us69 %idxprom28.us77 = sext i32 %k.065.us72 to i64 %arrayidx29.us78 = getelementptr inbounds [1000 x i32], ptr %v, i64 0, i64 %idxprom28.us77 %10 = trunc i64 %indvars.iv to i32 store i32 %10, ptr %arrayidx29.us78, align 4, !tbaa !8 %inc30.us79 = add nsw i32 %total.066.us71, 1 %inc31.us80 = add nsw i32 %k.065.us72, 1 br label %for.inc.us81 for.cond35.preheader.loopexit122.unr-lcssa.loopexit: ; preds = %for.inc.us81.1 %11 = sext i32 %k.1.us82.1 to i64 br label %for.cond35.preheader.loopexit122.unr-lcssa for.cond35.preheader.loopexit122.unr-lcssa: ; preds = %for.cond35.preheader.loopexit122.unr-lcssa.loopexit, %for.body.us69.preheader %total.1.us83.lcssa.ph = phi i32 [ undef, %for.body.us69.preheader ], [ %total.1.us83.1, %for.cond35.preheader.loopexit122.unr-lcssa.loopexit ] %indvars.iv.unr = phi i64 [ 0, %for.body.us69.preheader ], [ %indvars.iv.next.1, %for.cond35.preheader.loopexit122.unr-lcssa.loopexit ] %total.066.us71.unr = phi i32 [ 0, %for.body.us69.preheader ], [ %total.1.us83.1, %for.cond35.preheader.loopexit122.unr-lcssa.loopexit ] %k.065.us72.unr = phi i64 [ 0, %for.body.us69.preheader ], [ %11, %for.cond35.preheader.loopexit122.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond35.preheader, label %for.body.us69.epil for.body.us69.epil: ; preds = %for.cond35.preheader.loopexit122.unr-lcssa %arrayidx.us74.epil = getelementptr inbounds [1000 x i8], ptr %T, i64 0, i64 %indvars.iv.unr %12 = load i8, ptr %arrayidx.us74.epil, align 1, !tbaa !5 %cmp11.us75.epil = icmp eq i8 %12, %0 br i1 %cmp11.us75.epil, label %while.cond.preheader.us86.epil, label %for.cond35.preheader while.cond.preheader.us86.epil: ; preds = %for.body.us69.epil %arrayidx29.us78.epil = getelementptr inbounds [1000 x i32], ptr %v, i64 0, i64 %k.065.us72.unr %13 = trunc i64 %indvars.iv.unr to i32 store i32 %13, ptr %arrayidx29.us78.epil, align 4, !tbaa !8 %inc30.us79.epil = add nsw i32 %total.066.us71.unr, 1 br label %for.cond35.preheader for.cond35.preheader: ; preds = %for.cond35.preheader.loopexit122.unr-lcssa, %while.cond.preheader.us86.epil, %for.body.us69.epil, %for.inc.us %total.0.lcssa = phi i32 [ %total.1.us, %for.inc.us ], [ %total.1.us83.lcssa.ph, %for.cond35.preheader.loopexit122.unr-lcssa ], [ %inc30.us79.epil, %while.cond.preheader.us86.epil ], [ %total.066.us71.unr, %for.body.us69.epil ] %cmp3689 = icmp sgt i32 %total.0.lcssa, 0 br i1 %cmp3689, label %for.body38.preheader, label %for.end44 for.body38.preheader: ; preds = %for.cond35.preheader %wide.trip.count111 = zext i32 %total.0.lcssa to i64 br label %for.body38 for.body38: ; preds = %for.body38.preheader, %for.body38 %indvars.iv108 = phi i64 [ 0, %for.body38.preheader ], [ %indvars.iv.next109, %for.body38 ] %arrayidx40 = getelementptr inbounds [1000 x i32], ptr %v, i64 0, i64 %indvars.iv108 %14 = load i32, ptr %arrayidx40, align 4, !tbaa !8 %call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14) %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1 %exitcond112.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count111 br i1 %exitcond112.not, label %for.end44, label %for.body38, !llvm.loop !13 for.end44: ; preds = %for.body38, %for.body.lr.ph.split, %entry, %for.cond35.preheader call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %P) #4 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %T) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %v) #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: 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(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 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11}
#include <stdio.h> #define MAX 100000000 struct NODE { int distance; int state; } vertex[101]; int W[101][101]; int n, m; int min(int a, int b) { return (a > b ? b : a); } int prim(int start) { int x, p, step, sum = 0; for (x = 0; x < n; x++) { vertex[x].distance = MAX; vertex[x].state = 0; } vertex[start].distance = 0; for (step = 1; step <= n; step++) { int minimum = MAX; for (x = 0; x < n; x++) if (vertex[x].state == 0 && vertex[x].distance < minimum) { p = x; minimum = vertex[x].distance; } vertex[p].state = 1; sum += minimum; for (x = 0 ; x < n; x++) if (vertex[x].state == 0) vertex[x].distance = min(vertex[x].distance, W[p][x]); } return sum; } int main(void) { int i, j; int from, to, cost; while (1) { scanf("%d", &n); scanf("%d", &m); if (n == 0) break; for (i = 0; i < n; i++) for (j = 0; j < n; j++) W[i][j] = MAX; for (i = 0; i < m; i++) { scanf("%d %d %d", &from, &to, &cost); W[from][to] = cost; W[to][from] = cost; } printf("%d\n", prim(0)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151116/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151116/source.c" target datalayout = "e-m:e-p270: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.NODE = type { i32, i32 } @n = dso_local global i32 0, align 4 @vertex = dso_local local_unnamed_addr global [101 x %struct.NODE] zeroinitializer, align 16 @W = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @m = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim(i32 noundef %start) local_unnamed_addr #1 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp74 = icmp sgt i32 %0, 0 br i1 %cmp74, label %for.body.preheader, label %for.end.thread for.end.thread: ; preds = %entry %idxprom3137 = sext i32 %start to i64 %arrayidx4138 = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %idxprom3137 store i32 0, ptr %arrayidx4138, align 8, !tbaa !9 br label %for.end53 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %0, 4 br i1 %min.iters.check, label %for.body.preheader140, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967292 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %1 = or i64 %index, 2 %2 = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %index %3 = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %1 store <4 x i32> <i32 100000000, i32 0, i32 100000000, i32 0>, ptr %2, align 16, !tbaa !5 store <4 x i32> <i32 100000000, i32 0, i32 100000000, i32 0>, ptr %3, align 16, !tbaa !5 %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %for.body.preheader140 for.body.preheader140: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader140, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader140 ] %arrayidx = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv store i32 100000000, ptr %arrayidx, align 8, !tbaa !9 %state = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv, i32 1 store i32 0, ptr %state, align 4, !tbaa !15 %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 !16 for.end: ; preds = %for.body, %middle.block %idxprom3 = sext i32 %start to i64 %arrayidx4 = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %idxprom3 store i32 0, ptr %arrayidx4, align 8, !tbaa !9 %cmp7.not84 = icmp slt i32 %0, 1 br i1 %cmp7.not84, label %for.end53, label %for.cond9.preheader.us.preheader for.cond9.preheader.us.preheader: ; preds = %for.end %wide.trip.count129 = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 1 %5 = icmp eq i32 %0, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.body11.us.preheader for.body11.us.preheader: ; preds = %for.cond29.for.end50_crit_edge.us, %for.cond9.preheader.us.preheader %sum.087.us = phi i32 [ %add.us, %for.cond29.for.end50_crit_edge.us ], [ 0, %for.cond9.preheader.us.preheader ] %step.086.us = phi i32 [ %inc52.us, %for.cond29.for.end50_crit_edge.us ], [ 1, %for.cond9.preheader.us.preheader ] %p.085.us = phi i32 [ %p.2.us.lcssa, %for.cond29.for.end50_crit_edge.us ], [ undef, %for.cond9.preheader.us.preheader ] br i1 %5, label %for.end25.us.unr-lcssa, label %for.body11.us for.end25.us.unr-lcssa: ; preds = %for.inc23.us.1, %for.body11.us.preheader %p.2.us.lcssa.ph = phi i32 [ undef, %for.body11.us.preheader ], [ %p.2.us.1, %for.inc23.us.1 ] %minimum.1.us.lcssa.ph = phi i32 [ undef, %for.body11.us.preheader ], [ %minimum.1.us.1, %for.inc23.us.1 ] %indvars.iv126.unr = phi i64 [ 0, %for.body11.us.preheader ], [ %indvars.iv.next127.1, %for.inc23.us.1 ] %minimum.079.us.unr = phi i32 [ 100000000, %for.body11.us.preheader ], [ %minimum.1.us.1, %for.inc23.us.1 ] %p.178.us.unr = phi i32 [ %p.085.us, %for.body11.us.preheader ], [ %p.2.us.1, %for.inc23.us.1 ] br i1 %lcmp.mod.not, label %for.end25.us, label %for.body11.us.epil for.body11.us.epil: ; preds = %for.end25.us.unr-lcssa %state14.us.epil = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv126.unr, i32 1 %6 = load i32, ptr %state14.us.epil, align 4, !tbaa !15 %cmp15.us.epil = icmp eq i32 %6, 0 br i1 %cmp15.us.epil, label %land.lhs.true.us.epil, label %for.end25.us land.lhs.true.us.epil: ; preds = %for.body11.us.epil %arrayidx13.us.epil = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv126.unr %7 = load i32, ptr %arrayidx13.us.epil, align 8, !tbaa !9 %cmp19.us.epil = icmp slt i32 %7, %minimum.079.us.unr %8 = trunc i64 %indvars.iv126.unr to i32 %spec.select.us.epil = select i1 %cmp19.us.epil, i32 %8, i32 %p.178.us.unr %spec.select73.us.epil = tail call i32 @llvm.smin.i32(i32 %7, i32 %minimum.079.us.unr) br label %for.end25.us for.end25.us: ; preds = %for.body11.us.epil, %land.lhs.true.us.epil, %for.end25.us.unr-lcssa %p.2.us.lcssa = phi i32 [ %p.2.us.lcssa.ph, %for.end25.us.unr-lcssa ], [ %p.178.us.unr, %for.body11.us.epil ], [ %spec.select.us.epil, %land.lhs.true.us.epil ] %minimum.1.us.lcssa = phi i32 [ %minimum.1.us.lcssa.ph, %for.end25.us.unr-lcssa ], [ %minimum.079.us.unr, %for.body11.us.epil ], [ %spec.select73.us.epil, %land.lhs.true.us.epil ] %idxprom26.us = sext i32 %p.2.us.lcssa to i64 %state28.us = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %idxprom26.us, i32 1 store i32 1, ptr %state28.us, align 4, !tbaa !15 br label %for.body31.us for.body31.us: ; preds = %for.end25.us, %for.inc48.us %indvars.iv131 = phi i64 [ 0, %for.end25.us ], [ %indvars.iv.next132, %for.inc48.us ] %state34.us = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv131, i32 1 %9 = load i32, ptr %state34.us, align 4, !tbaa !15 %cmp35.us = icmp eq i32 %9, 0 br i1 %cmp35.us, label %if.then36.us, label %for.inc48.us if.then36.us: ; preds = %for.body31.us %arrayidx33.us = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv131 %10 = load i32, ptr %arrayidx33.us, align 8, !tbaa !9 %arrayidx43.us = getelementptr inbounds [101 x [101 x i32]], ptr @W, i64 0, i64 %idxprom26.us, i64 %indvars.iv131 %11 = load i32, ptr %arrayidx43.us, align 4, !tbaa !5 %cond.i.us = tail call i32 @llvm.smin.i32(i32 %10, i32 %11) store i32 %cond.i.us, ptr %arrayidx33.us, align 8, !tbaa !9 br label %for.inc48.us for.inc48.us: ; preds = %if.then36.us, %for.body31.us %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1 %exitcond135.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count129 br i1 %exitcond135.not, label %for.cond29.for.end50_crit_edge.us, label %for.body31.us, !llvm.loop !17 for.body11.us: ; preds = %for.body11.us.preheader, %for.inc23.us.1 %indvars.iv126 = phi i64 [ %indvars.iv.next127.1, %for.inc23.us.1 ], [ 0, %for.body11.us.preheader ] %minimum.079.us = phi i32 [ %minimum.1.us.1, %for.inc23.us.1 ], [ 100000000, %for.body11.us.preheader ] %p.178.us = phi i32 [ %p.2.us.1, %for.inc23.us.1 ], [ %p.085.us, %for.body11.us.preheader ] %niter = phi i64 [ %niter.next.1, %for.inc23.us.1 ], [ 0, %for.body11.us.preheader ] %state14.us = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv126, i32 1 %12 = load i32, ptr %state14.us, align 4, !tbaa !15 %cmp15.us = icmp eq i32 %12, 0 br i1 %cmp15.us, label %land.lhs.true.us, label %for.inc23.us land.lhs.true.us: ; preds = %for.body11.us %arrayidx13.us = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv126 %13 = load i32, ptr %arrayidx13.us, align 16, !tbaa !9 %cmp19.us = icmp slt i32 %13, %minimum.079.us %14 = trunc i64 %indvars.iv126 to i32 %spec.select.us = select i1 %cmp19.us, i32 %14, i32 %p.178.us %spec.select73.us = tail call i32 @llvm.smin.i32(i32 %13, i32 %minimum.079.us) br label %for.inc23.us for.inc23.us: ; preds = %land.lhs.true.us, %for.body11.us %p.2.us = phi i32 [ %p.178.us, %for.body11.us ], [ %spec.select.us, %land.lhs.true.us ] %minimum.1.us = phi i32 [ %minimum.079.us, %for.body11.us ], [ %spec.select73.us, %land.lhs.true.us ] %indvars.iv.next127 = or i64 %indvars.iv126, 1 %state14.us.1 = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv.next127, i32 1 %15 = load i32, ptr %state14.us.1, align 4, !tbaa !15 %cmp15.us.1 = icmp eq i32 %15, 0 br i1 %cmp15.us.1, label %land.lhs.true.us.1, label %for.inc23.us.1 land.lhs.true.us.1: ; preds = %for.inc23.us %arrayidx13.us.1 = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv.next127 %16 = load i32, ptr %arrayidx13.us.1, align 8, !tbaa !9 %cmp19.us.1 = icmp slt i32 %16, %minimum.1.us %17 = trunc i64 %indvars.iv.next127 to i32 %spec.select.us.1 = select i1 %cmp19.us.1, i32 %17, i32 %p.2.us %spec.select73.us.1 = tail call i32 @llvm.smin.i32(i32 %16, i32 %minimum.1.us) br label %for.inc23.us.1 for.inc23.us.1: ; preds = %land.lhs.true.us.1, %for.inc23.us %p.2.us.1 = phi i32 [ %p.2.us, %for.inc23.us ], [ %spec.select.us.1, %land.lhs.true.us.1 ] %minimum.1.us.1 = phi i32 [ %minimum.1.us, %for.inc23.us ], [ %spec.select73.us.1, %land.lhs.true.us.1 ] %indvars.iv.next127.1 = add nuw nsw i64 %indvars.iv126, 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.end25.us.unr-lcssa, label %for.body11.us, !llvm.loop !18 for.cond29.for.end50_crit_edge.us: ; preds = %for.inc48.us %add.us = add nsw i32 %minimum.1.us.lcssa, %sum.087.us %inc52.us = add nuw i32 %step.086.us, 1 %exitcond136.not = icmp eq i32 %step.086.us, %0 br i1 %exitcond136.not, label %for.end53, label %for.body11.us.preheader, !llvm.loop !19 for.end53: ; preds = %for.cond29.for.end50_crit_edge.us, %for.end.thread, %for.end %sum.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %for.end.thread ], [ %add.us, %for.cond29.for.end50_crit_edge.us ] ret i32 %sum.0.lcssa } ; 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %from = alloca i32, align 4 %to = alloca i32, align 4 %cost = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %from) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %to) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %cost) #6 %call40 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %call141 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp42 = icmp eq i32 %0, 0 br i1 %cmp42, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %prim.exit %1 = phi i32 [ %28, %prim.exit ], [ %0, %entry ] %cmp236 = icmp sgt i32 %1, 0 br i1 %cmp236, label %for.cond3.preheader.us.preheader, label %for.cond11.preheader for.cond3.preheader.us.preheader: ; preds = %for.cond.preheader %wide.trip.count47 = zext i32 %1 to i64 %min.iters.check51 = icmp ult i32 %1, 8 %n.vec54 = and i64 %wide.trip.count47, 4294967288 %cmp.n56 = icmp eq i64 %n.vec54, %wide.trip.count47 br label %for.cond3.preheader.us for.cond3.preheader.us: ; preds = %for.cond3.preheader.us.preheader, %for.cond3.for.inc8_crit_edge.us %indvars.iv44 = phi i64 [ 0, %for.cond3.preheader.us.preheader ], [ %indvars.iv.next45, %for.cond3.for.inc8_crit_edge.us ] br i1 %min.iters.check51, label %for.body5.us.preheader, label %vector.body57 vector.body57: ; preds = %for.cond3.preheader.us, %vector.body57 %index58 = phi i64 [ %index.next59, %vector.body57 ], [ 0, %for.cond3.preheader.us ] %2 = getelementptr inbounds [101 x [101 x i32]], ptr @W, i64 0, i64 %indvars.iv44, i64 %index58 store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %2, align 4, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %3, align 4, !tbaa !5 %index.next59 = add nuw i64 %index58, 8 %4 = icmp eq i64 %index.next59, %n.vec54 br i1 %4, label %middle.block49, label %vector.body57, !llvm.loop !20 middle.block49: ; preds = %vector.body57 br i1 %cmp.n56, label %for.cond3.for.inc8_crit_edge.us, label %for.body5.us.preheader for.body5.us.preheader: ; preds = %for.cond3.preheader.us, %middle.block49 %indvars.iv.ph = phi i64 [ 0, %for.cond3.preheader.us ], [ %n.vec54, %middle.block49 ] br label %for.body5.us for.body5.us: ; preds = %for.body5.us.preheader, %for.body5.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5.us ], [ %indvars.iv.ph, %for.body5.us.preheader ] %arrayidx7.us = getelementptr inbounds [101 x [101 x i32]], ptr @W, i64 0, i64 %indvars.iv44, i64 %indvars.iv store i32 100000000, ptr %arrayidx7.us, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count47 br i1 %exitcond.not, label %for.cond3.for.inc8_crit_edge.us, label %for.body5.us, !llvm.loop !21 for.cond3.for.inc8_crit_edge.us: ; preds = %for.body5.us, %middle.block49 %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1 %exitcond48.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count47 br i1 %exitcond48.not, label %for.cond11.preheader, label %for.cond3.preheader.us, !llvm.loop !22 for.cond11.preheader: ; preds = %for.cond3.for.inc8_crit_edge.us, %for.cond.preheader %5 = load i32, ptr @m, align 4, !tbaa !5 %cmp1238 = icmp sgt i32 %5, 0 br i1 %cmp1238, label %for.body13, label %for.end25 for.body13: ; preds = %for.cond11.preheader, %for.body13 %i.139 = phi i32 [ %inc24, %for.body13 ], [ 0, %for.cond11.preheader ] %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %from, ptr noundef nonnull %to, ptr noundef nonnull %cost) %6 = load i32, ptr %cost, align 4, !tbaa !5 %7 = load i32, ptr %from, align 4, !tbaa !5 %idxprom15 = sext i32 %7 to i64 %8 = load i32, ptr %to, align 4, !tbaa !5 %idxprom17 = sext i32 %8 to i64 %arrayidx18 = getelementptr inbounds [101 x [101 x i32]], ptr @W, i64 0, i64 %idxprom15, i64 %idxprom17 store i32 %6, ptr %arrayidx18, align 4, !tbaa !5 %arrayidx22 = getelementptr inbounds [101 x [101 x i32]], ptr @W, i64 0, i64 %idxprom17, i64 %idxprom15 store i32 %6, ptr %arrayidx22, align 4, !tbaa !5 %inc24 = add nuw nsw i32 %i.139, 1 %9 = load i32, ptr @m, align 4, !tbaa !5 %cmp12 = icmp slt i32 %inc24, %9 br i1 %cmp12, label %for.body13, label %for.end25.loopexit, !llvm.loop !23 for.end25.loopexit: ; preds = %for.body13 %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.end25 for.end25: ; preds = %for.end25.loopexit, %for.cond11.preheader %10 = phi i32 [ %.pre, %for.end25.loopexit ], [ %1, %for.cond11.preheader ] %cmp74.i = icmp sgt i32 %10, 0 br i1 %cmp74.i, label %for.body.preheader.i, label %for.end.thread.i for.end.thread.i: ; preds = %for.end25 store i32 0, ptr @vertex, align 16, !tbaa !9 br label %prim.exit for.body.preheader.i: ; preds = %for.end25 %wide.trip.count.i = zext i32 %10 to i64 %min.iters.check = icmp ult i32 %10, 4 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %wide.trip.count.i, 4294967292 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %11 = or i64 %index, 2 %12 = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %index %13 = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %11 store <4 x i32> <i32 100000000, i32 0, i32 100000000, i32 0>, ptr %12, align 16, !tbaa !5 store <4 x i32> <i32 100000000, i32 0, i32 100000000, i32 0>, ptr %13, align 16, !tbaa !5 %index.next = add nuw i64 %index, 4 %14 = icmp eq i64 %index.next, %n.vec br i1 %14, label %middle.block, label %vector.body, !llvm.loop !24 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i br i1 %cmp.n, label %for.end.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv.i store i32 100000000, ptr %arrayidx.i, align 8, !tbaa !9 %state.i = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv.i, i32 1 store i32 0, ptr %state.i, align 4, !tbaa !15 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %for.end.i, label %for.body.i, !llvm.loop !25 for.end.i: ; preds = %for.body.i, %middle.block store i32 0, ptr @vertex, align 16, !tbaa !9 %xtraiter = and i64 %wide.trip.count.i, 1 %15 = icmp eq i32 %10, 1 %unroll_iter = and i64 %wide.trip.count.i, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.body11.us.preheader.i for.body11.us.preheader.i: ; preds = %for.end.i, %for.cond29.for.end50_crit_edge.us.i %sum.087.us.i = phi i32 [ %add.us.i, %for.cond29.for.end50_crit_edge.us.i ], [ 0, %for.end.i ] %step.086.us.i = phi i32 [ %inc52.us.i, %for.cond29.for.end50_crit_edge.us.i ], [ 1, %for.end.i ] %p.085.us.i = phi i32 [ %p.2.us.i.lcssa, %for.cond29.for.end50_crit_edge.us.i ], [ undef, %for.end.i ] br i1 %15, label %for.end25.us.i.unr-lcssa, label %for.body11.us.i for.end25.us.i.unr-lcssa: ; preds = %for.inc23.us.i.1, %for.body11.us.preheader.i %p.2.us.i.lcssa.ph = phi i32 [ undef, %for.body11.us.preheader.i ], [ %p.2.us.i.1, %for.inc23.us.i.1 ] %minimum.1.us.i.lcssa.ph = phi i32 [ undef, %for.body11.us.preheader.i ], [ %minimum.1.us.i.1, %for.inc23.us.i.1 ] %indvars.iv126.i.unr = phi i64 [ 0, %for.body11.us.preheader.i ], [ %indvars.iv.next127.i.1, %for.inc23.us.i.1 ] %minimum.079.us.i.unr = phi i32 [ 100000000, %for.body11.us.preheader.i ], [ %minimum.1.us.i.1, %for.inc23.us.i.1 ] %p.178.us.i.unr = phi i32 [ %p.085.us.i, %for.body11.us.preheader.i ], [ %p.2.us.i.1, %for.inc23.us.i.1 ] br i1 %lcmp.mod.not, label %for.end25.us.i, label %for.body11.us.i.epil for.body11.us.i.epil: ; preds = %for.end25.us.i.unr-lcssa %state14.us.i.epil = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv126.i.unr, i32 1 %16 = load i32, ptr %state14.us.i.epil, align 4, !tbaa !15 %cmp15.us.i.epil = icmp eq i32 %16, 0 br i1 %cmp15.us.i.epil, label %land.lhs.true.us.i.epil, label %for.end25.us.i land.lhs.true.us.i.epil: ; preds = %for.body11.us.i.epil %arrayidx13.us.i.epil = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv126.i.unr %17 = load i32, ptr %arrayidx13.us.i.epil, align 8, !tbaa !9 %cmp19.us.i.epil = icmp slt i32 %17, %minimum.079.us.i.unr %18 = trunc i64 %indvars.iv126.i.unr to i32 %spec.select.us.i.epil = select i1 %cmp19.us.i.epil, i32 %18, i32 %p.178.us.i.unr %spec.select73.us.i.epil = call i32 @llvm.smin.i32(i32 %17, i32 %minimum.079.us.i.unr) br label %for.end25.us.i for.end25.us.i: ; preds = %for.body11.us.i.epil, %land.lhs.true.us.i.epil, %for.end25.us.i.unr-lcssa %p.2.us.i.lcssa = phi i32 [ %p.2.us.i.lcssa.ph, %for.end25.us.i.unr-lcssa ], [ %p.178.us.i.unr, %for.body11.us.i.epil ], [ %spec.select.us.i.epil, %land.lhs.true.us.i.epil ] %minimum.1.us.i.lcssa = phi i32 [ %minimum.1.us.i.lcssa.ph, %for.end25.us.i.unr-lcssa ], [ %minimum.079.us.i.unr, %for.body11.us.i.epil ], [ %spec.select73.us.i.epil, %land.lhs.true.us.i.epil ] %idxprom26.us.i = sext i32 %p.2.us.i.lcssa to i64 %state28.us.i = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %idxprom26.us.i, i32 1 store i32 1, ptr %state28.us.i, align 4, !tbaa !15 br label %for.body31.us.i for.body31.us.i: ; preds = %for.inc48.us.i, %for.end25.us.i %indvars.iv131.i = phi i64 [ 0, %for.end25.us.i ], [ %indvars.iv.next132.i, %for.inc48.us.i ] %state34.us.i = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv131.i, i32 1 %19 = load i32, ptr %state34.us.i, align 4, !tbaa !15 %cmp35.us.i = icmp eq i32 %19, 0 br i1 %cmp35.us.i, label %if.then36.us.i, label %for.inc48.us.i if.then36.us.i: ; preds = %for.body31.us.i %arrayidx33.us.i = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv131.i %20 = load i32, ptr %arrayidx33.us.i, align 8, !tbaa !9 %arrayidx43.us.i = getelementptr inbounds [101 x [101 x i32]], ptr @W, i64 0, i64 %idxprom26.us.i, i64 %indvars.iv131.i %21 = load i32, ptr %arrayidx43.us.i, align 4, !tbaa !5 %cond.i.us.i = call i32 @llvm.smin.i32(i32 %20, i32 %21) store i32 %cond.i.us.i, ptr %arrayidx33.us.i, align 8, !tbaa !9 br label %for.inc48.us.i for.inc48.us.i: ; preds = %if.then36.us.i, %for.body31.us.i %indvars.iv.next132.i = add nuw nsw i64 %indvars.iv131.i, 1 %exitcond135.not.i = icmp eq i64 %indvars.iv.next132.i, %wide.trip.count.i br i1 %exitcond135.not.i, label %for.cond29.for.end50_crit_edge.us.i, label %for.body31.us.i, !llvm.loop !17 for.body11.us.i: ; preds = %for.body11.us.preheader.i, %for.inc23.us.i.1 %indvars.iv126.i = phi i64 [ %indvars.iv.next127.i.1, %for.inc23.us.i.1 ], [ 0, %for.body11.us.preheader.i ] %minimum.079.us.i = phi i32 [ %minimum.1.us.i.1, %for.inc23.us.i.1 ], [ 100000000, %for.body11.us.preheader.i ] %p.178.us.i = phi i32 [ %p.2.us.i.1, %for.inc23.us.i.1 ], [ %p.085.us.i, %for.body11.us.preheader.i ] %niter = phi i64 [ %niter.next.1, %for.inc23.us.i.1 ], [ 0, %for.body11.us.preheader.i ] %state14.us.i = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv126.i, i32 1 %22 = load i32, ptr %state14.us.i, align 4, !tbaa !15 %cmp15.us.i = icmp eq i32 %22, 0 br i1 %cmp15.us.i, label %land.lhs.true.us.i, label %for.inc23.us.i land.lhs.true.us.i: ; preds = %for.body11.us.i %arrayidx13.us.i = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv126.i %23 = load i32, ptr %arrayidx13.us.i, align 16, !tbaa !9 %cmp19.us.i = icmp slt i32 %23, %minimum.079.us.i %24 = trunc i64 %indvars.iv126.i to i32 %spec.select.us.i = select i1 %cmp19.us.i, i32 %24, i32 %p.178.us.i %spec.select73.us.i = call i32 @llvm.smin.i32(i32 %23, i32 %minimum.079.us.i) br label %for.inc23.us.i for.inc23.us.i: ; preds = %land.lhs.true.us.i, %for.body11.us.i %p.2.us.i = phi i32 [ %p.178.us.i, %for.body11.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %minimum.1.us.i = phi i32 [ %minimum.079.us.i, %for.body11.us.i ], [ %spec.select73.us.i, %land.lhs.true.us.i ] %indvars.iv.next127.i = or i64 %indvars.iv126.i, 1 %state14.us.i.1 = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv.next127.i, i32 1 %25 = load i32, ptr %state14.us.i.1, align 4, !tbaa !15 %cmp15.us.i.1 = icmp eq i32 %25, 0 br i1 %cmp15.us.i.1, label %land.lhs.true.us.i.1, label %for.inc23.us.i.1 land.lhs.true.us.i.1: ; preds = %for.inc23.us.i %arrayidx13.us.i.1 = getelementptr inbounds [101 x %struct.NODE], ptr @vertex, i64 0, i64 %indvars.iv.next127.i %26 = load i32, ptr %arrayidx13.us.i.1, align 8, !tbaa !9 %cmp19.us.i.1 = icmp slt i32 %26, %minimum.1.us.i %27 = trunc i64 %indvars.iv.next127.i to i32 %spec.select.us.i.1 = select i1 %cmp19.us.i.1, i32 %27, i32 %p.2.us.i %spec.select73.us.i.1 = call i32 @llvm.smin.i32(i32 %26, i32 %minimum.1.us.i) br label %for.inc23.us.i.1 for.inc23.us.i.1: ; preds = %land.lhs.true.us.i.1, %for.inc23.us.i %p.2.us.i.1 = phi i32 [ %p.2.us.i, %for.inc23.us.i ], [ %spec.select.us.i.1, %land.lhs.true.us.i.1 ] %minimum.1.us.i.1 = phi i32 [ %minimum.1.us.i, %for.inc23.us.i ], [ %spec.select73.us.i.1, %land.lhs.true.us.i.1 ] %indvars.iv.next127.i.1 = add nuw nsw i64 %indvars.iv126.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 %for.end25.us.i.unr-lcssa, label %for.body11.us.i, !llvm.loop !18 for.cond29.for.end50_crit_edge.us.i: ; preds = %for.inc48.us.i %add.us.i = add nsw i32 %minimum.1.us.i.lcssa, %sum.087.us.i %inc52.us.i = add nuw i32 %step.086.us.i, 1 %exitcond136.not.i = icmp eq i32 %step.086.us.i, %10 br i1 %exitcond136.not.i, label %prim.exit, label %for.body11.us.preheader.i, !llvm.loop !19 prim.exit: ; preds = %for.cond29.for.end50_crit_edge.us.i, %for.end.thread.i %sum.0.lcssa.i = phi i32 [ 0, %for.end.thread.i ], [ %add.us.i, %for.cond29.for.end50_crit_edge.us.i ] %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m) %28 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp eq i32 %28, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %prim.exit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %cost) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %to) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %from) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 0} !10 = !{!"NODE", !6, i64 0, !6, i64 4} !11 = distinct !{!11, !12, !13, !14} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = !{!10, !6, i64 4} !16 = distinct !{!16, !12, !14, !13} !17 = distinct !{!17, !12} !18 = distinct !{!18, !12} !19 = distinct !{!19, !12} !20 = distinct !{!20, !12, !13, !14} !21 = distinct !{!21, !12, !14, !13} !22 = distinct !{!22, !12} !23 = distinct !{!23, !12} !24 = distinct !{!24, !12, !13, !14} !25 = distinct !{!25, !12, !14, !13}
/* cat <<EOF >mistaken-paste */ #pragma GCC diagnostic ignored "-Wincompatible-pointer-types" #define _USE_MATH_DEFINES #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> #include <time.h> #define BIG 2000000007 #define VERYBIG 200000000000007LL #define MOD 1000000007 #define FOD 998244353 typedef uint64_t ull; typedef int64_t sll; #define N_MAX 1000000 #define M_MAX 200000 #ifdef __cplusplus #include <queue> #include <stack> // #include <tuple> #include <set> #include <map> // using namespace std; // HELL using std::queue; using std::priority_queue; using std::stack; // using std::tuple; using std::set; using std::map; using std::vector; using std::greater; using std::pair; #endif typedef struct { int32_t a; int32_t b; } hw; typedef struct { sll a; sll b; } hwll; typedef struct { sll a; sll b; sll c; } hwllc; typedef struct { hwll a; hwll b; } linell; ull n, m; ull h, w; ull k; ull q; ull vua, vub, vuc, vud, vue, vuf; sll vsa, vsb, vsc, vsd, vse, vsf; long double vra, vrb, vrc; double vda, vdb, vdc; size_t slen; size_t tlen; char ch, dh; ull umin (ull x, ull y) { return (x < y) ? x : y; } ull umax (ull x, ull y) { return (x > y) ? x : y; } sll smin (sll x, sll y) { return (x < y) ? x : y; } sll smax (sll x, sll y) { return (x > y) ? x : y; } ull gcd (ull x, ull y) { if (x < y) { return gcd(y, x); } else if (y == 0) { return x; } else { return gcd(y, x % y); } } ull bitpow (ull a, ull x, ull modulo) { ull result = 1; while (x) { if (x & 1) { result *= a; result %= modulo; } x /= 2; a = (a * a) % modulo; } return result; } ull divide (ull a, ull b, ull modulo) { return (a * bitpow(b, modulo - 2, modulo)) % modulo; } ull udiff (ull a, ull b) { if (a >= b) { return a - b; } else { return b - a; } } sll sdiff (sll a, sll b) { if (a >= b) { return a - b; } else { return b - a; } } void printUquotient (ull left, ull right) { const int32_t digits = 20; printf("%llu.", left / right); left %= right; for (int32_t i = 0; i < digits; i++) { left *= 10; printf("%1d", left / right); left %= right; } puts(""); return; } void printSquotient (sll left, sll right) { if (left * right < 0) putchar('-'); printUquotient(sdiff(left, 0), sdiff(right, 0)); return; } int bitcount (ull n) { int result = 0; while (n) { if (n & 1) result++; n /= 2; } return result; } #ifdef __cplusplus bool setfind (set<ull> s, ull x) { return (s.find(x) != s.end()); } #endif // double distance (sll x1, sll y1, sll x2, sll y2) { // double xdist2, ydist2, origindist, dist; // xdist2 = (x1 - x2) * (x1 - x2); // ydist2 = (y1 - y2) * (y1 - y2); // return sqrt(xdist2 + ydist2); // } int32_t pullcomp (const void *left, const void *right) { ull l = *(ull*)left; ull r = *(ull*)right; if (l < r) { return -1; } if (l > r) { return +1; } return 0; } int32_t psllcomp (const void *left, const void *right) { sll l = *(sll*)left; sll r = *(sll*)right; if (l < r) { return -1; } if (l > r) { return +1; } return 0; } int32_t pcharcomp (const void *left, const void *right) { char l = *(char*)left; char r = *(char*)right; if (l < r) { return -1; } if (l > r) { return +1; } return 0; } int32_t pstrcomp (const void *left, const void *right) { char* l = *(char**)left; char* r = *(char**)right; return strcmp(l, r); } int32_t phwllABcomp (const void *left, const void *right) { hwll l = *(hwll*)left; hwll r = *(hwll*)right; if (l.a < r.a) { return -1; } if (l.a > r.a) { return +1; } if (l.b < r.b) { return -1; } if (l.b > r.b) { return +1; } return 0; } int32_t phwllREVcomp (const void *left, const void *right) { hwll l = *(hwll*)left; hwll r = *(hwll*)right; if (l.b < r.b) { return -1; } if (l.b > r.b) { return +1; } if (l.a < r.a) { return -1; } if (l.a > r.a) { return +1; } return 0; } int32_t ptriplecomp (const void *left, const void *right) { hwllc l = *(hwllc*)left; hwllc r = *(hwllc*)right; if (l.a < r.a) { return -1; } if (l.a > r.a) { return +1; } if (l.b < r.b) { return -1; } if (l.b > r.b) { return +1; } if (l.c < r.c) { return -1; } if (l.c > r.c) { return +1; } return 0; } bool isinrange (sll left, sll x, sll right) { return (left <= x && x <= right); } bool isinrange_soft (sll left, sll x, sll right) { return (left <= x && x <= right) || (left >= x && x >= right); } ull parent[N_MAX]; ull rank[N_MAX]; void uf_init (ull n) { for (sll i = 0; i < n; i++) { parent[i] = i; rank[i] = 0; } } ull uf_find (ull x) { if (parent[x] == x) return x; return parent[x] = uf_find(parent[x]); } bool uf_union (ull a, ull b) { a = uf_find(a); b = uf_find(b); if (a == b) return false; if (rank[a] > rank[b]) { parent[b] = a; } else { parent[a] = b; if (rank[a] == rank[b]) { rank[b]++; } } return true; } sll a[N_MAX]; // sll a[3001][3001]; sll b[N_MAX]; sll c[N_MAX]; char s[N_MAX + 1]; // char s[3010][3010]; char t[N_MAX + 1]; // hwll xy[N_MAX]; bool iscon[1000][1000]; ull color[N_MAX]; sll diffs[N_MAX], dlen = 0; hwll dfs (ull v, ull curr) { hwll x = {0, 0}; bool isok = true; color[v] = curr; if (curr == 1) { x.a++; } else { x.b++; } for (sll u = 0; u < n; u++) { if (v == u || iscon[v][u]) continue; if (color[u]) { if (color[u] == curr) isok = false; } else { hwll y = dfs(u, curr ^ 3); if (y.a < 0) isok = false; x.a += y.a; x.b += y.b; } } if (isok) { return x; } else { hwll ng = {-1, -1}; return ng; } } bool dp[1000][1000]; ull solve () { sll i, j, ki, li; ull result = 0; // sll result = 0; double dresult = 0; // ull maybe = 0; sll maybe = 0; // ull sum = 0; sll sum = 0; sll item; ull *dpcell; for (i = 0; i < m; i++) { iscon[a[i]][b[i]] = iscon[b[i]][a[i]] = true; } for (i = 0; i < n; i++) { if (!color[i]) { hwll x = dfs(i, 1); if (x.a < 0) goto fail; diffs[dlen++] = sdiff(x.a, x.b); } } for (i = 0; i <= dlen; i++) { for (j = 0; j <= n; j++) { if (!i) { dp[i][j] = (j ? false : true); continue; } sll hoge = diffs[i - 1]; if (hoge >= j) { dp[i][j] |= dp[i - 1][hoge - j]; } if (hoge <= j) { dp[i][j] |= dp[i - 1][j - hoge]; } if (hoge + j <= n) { dp[i][j] |= dp[i - 1][hoge + j]; } } } ull minv; for (j = 0; j <= n; j++) { if (dp[dlen][j]) { minv = j; break; } } if (j > n) goto fail; ull lowr = (n - minv) / 2; ull high = (n + minv) / 2; // printf("%lluvs%llu\n", lowr, high); result = (lowr * (lowr - 1) / 2) + (high * (high - 1) / 2); printf("%llu\n", result); // printf("%.15lf\n", dresult); // puts(s); return 0; success: // puts("YES"); puts("Yes"); // printf("%llu\n", result); // puts("0"); // puts("First"); return 0; fail: // puts("NO"); // puts("No"); // puts("0"); puts("-1"); // puts("-1 -1 -1"); // puts("Second"); return 1; } int32_t main (void) { int32_t i, j; int32_t x, y; // scanf("%lf%lf", &vda, &vdb, &vdc); // scanf("%lld%lld", &vsa, &vsb, &vsc, &vsd); // scanf("%llu%llu", &vua, &vub, &vuc, &vud); // scanf("%*llu%*llu"); // scanf("%llu%llu", &h, &w); scanf("%llu%llu", &n, &m); // scanf("%llu", &k, &n); // scanf("%llu%llu", &vua, &vub, &vuc, &vud, &vue, &vuf); // vua--; // vub--; // vuc--; // vud--; // scanf("%lld%lld", &vsa, &vsb, &vsc); // scanf("%s", s); // scanf("%s", t); // scanf("%llu", &k); // scanf("%llu", &q); for (i = 0; i < m; i++) { scanf("%lld", &a[i]); scanf("%lld", &b[i]); // scanf("%lld%lld", &xy[i].a, &xy[i].b); // scanf("%lld", &c[i]); a[i]--; b[i]--; // c[i]--; } // scanf("%llu%llu", &m, &k); // for (i = 0; i < m; i++) { // scanf("%llu", &b[i]); // b[i]--; // } // scanf("%llu", &q); // for (i = 0; i < n; i++) { // for (j = 0; j < n; j++) { // scanf("%llu", &a[i][j]); // } // } // for (i = 0; i < h; i++) { // scanf("%s", &s[i]); // } // scanf("%llu", &k); // scanf("%llu", &q); solve(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151174/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151174/source.c" target datalayout = "e-m:e-p270: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"%llu.\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%1d\00", align 1 @parent = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @rank = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @dlen = dso_local local_unnamed_addr global i64 0, align 8 @color = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @n = dso_local global i64 0, align 8 @iscon = dso_local local_unnamed_addr global [1000 x [1000 x i8]] zeroinitializer, align 16 @m = dso_local global i64 0, align 8 @b = dso_local global [1000000 x i64] zeroinitializer, align 16 @a = dso_local global [1000000 x i64] zeroinitializer, align 16 @diffs = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @dp = dso_local local_unnamed_addr global [1000 x [1000 x i8]] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1 @.str.5 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 @.str.6 = private unnamed_addr constant [9 x i8] c"%llu%llu\00", align 1 @.str.7 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @h = dso_local local_unnamed_addr global i64 0, align 8 @w = dso_local local_unnamed_addr global i64 0, align 8 @k = dso_local local_unnamed_addr global i64 0, align 8 @q = dso_local local_unnamed_addr global i64 0, align 8 @vua = dso_local local_unnamed_addr global i64 0, align 8 @vub = dso_local local_unnamed_addr global i64 0, align 8 @vuc = dso_local local_unnamed_addr global i64 0, align 8 @vud = dso_local local_unnamed_addr global i64 0, align 8 @vue = dso_local local_unnamed_addr global i64 0, align 8 @vuf = dso_local local_unnamed_addr global i64 0, align 8 @vsa = dso_local local_unnamed_addr global i64 0, align 8 @vsb = dso_local local_unnamed_addr global i64 0, align 8 @vsc = dso_local local_unnamed_addr global i64 0, align 8 @vsd = dso_local local_unnamed_addr global i64 0, align 8 @vse = dso_local local_unnamed_addr global i64 0, align 8 @vsf = dso_local local_unnamed_addr global i64 0, align 8 @vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @slen = dso_local local_unnamed_addr global i64 0, align 8 @tlen = dso_local local_unnamed_addr global i64 0, align 8 @ch = dso_local local_unnamed_addr global i8 0, align 1 @dh = dso_local local_unnamed_addr global i8 0, align 1 @c = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @s = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16 @t = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse.backedge, %entry %x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ] %y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ] %cmp = icmp ult i64 %x.tr, %y.tr br i1 %cmp, label %tailrecurse.backedge, label %if.else if.else: ; preds = %tailrecurse %cmp1 = icmp eq i64 %y.tr, 0 br i1 %cmp1, label %return, label %if.else3 if.else3: ; preds = %if.else %rem = urem i64 %x.tr, %y.tr br label %tailrecurse.backedge tailrecurse.backedge: ; preds = %if.else3, %tailrecurse %y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ] br label %tailrecurse return: ; preds = %if.else ret i64 %x.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 { entry: %tobool.not12 = icmp eq i64 %x, 0 br i1 %tobool.not12, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ] %a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ] %x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ] %and = and i64 %x.addr.013, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul i64 %result.015, %a.addr.014 %rem = urem i64 %mul, %modulo br label %if.end if.end: ; preds = %if.then, %while.body %result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ] %div11 = lshr i64 %x.addr.013, 1 %mul2 = mul i64 %a.addr.014, %a.addr.014 %rem3 = urem i64 %mul2, %modulo %tobool.not = icmp ult i64 %x.addr.013, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %if.end, %entry %result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ] ret i64 %result.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 { entry: %sub = add i64 %modulo, -2 %tobool.not12.i = icmp eq i64 %sub, 0 br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i while.body.i: ; preds = %entry, %if.end.i %result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ] %a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ] %x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ] %and.i = and i64 %x.addr.013.i, 1 %tobool1.not.i = icmp eq i64 %and.i, 0 br i1 %tobool1.not.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %while.body.i %mul.i = mul i64 %a.addr.014.i, %result.015.i %rem.i = urem i64 %mul.i, %modulo br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.i %result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ] %div11.i = lshr i64 %x.addr.013.i, 1 %mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i %rem3.i = urem i64 %mul2.i, %modulo %tobool.not.i = icmp ult i64 %x.addr.013.i, 2 br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5 bitpow.exit: ; preds = %if.end.i, %entry %result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ] %mul = mul i64 %result.0.lcssa.i, %a %rem = urem i64 %mul, %modulo ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not = icmp ult i64 %a, %b %sub = sub i64 %a, %b %sub1 = sub i64 %b, %a %retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub = sub nsw i64 %a, %b %retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true) ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @printUquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 { entry: %div = udiv i64 %left, %right %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div) %left.addr.0 = urem i64 %left, %right %mul = mul i64 %left.addr.0, 10 %div1 = udiv i64 %mul, %right %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1) %left.addr.0.1 = urem i64 %mul, %right %mul.1 = mul i64 %left.addr.0.1, 10 %div1.1 = udiv i64 %mul.1, %right %call2.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.1) %left.addr.0.2 = urem i64 %mul.1, %right %mul.2 = mul i64 %left.addr.0.2, 10 %div1.2 = udiv i64 %mul.2, %right %call2.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.2) %left.addr.0.3 = urem i64 %mul.2, %right %mul.3 = mul i64 %left.addr.0.3, 10 %div1.3 = udiv i64 %mul.3, %right %call2.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.3) %left.addr.0.4 = urem i64 %mul.3, %right %mul.4 = mul i64 %left.addr.0.4, 10 %div1.4 = udiv i64 %mul.4, %right %call2.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.4) %left.addr.0.5 = urem i64 %mul.4, %right %mul.5 = mul i64 %left.addr.0.5, 10 %div1.5 = udiv i64 %mul.5, %right %call2.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.5) %left.addr.0.6 = urem i64 %mul.5, %right %mul.6 = mul i64 %left.addr.0.6, 10 %div1.6 = udiv i64 %mul.6, %right %call2.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.6) %left.addr.0.7 = urem i64 %mul.6, %right %mul.7 = mul i64 %left.addr.0.7, 10 %div1.7 = udiv i64 %mul.7, %right %call2.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.7) %left.addr.0.8 = urem i64 %mul.7, %right %mul.8 = mul i64 %left.addr.0.8, 10 %div1.8 = udiv i64 %mul.8, %right %call2.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.8) %left.addr.0.9 = urem i64 %mul.8, %right %mul.9 = mul i64 %left.addr.0.9, 10 %div1.9 = udiv i64 %mul.9, %right %call2.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.9) %left.addr.0.10 = urem i64 %mul.9, %right %mul.10 = mul i64 %left.addr.0.10, 10 %div1.10 = udiv i64 %mul.10, %right %call2.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.10) %left.addr.0.11 = urem i64 %mul.10, %right %mul.11 = mul i64 %left.addr.0.11, 10 %div1.11 = udiv i64 %mul.11, %right %call2.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.11) %left.addr.0.12 = urem i64 %mul.11, %right %mul.12 = mul i64 %left.addr.0.12, 10 %div1.12 = udiv i64 %mul.12, %right %call2.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.12) %left.addr.0.13 = urem i64 %mul.12, %right %mul.13 = mul i64 %left.addr.0.13, 10 %div1.13 = udiv i64 %mul.13, %right %call2.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.13) %left.addr.0.14 = urem i64 %mul.13, %right %mul.14 = mul i64 %left.addr.0.14, 10 %div1.14 = udiv i64 %mul.14, %right %call2.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.14) %left.addr.0.15 = urem i64 %mul.14, %right %mul.15 = mul i64 %left.addr.0.15, 10 %div1.15 = udiv i64 %mul.15, %right %call2.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.15) %left.addr.0.16 = urem i64 %mul.15, %right %mul.16 = mul i64 %left.addr.0.16, 10 %div1.16 = udiv i64 %mul.16, %right %call2.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.16) %left.addr.0.17 = urem i64 %mul.16, %right %mul.17 = mul i64 %left.addr.0.17, 10 %div1.17 = udiv i64 %mul.17, %right %call2.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.17) %left.addr.0.18 = urem i64 %mul.17, %right %mul.18 = mul i64 %left.addr.0.18, 10 %div1.18 = udiv i64 %mul.18, %right %call2.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.18) %left.addr.0.19 = urem i64 %mul.18, %right %mul.19 = mul i64 %left.addr.0.19, 10 %div1.19 = udiv i64 %mul.19, %right %call2.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.19) %0 = load ptr, ptr @stdout, align 8, !tbaa !7 %call.i = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %0) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local void @printSquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 { entry: %mul = mul nsw i64 %right, %left %cmp = icmp slt i64 %mul, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %0 = load ptr, ptr @stdout, align 8, !tbaa !7 %call.i = tail call noundef i32 @putc(i32 noundef 45, ptr noundef %0) br label %if.end if.end: ; preds = %if.then, %entry %retval.0.i = tail call i64 @llvm.abs.i64(i64 %left, i1 true) %retval.0.i5 = tail call i64 @llvm.abs.i64(i64 %right, i1 true) tail call void @printUquotient(i64 noundef %retval.0.i, i64 noundef %retval.0.i5) ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 { entry: %tobool.not6 = icmp eq i64 %n, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ] %n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ] %0 = trunc i64 %n.addr.07 to i32 %1 = and i32 %0, 1 %spec.select = add i32 %1, %result.08 %div5 = lshr i64 %n.addr.07, 1 %tobool.not = icmp ult i64 %n.addr.07, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body, %entry %result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ] ret i32 %result.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i64, ptr %left, align 8, !tbaa !12 %1 = load i64, ptr %right, align 8, !tbaa !12 %cmp = icmp ult i64 %0, %1 %cmp1 = icmp ugt i64 %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 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i64, ptr %left, align 8, !tbaa !12 %1 = load i64, ptr %right, align 8, !tbaa !12 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %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 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i8, ptr %left, align 1, !tbaa !14 %1 = load i8, ptr %right, align 1, !tbaa !14 %cmp = icmp slt i8 %0, %1 %cmp5 = icmp sgt i8 %0, %1 %. = zext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #6 { entry: %0 = load ptr, ptr %left, align 8, !tbaa !7 %1 = load ptr, ptr %right, align 8, !tbaa !7 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #13 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !15 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !15 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !15 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !15 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16 %cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15 %l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !16 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15 %r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !16 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp13, label %cleanup, label %if.end15 if.end15: ; preds = %if.end10 %cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp17, label %cleanup, label %if.end19 if.end19: ; preds = %if.end15 %cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload %. = zext i1 %cmp22 to i32 br label %cleanup cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 { entry: %cmp = icmp sle i64 %left, %x %cmp1 = icmp sle i64 %x, %right %0 = and i1 %cmp, %cmp1 ret i1 %0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 { entry: %cmp.not = icmp sgt i64 %left, %x %cmp1.not = icmp sgt i64 %x, %right %or.cond = or i1 %cmp.not, %cmp1.not br i1 %or.cond, label %lor.rhs, label %lor.end lor.rhs: ; preds = %entry %cmp2 = icmp sge i64 %left, %x %cmp3 = icmp sge i64 %x, %right %0 = and i1 %cmp2, %cmp3 br label %lor.end lor.end: ; preds = %entry, %lor.rhs %1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ] ret i1 %1 } ; Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @uf_init(i64 noundef %n) local_unnamed_addr #8 { entry: %cmp6.not = icmp eq i64 %n, 0 br i1 %cmp6.not, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = shl nuw i64 %n, 3 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @rank, i8 0, i64 %0, i1 false), !tbaa !12 %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2> %1 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %index store <2 x i64> %vec.ind, ptr %1, align 16, !tbaa !12 %2 = getelementptr inbounds i64, ptr %1, i64 2 store <2 x i64> %step.add, ptr %2, align 16, !tbaa !12 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %3 = icmp eq i64 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !18 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry ret void for.body: ; preds = %for.body.preheader9, %for.body %i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %i.07 store i64 %i.07, ptr %arrayidx, align 8, !tbaa !12 %inc = add nuw nsw i64 %i.07, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !21 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @uf_find(i64 noundef %x) local_unnamed_addr #9 { entry: %arrayidx = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %x %0 = load i64, ptr %arrayidx, align 8, !tbaa !12 %cmp = icmp eq i64 %0, %x br i1 %cmp, label %common.ret7, label %if.end common.ret7: ; preds = %entry, %if.end %common.ret7.op = phi i64 [ %call, %if.end ], [ %x, %entry ] ret i64 %common.ret7.op if.end: ; preds = %entry %call = tail call i64 @uf_find(i64 noundef %0) store i64 %call, ptr %arrayidx, align 8, !tbaa !12 br label %common.ret7 } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local zeroext i1 @uf_union(i64 noundef %a, i64 noundef %b) local_unnamed_addr #10 { entry: %call = tail call i64 @uf_find(i64 noundef %a) %call1 = tail call i64 @uf_find(i64 noundef %b) %cmp = icmp ne i64 %call, %call1 br i1 %cmp, label %if.end, label %return if.end: ; preds = %entry %arrayidx = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %call %0 = load i64, ptr %arrayidx, align 8, !tbaa !12 %arrayidx2 = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %call1 %1 = load i64, ptr %arrayidx2, align 8, !tbaa !12 %cmp3 = icmp ugt i64 %0, %1 br i1 %cmp3, label %if.then4, label %if.else if.then4: ; preds = %if.end %arrayidx5 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %call1 store i64 %call, ptr %arrayidx5, align 8, !tbaa !12 br label %return if.else: ; preds = %if.end %arrayidx6 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %call store i64 %call1, ptr %arrayidx6, align 8, !tbaa !12 %cmp9 = icmp eq i64 %0, %1 br i1 %cmp9, label %if.then10, label %return if.then10: ; preds = %if.else %inc = add i64 %0, 1 store i64 %inc, ptr %arrayidx2, align 8, !tbaa !12 br label %return return: ; preds = %if.then4, %if.then10, %if.else, %entry ret i1 %cmp } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local { i64, i64 } @dfs(i64 noundef %v, i64 noundef %curr) local_unnamed_addr #9 { entry: %arrayidx = getelementptr inbounds [1000000 x i64], ptr @color, i64 0, i64 %v store i64 %curr, ptr %arrayidx, align 8, !tbaa !12 %cmp = icmp eq i64 %curr, 1 %. = zext i1 %cmp to i64 %not.cmp = xor i1 %cmp, true %.47 = zext i1 %not.cmp to i64 %0 = load i64, ptr @n, align 8, !tbaa !12 %cmp249.not = icmp eq i64 %0, 0 br i1 %cmp249.not, label %.thread, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %xor = xor i64 %curr, 3 br label %for.body for.cond.cleanup: ; preds = %for.inc %1 = and i8 %isok.2.fr, 1 %2 = icmp eq i8 %1, 0 %spec.select67 = select i1 %2, i64 -1, i64 %x.sroa.0.2 %spec.select68 = select i1 %2, i64 -1, i64 %x.sroa.8.2 br label %.thread .thread: ; preds = %for.cond.cleanup, %entry %3 = phi i64 [ %., %entry ], [ %spec.select67, %for.cond.cleanup ] %4 = phi i64 [ %.47, %entry ], [ %spec.select68, %for.cond.cleanup ] %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %3, 0 %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %4, 1 ret { i64, i64 } %.fca.1.insert for.body: ; preds = %for.body.lr.ph, %for.inc %5 = phi i64 [ %0, %for.body.lr.ph ], [ %10, %for.inc ] %u.053 = phi i64 [ 0, %for.body.lr.ph ], [ %inc26, %for.inc ] %isok.052 = phi i8 [ 1, %for.body.lr.ph ], [ %isok.2.fr, %for.inc ] %x.sroa.8.151 = phi i64 [ %.47, %for.body.lr.ph ], [ %x.sroa.8.2, %for.inc ] %x.sroa.0.150 = phi i64 [ %., %for.body.lr.ph ], [ %x.sroa.0.2, %for.inc ] %cmp3 = icmp eq i64 %u.053, %v br i1 %cmp3, label %for.inc, label %lor.lhs.false lor.lhs.false: ; preds = %for.body %arrayidx5 = getelementptr inbounds [1000 x [1000 x i8]], ptr @iscon, i64 0, i64 %v, i64 %u.053 %6 = load i8, ptr %arrayidx5, align 1, !tbaa !22, !range !24, !noundef !25 %tobool.not = icmp eq i8 %6, 0 br i1 %tobool.not, label %if.end7, label %for.inc if.end7: ; preds = %lor.lhs.false %arrayidx8 = getelementptr inbounds [1000000 x i64], ptr @color, i64 0, i64 %u.053 %7 = load i64, ptr %arrayidx8, align 8, !tbaa !12 %tobool9.not = icmp eq i64 %7, 0 br i1 %tobool9.not, label %if.else15, label %if.then10 if.then10: ; preds = %if.end7 %cmp12 = icmp eq i64 %7, %curr %spec.select = select i1 %cmp12, i8 0, i8 %isok.052 br label %for.inc if.else15: ; preds = %if.end7 %call = tail call { i64, i64 } @dfs(i64 noundef %u.053, i64 noundef %xor) %8 = extractvalue { i64, i64 } %call, 0 %9 = extractvalue { i64, i64 } %call, 1 %cmp17 = icmp slt i64 %8, 0 %spec.select48 = select i1 %cmp17, i8 0, i8 %isok.052 %add = add nsw i64 %8, %x.sroa.0.150 %add24 = add nsw i64 %9, %x.sroa.8.151 %.pre = load i64, ptr @n, align 8, !tbaa !12 br label %for.inc for.inc: ; preds = %if.then10, %if.else15, %for.body, %lor.lhs.false %10 = phi i64 [ %5, %for.body ], [ %5, %lor.lhs.false ], [ %.pre, %if.else15 ], [ %5, %if.then10 ] %x.sroa.0.2 = phi i64 [ %x.sroa.0.150, %for.body ], [ %x.sroa.0.150, %lor.lhs.false ], [ %add, %if.else15 ], [ %x.sroa.0.150, %if.then10 ] %x.sroa.8.2 = phi i64 [ %x.sroa.8.151, %for.body ], [ %x.sroa.8.151, %lor.lhs.false ], [ %add24, %if.else15 ], [ %x.sroa.8.151, %if.then10 ] %isok.2 = phi i8 [ %isok.052, %for.body ], [ %isok.052, %lor.lhs.false ], [ %spec.select48, %if.else15 ], [ %spec.select, %if.then10 ] %isok.2.fr = freeze i8 %isok.2 %inc26 = add nuw nsw i64 %u.053, 1 %cmp2 = icmp ult i64 %inc26, %10 br i1 %cmp2, label %for.body, label %for.cond.cleanup, !llvm.loop !26 } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @solve() local_unnamed_addr #3 { entry: %0 = load i64, ptr @m, align 8, !tbaa !12 %cmp190.not = icmp eq i64 %0, 0 br i1 %cmp190.not, label %for.cond8.preheader, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %0, 1 %1 = icmp eq i64 %0, 1 br i1 %1, label %for.cond8.preheader.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %0, -2 br label %for.body for.cond8.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %i.0191.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond8.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond8.preheader.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds [1000000 x i64], ptr @b, i64 0, i64 %i.0191.unr %2 = load i64, ptr %arrayidx.epil, align 8, !tbaa !12 %arrayidx2.epil = getelementptr inbounds [1000000 x i64], ptr @a, i64 0, i64 %i.0191.unr %3 = load i64, ptr %arrayidx2.epil, align 8, !tbaa !12 %arrayidx3.epil = getelementptr inbounds [1000 x [1000 x i8]], ptr @iscon, i64 0, i64 %2, i64 %3 store i8 1, ptr %arrayidx3.epil, align 1, !tbaa !22 %arrayidx7.epil = getelementptr inbounds [1000 x [1000 x i8]], ptr @iscon, i64 0, i64 %3, i64 %2 store i8 1, ptr %arrayidx7.epil, align 1, !tbaa !22 br label %for.cond8.preheader for.cond8.preheader: ; preds = %for.body.epil, %for.cond8.preheader.loopexit.unr-lcssa, %entry %4 = load i64, ptr @n, align 8, !tbaa !12 %cmp9192.not = icmp eq i64 %4, 0 br i1 %cmp9192.not, label %for.cond22.preheader, label %for.body10 for.body: ; preds = %for.body, %for.body.preheader.new %i.0191 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds [1000000 x i64], ptr @b, i64 0, i64 %i.0191 %5 = load i64, ptr %arrayidx, align 16, !tbaa !12 %arrayidx2 = getelementptr inbounds [1000000 x i64], ptr @a, i64 0, i64 %i.0191 %6 = load i64, ptr %arrayidx2, align 16, !tbaa !12 %arrayidx3 = getelementptr inbounds [1000 x [1000 x i8]], ptr @iscon, i64 0, i64 %5, i64 %6 store i8 1, ptr %arrayidx3, align 1, !tbaa !22 %arrayidx7 = getelementptr inbounds [1000 x [1000 x i8]], ptr @iscon, i64 0, i64 %6, i64 %5 store i8 1, ptr %arrayidx7, align 1, !tbaa !22 %inc = or i64 %i.0191, 1 %arrayidx.1 = getelementptr inbounds [1000000 x i64], ptr @b, i64 0, i64 %inc %7 = load i64, ptr %arrayidx.1, align 8, !tbaa !12 %arrayidx2.1 = getelementptr inbounds [1000000 x i64], ptr @a, i64 0, i64 %inc %8 = load i64, ptr %arrayidx2.1, align 8, !tbaa !12 %arrayidx3.1 = getelementptr inbounds [1000 x [1000 x i8]], ptr @iscon, i64 0, i64 %7, i64 %8 store i8 1, ptr %arrayidx3.1, align 1, !tbaa !22 %arrayidx7.1 = getelementptr inbounds [1000 x [1000 x i8]], ptr @iscon, i64 0, i64 %8, i64 %7 store i8 1, ptr %arrayidx7.1, align 1, !tbaa !22 %inc.1 = add nuw nsw i64 %i.0191, 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.cond8.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !27 for.cond22.preheader: ; preds = %for.inc19, %for.cond8.preheader %.lcssa188 = phi i64 [ 0, %for.cond8.preheader ], [ %16, %for.inc19 ] %9 = load i64, ptr @dlen, align 8, !tbaa !12 %cmp23.not195 = icmp slt i64 %9, 0 br i1 %cmp23.not195, label %for.body93.preheader, label %for.cond25.preheader.preheader for.cond25.preheader.preheader: ; preds = %for.cond22.preheader %10 = add i64 %.lcssa188, 1 %min.iters.check = icmp ult i64 %10, 8 %min.iters.check213 = icmp ult i64 %10, 16 %n.vec = and i64 %10, -16 %cmp.n = icmp eq i64 %10, %n.vec %n.vec.remaining = and i64 %10, 8 %min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0 %n.vec215 = and i64 %10, -8 %cmp.n217 = icmp eq i64 %10, %n.vec215 br label %for.cond25.preheader for.body10: ; preds = %for.cond8.preheader, %for.inc19 %11 = phi i64 [ %16, %for.inc19 ], [ %4, %for.cond8.preheader ] %i.1193 = phi i64 [ %inc20, %for.inc19 ], [ 0, %for.cond8.preheader ] %arrayidx11 = getelementptr inbounds [1000000 x i64], ptr @color, i64 0, i64 %i.1193 %12 = load i64, ptr %arrayidx11, align 8, !tbaa !12 %tobool.not = icmp eq i64 %12, 0 br i1 %tobool.not, label %if.then, label %for.inc19 if.then: ; preds = %for.body10 %call = tail call { i64, i64 } @dfs(i64 noundef %i.1193, i64 noundef 1) %13 = extractvalue { i64, i64 } %call, 0 %cmp12 = icmp slt i64 %13, 0 br i1 %cmp12, label %fail, label %cleanup.thread cleanup.thread: ; preds = %if.then %14 = extractvalue { i64, i64 } %call, 1 %sub.i = sub nsw i64 %13, %14 %retval.0.i = tail call i64 @llvm.abs.i64(i64 %sub.i, i1 true) %15 = load i64, ptr @dlen, align 8, !tbaa !12 %inc16 = add nsw i64 %15, 1 store i64 %inc16, ptr @dlen, align 8, !tbaa !12 %arrayidx17 = getelementptr inbounds [1000000 x i64], ptr @diffs, i64 0, i64 %15 store i64 %retval.0.i, ptr %arrayidx17, align 8, !tbaa !12 %.pre = load i64, ptr @n, align 8, !tbaa !12 br label %for.inc19 for.inc19: ; preds = %cleanup.thread, %for.body10 %16 = phi i64 [ %.pre, %cleanup.thread ], [ %11, %for.body10 ] %inc20 = add nuw nsw i64 %i.1193, 1 %cmp9 = icmp ult i64 %inc20, %16 br i1 %cmp9, label %for.body10, label %for.cond22.preheader, !llvm.loop !28 for.cond25.preheader: ; preds = %for.cond25.preheader.preheader, %for.inc87 %i.2196 = phi i64 [ %inc88, %for.inc87 ], [ 0, %for.cond25.preheader.preheader ] %tobool28.not = icmp eq i64 %i.2196, 0 %sub = add nsw i64 %i.2196, -1 br i1 %tobool28.not, label %iter.check, label %for.cond25.preheader.split iter.check: ; preds = %for.cond25.preheader br i1 %min.iters.check, label %for.body27.us.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check br i1 %min.iters.check213, label %vec.epilog.ph, label %vector.body vector.body: ; preds = %vector.main.loop.iter.check, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ] %vec.ind = phi <16 x i64> [ %vec.ind.next, %vector.body ], [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15>, %vector.main.loop.iter.check ] %17 = icmp eq <16 x i64> %vec.ind, zeroinitializer %18 = getelementptr inbounds [1000 x i8], ptr @dp, i64 0, i64 %index %19 = zext <16 x i1> %17 to <16 x i8> store <16 x i8> %19, ptr %18, align 16, !tbaa !22 %index.next = add nuw i64 %index, 16 %vec.ind.next = add <16 x i64> %vec.ind, <i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16> %20 = icmp eq i64 %index.next, %n.vec br i1 %20, label %middle.block, label %vector.body, !llvm.loop !29 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.inc87, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block br i1 %min.epilog.iters.check.not.not, label %for.body27.us.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 ] %.splatinsert = insertelement <8 x i64> poison, i64 %vec.epilog.resume.val, i64 0 %.splat = shufflevector <8 x i64> %.splatinsert, <8 x i64> poison, <8 x i32> zeroinitializer %induction = or <8 x i64> %.splat, <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7> br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index218 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next221, %vec.epilog.vector.body ] %vec.ind219 = phi <8 x i64> [ %induction, %vec.epilog.ph ], [ %vec.ind.next220, %vec.epilog.vector.body ] %21 = icmp eq <8 x i64> %vec.ind219, zeroinitializer %22 = getelementptr inbounds [1000 x i8], ptr @dp, i64 0, i64 %index218 %23 = zext <8 x i1> %21 to <8 x i8> store <8 x i8> %23, ptr %22, align 8, !tbaa !22 %index.next221 = add nuw i64 %index218, 8 %vec.ind.next220 = add <8 x i64> %vec.ind219, <i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8> %24 = icmp eq i64 %index.next221, %n.vec215 br i1 %24, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !30 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body br i1 %cmp.n217, label %for.inc87, label %for.body27.us.preheader for.body27.us.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %j.0194.us.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec215, %vec.epilog.middle.block ] br label %for.body27.us for.body27.us: ; preds = %for.body27.us.preheader, %for.body27.us %j.0194.us = phi i64 [ %inc85.us, %for.body27.us ], [ %j.0194.us.ph, %for.body27.us.preheader ] %tobool30.not.us = icmp eq i64 %j.0194.us, 0 %arrayidx33.us = getelementptr inbounds [1000 x i8], ptr @dp, i64 0, i64 %j.0194.us %frombool.us = zext i1 %tobool30.not.us to i8 store i8 %frombool.us, ptr %arrayidx33.us, align 1, !tbaa !22 %inc85.us = add nuw i64 %j.0194.us, 1 %exitcond203.not = icmp eq i64 %j.0194.us, %.lcssa188 br i1 %exitcond203.not, label %for.inc87, label %for.body27.us, !llvm.loop !31 for.cond25.preheader.split: ; preds = %for.cond25.preheader %arrayidx35 = getelementptr inbounds [1000000 x i64], ptr @diffs, i64 0, i64 %sub %25 = load i64, ptr %arrayidx35, align 8, !tbaa !12 br label %for.body27 for.body27: ; preds = %for.cond25.preheader.split, %for.inc84 %j.0194 = phi i64 [ 0, %for.cond25.preheader.split ], [ %inc85, %for.inc84 ] %cmp36.not = icmp slt i64 %25, %j.0194 br i1 %cmp36.not, label %if.end49, label %if.then37 if.then37: ; preds = %for.body27 %sub40 = sub nsw i64 %25, %j.0194 %arrayidx41 = getelementptr inbounds [1000 x [1000 x i8]], ptr @dp, i64 0, i64 %sub, i64 %sub40 %26 = load i8, ptr %arrayidx41, align 1, !tbaa !22, !range !24, !noundef !25 %arrayidx44 = getelementptr inbounds [1000 x [1000 x i8]], ptr @dp, i64 0, i64 %i.2196, i64 %j.0194 %27 = load i8, ptr %arrayidx44, align 1, !tbaa !22, !range !24, !noundef !25 %or180 = or i8 %27, %26 store i8 %or180, ptr %arrayidx44, align 1, !tbaa !22 br label %if.end49 if.end49: ; preds = %if.then37, %for.body27 %cmp50.not = icmp sgt i64 %25, %j.0194 br i1 %cmp50.not, label %if.end66, label %if.then52 if.then52: ; preds = %if.end49 %sub55 = sub nsw i64 %j.0194, %25 %arrayidx56 = getelementptr inbounds [1000 x [1000 x i8]], ptr @dp, i64 0, i64 %sub, i64 %sub55 %28 = load i8, ptr %arrayidx56, align 1, !tbaa !22, !range !24, !noundef !25 %arrayidx60 = getelementptr inbounds [1000 x [1000 x i8]], ptr @dp, i64 0, i64 %i.2196, i64 %j.0194 %29 = load i8, ptr %arrayidx60, align 1, !tbaa !22, !range !24, !noundef !25 %or63181 = or i8 %29, %28 store i8 %or63181, ptr %arrayidx60, align 1, !tbaa !22 br label %if.end66 if.end66: ; preds = %if.then52, %if.end49 %add = add nsw i64 %25, %j.0194 %cmp67.not = icmp ugt i64 %add, %.lcssa188 br i1 %cmp67.not, label %for.inc84, label %if.then69 if.then69: ; preds = %if.end66 %arrayidx73 = getelementptr inbounds [1000 x [1000 x i8]], ptr @dp, i64 0, i64 %sub, i64 %add %30 = load i8, ptr %arrayidx73, align 1, !tbaa !22, !range !24, !noundef !25 %arrayidx77 = getelementptr inbounds [1000 x [1000 x i8]], ptr @dp, i64 0, i64 %i.2196, i64 %j.0194 %31 = load i8, ptr %arrayidx77, align 1, !tbaa !22, !range !24, !noundef !25 %or80182 = or i8 %31, %30 store i8 %or80182, ptr %arrayidx77, align 1, !tbaa !22 br label %for.inc84 for.inc84: ; preds = %if.end66, %if.then69 %inc85 = add nuw i64 %j.0194, 1 %exitcond202.not = icmp eq i64 %j.0194, %.lcssa188 br i1 %exitcond202.not, label %for.inc87, label %for.body27, !llvm.loop !32 for.inc87: ; preds = %for.inc84, %for.body27.us, %middle.block, %vec.epilog.middle.block %inc88 = add nuw i64 %i.2196, 1 %exitcond204.not = icmp eq i64 %i.2196, %9 br i1 %exitcond204.not, label %for.body93.preheader, label %for.cond25.preheader, !llvm.loop !33 for.body93.preheader: ; preds = %for.inc87, %for.cond22.preheader br label %for.body93 for.body93: ; preds = %for.body93.preheader, %for.inc99 %j.1198 = phi i64 [ %inc100, %for.inc99 ], [ 0, %for.body93.preheader ] %arrayidx95 = getelementptr inbounds [1000 x [1000 x i8]], ptr @dp, i64 0, i64 %9, i64 %j.1198 %32 = load i8, ptr %arrayidx95, align 1, !tbaa !22, !range !24, !noundef !25 %tobool96.not = icmp eq i8 %32, 0 br i1 %tobool96.not, label %for.inc99, label %if.end105 for.inc99: ; preds = %for.body93 %inc100 = add nuw i64 %j.1198, 1 %exitcond205.not = icmp eq i64 %j.1198, %.lcssa188 br i1 %exitcond205.not, label %fail, label %for.body93, !llvm.loop !34 if.end105: ; preds = %for.body93 %sub106 = sub i64 %.lcssa188, %j.1198 %div176 = lshr i64 %sub106, 1 %add107 = add i64 %j.1198, %.lcssa188 %div108177 = lshr i64 %add107, 1 %sub109 = add nsw i64 %div176, -1 %mul = mul i64 %sub109, %div176 %div110178 = lshr i64 %mul, 1 %sub111 = add nsw i64 %div108177, -1 %mul112 = mul i64 %sub111, %div108177 %div113179 = lshr i64 %mul112, 1 %add114 = add nuw i64 %div110178, %div113179 %call115 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %add114) br label %cleanup118 fail: ; preds = %if.then, %for.inc99 %call117 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.5) br label %cleanup118 cleanup118: ; preds = %fail, %if.end105 %retval.0 = phi i64 [ 1, %fail ], [ 0, %if.end105 ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull @n, ptr noundef nonnull @m) %0 = load i64, ptr @m, align 8, !tbaa !12 %cmp17.not = icmp eq i64 %0, 0 br i1 %cmp17.not, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000000 x i64], ptr @a, i64 0, i64 %indvars.iv %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %arrayidx) %arrayidx4 = getelementptr inbounds [1000000 x i64], ptr @b, i64 0, i64 %indvars.iv %call5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %arrayidx4) %1 = load i64, ptr %arrayidx, align 8, !tbaa !12 %dec = add nsw i64 %1, -1 store i64 %dec, ptr %arrayidx, align 8, !tbaa !12 %2 = load i64, ptr %arrayidx4, align 8, !tbaa !12 %dec10 = add nsw i64 %2, -1 store i64 %dec10, ptr %arrayidx4, align 8, !tbaa !12 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %3 = load i64, ptr @m, align 8, !tbaa !12 %cmp = icmp ugt i64 %3, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !35 for.end: ; preds = %for.body, %entry %call11 = tail call i64 @solve() ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #11 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12 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 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 #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nosync nounwind memory(write, 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 #9 = { 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 #10 = { 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 #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #12 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #13 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"any pointer", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = !{!13, !13, i64 0} !13 = !{!"long", !9, i64 0} !14 = !{!9, !9, i64 0} !15 = !{i64 0, i64 8, !12, i64 8, i64 8, !12} !16 = !{i64 0, i64 8, !12} !17 = !{i64 0, i64 8, !12, i64 8, i64 8, !12, i64 16, i64 8, !12} !18 = distinct !{!18, !6, !19, !20} !19 = !{!"llvm.loop.isvectorized", i32 1} !20 = !{!"llvm.loop.unroll.runtime.disable"} !21 = distinct !{!21, !6, !20, !19} !22 = !{!23, !23, i64 0} !23 = !{!"_Bool", !9, i64 0} !24 = !{i8 0, i8 2} !25 = !{} !26 = distinct !{!26, !6} !27 = distinct !{!27, !6} !28 = distinct !{!28, !6} !29 = distinct !{!29, !6, !19, !20} !30 = distinct !{!30, !6, !19, !20} !31 = distinct !{!31, !6, !20, !19} !32 = distinct !{!32, !6} !33 = distinct !{!33, !6} !34 = distinct !{!34, !6} !35 = distinct !{!35, !6}
#include <stdarg.h> #include <stdio.h> #include <stdlib.h> long long min(int len, ...) { long long i, _min, num; va_list ap; va_start(ap, len); _min = va_arg(ap, long long); for (i = 1; i < len; i++) { num = va_arg(ap, long long); if (num < _min) _min = num; } va_end(ap); return _min; } int binary(long long *src, int len, long long trg) { // assumed src[0..len+1] int low, hi, mid; low = 0; hi = len+1; while (low < hi) { mid = low + (hi-low)/2; if (trg < *(src+mid)) hi = mid; else low = mid+1; } return low; } #define INF 1000000000000000000LL int main(void) { int i, j, k, l, m, n, A, B, Q; long long s[100010], t[100010], x, res, d1, d2; scanf("%d%d%d", &A, &B, &Q); for (i=1;i<=A;i++) scanf("%lld", &s[i]); s[0] = -INF; s[A+1] = INF; for (j=1;j<=B;j++) scanf("%lld", &t[j]); t[0] = -INF; t[B+1] = INF; for (i=1;i<=Q;i++) { scanf("%lld", &x); k = binary(s, A, x); l = binary(t, B, x); res = INF; for (m=k-1;m<=k;m++) for (n=l-1;n<=l;n++) { d1 = llabs(s[m] - x) + llabs(t[n] - s[m]); d2 = llabs(t[n] - x) + llabs(s[m] - t[n]); res = min( 3, res, d1, d2); } printf("%lld\n", res); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151224/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151224/source.c" target datalayout = "e-m:e-p270: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.__va_list_tag = type { i32, i32, ptr, ptr } @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nosync nounwind uwtable define dso_local i64 @min(i32 noundef %len, ...) local_unnamed_addr #0 { entry: %ap = alloca [1 x %struct.__va_list_tag], align 16 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %ap) #8 call void @llvm.va_start(ptr nonnull %ap) %gp_offset = load i32, ptr %ap, align 16 %fits_in_gp = icmp ult i32 %gp_offset, 41 br i1 %fits_in_gp, label %vaarg.in_reg, label %vaarg.in_mem vaarg.in_reg: ; preds = %entry %0 = getelementptr inbounds %struct.__va_list_tag, ptr %ap, i64 0, i32 3 %reg_save_area = load ptr, ptr %0, align 16 %1 = zext i32 %gp_offset to i64 %2 = getelementptr i8, ptr %reg_save_area, i64 %1 %3 = add nuw nsw i32 %gp_offset, 8 store i32 %3, ptr %ap, align 16 br label %vaarg.end vaarg.in_mem: ; preds = %entry %overflow_arg_area_p = getelementptr inbounds %struct.__va_list_tag, ptr %ap, i64 0, i32 2 %overflow_arg_area = load ptr, ptr %overflow_arg_area_p, align 8 %overflow_arg_area.next = getelementptr i8, ptr %overflow_arg_area, i64 8 store ptr %overflow_arg_area.next, ptr %overflow_arg_area_p, align 8 br label %vaarg.end vaarg.end: ; preds = %vaarg.in_mem, %vaarg.in_reg %ap.promoted = phi i32 [ %3, %vaarg.in_reg ], [ %gp_offset, %vaarg.in_mem ] %vaarg.addr = phi ptr [ %2, %vaarg.in_reg ], [ %overflow_arg_area, %vaarg.in_mem ] %4 = load i64, ptr %vaarg.addr, align 8 %cmp23 = icmp sgt i32 %len, 1 br i1 %cmp23, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %vaarg.end %conv = sext i32 %len to i64 %overflow_arg_area_p10 = getelementptr inbounds %struct.__va_list_tag, ptr %ap, i64 0, i32 2 %5 = getelementptr inbounds %struct.__va_list_tag, ptr %ap, i64 0, i32 3 %reg_save_area8 = load ptr, ptr %5, align 16 %overflow_arg_area_p10.promoted = load ptr, ptr %overflow_arg_area_p10, align 8 %6 = add nsw i64 %conv, -1 %xtraiter = and i64 %6, 1 %7 = icmp eq i32 %len, 2 br i1 %7, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %6, -2 br label %for.body for.body: ; preds = %vaarg.end13.1, %for.body.lr.ph.new %overflow_arg_area.next1228 = phi ptr [ %overflow_arg_area_p10.promoted, %for.body.lr.ph.new ], [ %overflow_arg_area.next1227.1, %vaarg.end13.1 ] %_min.025 = phi i64 [ %4, %for.body.lr.ph.new ], [ %spec.select.1, %vaarg.end13.1 ] %gp_offset52224 = phi i32 [ %ap.promoted, %for.body.lr.ph.new ], [ %gp_offset521.1, %vaarg.end13.1 ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %vaarg.end13.1 ] %fits_in_gp6 = icmp ult i32 %gp_offset52224, 41 br i1 %fits_in_gp6, label %vaarg.in_reg7, label %vaarg.in_mem9 vaarg.in_reg7: ; preds = %for.body %8 = zext i32 %gp_offset52224 to i64 %9 = getelementptr i8, ptr %reg_save_area8, i64 %8 %10 = add nuw nsw i32 %gp_offset52224, 8 store i32 %10, ptr %ap, align 16 br label %vaarg.end13 vaarg.in_mem9: ; preds = %for.body %overflow_arg_area.next12 = getelementptr i8, ptr %overflow_arg_area.next1228, i64 8 store ptr %overflow_arg_area.next12, ptr %overflow_arg_area_p10, align 8 br label %vaarg.end13 vaarg.end13: ; preds = %vaarg.in_mem9, %vaarg.in_reg7 %overflow_arg_area.next1227 = phi ptr [ %overflow_arg_area.next1228, %vaarg.in_reg7 ], [ %overflow_arg_area.next12, %vaarg.in_mem9 ] %gp_offset521 = phi i32 [ %10, %vaarg.in_reg7 ], [ %gp_offset52224, %vaarg.in_mem9 ] %vaarg.addr14 = phi ptr [ %9, %vaarg.in_reg7 ], [ %overflow_arg_area.next1228, %vaarg.in_mem9 ] %11 = load i64, ptr %vaarg.addr14, align 8 %spec.select = call i64 @llvm.smin.i64(i64 %11, i64 %_min.025) %fits_in_gp6.1 = icmp ult i32 %gp_offset521, 41 br i1 %fits_in_gp6.1, label %vaarg.in_reg7.1, label %vaarg.in_mem9.1 vaarg.in_mem9.1: ; preds = %vaarg.end13 %overflow_arg_area.next12.1 = getelementptr i8, ptr %overflow_arg_area.next1227, i64 8 store ptr %overflow_arg_area.next12.1, ptr %overflow_arg_area_p10, align 8 br label %vaarg.end13.1 vaarg.in_reg7.1: ; preds = %vaarg.end13 %12 = zext i32 %gp_offset521 to i64 %13 = getelementptr i8, ptr %reg_save_area8, i64 %12 %14 = add nuw nsw i32 %gp_offset521, 8 store i32 %14, ptr %ap, align 16 br label %vaarg.end13.1 vaarg.end13.1: ; preds = %vaarg.in_reg7.1, %vaarg.in_mem9.1 %overflow_arg_area.next1227.1 = phi ptr [ %overflow_arg_area.next1227, %vaarg.in_reg7.1 ], [ %overflow_arg_area.next12.1, %vaarg.in_mem9.1 ] %gp_offset521.1 = phi i32 [ %14, %vaarg.in_reg7.1 ], [ %gp_offset521, %vaarg.in_mem9.1 ] %vaarg.addr14.1 = phi ptr [ %13, %vaarg.in_reg7.1 ], [ %overflow_arg_area.next1227, %vaarg.in_mem9.1 ] %15 = load i64, ptr %vaarg.addr14.1, align 8 %spec.select.1 = call i64 @llvm.smin.i64(i64 %15, i64 %spec.select) %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 !5 for.end.loopexit.unr-lcssa: ; preds = %vaarg.end13.1, %for.body.lr.ph %spec.select.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %spec.select.1, %vaarg.end13.1 ] %overflow_arg_area.next1228.unr = phi ptr [ %overflow_arg_area_p10.promoted, %for.body.lr.ph ], [ %overflow_arg_area.next1227.1, %vaarg.end13.1 ] %_min.025.unr = phi i64 [ %4, %for.body.lr.ph ], [ %spec.select.1, %vaarg.end13.1 ] %gp_offset52224.unr = phi i32 [ %ap.promoted, %for.body.lr.ph ], [ %gp_offset521.1, %vaarg.end13.1 ] %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 %fits_in_gp6.epil = icmp ult i32 %gp_offset52224.unr, 41 br i1 %fits_in_gp6.epil, label %vaarg.in_reg7.epil, label %vaarg.in_mem9.epil vaarg.in_mem9.epil: ; preds = %for.body.epil %overflow_arg_area.next12.epil = getelementptr i8, ptr %overflow_arg_area.next1228.unr, i64 8 store ptr %overflow_arg_area.next12.epil, ptr %overflow_arg_area_p10, align 8 br label %vaarg.end13.epil vaarg.in_reg7.epil: ; preds = %for.body.epil %16 = zext i32 %gp_offset52224.unr to i64 %17 = getelementptr i8, ptr %reg_save_area8, i64 %16 %18 = add nuw nsw i32 %gp_offset52224.unr, 8 store i32 %18, ptr %ap, align 16 br label %vaarg.end13.epil vaarg.end13.epil: ; preds = %vaarg.in_reg7.epil, %vaarg.in_mem9.epil %vaarg.addr14.epil = phi ptr [ %17, %vaarg.in_reg7.epil ], [ %overflow_arg_area.next1228.unr, %vaarg.in_mem9.epil ] %19 = load i64, ptr %vaarg.addr14.epil, align 8 %spec.select.epil = call i64 @llvm.smin.i64(i64 %19, i64 %_min.025.unr) br label %for.end for.end: ; preds = %vaarg.end13.epil, %for.end.loopexit.unr-lcssa, %vaarg.end %_min.0.lcssa = phi i64 [ %4, %vaarg.end ], [ %spec.select.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %vaarg.end13.epil ] call void @llvm.va_end(ptr nonnull %ap) call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %ap) #8 ret i64 %_min.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.va_start(ptr) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.va_end(ptr) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @binary(ptr nocapture noundef readonly %src, i32 noundef %len, i64 noundef %trg) local_unnamed_addr #3 { entry: %cmp10 = icmp sgt i32 %len, -1 br i1 %cmp10, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %entry %add = add nuw nsw i32 %len, 1 br label %while.body while.body: ; preds = %while.body.preheader, %while.body %low.012 = phi i32 [ %low.1, %while.body ], [ 0, %while.body.preheader ] %hi.011 = phi i32 [ %hi.1, %while.body ], [ %add, %while.body.preheader ] %sub = sub nsw i32 %hi.011, %low.012 %div = sdiv i32 %sub, 2 %add1 = add nsw i32 %div, %low.012 %idx.ext = sext i32 %add1 to i64 %add.ptr = getelementptr inbounds i64, ptr %src, i64 %idx.ext %0 = load i64, ptr %add.ptr, align 8, !tbaa !7 %cmp2 = icmp sgt i64 %0, %trg %add3 = add nsw i32 %add1, 1 %hi.1 = select i1 %cmp2, i32 %add1, i32 %hi.011 %low.1 = select i1 %cmp2, i32 %low.012, i32 %add3 %cmp = icmp slt i32 %low.1, %hi.1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %while.body, %entry %low.0.lcssa = phi i32 [ 0, %entry ], [ %low.1, %while.body ] ret i32 %low.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %Q = alloca i32, align 4 %s = alloca [100010 x i64], align 16 %t = alloca [100010 x i64], align 16 %x = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Q) #8 call void @llvm.lifetime.start.p0(i64 800080, ptr nonnull %s) #8 call void @llvm.lifetime.start.p0(i64 800080, ptr nonnull %t) #8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %Q) %0 = load i32, ptr %A, align 4, !tbaa !12 %cmp.not97 = icmp slt i32 %0, 1 br i1 %cmp.not97, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100010 x i64], ptr %s, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %A, align 4, !tbaa !12 %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 !14 for.end: ; preds = %for.body, %entry %.lcssa96 = phi i32 [ %0, %entry ], [ %1, %for.body ] store i64 -1000000000000000000, ptr %s, align 16, !tbaa !7 %add = add nsw i32 %.lcssa96, 1 %idxprom3 = sext i32 %add to i64 %arrayidx4 = getelementptr inbounds [100010 x i64], ptr %s, i64 0, i64 %idxprom3 store i64 1000000000000000000, ptr %arrayidx4, align 8, !tbaa !7 %3 = load i32, ptr %B, align 4, !tbaa !12 %cmp6.not99 = icmp slt i32 %3, 1 br i1 %cmp6.not99, label %for.end13, label %for.body7 for.body7: ; preds = %for.end, %for.body7 %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.body7 ], [ 1, %for.end ] %arrayidx9 = getelementptr inbounds [100010 x i64], ptr %t, i64 0, i64 %indvars.iv111 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9) %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %4 = load i32, ptr %B, align 4, !tbaa !12 %5 = sext i32 %4 to i64 %cmp6.not.not = icmp slt i64 %indvars.iv111, %5 br i1 %cmp6.not.not, label %for.body7, label %for.end13, !llvm.loop !15 for.end13: ; preds = %for.body7, %for.end %.lcssa = phi i32 [ %3, %for.end ], [ %4, %for.body7 ] store i64 -1000000000000000000, ptr %t, align 16, !tbaa !7 %add15 = add nsw i32 %.lcssa, 1 %idxprom16 = sext i32 %add15 to i64 %arrayidx17 = getelementptr inbounds [100010 x i64], ptr %t, i64 0, i64 %idxprom16 store i64 1000000000000000000, ptr %arrayidx17, align 8, !tbaa !7 %6 = load i32, ptr %Q, align 4, !tbaa !12 %cmp19.not106 = icmp slt i32 %6, 1 br i1 %cmp19.not106, label %for.end60, label %for.body20 for.body20: ; preds = %for.end13, %for.end56 %i.1107 = phi i32 [ %inc59, %for.end56 ], [ 1, %for.end13 ] %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x) %7 = load i32, ptr %A, align 4, !tbaa !12 %8 = load i64, ptr %x, align 8, !tbaa !7 %cmp10.i = icmp sgt i32 %7, -1 br i1 %cmp10.i, label %while.body.preheader.i, label %binary.exit while.body.preheader.i: ; preds = %for.body20 %add.i = add nuw nsw i32 %7, 1 br label %while.body.i while.body.i: ; preds = %while.body.i, %while.body.preheader.i %low.012.i = phi i32 [ %low.1.i, %while.body.i ], [ 0, %while.body.preheader.i ] %hi.011.i = phi i32 [ %hi.1.i, %while.body.i ], [ %add.i, %while.body.preheader.i ] %sub.i = sub nsw i32 %hi.011.i, %low.012.i %div.i = sdiv i32 %sub.i, 2 %add1.i = add nsw i32 %div.i, %low.012.i %idx.ext.i = sext i32 %add1.i to i64 %add.ptr.i = getelementptr inbounds i64, ptr %s, i64 %idx.ext.i %9 = load i64, ptr %add.ptr.i, align 8, !tbaa !7 %cmp2.i = icmp sgt i64 %9, %8 %add3.i = add nsw i32 %add1.i, 1 %hi.1.i = select i1 %cmp2.i, i32 %add1.i, i32 %hi.011.i %low.1.i = select i1 %cmp2.i, i32 %low.012.i, i32 %add3.i %cmp.i = icmp slt i32 %low.1.i, %hi.1.i br i1 %cmp.i, label %while.body.i, label %binary.exit, !llvm.loop !11 binary.exit: ; preds = %while.body.i, %for.body20 %low.0.lcssa.i = phi i32 [ 0, %for.body20 ], [ %low.1.i, %while.body.i ] %10 = load i32, ptr %B, align 4, !tbaa !12 %cmp10.i78 = icmp sgt i32 %10, -1 br i1 %cmp10.i78, label %while.body.preheader.i80, label %binary.exit95 while.body.preheader.i80: ; preds = %binary.exit %add.i81 = add nuw nsw i32 %10, 1 br label %while.body.i82 while.body.i82: ; preds = %while.body.i82, %while.body.preheader.i80 %low.012.i83 = phi i32 [ %low.1.i93, %while.body.i82 ], [ 0, %while.body.preheader.i80 ] %hi.011.i84 = phi i32 [ %hi.1.i92, %while.body.i82 ], [ %add.i81, %while.body.preheader.i80 ] %sub.i85 = sub nsw i32 %hi.011.i84, %low.012.i83 %div.i86 = sdiv i32 %sub.i85, 2 %add1.i87 = add nsw i32 %div.i86, %low.012.i83 %idx.ext.i88 = sext i32 %add1.i87 to i64 %add.ptr.i89 = getelementptr inbounds i64, ptr %t, i64 %idx.ext.i88 %11 = load i64, ptr %add.ptr.i89, align 8, !tbaa !7 %cmp2.i90 = icmp sgt i64 %11, %8 %add3.i91 = add nsw i32 %add1.i87, 1 %hi.1.i92 = select i1 %cmp2.i90, i32 %add1.i87, i32 %hi.011.i84 %low.1.i93 = select i1 %cmp2.i90, i32 %low.012.i83, i32 %add3.i91 %cmp.i94 = icmp slt i32 %low.1.i93, %hi.1.i92 br i1 %cmp.i94, label %while.body.i82, label %binary.exit95, !llvm.loop !11 binary.exit95: ; preds = %while.body.i82, %binary.exit %low.0.lcssa.i79 = phi i32 [ 0, %binary.exit ], [ %low.1.i93, %while.body.i82 ] %sub = add i32 %low.0.lcssa.i, -1 %sub28 = add i32 %low.0.lcssa.i79, -1 %12 = sext i32 %sub28 to i64 %13 = sext i32 %sub to i64 %arrayidx33 = getelementptr inbounds [100010 x i64], ptr %s, i64 0, i64 %13 %14 = load i64, ptr %arrayidx33, align 8, !tbaa !7 %sub34 = sub nsw i64 %14, %8 %15 = call i64 @llvm.abs.i64(i64 %sub34, i1 true) %arrayidx36 = getelementptr inbounds [100010 x i64], ptr %t, i64 0, i64 %12 %16 = load i64, ptr %arrayidx36, align 8, !tbaa !7 %sub39 = sub nsw i64 %16, %14 %17 = call i64 @llvm.abs.i64(i64 %sub39, i1 true) %add40 = add nuw nsw i64 %17, %15 %sub43 = sub nsw i64 %16, %8 %18 = call i64 @llvm.abs.i64(i64 %sub43, i1 true) %sub48 = sub nsw i64 %14, %16 %19 = call i64 @llvm.abs.i64(i64 %sub48, i1 true) %add49 = add nuw nsw i64 %18, %19 %call50 = call i64 (i32, ...) @min(i32 noundef 3, i64 noundef 1000000000000000000, i64 noundef %add40, i64 noundef %add49) %indvars.iv.next115 = add nsw i64 %12, 1 %cmp30.not.not.not = icmp eq i32 %low.0.lcssa.i79, -2147483648 br i1 %cmp30.not.not.not, label %for.inc54, label %for.body31.1, !llvm.loop !16 for.body31.1: ; preds = %binary.exit95 %20 = load i64, ptr %arrayidx33, align 8, !tbaa !7 %21 = load i64, ptr %x, align 8, !tbaa !7 %sub34.1 = sub nsw i64 %20, %21 %22 = call i64 @llvm.abs.i64(i64 %sub34.1, i1 true) %arrayidx36.1 = getelementptr inbounds [100010 x i64], ptr %t, i64 0, i64 %indvars.iv.next115 %23 = load i64, ptr %arrayidx36.1, align 8, !tbaa !7 %sub39.1 = sub nsw i64 %23, %20 %24 = call i64 @llvm.abs.i64(i64 %sub39.1, i1 true) %add40.1 = add nuw nsw i64 %24, %22 %sub43.1 = sub nsw i64 %23, %21 %25 = call i64 @llvm.abs.i64(i64 %sub43.1, i1 true) %sub48.1 = sub nsw i64 %20, %23 %26 = call i64 @llvm.abs.i64(i64 %sub48.1, i1 true) %add49.1 = add nuw nsw i64 %25, %26 %call50.1 = call i64 (i32, ...) @min(i32 noundef 3, i64 noundef %call50, i64 noundef %add40.1, i64 noundef %add49.1) br label %for.inc54 for.inc54: ; preds = %for.body31.1, %binary.exit95 %call50.lcssa = phi i64 [ %call50, %binary.exit95 ], [ %call50.1, %for.body31.1 ] %cmp26.not.not.not = icmp eq i32 %low.0.lcssa.i, -2147483648 br i1 %cmp26.not.not.not, label %for.end56, label %for.body27.1, !llvm.loop !17 for.body27.1: ; preds = %for.inc54 %indvars.iv.next118 = add nsw i64 %13, 1 %arrayidx33.1 = getelementptr inbounds [100010 x i64], ptr %s, i64 0, i64 %indvars.iv.next118 %27 = load i64, ptr %arrayidx33.1, align 8, !tbaa !7 %28 = load i64, ptr %x, align 8, !tbaa !7 %sub34.1120 = sub nsw i64 %27, %28 %29 = call i64 @llvm.abs.i64(i64 %sub34.1120, i1 true) %30 = load i64, ptr %arrayidx36, align 8, !tbaa !7 %sub39.1122 = sub nsw i64 %30, %27 %31 = call i64 @llvm.abs.i64(i64 %sub39.1122, i1 true) %add40.1123 = add nuw nsw i64 %31, %29 %sub43.1124 = sub nsw i64 %30, %28 %32 = call i64 @llvm.abs.i64(i64 %sub43.1124, i1 true) %sub48.1125 = sub nsw i64 %27, %30 %33 = call i64 @llvm.abs.i64(i64 %sub48.1125, i1 true) %add49.1126 = add nuw nsw i64 %32, %33 %call50.1127 = call i64 (i32, ...) @min(i32 noundef 3, i64 noundef %call50.lcssa, i64 noundef %add40.1123, i64 noundef %add49.1126) br i1 %cmp30.not.not.not, label %for.end56, label %for.body31.1.1, !llvm.loop !16 for.body31.1.1: ; preds = %for.body27.1 %34 = load i64, ptr %arrayidx33.1, align 8, !tbaa !7 %35 = load i64, ptr %x, align 8, !tbaa !7 %sub34.1.1 = sub nsw i64 %34, %35 %36 = call i64 @llvm.abs.i64(i64 %sub34.1.1, i1 true) %arrayidx36.1.1 = getelementptr inbounds [100010 x i64], ptr %t, i64 0, i64 %indvars.iv.next115 %37 = load i64, ptr %arrayidx36.1.1, align 8, !tbaa !7 %sub39.1.1 = sub nsw i64 %37, %34 %38 = call i64 @llvm.abs.i64(i64 %sub39.1.1, i1 true) %add40.1.1 = add nuw nsw i64 %38, %36 %sub43.1.1 = sub nsw i64 %37, %35 %39 = call i64 @llvm.abs.i64(i64 %sub43.1.1, i1 true) %sub48.1.1 = sub nsw i64 %34, %37 %40 = call i64 @llvm.abs.i64(i64 %sub48.1.1, i1 true) %add49.1.1 = add nuw nsw i64 %39, %40 %call50.1.1 = call i64 (i32, ...) @min(i32 noundef 3, i64 noundef %call50.1127, i64 noundef %add40.1.1, i64 noundef %add49.1.1) br label %for.end56 for.end56: ; preds = %for.body27.1, %for.body31.1.1, %for.inc54 %call50.lcssa.lcssa = phi i64 [ %call50.lcssa, %for.inc54 ], [ %call50.1127, %for.body27.1 ], [ %call50.1.1, %for.body31.1.1 ] %call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %call50.lcssa.lcssa) %inc59 = add nuw nsw i32 %i.1107, 1 %41 = load i32, ptr %Q, align 4, !tbaa !12 %cmp19.not.not = icmp slt i32 %i.1107, %41 br i1 %cmp19.not.not, label %for.body20, label %for.end60, !llvm.loop !18 for.end60: ; preds = %for.end56, %for.end13 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #8 call void @llvm.lifetime.end.p0(i64 800080, ptr nonnull %t) #8 call void @llvm.lifetime.end.p0(i64 800080, ptr nonnull %s) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Q) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #8 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #6 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #7 attributes #0 = { nofree nosync nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #3 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"long long", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = !{!13, !13, i64 0} !13 = !{!"int", !9, i64 0} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6} !18 = distinct !{!18, !6}
// // main.c // Save Your Privacy! // // Created by x15071xx on 2016/06/15. // Copyright ?? 2016??´ AIT. All rights reserved. // #include <stdio.h> int main(int argc, const char * argv[]) { while (1) { int human[100][100] = {0},n,m,i,j,k = 0,cri[100]={0},x,count=0; int human_num[100]={0},criminal[2]={0,-1}; scanf("%d",&n); if (n==0) { break; } for (i=0; i<n; i++) { scanf("%d",&m); human_num[i] = m; for (j=0; j<m; j++) { scanf("%d",&human[i][j]); } } scanf("%d",&k); for (j=0; j<k; j++) { scanf("%d",&cri[j]); } for (i=0; i<n; i++) { for (j=0; j< human_num[i]; j++) { for (x=0; x<k ; x++) { if (cri[x] == human[i][j]) { count++; } } } if (count == k) { criminal[0]++; criminal[1] = i+1; } count=0; } if (criminal[0] == 1) { printf("%d\n",criminal[1]); } else if (criminal[0] > 1|| criminal[0] == 0) { printf("-1\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151268/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151268/source.c" target datalayout = "e-m:e-p270: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 = private unnamed_addr constant [3 x i8] c"-1\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: %human = alloca [100 x [100 x i32]], align 16 %n = alloca i32, align 4 %m = alloca i32, align 4 %k = alloca i32, align 4 %cri = alloca [100 x i32], align 16 %human_num = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %human) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %human, i8 0, i64 40000, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 store i32 0, ptr %k, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %cri) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %cri, i8 0, i64 400, i1 false) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %human_num) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %human_num, i8 0, i64 400, i1 false) %call129 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp130 = icmp eq i32 %0, 0 br i1 %cmp130, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %cleanup %1 = phi i32 [ %28, %cleanup ], [ %0, %entry ] %cmp1109 = icmp sgt i32 %1, 0 br i1 %cmp1109, label %for.body, label %for.end13 for.body: ; preds = %for.cond.preheader, %for.inc11 %indvars.iv134 = phi i64 [ %indvars.iv.next135, %for.inc11 ], [ 0, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %2 = load i32, ptr %m, align 4, !tbaa !5 %arrayidx = getelementptr inbounds [100 x i32], ptr %human_num, i64 0, i64 %indvars.iv134 store i32 %2, ptr %arrayidx, align 4, !tbaa !5 %cmp4107 = icmp sgt i32 %2, 0 br i1 %cmp4107, label %for.body5, label %for.inc11 for.body5: ; preds = %for.body, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ] %arrayidx9 = getelementptr inbounds [100 x [100 x i32]], ptr %human, i64 0, i64 %indvars.iv134, i64 %indvars.iv %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %m, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp4 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp4, label %for.body5, label %for.inc11, !llvm.loop !9 for.inc11: ; preds = %for.body5, %for.body %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp1 = icmp slt i64 %indvars.iv.next135, %6 br i1 %cmp1, label %for.body, label %for.end13, !llvm.loop !11 for.end13: ; preds = %for.inc11, %for.cond.preheader %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %7 = load i32, ptr %k, align 4, !tbaa !5 %cmp16111 = icmp sgt i32 %7, 0 br i1 %cmp16111, label %for.body17, label %for.cond24.preheader for.cond24.preheader: ; preds = %for.body17, %for.end13 %.lcssa = phi i32 [ %7, %for.end13 ], [ %25, %for.body17 ] %.lcssa.fr = freeze i32 %.lcssa %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp25121 = icmp sgt i32 %8, 0 br i1 %cmp25121, label %for.cond27.preheader.lr.ph, label %if.then69 for.cond27.preheader.lr.ph: ; preds = %for.cond24.preheader %cmp33113 = icmp sgt i32 %.lcssa.fr, 0 br i1 %cmp33113, label %for.cond27.preheader.us.preheader, label %for.cond27.preheader.lr.ph.split for.cond27.preheader.us.preheader: ; preds = %for.cond27.preheader.lr.ph %wide.trip.count156 = zext i32 %8 to i64 %wide.trip.count146 = zext i32 %.lcssa.fr to i64 %min.iters.check = icmp ult i32 %.lcssa.fr, 8 %n.vec = and i64 %wide.trip.count146, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count146 br label %for.cond27.preheader.us for.cond27.preheader.us: ; preds = %for.cond27.preheader.us.preheader, %for.end50.us %indvars.iv153 = phi i64 [ 0, %for.cond27.preheader.us.preheader ], [ %indvars.iv.next154, %for.end50.us ] %criminal.sroa.0.0124.us = phi i32 [ 0, %for.cond27.preheader.us.preheader ], [ %criminal.sroa.0.1.us, %for.end50.us ] %criminal.sroa.8.0123.us = phi i32 [ -1, %for.cond27.preheader.us.preheader ], [ %criminal.sroa.8.1.us, %for.end50.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %human_num, i64 0, i64 %indvars.iv153 %9 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30117.us = icmp sgt i32 %9, 0 br i1 %cmp30117.us, label %for.cond32.preheader.us.us.preheader, label %for.end50.us for.cond32.preheader.us.us.preheader: ; preds = %for.cond27.preheader.us %wide.trip.count151 = zext i32 %9 to i64 br label %for.cond32.preheader.us.us for.end50.us: ; preds = %for.cond32.for.inc48_crit_edge.us.us, %for.cond27.preheader.us %count.1.lcssa.us = phi i32 [ 0, %for.cond27.preheader.us ], [ %spec.select.us.us.lcssa, %for.cond32.for.inc48_crit_edge.us.us ] %cmp51.us = icmp eq i32 %count.1.lcssa.us, %.lcssa.fr %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1 %10 = trunc i64 %indvars.iv.next154 to i32 %criminal.sroa.8.1.us = select i1 %cmp51.us, i32 %10, i32 %criminal.sroa.8.0123.us %inc54.us = zext i1 %cmp51.us to i32 %criminal.sroa.0.1.us = add nuw nsw i32 %criminal.sroa.0.0124.us, %inc54.us %exitcond157.not = icmp eq i64 %indvars.iv.next154, %wide.trip.count156 br i1 %exitcond157.not, label %for.end59, label %for.cond27.preheader.us, !llvm.loop !12 for.cond32.preheader.us.us: ; preds = %for.cond32.preheader.us.us.preheader, %for.cond32.for.inc48_crit_edge.us.us %indvars.iv148 = phi i64 [ 0, %for.cond32.preheader.us.us.preheader ], [ %indvars.iv.next149, %for.cond32.for.inc48_crit_edge.us.us ] %count.1119.us.us = phi i32 [ 0, %for.cond32.preheader.us.us.preheader ], [ %spec.select.us.us.lcssa, %for.cond32.for.inc48_crit_edge.us.us ] %arrayidx40.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %human, i64 0, i64 %indvars.iv153, i64 %indvars.iv148 %11 = load i32, ptr %arrayidx40.us.us, align 4, !tbaa !5 br i1 %min.iters.check, label %for.body34.us.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond32.preheader.us.us %12 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.1119.us.us, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %11, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %12, %vector.ph ], [ %19, %vector.body ] %vec.phi169 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ] %13 = getelementptr inbounds [100 x i32], ptr %cri, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %13, align 16, !tbaa !5 %14 = getelementptr inbounds i32, ptr %13, i64 4 %wide.load170 = load <4 x i32>, ptr %14, align 16, !tbaa !5 %15 = icmp eq <4 x i32> %wide.load, %broadcast.splat %16 = icmp eq <4 x i32> %wide.load170, %broadcast.splat %17 = zext <4 x i1> %15 to <4 x i32> %18 = zext <4 x i1> %16 to <4 x i32> %19 = add <4 x i32> %vec.phi, %17 %20 = add <4 x i32> %vec.phi169, %18 %index.next = add nuw i64 %index, 8 %21 = icmp eq i64 %index.next, %n.vec br i1 %21, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %20, %19 %22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond32.for.inc48_crit_edge.us.us, label %for.body34.us.us.preheader for.body34.us.us.preheader: ; preds = %for.cond32.preheader.us.us, %middle.block %indvars.iv143.ph = phi i64 [ 0, %for.cond32.preheader.us.us ], [ %n.vec, %middle.block ] %count.2115.us.us.ph = phi i32 [ %count.1119.us.us, %for.cond32.preheader.us.us ], [ %22, %middle.block ] br label %for.body34.us.us for.body34.us.us: ; preds = %for.body34.us.us.preheader, %for.body34.us.us %indvars.iv143 = phi i64 [ %indvars.iv.next144, %for.body34.us.us ], [ %indvars.iv143.ph, %for.body34.us.us.preheader ] %count.2115.us.us = phi i32 [ %spec.select.us.us, %for.body34.us.us ], [ %count.2115.us.us.ph, %for.body34.us.us.preheader ] %arrayidx36.us.us = getelementptr inbounds [100 x i32], ptr %cri, i64 0, i64 %indvars.iv143 %23 = load i32, ptr %arrayidx36.us.us, align 4, !tbaa !5 %cmp41.us.us = icmp eq i32 %23, %11 %inc43.us.us = zext i1 %cmp41.us.us to i32 %spec.select.us.us = add nsw i32 %count.2115.us.us, %inc43.us.us %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1 %exitcond147.not = icmp eq i64 %indvars.iv.next144, %wide.trip.count146 br i1 %exitcond147.not, label %for.cond32.for.inc48_crit_edge.us.us, label %for.body34.us.us, !llvm.loop !16 for.cond32.for.inc48_crit_edge.us.us: ; preds = %for.body34.us.us, %middle.block %spec.select.us.us.lcssa = phi i32 [ %22, %middle.block ], [ %spec.select.us.us, %for.body34.us.us ] %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1 %exitcond152.not = icmp eq i64 %indvars.iv.next149, %wide.trip.count151 br i1 %exitcond152.not, label %for.end50.us, label %for.cond32.preheader.us.us, !llvm.loop !17 for.cond27.preheader.lr.ph.split: ; preds = %for.cond27.preheader.lr.ph %cmp51 = icmp eq i32 %.lcssa.fr, 0 %wide.trip.count = zext i32 %8 to i64 %xtraiter = and i64 %wide.trip.count, 7 %24 = icmp ult i32 %8, 8 br i1 %24, label %for.end59.loopexit131.unr-lcssa, label %for.cond27.preheader.lr.ph.split.new for.cond27.preheader.lr.ph.split.new: ; preds = %for.cond27.preheader.lr.ph.split %unroll_iter = and i64 %wide.trip.count, 4294967288 br label %for.cond27.preheader for.body17: ; preds = %for.end13, %for.body17 %indvars.iv137 = phi i64 [ %indvars.iv.next138, %for.body17 ], [ 0, %for.end13 ] %arrayidx19 = getelementptr inbounds [100 x i32], ptr %cri, i64 0, i64 %indvars.iv137 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19) %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1 %25 = load i32, ptr %k, align 4, !tbaa !5 %26 = sext i32 %25 to i64 %cmp16 = icmp slt i64 %indvars.iv.next138, %26 br i1 %cmp16, label %for.body17, label %for.cond24.preheader, !llvm.loop !18 for.cond27.preheader: ; preds = %for.cond27.preheader, %for.cond27.preheader.lr.ph.split.new %indvars.iv140 = phi i64 [ 0, %for.cond27.preheader.lr.ph.split.new ], [ %indvars.iv.next141.7, %for.cond27.preheader ] %niter = phi i64 [ 0, %for.cond27.preheader.lr.ph.split.new ], [ %niter.next.7, %for.cond27.preheader ] %indvars.iv.next141.7 = add nuw nsw i64 %indvars.iv140, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end59.loopexit131.unr-lcssa, label %for.cond27.preheader, !llvm.loop !12 for.end59.loopexit131.unr-lcssa: ; preds = %for.cond27.preheader, %for.cond27.preheader.lr.ph.split %indvars.iv.next141.lcssa.ph = phi i64 [ undef, %for.cond27.preheader.lr.ph.split ], [ %indvars.iv.next141.7, %for.cond27.preheader ] %indvars.iv140.unr = phi i64 [ 0, %for.cond27.preheader.lr.ph.split ], [ %indvars.iv.next141.7, %for.cond27.preheader ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end59.loopexit131, label %for.cond27.preheader.epil for.cond27.preheader.epil: ; preds = %for.end59.loopexit131.unr-lcssa, %for.cond27.preheader.epil %indvars.iv140.epil = phi i64 [ %indvars.iv.next141.epil, %for.cond27.preheader.epil ], [ %indvars.iv140.unr, %for.end59.loopexit131.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond27.preheader.epil ], [ 0, %for.end59.loopexit131.unr-lcssa ] %indvars.iv.next141.epil = add nuw nsw i64 %indvars.iv140.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.end59.loopexit131, label %for.cond27.preheader.epil, !llvm.loop !19 for.end59.loopexit131: ; preds = %for.cond27.preheader.epil, %for.end59.loopexit131.unr-lcssa %indvars.iv.next141.lcssa = phi i64 [ %indvars.iv.next141.lcssa.ph, %for.end59.loopexit131.unr-lcssa ], [ %indvars.iv.next141.epil, %for.cond27.preheader.epil ] %27 = trunc i64 %indvars.iv.next141.lcssa to i32 br i1 %cmp51, label %for.end59, label %if.then69 for.end59: ; preds = %for.end50.us, %for.end59.loopexit131 %criminal.sroa.8.0.lcssa = phi i32 [ %27, %for.end59.loopexit131 ], [ %criminal.sroa.8.1.us, %for.end50.us ] %criminal.sroa.0.0.lcssa = phi i32 [ %8, %for.end59.loopexit131 ], [ %criminal.sroa.0.1.us, %for.end50.us ] %cmp61 = icmp eq i32 %criminal.sroa.0.0.lcssa, 1 br i1 %cmp61, label %if.then62, label %if.else if.then62: ; preds = %for.end59 %call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %criminal.sroa.8.0.lcssa) br label %cleanup if.else: ; preds = %for.end59 %cmp66 = icmp sgt i32 %criminal.sroa.0.0.lcssa, 1 %cmp68 = icmp eq i32 %criminal.sroa.0.0.lcssa, 0 %or.cond = or i1 %cmp66, %cmp68 br i1 %or.cond, label %if.then69, label %cleanup if.then69: ; preds = %for.cond24.preheader, %for.end59.loopexit131, %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup cleanup: ; preds = %if.then62, %if.else, %if.then69 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %human_num) #6 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %cri) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %human) #6 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %human) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %human, i8 0, i64 40000, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 store i32 0, ptr %k, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %cri) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %cri, i8 0, i64 400, i1 false) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %human_num) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %human_num, i8 0, i64 400, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %28 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %28, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %human_num) #6 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %cri) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %human) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !20} !20 = !{!"llvm.loop.unroll.disable"}
#include<stdio.h> #include<math.h> long long int pwo(long long int x,long long int y) { long long int i,a,mod = 1000000000 + 7; a = x; if(y == 0) { return 1; } for(i = 1 ; i < y ; i++) { x = x*a; x = x; } return x; } int main(void) { long long int n,i,j,mod = 1000000000 + 7,sum = 0,x[200001],y[200001],d,count = 0; long double a; scanf("%lld %lld",&n,&d); for(i = 0 ; i < n ; i++) { scanf("%lld %lld",&x[i],&y[i]); a = pow(x[i] * x[i] + y[i] * y[i],0.5); if(a <= d) { count++; } } printf("%lld\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151310/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151310/source.c" target datalayout = "e-m:e-p270: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 norecurse nosync nounwind memory(none) uwtable define dso_local i64 @pwo(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cmp = icmp eq i64 %y, 0 br i1 %cmp, label %cleanup, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp19 = icmp sgt i64 %y, 1 br i1 %cmp19, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %for.cond.preheader %0 = add i64 %y, -1 %1 = add i64 %y, -2 %xtraiter = and i64 %0, 7 %2 = icmp ult i64 %1, 7 br i1 %2, label %cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %0, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %x.addr.011 = phi i64 [ %x, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %x.addr.011, %x %mul.1 = mul nsw i64 %mul, %x %mul.2 = mul nsw i64 %mul.1, %x %mul.3 = mul nsw i64 %mul.2, %x %mul.4 = mul nsw i64 %mul.3, %x %mul.5 = mul nsw i64 %mul.4, %x %mul.6 = mul nsw i64 %mul.5, %x %mul.7 = mul nsw i64 %mul.6, %x %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !5 cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %x.addr.011.unr = phi i64 [ %x, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %cleanup, label %for.body.epil for.body.epil: ; preds = %cleanup.loopexit.unr-lcssa, %for.body.epil %x.addr.011.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %x.addr.011.unr, %cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %cleanup.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %x.addr.011.epil, %x %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 %cleanup, label %for.body.epil, !llvm.loop !7 cleanup: ; preds = %cleanup.loopexit.unr-lcssa, %for.body.epil, %for.cond.preheader, %entry %retval.0 = phi i64 [ 1, %entry ], [ %x, %for.cond.preheader ], [ %mul.lcssa.ph, %cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i64, align 8 %x = alloca [200001 x i64], align 16 %y = alloca [200001 x i64], align 16 %d = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %y) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d) %0 = load i64, ptr %n, align 8, !tbaa !9 %cmp23 = icmp sgt i64 %0, 0 br i1 %cmp23, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.025 = phi i64 [ %inc13, %for.body ], [ 0, %entry ] %count.024 = phi i64 [ %count.1, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200001 x i64], ptr %x, i64 0, i64 %i.025 %arrayidx1 = getelementptr inbounds [200001 x i64], ptr %y, i64 0, i64 %i.025 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx1) %1 = load i64, ptr %arrayidx, align 8, !tbaa !9 %mul = mul nsw i64 %1, %1 %2 = load i64, ptr %arrayidx1, align 8, !tbaa !9 %mul7 = mul nsw i64 %2, %2 %add = add nuw nsw i64 %mul7, %mul %conv = sitofp i64 %add to double %sqrt = call double @sqrt(double %conv) #5 %abs = call double @llvm.fabs.f64(double %sqrt) %conv9 = fpext double %abs to x86_fp80 %3 = load i64, ptr %d, align 8, !tbaa !9 %conv10 = sitofp i64 %3 to x86_fp80 %cmp11 = fcmp ole x86_fp80 %conv9, %conv10 %inc = zext i1 %cmp11 to i64 %count.1 = add nuw nsw i64 %count.024, %inc %inc13 = add nuw nsw i64 %i.025, 1 %4 = load i64, ptr %n, align 8, !tbaa !9 %cmp = icmp slt i64 %inc13, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !13 for.end: ; preds = %for.body, %entry %count.0.lcssa = phi i64 [ 0, %entry ], [ %count.1, %for.body ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 8, 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 declare double @sqrt(double) local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #4 attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !8} !8 = !{!"llvm.loop.unroll.disable"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !11, i64 0} !11 = !{!"omnipotent char", !12, i64 0} !12 = !{!"Simple C/C++ TBAA"} !13 = distinct !{!13, !6}
#include <stdio.h> int main(void) { int N=0; long int D=0; int count=0; long int x=0; long int y=0; scanf("%d%ld",&N,&D); for(int i=0;i<N;i++){ scanf("%ld%ld",&x,&y); if(x*x+y*y<=D*D) count+=1; } printf("%d",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151354/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151354/source.c" target datalayout = "e-m:e-p270: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%ld\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %D = alloca i64, align 8 %x = alloca i64, align 8 %y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 store i32 0, ptr %N, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %D) #3 store i64 0, ptr %D, align 8, !tbaa !9 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3 store i64 0, ptr %x, align 8, !tbaa !9 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #3 store i64 0, ptr %y, align 8, !tbaa !9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %D) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %D) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 for.body: ; preds = %entry, %for.body %i.011 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %count.010 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %1 = load i64, ptr %x, align 8, !tbaa !9 %mul = mul nsw i64 %1, %1 %2 = load i64, ptr %y, align 8, !tbaa !9 %mul2 = mul nsw i64 %2, %2 %add = add nuw nsw i64 %mul2, %mul %3 = load i64, ptr %D, align 8, !tbaa !9 %mul3 = mul nsw i64 %3, %3 %cmp4.not = icmp ule i64 %add, %mul3 %add5 = zext i1 %cmp4.not to i32 %spec.select = add nuw nsw i32 %count.010, %add5 %inc = add nuw nsw i32 %i.011, 1 %4 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #define ll long long #define fr(i,n,m) for(ll i=n;i<m;i++) int main() { ll n,d,x,y,count=0; scanf("%lli %lli",&n,&d); fr(i,0,n) { scanf("%lli %lli",&x,&y); ll XY = x*x+y*y; ll D = d*d; if (XY <= D) { count++; } } printf("%lli",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151398/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151398/source.c" target datalayout = "e-m:e-p270: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"%lli %lli\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lli\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %d = alloca i64, align 8 %x = alloca i64, align 8 %y = 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 %d) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp9 = icmp sgt i64 %0, 0 br i1 %cmp9, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %count.0.lcssa = phi i64 [ 0, %entry ], [ %spec.select, %for.body ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 ret i32 0 for.body: ; preds = %entry, %for.body %count.011 = phi i64 [ %spec.select, %for.body ], [ 0, %entry ] %i.010 = phi i64 [ %inc5, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %1 = load i64, ptr %x, align 8, !tbaa !5 %mul = mul nsw i64 %1, %1 %2 = load i64, ptr %y, align 8, !tbaa !5 %mul2 = mul nsw i64 %2, %2 %add = add nuw nsw i64 %mul2, %mul %3 = load i64, ptr %d, align 8, !tbaa !5 %mul3 = mul nsw i64 %3, %3 %cmp4.not = icmp ule i64 %add, %mul3 %inc = zext i1 %cmp4.not to i64 %spec.select = add nuw nsw i64 %count.011, %inc %inc5 = add nuw nsw i64 %i.010, 1 %4 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc5, %4 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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) { double n, d, x, y; int i, count = 0; scanf("%lf %lf", &n, &d); for (i = 0; i < n; i++) { scanf("%lf %lf", &x, &y); if (x * x + y * y <= d * d) { count++; } } printf("%d", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151440/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151440/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca double, align 8 %d = alloca double, align 8 %x = alloca double, align 8 %y = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #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, ptr noundef nonnull %d) %0 = load double, ptr %n, align 8, !tbaa !5 %cmp10 = fcmp ogt double %0, 0.000000e+00 br i1 %cmp10, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %count.012 = phi i32 [ %count.1, %for.body ], [ 0, %entry ] %i.011 = phi i32 [ %inc6, %for.body ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %1 = load double, ptr %x, align 8, !tbaa !5 %2 = load double, ptr %y, align 8, !tbaa !5 %mul3 = fmul double %2, %2 %3 = call double @llvm.fmuladd.f64(double %1, double %1, double %mul3) %4 = load double, ptr %d, align 8, !tbaa !5 %mul = fmul double %4, %4 %cmp4 = fcmp ole double %3, %mul %inc = zext i1 %cmp4 to i32 %count.1 = add nuw nsw i32 %count.012, %inc %inc6 = add nuw nsw i32 %i.011, 1 %conv = sitofp i32 %inc6 to double %5 = load double, ptr %n, align 8, !tbaa !5 %cmp = fcmp ogt double %5, %conv br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1, %for.body ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <math.h> #define num 2*100000+10 int main(void){ int N,D,i,C=0; double x[num],y[num]; scanf("%d %d",&N ,&D); for ( i = 0; i < N; i++){ scanf("%lf%lf",&x[i],&y[i]); if (D>=sqrt((x[i] * x[i]) + (y[i] * y[i]))){ C++; } } printf("%d",C); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151491/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151491/source.c" target datalayout = "e-m:e-p270: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 [7 x i8] c"%lf%lf\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %D = alloca i32, align 4 %x = alloca [200010 x double], align 16 %y = alloca [200010 x double], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #5 call void @llvm.lifetime.start.p0(i64 1600080, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 1600080, ptr nonnull %y) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %D) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp26 = icmp sgt i32 %0, 0 br i1 %cmp26, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %C.028 = phi i32 [ %C.1, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200010 x double], ptr %x, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [200010 x double], ptr %y, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %1 = load i32, ptr %D, align 4, !tbaa !5 %conv = sitofp i32 %1 to double %2 = load double, ptr %arrayidx, align 8, !tbaa !9 %3 = load double, ptr %arrayidx2, align 8, !tbaa !9 %mul12 = fmul double %3, %3 %4 = call double @llvm.fmuladd.f64(double %2, double %2, double %mul12) %sqrt = call double @llvm.sqrt.f64(double %4) %cmp14 = fcmp ole double %sqrt, %conv %inc = zext i1 %cmp14 to i32 %C.1 = add nuw nsw i32 %C.028, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %N, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %C.0.lcssa = phi i32 [ 0, %entry ], [ %C.1, %for.body ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %C.0.lcssa) call void @llvm.lifetime.end.p0(i64 1600080, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 1600080, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.sqrt.f64(double) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"double", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<math.h> int main(){ int t,d,c=0; scanf("%d %d",&t,&d); while(t--){ long int x,y; scanf("%ld %ld",&x,&y); double result=sqrt(x*x + y*y); if(result<=d) c=c+1; } printf("%d",c); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151541/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151541/source.c" target datalayout = "e-m:e-p270: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 [8 x i8] c"%ld %ld\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %d = alloca i32, align 4 %x = alloca i64, align 8 %y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %d) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec9 = add nsw i32 %0, -1 store i32 %dec9, ptr %t, align 4, !tbaa !5 %tobool.not10 = icmp eq i32 %0, 0 br i1 %tobool.not10, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %c.011 = phi i32 [ %c.1, %while.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %1 = load i64, ptr %x, align 8, !tbaa !9 %mul = mul nsw i64 %1, %1 %2 = load i64, ptr %y, align 8, !tbaa !9 %mul2 = mul nsw i64 %2, %2 %add = add nuw nsw i64 %mul2, %mul %conv = sitofp i64 %add to double %call3 = call double @sqrt(double noundef %conv) #4 %3 = load i32, ptr %d, align 4, !tbaa !5 %conv4 = sitofp i32 %3 to double %cmp = fcmp ole double %call3, %conv4 %add6 = zext i1 %cmp to i32 %c.1 = add nuw nsw i32 %c.011, %add6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4 %4 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %4, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %4, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body, %entry %c.0.lcssa = phi i32 [ 0, %entry ], [ %c.1, %while.body ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double 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 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> #include<stdbool.h> #include<string.h> #include<math.h> #include<ctype.h> typedef long long ll; ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } ll asc(const void* a, const void* b) { return *(ll*)a - *(ll*)b; } ll dsc(const void* a, const void* b) { return *(ll*)b - *(ll*)a; } int main() { ll n,d,x,y; scanf("%lld%lld", &n,&d); ll ans = 0; for (int i = 0; i < n; i++) { scanf("%lld%lld", &x, &y); if (x * x + y * y <= d * d) ans++; } printf("%lld",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151592/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151592/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %cmp4 = icmp eq i64 %b, 0 br i1 %cmp4, label %return, label %if.end if.end: ; preds = %entry, %if.end %b.tr6 = phi i64 [ %rem, %if.end ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %if.end ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %cmp = icmp eq i64 %rem, 0 br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %if.end ] ret i64 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %cmp4.i = icmp eq i64 %b, 0 br i1 %cmp4.i, label %gcd.exit, label %if.end.i if.end.i: ; preds = %entry, %if.end.i %b.tr6.i = phi i64 [ %rem.i, %if.end.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %if.end.i ], [ %a, %entry ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %cmp.i = icmp eq i64 %rem.i, 0 br i1 %cmp.i, label %gcd.exit, label %if.end.i gcd.exit: ; preds = %if.end.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %if.end.i ] %div = sdiv i64 %a, %a.tr.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i64 @asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 ret i64 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i64 @dsc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 ret i64 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i64, align 8 %d = alloca i64, align 8 %x = alloca i64, align 8 %y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp11 = icmp sgt i64 %0, 0 br i1 %cmp11, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %ans.0.lcssa = phi i64 [ 0, %entry ], [ %spec.select, %for.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %ans.012 = phi i64 [ %spec.select, %for.body ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %1 = load i64, ptr %x, align 8, !tbaa !5 %mul = mul nsw i64 %1, %1 %2 = load i64, ptr %y, align 8, !tbaa !5 %mul3 = mul nsw i64 %2, %2 %add = add nuw nsw i64 %mul3, %mul %3 = load i64, ptr %d, align 8, !tbaa !5 %mul4 = mul nsw i64 %3, %3 %cmp5.not = icmp ule i64 %add, %mul4 %inc = zext i1 %cmp5.not to i64 %spec.select = add nuw nsw i64 %ans.012, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp sgt i64 %4, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { 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 #1 = { 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 #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int a, n, i; while (1){ scanf("%d", &a); if (a == 0) break; n = 0; for (i = 5; a/i >0; i *= 5){ n += a/i; } printf("%d\n", n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151635/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151635/source.c" target datalayout = "e-m:e-p270: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: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp13 = icmp eq i32 %0, 0 br i1 %cmp13, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %2, %for.end ], [ %0, %entry ] %cmp18 = icmp sgt i32 %1, 4 br i1 %cmp18, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %for.cond.preheader %div714 = udiv i32 %1, 5 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %div11 = phi i32 [ %div, %for.body ], [ %div714, %for.body.preheader ] %i.010 = phi i32 [ %mul, %for.body ], [ 5, %for.body.preheader ] %n.09 = phi i32 [ %add, %for.body ], [ 0, %for.body.preheader ] %add = add nuw nsw i32 %div11, %n.09 %mul = mul nuw nsw i32 %i.010, 5 %div = sdiv i32 %1, %mul %cmp1 = icmp sgt i32 %div, 0 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond.preheader %n.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %n.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %2 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp eq i32 %2, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int exp(int x, int p) { int i; int ret; for(ret = 1, i = 0; i < p; i++) { ret *= x; } return ret; } int main() { long n; int five; int tmp_five; int i; scanf("%ld", &n); while(n) { for(i = 1, five = 0; tmp_five = n / exp(5, i); i++) { five += tmp_five; } printf("%d\n", five); fflush(stdout); scanf("%ld", &n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151714/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151714/source.c" target datalayout = "e-m:e-p270: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 [4 x i8] c"%d\0A\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @exp(i32 noundef %x, i32 noundef %p) local_unnamed_addr #0 { entry: %cmp3 = icmp sgt i32 %p, 0 br i1 %cmp3, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %p, 8 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %p, -8 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %x, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %0 = mul <4 x i32> %vec.phi, %broadcast.splat %1 = mul <4 x i32> %vec.phi6, %broadcast.splat %index.next = add nuw i32 %index, 8 %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !5 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %p br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %ret.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.04.ph = phi i32 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %ret.05 = phi i32 [ %mul, %for.body ], [ %ret.05.ph, %for.body.preheader7 ] %i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ] %mul = mul nsw i32 %ret.05, %x %inc = add nuw nsw i32 %i.04, 1 %exitcond.not = icmp eq i32 %inc, %p br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %middle.block, %entry %ret.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %ret.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree 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 i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !10 %tobool.not9 = icmp eq i64 %0, 0 br i1 %tobool.not9, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i64 [ %7, %for.end ], [ %0, %entry ] br label %for.cond for.cond: ; preds = %for.cond.preheader, %for.body %five.0 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %i.0 = phi i32 [ %inc, %for.body ], [ 1, %for.cond.preheader ] %min.iters.check = icmp ult i32 %i.0, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.cond %n.vec = and i32 %i.0, 2147483640 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %2, %vector.body ] %vec.phi10 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %3, %vector.body ] %2 = mul <4 x i32> %vec.phi, <i32 5, i32 5, i32 5, i32 5> %3 = mul <4 x i32> %vec.phi10, <i32 5, i32 5, i32 5, i32 5> %index.next = add nuw i32 %index, 8 %4 = icmp eq i32 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %3, %2 %5 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %i.0, %n.vec br i1 %cmp.n, label %exp.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.cond, %middle.block %ret.05.i.ph = phi i32 [ 1, %for.cond ], [ %5, %middle.block ] %i.04.i.ph = phi i32 [ 0, %for.cond ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %ret.05.i = phi i32 [ %mul.i, %for.body.i ], [ %ret.05.i.ph, %for.body.i.preheader ] %i.04.i = phi i32 [ %inc.i, %for.body.i ], [ %i.04.i.ph, %for.body.i.preheader ] %mul.i = mul nsw i32 %ret.05.i, 5 %inc.i = add nuw nsw i32 %i.04.i, 1 %exitcond.not.i = icmp eq i32 %inc.i, %i.0 br i1 %exitcond.not.i, label %exp.exit, label %for.body.i, !llvm.loop !15 exp.exit: ; preds = %for.body.i, %middle.block %mul.i.lcssa = phi i32 [ %5, %middle.block ], [ %mul.i, %for.body.i ] %conv = zext i32 %mul.i.lcssa to i64 %div = sdiv i64 %1, %conv %conv2 = trunc i64 %div to i32 %tobool3.not = icmp eq i32 %conv2, 0 br i1 %tobool3.not, label %for.end, label %for.body for.body: ; preds = %exp.exit %add = add nsw i32 %five.0, %conv2 %inc = add nuw nsw i32 %i.0, 1 br label %for.cond, !llvm.loop !16 for.end: ; preds = %exp.exit %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %five.0) %6 = load ptr, ptr @stdout, align 8, !tbaa !17 %call5 = call i32 @fflush(ptr noundef %6) %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %7 = load i64, ptr %n, align 8, !tbaa !10 %tobool.not = icmp eq i64 %7, 0 br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !19 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 8, 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: nofree nounwind declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #4 attributes #0 = { 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 #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 = distinct !{!5, !6, !7, !8} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!"llvm.loop.isvectorized", i32 1} !8 = !{!"llvm.loop.unroll.runtime.disable"} !9 = distinct !{!9, !6, !8, !7} !10 = !{!11, !11, i64 0} !11 = !{!"long", !12, i64 0} !12 = !{!"omnipotent char", !13, i64 0} !13 = !{!"Simple C/C++ TBAA"} !14 = distinct !{!14, !6, !7, !8} !15 = distinct !{!15, !6, !8, !7} !16 = distinct !{!16, !6} !17 = !{!18, !18, i64 0} !18 = !{!"any pointer", !12, i64 0} !19 = distinct !{!19, !6}
#include <stdio.h> int main() { int a, b; scanf("%d %d",&a,&b); if(a>9 || b>9) a=-1; else a*=b; printf("%d\n",a); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151772/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151772/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 9 %1 = load i32, ptr %b, align 4 %cmp1 = icmp sgt i32 %1, 9 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 %mul = mul nsw i32 %1, %0 %storemerge = select i1 %or.cond, i32 -1, i32 %mul store i32 %storemerge, ptr %a, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %storemerge) 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; scanf("%d %d",&A,&B); if(10 > A&&10 > B)printf("%d",A * B); else printf("-1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151822/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151822/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 10 %1 = load i32, ptr %B, align 4 %cmp1 = icmp slt i32 %1, 10 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %mul = mul nsw i32 %1, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) br label %if.end if.else: ; preds = %entry %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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, ans; scanf("%d%d", &a, &b); if (a<=9 && b<=9) { ans = a*b; } else { ans = -1; } printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151866/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151866/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 10 %1 = load i32, ptr %b, align 4 %cmp1 = icmp slt i32 %1, 10 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %mul = mul nsw i32 %1, %0 %ans.0 = select i1 %or.cond, i32 %mul, i32 -1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0) 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; scanf("%d %d", &A,&B); if(A<10 && B<10){ printf("%d\n", A*B); } else{ printf("-1\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151909/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151909/source.c" target datalayout = "e-m:e-p270: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 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 10 %1 = load i32, ptr %B, align 4 %cmp1 = icmp slt i32 %1, 10 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %mul = mul nsw i32 %1, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) br label %if.end if.else: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: 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 x,y,z; scanf("%d %d",&x,&y); z=x*y; if (x>9||y>9){ printf("-1\n"); }else{ printf("%d\n",z); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151952/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151952/source.c" target datalayout = "e-m:e-p270: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 [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4 %cmp = icmp sgt i32 %0, 9 %cmp1 = icmp sgt i32 %1, 9 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.else: ; preds = %entry %mul = mul nsw i32 %1, %0 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b; scanf("%d%d",&a,&b); if(a<=9&&b<=9) printf("%d\n",a*b); else printf("-1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151996/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151996/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 10 %1 = load i32, ptr %b, align 4 %cmp1 = icmp slt i32 %1, 10 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %mul = mul nsw i32 %1, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) br label %if.end if.else: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: 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 i,j; scanf("%d %d",&i,&j); if((i <= 9 && i >= 1) && (j <= 9 && j >= 1)) printf("%d",i * j); else printf("-1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152038/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152038/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %i = alloca i32, align 4 %j = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %j) %0 = load i32, ptr %i, align 4 %1 = add i32 %0, -1 %or.cond = icmp ult i32 %1, 9 %2 = load i32, ptr %j, align 4 %cmp3 = icmp slt i32 %2, 10 %or.cond8 = select i1 %or.cond, i1 %cmp3, i1 false %cmp5 = icmp sgt i32 %2, 0 %or.cond9 = select i1 %or.cond8, i1 %cmp5, i1 false br i1 %or.cond9, label %if.then, label %if.else if.then: ; preds = %entry %mul = mul nuw nsw i32 %2, %0 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) br label %if.end if.else: ; preds = %entry %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #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)"}
#include<stdio.h> int main() { int a, b; while(scanf("%d %d", &a, &b)==2){ if(a<=9 && b<=9) printf("%d\n", a*b); else printf("-1\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152081/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152081/source.c" target datalayout = "e-m:e-p270: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 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp7 = icmp eq i32 %call6, 2 br i1 %cmp7, label %while.body, label %while.end while.body: ; preds = %entry, %if.end %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp1 = icmp slt i32 %0, 10 %1 = load i32, ptr %b, align 4 %cmp2 = icmp slt i32 %1, 10 %or.cond = select i1 %cmp1, i1 %cmp2, i1 false br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %while.body %mul = mul nsw i32 %1, %0 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) br label %if.end if.else: ; preds = %while.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.end: ; preds = %if.else, %if.then %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp = icmp eq i32 %call, 2 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { //変数定義 int A; int B; //入力 scanf("%d", &A); scanf("%d", &B); //A,Bの判定 if(A>=10){ printf("-1\n"); }else if(B>=10){ printf("-1\n"); }else{ printf("%d\n",A*B); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152124/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152124/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 9 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %if.end8 if.else: ; preds = %entry %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %1, 9 br i1 %cmp3, label %if.then4, label %if.else6 if.then4: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %if.end8 if.else6: ; preds = %if.else %mul = mul nsw i32 %1, %0 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul) br label %if.end8 if.end8: ; preds = %if.then4, %if.else6, %if.then 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: 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 <string.h> int main(){ int a, b; scanf("%d %d", &a, &b); if ((a > 9) || (b > 9)){ printf("-1\n"); } else { printf("%d\n", a * b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152168/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152168/source.c" target datalayout = "e-m:e-p270: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 [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 9 %1 = load i32, ptr %b, align 4 %cmp1 = icmp sgt i32 %1, 9 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.else: ; preds = %entry %mul = mul nsw i32 %1, %0 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul) br label %if.end if.end: ; preds = %if.else, %if.then 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: 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 A,B,C; scanf("%d%d",&A,&B); if(A>=10||B>=10) { C=-1; } else C=A*B; printf("%d",C); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152210/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152210/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 9 %1 = load i32, ptr %B, align 4 %cmp1 = icmp sgt i32 %1, 9 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 %mul = mul nsw i32 %1, %0 %C.0 = select i1 %or.cond, i32 -1, i32 %mul %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %C.0) 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; scanf("%d%d",&a,&b); if(a>9){ printf("-1\n"); return 0;} if(b>9){ printf("-1\n"); return 0;} printf("%d\n",a*b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152254/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152254/source.c" target datalayout = "e-m:e-p270: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 [4 x i8] c"%d\0A\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 9 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup if.end: ; preds = %entry %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp2 = icmp sgt i32 %1, 9 br i1 %cmp2, label %if.then3, label %if.end5 if.then3: ; preds = %if.end %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup if.end5: ; preds = %if.end %mul = mul nsw i32 %1, %0 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul) br label %cleanup cleanup: ; preds = %if.end5, %if.then3, %if.then 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: 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 i,j,k; int a,b; scanf("%d%d",&a,&b); if(a<10&&b<10){ printf("%d\n",a*b); return 0; } printf("-1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152298/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152298/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 10 %1 = load i32, ptr %b, align 4 %cmp1 = icmp slt i32 %1, 10 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.then, label %if.end if.then: ; preds = %entry %mul = mul nsw i32 %1, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) br label %cleanup if.end: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup cleanup: ; preds = %if.end, %if.then 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: 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 <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define P 1000000007 long f(long a){ long s=1; while(a!=0) s=s*(a--)%P; return s; } int main(void){ int n, m; scanf("%d%d", &n, &m); if(n+1<m || m+1<n){ puts("0"); }else{ printf("%d\n", f(n)*f(m)*((n==m)+1)%P); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152340/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152340/source.c" target datalayout = "e-m:e-p270: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 [2 x i8] c"0\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @f(i64 noundef %a) local_unnamed_addr #0 { entry: %cmp.not3 = icmp eq i64 %a, 0 br i1 %cmp.not3, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %xtraiter = and i64 %a, 3 %0 = icmp ult i64 %a, 4 br i1 %0, label %while.end.loopexit.unr-lcssa, label %while.body.preheader.new while.body.preheader.new: ; preds = %while.body.preheader %unroll_iter = and i64 %a, -4 br label %while.body while.body: ; preds = %while.body, %while.body.preheader.new %s.05 = phi i64 [ 1, %while.body.preheader.new ], [ %rem.3, %while.body ] %a.addr.04 = phi i64 [ %a, %while.body.preheader.new ], [ %dec.3, %while.body ] %niter = phi i64 [ 0, %while.body.preheader.new ], [ %niter.next.3, %while.body ] %dec = add nsw i64 %a.addr.04, -1 %mul = mul nsw i64 %s.05, %a.addr.04 %rem = srem i64 %mul, 1000000007 %dec.1 = add nsw i64 %a.addr.04, -2 %mul.1 = mul nsw i64 %rem, %dec %rem.1 = srem i64 %mul.1, 1000000007 %dec.2 = add nsw i64 %a.addr.04, -3 %mul.2 = mul nsw i64 %rem.1, %dec.1 %rem.2 = srem i64 %mul.2, 1000000007 %dec.3 = add nsw i64 %a.addr.04, -4 %mul.3 = mul nsw i64 %rem.2, %dec.2 %rem.3 = srem i64 %mul.3, 1000000007 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %while.end.loopexit.unr-lcssa, label %while.body, !llvm.loop !5 while.end.loopexit.unr-lcssa: ; preds = %while.body, %while.body.preheader %rem.lcssa.ph = phi i64 [ undef, %while.body.preheader ], [ %rem.3, %while.body ] %s.05.unr = phi i64 [ 1, %while.body.preheader ], [ %rem.3, %while.body ] %a.addr.04.unr = phi i64 [ %a, %while.body.preheader ], [ %dec.3, %while.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.end, label %while.body.epil while.body.epil: ; preds = %while.end.loopexit.unr-lcssa, %while.body.epil %s.05.epil = phi i64 [ %rem.epil, %while.body.epil ], [ %s.05.unr, %while.end.loopexit.unr-lcssa ] %a.addr.04.epil = phi i64 [ %dec.epil, %while.body.epil ], [ %a.addr.04.unr, %while.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %while.body.epil ], [ 0, %while.end.loopexit.unr-lcssa ] %dec.epil = add nsw i64 %a.addr.04.epil, -1 %mul.epil = mul nsw i64 %s.05.epil, %a.addr.04.epil %rem.epil = srem i64 %mul.epil, 1000000007 %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 %while.end, label %while.body.epil, !llvm.loop !7 while.end: ; preds = %while.end.loopexit.unr-lcssa, %while.body.epil, %entry %s.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %while.end.loopexit.unr-lcssa ], [ %rem.epil, %while.body.epil ] ret i64 %s.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree 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 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !9 %add = add nsw i32 %0, 1 %1 = load i32, ptr %m, align 4, !tbaa !9 %cmp = icmp slt i32 %add, %1 %add1 = add nsw i32 %1, 1 %cmp2 = icmp slt i32 %add1, %0 %or.cond = select i1 %cmp, i1 true, i1 %cmp2 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) br label %if.end if.else: ; preds = %entry %cmp.not3.i = icmp eq i32 %0, 0 br i1 %cmp.not3.i, label %f.exit, label %while.body.i.preheader while.body.i.preheader: ; preds = %if.else %conv = sext i32 %0 to i64 %xtraiter = and i64 %conv, 3 %2 = icmp ult i32 %0, 4 br i1 %2, label %f.exit.loopexit.unr-lcssa, label %while.body.i.preheader.new while.body.i.preheader.new: ; preds = %while.body.i.preheader %unroll_iter = and i64 %conv, -4 br label %while.body.i while.body.i: ; preds = %while.body.i, %while.body.i.preheader.new %s.05.i = phi i64 [ 1, %while.body.i.preheader.new ], [ %rem.i.3, %while.body.i ] %a.addr.04.i = phi i64 [ %conv, %while.body.i.preheader.new ], [ %dec.i.3, %while.body.i ] %niter = phi i64 [ 0, %while.body.i.preheader.new ], [ %niter.next.3, %while.body.i ] %dec.i = add nsw i64 %a.addr.04.i, -1 %mul.i = mul nsw i64 %a.addr.04.i, %s.05.i %rem.i = srem i64 %mul.i, 1000000007 %dec.i.1 = add nsw i64 %a.addr.04.i, -2 %mul.i.1 = mul nsw i64 %dec.i, %rem.i %rem.i.1 = srem i64 %mul.i.1, 1000000007 %dec.i.2 = add nsw i64 %a.addr.04.i, -3 %mul.i.2 = mul nsw i64 %dec.i.1, %rem.i.1 %rem.i.2 = srem i64 %mul.i.2, 1000000007 %dec.i.3 = add nsw i64 %a.addr.04.i, -4 %mul.i.3 = mul nsw i64 %dec.i.2, %rem.i.2 %rem.i.3 = srem i64 %mul.i.3, 1000000007 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %f.exit.loopexit.unr-lcssa, label %while.body.i, !llvm.loop !5 f.exit.loopexit.unr-lcssa: ; preds = %while.body.i, %while.body.i.preheader %rem.i.lcssa.ph = phi i64 [ undef, %while.body.i.preheader ], [ %rem.i.3, %while.body.i ] %s.05.i.unr = phi i64 [ 1, %while.body.i.preheader ], [ %rem.i.3, %while.body.i ] %a.addr.04.i.unr = phi i64 [ %conv, %while.body.i.preheader ], [ %dec.i.3, %while.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %f.exit, label %while.body.i.epil while.body.i.epil: ; preds = %f.exit.loopexit.unr-lcssa, %while.body.i.epil %s.05.i.epil = phi i64 [ %rem.i.epil, %while.body.i.epil ], [ %s.05.i.unr, %f.exit.loopexit.unr-lcssa ] %a.addr.04.i.epil = phi i64 [ %dec.i.epil, %while.body.i.epil ], [ %a.addr.04.i.unr, %f.exit.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %while.body.i.epil ], [ 0, %f.exit.loopexit.unr-lcssa ] %dec.i.epil = add nsw i64 %a.addr.04.i.epil, -1 %mul.i.epil = mul nsw i64 %a.addr.04.i.epil, %s.05.i.epil %rem.i.epil = srem i64 %mul.i.epil, 1000000007 %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 %f.exit, label %while.body.i.epil, !llvm.loop !13 f.exit: ; preds = %f.exit.loopexit.unr-lcssa, %while.body.i.epil, %if.else %s.0.lcssa.i = phi i64 [ 1, %if.else ], [ %rem.i.lcssa.ph, %f.exit.loopexit.unr-lcssa ], [ %rem.i.epil, %while.body.i.epil ] %cmp.not3.i14 = icmp eq i32 %1, 0 br i1 %cmp.not3.i14, label %f.exit23, label %while.body.i15.preheader while.body.i15.preheader: ; preds = %f.exit %conv5 = sext i32 %1 to i64 %xtraiter25 = and i64 %conv5, 3 %3 = icmp ult i32 %1, 4 br i1 %3, label %f.exit23.loopexit.unr-lcssa, label %while.body.i15.preheader.new while.body.i15.preheader.new: ; preds = %while.body.i15.preheader %unroll_iter29 = and i64 %conv5, -4 br label %while.body.i15 while.body.i15: ; preds = %while.body.i15, %while.body.i15.preheader.new %s.05.i16 = phi i64 [ 1, %while.body.i15.preheader.new ], [ %rem.i20.3, %while.body.i15 ] %a.addr.04.i17 = phi i64 [ %conv5, %while.body.i15.preheader.new ], [ %dec.i18.3, %while.body.i15 ] %niter30 = phi i64 [ 0, %while.body.i15.preheader.new ], [ %niter30.next.3, %while.body.i15 ] %dec.i18 = add nsw i64 %a.addr.04.i17, -1 %mul.i19 = mul nsw i64 %a.addr.04.i17, %s.05.i16 %rem.i20 = srem i64 %mul.i19, 1000000007 %dec.i18.1 = add nsw i64 %a.addr.04.i17, -2 %mul.i19.1 = mul nsw i64 %dec.i18, %rem.i20 %rem.i20.1 = srem i64 %mul.i19.1, 1000000007 %dec.i18.2 = add nsw i64 %a.addr.04.i17, -3 %mul.i19.2 = mul nsw i64 %dec.i18.1, %rem.i20.1 %rem.i20.2 = srem i64 %mul.i19.2, 1000000007 %dec.i18.3 = add nsw i64 %a.addr.04.i17, -4 %mul.i19.3 = mul nsw i64 %dec.i18.2, %rem.i20.2 %rem.i20.3 = srem i64 %mul.i19.3, 1000000007 %niter30.next.3 = add i64 %niter30, 4 %niter30.ncmp.3 = icmp eq i64 %niter30.next.3, %unroll_iter29 br i1 %niter30.ncmp.3, label %f.exit23.loopexit.unr-lcssa, label %while.body.i15, !llvm.loop !5 f.exit23.loopexit.unr-lcssa: ; preds = %while.body.i15, %while.body.i15.preheader %rem.i20.lcssa.ph = phi i64 [ undef, %while.body.i15.preheader ], [ %rem.i20.3, %while.body.i15 ] %s.05.i16.unr = phi i64 [ 1, %while.body.i15.preheader ], [ %rem.i20.3, %while.body.i15 ] %a.addr.04.i17.unr = phi i64 [ %conv5, %while.body.i15.preheader ], [ %dec.i18.3, %while.body.i15 ] %lcmp.mod27.not = icmp eq i64 %xtraiter25, 0 br i1 %lcmp.mod27.not, label %f.exit23, label %while.body.i15.epil while.body.i15.epil: ; preds = %f.exit23.loopexit.unr-lcssa, %while.body.i15.epil %s.05.i16.epil = phi i64 [ %rem.i20.epil, %while.body.i15.epil ], [ %s.05.i16.unr, %f.exit23.loopexit.unr-lcssa ] %a.addr.04.i17.epil = phi i64 [ %dec.i18.epil, %while.body.i15.epil ], [ %a.addr.04.i17.unr, %f.exit23.loopexit.unr-lcssa ] %epil.iter26 = phi i64 [ %epil.iter26.next, %while.body.i15.epil ], [ 0, %f.exit23.loopexit.unr-lcssa ] %dec.i18.epil = add nsw i64 %a.addr.04.i17.epil, -1 %mul.i19.epil = mul nsw i64 %a.addr.04.i17.epil, %s.05.i16.epil %rem.i20.epil = srem i64 %mul.i19.epil, 1000000007 %epil.iter26.next = add i64 %epil.iter26, 1 %epil.iter26.cmp.not = icmp eq i64 %epil.iter26.next, %xtraiter25 br i1 %epil.iter26.cmp.not, label %f.exit23, label %while.body.i15.epil, !llvm.loop !14 f.exit23: ; preds = %f.exit23.loopexit.unr-lcssa, %while.body.i15.epil, %f.exit %s.0.lcssa.i22 = phi i64 [ 1, %f.exit ], [ %rem.i20.lcssa.ph, %f.exit23.loopexit.unr-lcssa ], [ %rem.i20.epil, %while.body.i15.epil ] %mul = mul nsw i64 %s.0.lcssa.i22, %s.0.lcssa.i %cmp7 = icmp eq i32 %0, %1 %4 = zext i1 %cmp7 to i64 %mul11 = shl nsw i64 %mul, %4 %rem = srem i64 %mul11, 1000000007 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %rem) br label %if.end if.end: ; preds = %f.exit23, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: 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 #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { 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 #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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !8} !8 = !{!"llvm.loop.unroll.disable"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !11, i64 0} !11 = !{!"omnipotent char", !12, i64 0} !12 = !{!"Simple C/C++ TBAA"} !13 = distinct !{!13, !8} !14 = distinct !{!14, !8}
#include<stdio.h> long long int beki(int n){ long long int ret=1; while(n!=1){ ret=(ret*n)%(1000000000+7); n--; } return ret; } int main(void){ int N,M; scanf("%d %d", &N, &M); long long int num; if(N-M>1 && N-M<-1){ num=0; }else if(N==M){ num=beki(N); num=(num*num*2)%(1000000000+7); }else if(N==M+1){ num=(beki(N)*beki(M))%(1000000000+7); }else if(M==N+1){ num=(beki(M)*beki(N))%(1000000000+7); } printf("%d\n", num); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152391/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152391/source.c" target datalayout = "e-m:e-p270: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 norecurse nosync nounwind memory(none) uwtable define dso_local i64 @beki(i32 noundef %n) local_unnamed_addr #0 { entry: %cmp.not4 = icmp eq i32 %n, 1 br i1 %cmp.not4, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %0 = sext i32 %n to i64 br label %while.body while.body: ; preds = %while.body.preheader, %while.body %indvars.iv = phi i64 [ %0, %while.body.preheader ], [ %indvars.iv.next, %while.body ] %ret.06 = phi i64 [ 1, %while.body.preheader ], [ %rem, %while.body ] %mul = mul nsw i64 %ret.06, %indvars.iv %rem = srem i64 %mul, 1000000007 %indvars.iv.next = add nsw i64 %indvars.iv, -1 %1 = and i64 %indvars.iv.next, 4294967295 %cmp.not = icmp eq i64 %1, 1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %ret.0.lcssa = phi i64 [ 1, %entry ], [ %rem, %while.body ] ret i64 %ret.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree 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 %M = 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 %M) #5 %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 !7 %1 = load i32, ptr %M, align 4, !tbaa !7 %cmp3 = icmp eq i32 %0, %1 br i1 %cmp3, label %if.then4, label %if.else7 if.then4: ; preds = %entry %cmp.not4.i = icmp eq i32 %0, 1 br i1 %cmp.not4.i, label %beki.exit, label %while.body.preheader.i while.body.preheader.i: ; preds = %if.then4 %2 = sext i32 %0 to i64 br label %while.body.i while.body.i: ; preds = %while.body.i, %while.body.preheader.i %indvars.iv.i = phi i64 [ %2, %while.body.preheader.i ], [ %indvars.iv.next.i, %while.body.i ] %ret.06.i = phi i64 [ 1, %while.body.preheader.i ], [ %rem.i, %while.body.i ] %mul.i = mul nsw i64 %ret.06.i, %indvars.iv.i %rem.i = srem i64 %mul.i, 1000000007 %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %3 = and i64 %indvars.iv.next.i, 4294967295 %cmp.not.i = icmp eq i64 %3, 1 br i1 %cmp.not.i, label %beki.exit, label %while.body.i, !llvm.loop !5 beki.exit: ; preds = %while.body.i, %if.then4 %ret.0.lcssa.i = phi i64 [ 1, %if.then4 ], [ %rem.i, %while.body.i ] %mul = shl nsw i64 %ret.0.lcssa.i, 1 %mul6 = mul nsw i64 %mul, %ret.0.lcssa.i %rem = urem i64 %mul6, 1000000007 br label %if.end24 if.else7: ; preds = %entry %add = add nsw i32 %1, 1 %cmp8 = icmp eq i32 %0, %add br i1 %cmp8, label %if.then9, label %if.else14 if.then9: ; preds = %if.else7 %cmp.not4.i29 = icmp eq i32 %0, 1 br i1 %cmp.not4.i29, label %beki.exit39, label %while.body.preheader.i30 while.body.preheader.i30: ; preds = %if.then9 %4 = sext i32 %0 to i64 br label %while.body.i31 while.body.i31: ; preds = %while.body.i31, %while.body.preheader.i30 %indvars.iv.i32 = phi i64 [ %4, %while.body.preheader.i30 ], [ %indvars.iv.next.i36, %while.body.i31 ] %ret.06.i33 = phi i64 [ 1, %while.body.preheader.i30 ], [ %rem.i35, %while.body.i31 ] %mul.i34 = mul nsw i64 %ret.06.i33, %indvars.iv.i32 %rem.i35 = srem i64 %mul.i34, 1000000007 %indvars.iv.next.i36 = add nsw i64 %indvars.iv.i32, -1 %5 = and i64 %indvars.iv.next.i36, 4294967295 %cmp.not.i37 = icmp eq i64 %5, 1 br i1 %cmp.not.i37, label %beki.exit39, label %while.body.i31, !llvm.loop !5 beki.exit39: ; preds = %while.body.i31, %if.then9 %ret.0.lcssa.i38 = phi i64 [ 1, %if.then9 ], [ %rem.i35, %while.body.i31 ] %cmp.not4.i40 = icmp eq i32 %1, 1 br i1 %cmp.not4.i40, label %beki.exit50, label %while.body.preheader.i41 while.body.preheader.i41: ; preds = %beki.exit39 %6 = sext i32 %1 to i64 br label %while.body.i42 while.body.i42: ; preds = %while.body.i42, %while.body.preheader.i41 %indvars.iv.i43 = phi i64 [ %6, %while.body.preheader.i41 ], [ %indvars.iv.next.i47, %while.body.i42 ] %ret.06.i44 = phi i64 [ 1, %while.body.preheader.i41 ], [ %rem.i46, %while.body.i42 ] %mul.i45 = mul nsw i64 %ret.06.i44, %indvars.iv.i43 %rem.i46 = srem i64 %mul.i45, 1000000007 %indvars.iv.next.i47 = add nsw i64 %indvars.iv.i43, -1 %7 = and i64 %indvars.iv.next.i47, 4294967295 %cmp.not.i48 = icmp eq i64 %7, 1 br i1 %cmp.not.i48, label %beki.exit50, label %while.body.i42, !llvm.loop !5 beki.exit50: ; preds = %while.body.i42, %beki.exit39 %ret.0.lcssa.i49 = phi i64 [ 1, %beki.exit39 ], [ %rem.i46, %while.body.i42 ] %mul12 = mul nsw i64 %ret.0.lcssa.i49, %ret.0.lcssa.i38 %rem13 = srem i64 %mul12, 1000000007 br label %if.end24 if.else14: ; preds = %if.else7 %add15 = add nsw i32 %0, 1 %cmp16 = icmp eq i32 %1, %add15 call void @llvm.assume(i1 %cmp16) %cmp.not4.i51 = icmp eq i32 %1, 1 br i1 %cmp.not4.i51, label %beki.exit61, label %while.body.preheader.i52 while.body.preheader.i52: ; preds = %if.else14 %8 = sext i32 %1 to i64 br label %while.body.i53 while.body.i53: ; preds = %while.body.i53, %while.body.preheader.i52 %indvars.iv.i54 = phi i64 [ %8, %while.body.preheader.i52 ], [ %indvars.iv.next.i58, %while.body.i53 ] %ret.06.i55 = phi i64 [ 1, %while.body.preheader.i52 ], [ %rem.i57, %while.body.i53 ] %mul.i56 = mul nsw i64 %ret.06.i55, %indvars.iv.i54 %rem.i57 = srem i64 %mul.i56, 1000000007 %indvars.iv.next.i58 = add nsw i64 %indvars.iv.i54, -1 %9 = and i64 %indvars.iv.next.i58, 4294967295 %cmp.not.i59 = icmp eq i64 %9, 1 br i1 %cmp.not.i59, label %beki.exit61, label %while.body.i53, !llvm.loop !5 beki.exit61: ; preds = %while.body.i53, %if.else14 %ret.0.lcssa.i60 = phi i64 [ 1, %if.else14 ], [ %rem.i57, %while.body.i53 ] %cmp.not4.i62 = icmp eq i32 %0, 1 br i1 %cmp.not4.i62, label %beki.exit72, label %while.body.preheader.i63 while.body.preheader.i63: ; preds = %beki.exit61 %10 = sext i32 %0 to i64 br label %while.body.i64 while.body.i64: ; preds = %while.body.i64, %while.body.preheader.i63 %indvars.iv.i65 = phi i64 [ %10, %while.body.preheader.i63 ], [ %indvars.iv.next.i69, %while.body.i64 ] %ret.06.i66 = phi i64 [ 1, %while.body.preheader.i63 ], [ %rem.i68, %while.body.i64 ] %mul.i67 = mul nsw i64 %ret.06.i66, %indvars.iv.i65 %rem.i68 = srem i64 %mul.i67, 1000000007 %indvars.iv.next.i69 = add nsw i64 %indvars.iv.i65, -1 %11 = and i64 %indvars.iv.next.i69, 4294967295 %cmp.not.i70 = icmp eq i64 %11, 1 br i1 %cmp.not.i70, label %beki.exit72, label %while.body.i64, !llvm.loop !5 beki.exit72: ; preds = %while.body.i64, %beki.exit61 %ret.0.lcssa.i71 = phi i64 [ 1, %beki.exit61 ], [ %rem.i68, %while.body.i64 ] %mul20 = mul nsw i64 %ret.0.lcssa.i71, %ret.0.lcssa.i60 %rem21 = srem i64 %mul20, 1000000007 br label %if.end24 if.end24: ; preds = %beki.exit, %beki.exit72, %beki.exit50 %num.0 = phi i64 [ %rem, %beki.exit ], [ %rem13, %beki.exit50 ], [ %rem21, %beki.exit72 ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %num.0) 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: 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 willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #4 attributes #0 = { 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 #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 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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #define NMAX 1000 int bs (int [], int, int); int compar (const void *a, const void *b) { return *(int *)a- *(int *)b; } int main(void) { while(1) { int i,j,k,N,M,c,p[NMAX*NMAX],s; scanf("%d%d",&N,&M); if(N==0 && M==0) break; for(i=0;i<=N-1;i++) { scanf("%d",&p[i]); } k=N; for(i=0;i<=N-1;i++) { for(j=i;j<=N-1;j++) { p[k]=p[i]+p[j]; k++; } } p[k]=0; qsort(p,k+1,sizeof(int),compar); for(i=c=0;i<=k;i++) { if(p[i]<=M) { s=p[i]+bs(p,k+1,M-p[i]); if(s<=M&&s>c)c=s; } } printf("%d\n",c); } return 0; } int bs (int D[], int n, int c) { int j,k,l; j=0; k=n-1; while(1) { if(j<=k) { l=(j+k)/2; if(D[l] > c) { k=l-1; } else if(D[l+1] < c) { j=l+1; } else { return D[l]; } } else { return D[k]; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152434/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152434/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compar(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %p = alloca [1000000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #7 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %p) #7 %call104 = 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 %cmp105 = icmp eq i32 %0, 0 %1 = load i32, ptr %M, align 4 %cmp1106 = icmp eq i32 %1, 0 %or.cond107 = select i1 %cmp105, i1 %cmp1106, i1 false br i1 %or.cond107, label %while.end, label %for.cond.preheader.preheader for.cond.preheader.preheader: ; preds = %entry %scevgep135 = getelementptr inbounds i8, ptr %p, i64 4 %invariant.gep = getelementptr i8, ptr %p, i64 4 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.preheader, %cleanup %2 = phi i32 [ %32, %cleanup ], [ %0, %for.cond.preheader.preheader ] %cmp2.not.not92 = icmp sgt i32 %2, 0 br i1 %cmp2.not.not92, label %for.body, label %for.end24 for.cond4.preheader: ; preds = %for.body %cmp6.not.not96 = icmp sgt i32 %4, 0 br i1 %cmp6.not.not96, label %for.cond8.preheader.preheader, label %for.end24 for.cond8.preheader.preheader: ; preds = %for.cond4.preheader %3 = zext i32 %4 to i64 %wide.trip.count = zext i32 %4 to i64 br label %for.cond8.preheader for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [1000000 x i32], ptr %p, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp2.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.cond8.preheader: ; preds = %for.cond8.preheader.preheader, %for.inc22 %indvars.iv114 = phi i64 [ 0, %for.cond8.preheader.preheader ], [ %indvars.iv.next115, %for.inc22 ] %k.097 = phi i32 [ %4, %for.cond8.preheader.preheader ], [ %26, %for.inc22 ] %6 = add nuw i64 %indvars.iv114, 1 %umax143 = call i64 @llvm.umax.i64(i64 %6, i64 %wide.trip.count) %7 = sub i64 %umax143, %indvars.iv114 %arrayidx13 = getelementptr inbounds [1000000 x i32], ptr %p, i64 0, i64 %indvars.iv114 %8 = sext i32 %k.097 to i64 %min.iters.check = icmp ult i64 %7, 16 br i1 %min.iters.check, label %for.body11.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.cond8.preheader %9 = shl nuw nsw i64 %indvars.iv114, 2 %gep = getelementptr i8, ptr %invariant.gep, i64 %9 %10 = add nuw i64 %indvars.iv114, 1 %umax = call i64 @llvm.umax.i64(i64 %10, i64 %wide.trip.count) %11 = xor i64 %indvars.iv114, -1 %12 = add i64 %umax, %11 %13 = shl nsw i64 %12, 2 %scevgep139 = getelementptr i8, ptr %gep, i64 %13 %scevgep137 = getelementptr i8, ptr %p, i64 %9 %14 = shl nsw i64 %8, 2 %scevgep = getelementptr i8, ptr %p, i64 %14 %15 = getelementptr i8, ptr %scevgep135, i64 %13 %scevgep136 = getelementptr i8, ptr %15, i64 %14 %bound0 = icmp ult ptr %scevgep, %gep %bound1 = icmp ult ptr %scevgep137, %scevgep136 %found.conflict = and i1 %bound0, %bound1 %bound0140 = icmp ult ptr %scevgep, %scevgep139 %bound1141 = icmp ult ptr %scevgep137, %scevgep136 %found.conflict142 = and i1 %bound0140, %bound1141 %conflict.rdx = or i1 %found.conflict, %found.conflict142 br i1 %conflict.rdx, label %for.body11.preheader, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %7, -8 %ind.end = add i64 %indvars.iv114, %n.vec %ind.end144 = add i64 %n.vec, %8 %16 = load i32, ptr %arrayidx13, align 4, !tbaa !5, !alias.scope !11 %broadcast.splatinsert148 = insertelement <4 x i32> poison, i32 %16, i64 0 %broadcast.splat149 = shufflevector <4 x i32> %broadcast.splatinsert148, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %8 %offset.idx146 = add i64 %indvars.iv114, %index %17 = getelementptr inbounds [1000000 x i32], ptr %p, i64 0, i64 %offset.idx146 %wide.load = load <4 x i32>, ptr %17, align 4, !tbaa !5, !alias.scope !14 %18 = getelementptr inbounds i32, ptr %17, i64 4 %wide.load147 = load <4 x i32>, ptr %18, align 4, !tbaa !5, !alias.scope !14 %19 = add nsw <4 x i32> %wide.load, %broadcast.splat149 %20 = add nsw <4 x i32> %wide.load147, %broadcast.splat149 %21 = getelementptr inbounds [1000000 x i32], ptr %p, i64 0, i64 %offset.idx store <4 x i32> %19, ptr %21, align 4, !tbaa !5, !alias.scope !16, !noalias !18 %22 = getelementptr inbounds i32, ptr %21, i64 4 store <4 x i32> %20, ptr %22, align 4, !tbaa !5, !alias.scope !16, !noalias !18 %index.next = add nuw i64 %index, 8 %23 = icmp eq i64 %index.next, %n.vec br i1 %23, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %7, %n.vec br i1 %cmp.n, label %for.inc22, label %for.body11.preheader for.body11.preheader: ; preds = %vector.memcheck, %for.cond8.preheader, %middle.block %indvars.iv116.ph = phi i64 [ %indvars.iv114, %vector.memcheck ], [ %indvars.iv114, %for.cond8.preheader ], [ %ind.end, %middle.block ] %indvars.iv112.ph = phi i64 [ %8, %vector.memcheck ], [ %8, %for.cond8.preheader ], [ %ind.end144, %middle.block ] br label %for.body11 for.body11: ; preds = %for.body11.preheader, %for.body11 %indvars.iv116 = phi i64 [ %indvars.iv.next117, %for.body11 ], [ %indvars.iv116.ph, %for.body11.preheader ] %indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.body11 ], [ %indvars.iv112.ph, %for.body11.preheader ] %24 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %arrayidx15 = getelementptr inbounds [1000000 x i32], ptr %p, i64 0, i64 %indvars.iv116 %25 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %add = add nsw i32 %25, %24 %arrayidx17 = getelementptr inbounds [1000000 x i32], ptr %p, i64 0, i64 %indvars.iv112 store i32 %add, ptr %arrayidx17, align 4, !tbaa !5 %indvars.iv.next113 = add nsw i64 %indvars.iv112, 1 %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1 %cmp10.not.not = icmp ult i64 %indvars.iv.next117, %3 br i1 %cmp10.not.not, label %for.body11, label %for.inc22, !llvm.loop !22 for.inc22: ; preds = %for.body11, %middle.block %indvars.iv.next113.lcssa = phi i64 [ %ind.end144, %middle.block ], [ %indvars.iv.next113, %for.body11 ] %26 = trunc i64 %indvars.iv.next113.lcssa to i32 %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1 %exitcond.not = icmp eq i64 %indvars.iv.next115, %wide.trip.count br i1 %exitcond.not, label %for.end24, label %for.cond8.preheader, !llvm.loop !23 for.end24: ; preds = %for.inc22, %for.cond.preheader, %for.cond4.preheader %k.0.lcssa = phi i32 [ %4, %for.cond4.preheader ], [ %2, %for.cond.preheader ], [ %26, %for.inc22 ] %idxprom25 = sext i32 %k.0.lcssa to i64 %arrayidx26 = getelementptr inbounds [1000000 x i32], ptr %p, i64 0, i64 %idxprom25 store i32 0, ptr %arrayidx26, align 4, !tbaa !5 %add27 = add i32 %k.0.lcssa, 1 %conv = sext i32 %add27 to i64 call void @qsort(ptr noundef nonnull %p, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @compar) #7 %cmp29.not100 = icmp slt i32 %k.0.lcssa, 0 br i1 %cmp29.not100, label %cleanup, label %for.body31.lr.ph for.body31.lr.ph: ; preds = %for.end24 %27 = load i32, ptr %M, align 4, !tbaa !5 %wide.trip.count125 = zext i32 %add27 to i64 br label %for.body31 for.body31: ; preds = %for.body31.lr.ph, %for.inc54 %indvars.iv122 = phi i64 [ 0, %for.body31.lr.ph ], [ %indvars.iv.next123, %for.inc54 ] %c.0101 = phi i32 [ 0, %for.body31.lr.ph ], [ %c.1, %for.inc54 ] %arrayidx33 = getelementptr inbounds [1000000 x i32], ptr %p, i64 0, i64 %indvars.iv122 %28 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %cmp34.not = icmp sgt i32 %28, %27 br i1 %cmp34.not, label %for.inc54, label %if.then36 if.then36: ; preds = %for.body31 %sub43 = sub nsw i32 %27, %28 br label %if.then.i if.then.i: ; preds = %if.then36, %if.end17.i %k.034.i = phi i32 [ %k.1.i, %if.end17.i ], [ %k.0.lcssa, %if.then36 ] %j.033.i = phi i32 [ %j.1.i, %if.end17.i ], [ 0, %if.then36 ] %add.i = add nsw i32 %j.033.i, %k.034.i %div.i = sdiv i32 %add.i, 2 %idxprom.i = sext i32 %div.i to i64 %arrayidx.i = getelementptr inbounds i32, ptr %p, i64 %idxprom.i %29 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp1.i = icmp sgt i32 %29, %sub43 br i1 %cmp1.i, label %if.then2.i, label %if.else.i if.then2.i: ; preds = %if.then.i %sub3.i = add nsw i32 %div.i, -1 br label %if.end17.i if.else.i: ; preds = %if.then.i %add4.i = add nsw i32 %div.i, 1 %idxprom5.i = sext i32 %add4.i to i64 %arrayidx6.i = getelementptr inbounds i32, ptr %p, i64 %idxprom5.i %30 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5 %cmp7.i = icmp slt i32 %30, %sub43 br i1 %cmp7.i, label %if.end17.i, label %bs.exit if.else14.i: ; preds = %if.end17.i %idxprom15.i = sext i32 %k.1.i to i64 %arrayidx16.i = getelementptr inbounds i32, ptr %p, i64 %idxprom15.i %31 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5 br label %bs.exit if.end17.i: ; preds = %if.else.i, %if.then2.i %j.1.i = phi i32 [ %j.033.i, %if.then2.i ], [ %add4.i, %if.else.i ] %k.1.i = phi i32 [ %sub3.i, %if.then2.i ], [ %k.034.i, %if.else.i ] %cmp.not.i = icmp sgt i32 %j.1.i, %k.1.i br i1 %cmp.not.i, label %if.else14.i, label %if.then.i bs.exit: ; preds = %if.else.i, %if.else14.i %retval.0.i = phi i32 [ %31, %if.else14.i ], [ %29, %if.else.i ] %add45 = add nsw i32 %retval.0.i, %28 %cmp46.not = icmp sle i32 %add45, %27 %cmp49 = icmp sgt i32 %add45, %c.0101 %or.cond87 = select i1 %cmp46.not, i1 %cmp49, i1 false %spec.select = select i1 %or.cond87, i32 %add45, i32 %c.0101 br label %for.inc54 for.inc54: ; preds = %bs.exit, %for.body31 %c.1 = phi i32 [ %c.0101, %for.body31 ], [ %spec.select, %bs.exit ] %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1 %exitcond126.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count125 br i1 %exitcond126.not, label %cleanup, label %for.body31, !llvm.loop !24 cleanup: ; preds = %for.inc54, %for.end24 %c.0.lcssa = phi i32 [ 0, %for.end24 ], [ %c.1, %for.inc54 ] %call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.0.lcssa) call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %p) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #7 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %p) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M) %32 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp eq i32 %32, 0 %33 = load i32, ptr %M, align 4 %cmp1 = icmp eq i32 %33, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %p) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @bs(ptr nocapture noundef readonly %D, i32 noundef %n, i32 noundef %c) local_unnamed_addr #5 { entry: %sub = add nsw i32 %n, -1 %cmp.not32 = icmp slt i32 %n, 1 br i1 %cmp.not32, label %if.else14, label %if.then if.then: ; preds = %entry, %if.end17 %k.034 = phi i32 [ %k.1, %if.end17 ], [ %sub, %entry ] %j.033 = phi i32 [ %j.1, %if.end17 ], [ 0, %entry ] %add = add nsw i32 %k.034, %j.033 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i32, ptr %D, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %0, %c br i1 %cmp1, label %if.then2, label %if.else if.then2: ; preds = %if.then %sub3 = add nsw i32 %div, -1 br label %if.end17 if.else: ; preds = %if.then %add4 = add nsw i32 %div, 1 %idxprom5 = sext i32 %add4 to i64 %arrayidx6 = getelementptr inbounds i32, ptr %D, i64 %idxprom5 %1 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp slt i32 %1, %c br i1 %cmp7, label %if.end17, label %cleanup if.else14: ; preds = %if.end17, %entry %k.0.lcssa = phi i32 [ %sub, %entry ], [ %k.1, %if.end17 ] %idxprom15 = sext i32 %k.0.lcssa to i64 %arrayidx16 = getelementptr inbounds i32, ptr %D, i64 %idxprom15 %2 = load i32, ptr %arrayidx16, align 4, !tbaa !5 br label %cleanup if.end17: ; preds = %if.else, %if.then2 %j.1 = phi i32 [ %j.033, %if.then2 ], [ %add4, %if.else ] %k.1 = phi i32 [ %sub3, %if.then2 ], [ %k.034, %if.else ] %cmp.not = icmp sgt i32 %j.1, %k.1 br i1 %cmp.not, label %if.else14, label %if.then cleanup: ; preds = %if.else, %if.else14 %retval.0 = phi i32 [ %2, %if.else14 ], [ %0, %if.else ] ret i32 %retval.0 } ; 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 i64 @llvm.umax.i64(i64, i64) #6 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12} !12 = distinct !{!12, !13} !13 = distinct !{!13, !"LVerDomain"} !14 = !{!15} !15 = distinct !{!15, !13} !16 = !{!17} !17 = distinct !{!17, !13} !18 = !{!12, !15} !19 = distinct !{!19, !10, !20, !21} !20 = !{!"llvm.loop.isvectorized", i32 1} !21 = !{!"llvm.loop.unroll.runtime.disable"} !22 = distinct !{!22, !10, !20} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10}
#include<stdio.h> int main(){ int hey,m,i,j,k,cnt=0; while(1){ scanf("%d %d",&m,&hey); if(m+hey==0) break; for(i=1;i<=m;i++){ for(j=1;j<=m;j++){ for(k=1;k<=m;k++){ if((i+j+k)==hey&&i!=j&&i!=k&&j!=k) cnt++; } } } printf("%d\n",cnt/6); cnt=0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152492/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152492/source.c" target datalayout = "e-m:e-p270: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: %hey = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %hey) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %hey) %0 = load i32, ptr %m, align 4, !tbaa !5 %1 = load i32, ptr %hey, align 4, !tbaa !5 %add53 = sub i32 0, %1 %cmp54 = icmp eq i32 %0, %add53 br i1 %cmp54, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end24 %2 = phi i32 [ %30, %for.end24 ], [ %1, %entry ] %3 = phi i32 [ %29, %for.end24 ], [ %0, %entry ] %cmp1.not48 = icmp slt i32 %3, 1 br i1 %cmp1.not48, label %for.end24, label %for.cond2.preheader.preheader for.cond2.preheader.preheader: ; preds = %for.cond.preheader %min.iters.check = icmp ult i32 %3, 8 %n.vec = and i32 %3, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert59 = insertelement <4 x i32> poison, i32 %2, i64 0 %broadcast.splat60 = shufflevector <4 x i32> %broadcast.splatinsert59, <4 x i32> poison, <4 x i32> zeroinitializer %cmp.n = icmp eq i32 %3, %n.vec br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.cond2.for.inc22_crit_edge.split %cnt.150 = phi i32 [ %cnt.4.lcssa, %for.cond2.for.inc22_crit_edge.split ], [ 0, %for.cond2.preheader.preheader ] %i.049 = phi i32 [ %inc23, %for.cond2.for.inc22_crit_edge.split ], [ 1, %for.cond2.preheader.preheader ] %broadcast.splatinsert63 = insertelement <4 x i32> poison, i32 %i.049, i64 0 %broadcast.splat64 = shufflevector <4 x i32> %broadcast.splatinsert63, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.cond5.preheader for.cond5.preheader: ; preds = %for.cond2.preheader, %for.cond5.for.inc19_crit_edge %cnt.246 = phi i32 [ %cnt.150, %for.cond2.preheader ], [ %cnt.4.lcssa, %for.cond5.for.inc19_crit_edge ] %j.045 = phi i32 [ 1, %for.cond2.preheader ], [ %inc20, %for.cond5.for.inc19_crit_edge ] %add8 = add nuw nsw i32 %j.045, %i.049 %cmp11.not = icmp eq i32 %i.049, %j.045 br i1 %min.iters.check, label %for.body7.preheader, label %vector.ph vector.ph: ; preds = %for.cond5.preheader %4 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %cnt.246, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add8, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert61 = insertelement <4 x i1> poison, i1 %cmp11.not, i64 0 %broadcast.splat62 = shufflevector <4 x i1> %broadcast.splatinsert61, <4 x i1> poison, <4 x i32> zeroinitializer %broadcast.splatinsert65 = insertelement <4 x i32> poison, i32 %j.045, i64 0 %broadcast.splat66 = shufflevector <4 x i32> %broadcast.splatinsert65, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %4, %vector.ph ], [ %23, %vector.body ] %vec.phi57 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %5 = add nuw nsw <4 x i32> %broadcast.splat, %vec.ind %6 = add nuw nsw <4 x i32> %broadcast.splat, %step.add %7 = icmp ne <4 x i32> %5, %broadcast.splat60 %8 = icmp ne <4 x i32> %6, %broadcast.splat60 %9 = icmp eq <4 x i32> %broadcast.splat64, %vec.ind %10 = icmp eq <4 x i32> %broadcast.splat64, %step.add %11 = or <4 x i1> %7, %9 %12 = or <4 x i1> %8, %10 %13 = icmp eq <4 x i32> %broadcast.splat66, %vec.ind %14 = icmp eq <4 x i32> %broadcast.splat66, %step.add %15 = or <4 x i1> %11, %13 %16 = or <4 x i1> %15, %broadcast.splat62 %17 = or <4 x i1> %12, %14 %18 = or <4 x i1> %17, %broadcast.splat62 %19 = xor <4 x i1> %16, <i1 true, i1 true, i1 true, i1 true> %20 = xor <4 x i1> %18, <i1 true, i1 true, i1 true, i1 true> %21 = zext <4 x i1> %19 to <4 x i32> %22 = zext <4 x i1> %20 to <4 x i32> %23 = add <4 x i32> %vec.phi, %21 %24 = add <4 x i32> %vec.phi57, %22 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %25 = icmp eq i32 %index.next, %n.vec br i1 %25, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %24, %23 %26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond5.for.inc19_crit_edge, label %for.body7.preheader for.body7.preheader: ; preds = %for.cond5.preheader, %middle.block %cnt.343.ph = phi i32 [ %cnt.246, %for.cond5.preheader ], [ %26, %middle.block ] %k.042.ph = phi i32 [ 1, %for.cond5.preheader ], [ %ind.end, %middle.block ] br label %for.body7 for.body7: ; preds = %for.body7.preheader, %for.body7 %cnt.343 = phi i32 [ %cnt.4, %for.body7 ], [ %cnt.343.ph, %for.body7.preheader ] %k.042 = phi i32 [ %inc18, %for.body7 ], [ %k.042.ph, %for.body7.preheader ] %add9 = add nuw nsw i32 %add8, %k.042 %cmp10 = icmp ne i32 %add9, %2 %cmp13.not = icmp eq i32 %i.049, %k.042 %27 = or i1 %cmp10, %cmp13.not %cmp15.not = icmp eq i32 %j.045, %k.042 %28 = or i1 %27, %cmp15.not %or.cond40 = or i1 %28, %cmp11.not %not.or.cond40 = xor i1 %or.cond40, true %inc = zext i1 %not.or.cond40 to i32 %cnt.4 = add nsw i32 %cnt.343, %inc %inc18 = add nuw i32 %k.042, 1 %exitcond.not = icmp eq i32 %k.042, %3 br i1 %exitcond.not, label %for.cond5.for.inc19_crit_edge, label %for.body7, !llvm.loop !13 for.cond5.for.inc19_crit_edge: ; preds = %for.body7, %middle.block %cnt.4.lcssa = phi i32 [ %26, %middle.block ], [ %cnt.4, %for.body7 ] %inc20 = add nuw i32 %j.045, 1 %exitcond55.not = icmp eq i32 %j.045, %3 br i1 %exitcond55.not, label %for.cond2.for.inc22_crit_edge.split, label %for.cond5.preheader, !llvm.loop !14 for.cond2.for.inc22_crit_edge.split: ; preds = %for.cond5.for.inc19_crit_edge %inc23 = add nuw i32 %i.049, 1 %exitcond56.not = icmp eq i32 %i.049, %3 br i1 %exitcond56.not, label %for.end24, label %for.cond2.preheader, !llvm.loop !15 for.end24: ; preds = %for.cond2.for.inc22_crit_edge.split, %for.cond.preheader %cnt.1.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %cnt.4.lcssa, %for.cond2.for.inc22_crit_edge.split ] %div = sdiv i32 %cnt.1.lcssa, 6 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %hey) %29 = load i32, ptr %m, align 4, !tbaa !5 %30 = load i32, ptr %hey, align 4, !tbaa !5 %add = sub i32 0, %30 %cmp = icmp eq i32 %29, %add br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end24, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %hey) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> #define swap(a, b) ((a != b) && (a += b, b = a - b, a -= b)) int main(void) { int i, j, k; int n, x, count; while (scanf("%d %d", &n, &x), n || x) { count = 0; for (i = 1; i <= n; i++) { for (j = i+1; j <= n; j++) { for (k = j+1; k <= n; k++) { if (i+j+k == x) count++; } } } printf("%d\n", count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152542/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152542/source.c" target datalayout = "e-m:e-p270: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: %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 %call40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool41 = icmp ne i32 %0, 0 %1 = load i32, ptr %x, align 4 %tobool142 = icmp ne i32 %1, 0 %2 = select i1 %tobool41, i1 true, i1 %tobool142 br i1 %2, label %for.cond.preheader, label %while.end for.cond.preheader: ; preds = %entry, %for.end18 %3 = phi i32 [ %20, %for.end18 ], [ %1, %entry ] %4 = phi i32 [ %19, %for.end18 ], [ %0, %entry ] %cmp.not36 = icmp slt i32 %4, 1 br i1 %cmp.not36, label %for.end18, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %5 = add i32 %4, -2 %broadcast.splatinsert48 = insertelement <4 x i32> poison, i32 %3, i64 0 %broadcast.splat49 = shufflevector <4 x i32> %broadcast.splatinsert48, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.body for.cond.loopexit: ; preds = %for.cond2.loopexit, %for.body %count.1.lcssa = phi i32 [ %count.038, %for.body ], [ %count.2.lcssa, %for.cond2.loopexit ] %exitcond43.not = icmp eq i32 %i.037, %4 %indvar.next = add i32 %indvar, 1 br i1 %exitcond43.not, label %for.end18, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ] %count.038 = phi i32 [ 0, %for.body.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %i.037 = phi i32 [ 1, %for.body.preheader ], [ %add, %for.cond.loopexit ] %add = add nuw i32 %i.037, 1 %cmp3.not32.not = icmp slt i32 %i.037, %4 br i1 %cmp3.not32.not, label %for.body4, label %for.cond.loopexit for.cond2.loopexit: ; preds = %for.body8, %middle.block, %for.body4 %count.2.lcssa = phi i32 [ %count.134, %for.body4 ], [ %18, %middle.block ], [ %spec.select, %for.body8 ] %exitcond.not = icmp eq i32 %j.033, %4 %indvar.next45 = add i32 %indvar44, 1 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body4, !llvm.loop !11 for.body4: ; preds = %for.body, %for.cond2.loopexit %indvar44 = phi i32 [ %indvar.next45, %for.cond2.loopexit ], [ 0, %for.body ] %count.134 = phi i32 [ %count.2.lcssa, %for.cond2.loopexit ], [ %count.038, %for.body ] %j.033 = phi i32 [ %add5, %for.cond2.loopexit ], [ %add, %for.body ] %6 = add i32 %indvar, %indvar44 %7 = sub i32 %5, %6 %add5 = add i32 %j.033, 1 %cmp7.not29.not = icmp slt i32 %j.033, %4 br i1 %cmp7.not29.not, label %for.body8.lr.ph, label %for.cond2.loopexit for.body8.lr.ph: ; preds = %for.body4 %add9 = add nuw nsw i32 %j.033, %i.037 %min.iters.check = icmp ult i32 %7, 8 br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph vector.ph: ; preds = %for.body8.lr.ph %n.vec = and i32 %7, -8 %ind.end = add i32 %add5, %n.vec %8 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.134, i64 0 %.splatinsert = insertelement <4 x i32> poison, i32 %add5, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3> %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add9, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %8, %vector.ph ], [ %15, %vector.body ] %vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %9 = add nuw nsw <4 x i32> %broadcast.splat, %vec.ind %10 = add nuw nsw <4 x i32> %broadcast.splat, %step.add %11 = icmp eq <4 x i32> %9, %broadcast.splat49 %12 = icmp eq <4 x i32> %10, %broadcast.splat49 %13 = zext <4 x i1> %11 to <4 x i32> %14 = zext <4 x i1> %12 to <4 x i32> %15 = add <4 x i32> %vec.phi, %13 %16 = add <4 x i32> %vec.phi46, %14 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %17 = icmp eq i32 %index.next, %n.vec br i1 %17, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %16, %15 %18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %7, %n.vec br i1 %cmp.n, label %for.cond2.loopexit, label %for.body8.preheader for.body8.preheader: ; preds = %for.body8.lr.ph, %middle.block %count.231.ph = phi i32 [ %count.134, %for.body8.lr.ph ], [ %18, %middle.block ] %k.030.ph = phi i32 [ %add5, %for.body8.lr.ph ], [ %ind.end, %middle.block ] br label %for.body8 for.body8: ; preds = %for.body8.preheader, %for.body8 %count.231 = phi i32 [ %spec.select, %for.body8 ], [ %count.231.ph, %for.body8.preheader ] %k.030 = phi i32 [ %inc12, %for.body8 ], [ %k.030.ph, %for.body8.preheader ] %add10 = add nuw nsw i32 %add9, %k.030 %cmp11 = icmp eq i32 %add10, %3 %inc = zext i1 %cmp11 to i32 %spec.select = add nsw i32 %count.231, %inc %inc12 = add nuw nsw i32 %k.030, 1 %cmp7.not.not = icmp slt i32 %k.030, %4 br i1 %cmp7.not.not, label %for.body8, label %for.cond2.loopexit, !llvm.loop !15 for.end18: ; preds = %for.cond.loopexit, %for.cond.preheader %count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x) %19 = load i32, ptr %n, align 4, !tbaa !5 %tobool = icmp ne i32 %19, 0 %20 = load i32, ptr %x, align 4 %tobool1 = icmp ne i32 %20, 0 %21 = select i1 %tobool, i1 true, i1 %tobool1 br i1 %21, label %for.cond.preheader, label %while.end, !llvm.loop !16 while.end: ; preds = %for.end18, %entry 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.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !14, !13} !16 = distinct !{!16, !10}
#include <stdio.h> int main(){ int max, answer; int i; int num1, num2, num3; while(1){ scanf("%d %d", &max, &answer); if(max == 0 && answer == 0){ break; } i = 0; for(num1 = 1; num1 <= max; num1++){ for(num2 = num1 + 1; num2 <= max; num2++){ for(num3 = num2 + 1; num3 <= max; num3++){ if(num1 + num2 + num3 == answer){ i++; } } } } printf("%d\n", i); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152586/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152586/source.c" target datalayout = "e-m:e-p270: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: %max = alloca i32, align 4 %answer = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %max) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %answer) #4 %call43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %max, ptr noundef nonnull %answer) %0 = load i32, ptr %max, align 4, !tbaa !5 %cmp44 = icmp eq i32 %0, 0 %1 = load i32, ptr %answer, align 4 %cmp145 = icmp eq i32 %1, 0 %or.cond46 = select i1 %cmp44, i1 %cmp145, i1 false br i1 %or.cond46, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end21 %2 = phi i32 [ %19, %for.end21 ], [ %1, %entry ] %3 = phi i32 [ %18, %for.end21 ], [ %0, %entry ] %cmp2.not39 = icmp slt i32 %3, 1 br i1 %cmp2.not39, label %for.end21, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %4 = add i32 %3, -2 %broadcast.splatinsert52 = insertelement <4 x i32> poison, i32 %2, i64 0 %broadcast.splat53 = shufflevector <4 x i32> %broadcast.splatinsert52, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.body for.cond.loopexit: ; preds = %for.cond3.loopexit, %for.body %i.1.lcssa = phi i32 [ %i.040, %for.body ], [ %i.2.lcssa, %for.cond3.loopexit ] %exitcond47.not = icmp eq i32 %num1.041, %3 %indvar.next = add i32 %indvar, 1 br i1 %exitcond47.not, label %for.end21, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ] %num1.041 = phi i32 [ 1, %for.body.preheader ], [ %add, %for.cond.loopexit ] %i.040 = phi i32 [ 0, %for.body.preheader ], [ %i.1.lcssa, %for.cond.loopexit ] %add = add nuw i32 %num1.041, 1 %cmp4.not35.not = icmp slt i32 %num1.041, %3 br i1 %cmp4.not35.not, label %for.body5, label %for.cond.loopexit for.cond3.loopexit: ; preds = %for.body9, %middle.block, %for.body5 %i.2.lcssa = phi i32 [ %i.136, %for.body5 ], [ %17, %middle.block ], [ %spec.select, %for.body9 ] %exitcond.not = icmp eq i32 %num2.037, %3 %indvar.next49 = add i32 %indvar48, 1 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body5, !llvm.loop !11 for.body5: ; preds = %for.body, %for.cond3.loopexit %indvar48 = phi i32 [ %indvar.next49, %for.cond3.loopexit ], [ 0, %for.body ] %num2.037 = phi i32 [ %add6, %for.cond3.loopexit ], [ %add, %for.body ] %i.136 = phi i32 [ %i.2.lcssa, %for.cond3.loopexit ], [ %i.040, %for.body ] %5 = add i32 %indvar, %indvar48 %6 = sub i32 %4, %5 %add6 = add i32 %num2.037, 1 %cmp8.not32.not = icmp slt i32 %num2.037, %3 br i1 %cmp8.not32.not, label %for.body9.lr.ph, label %for.cond3.loopexit for.body9.lr.ph: ; preds = %for.body5 %add10 = add nuw nsw i32 %num2.037, %num1.041 %min.iters.check = icmp ult i32 %6, 8 br i1 %min.iters.check, label %for.body9.preheader, label %vector.ph vector.ph: ; preds = %for.body9.lr.ph %n.vec = and i32 %6, -8 %ind.end = add i32 %add6, %n.vec %.splatinsert = insertelement <4 x i32> poison, i32 %add6, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3> %7 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %i.136, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add10, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %vec.phi = phi <4 x i32> [ %7, %vector.ph ], [ %14, %vector.body ] %vec.phi51 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %8 = add nuw nsw <4 x i32> %broadcast.splat, %vec.ind %9 = add nuw nsw <4 x i32> %broadcast.splat, %step.add %10 = icmp eq <4 x i32> %8, %broadcast.splat53 %11 = icmp eq <4 x i32> %9, %broadcast.splat53 %12 = zext <4 x i1> %10 to <4 x i32> %13 = zext <4 x i1> %11 to <4 x i32> %14 = add <4 x i32> %vec.phi, %12 %15 = add <4 x i32> %vec.phi51, %13 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %16 = icmp eq i32 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %15, %14 %17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %6, %n.vec br i1 %cmp.n, label %for.cond3.loopexit, label %for.body9.preheader for.body9.preheader: ; preds = %for.body9.lr.ph, %middle.block %num3.034.ph = phi i32 [ %add6, %for.body9.lr.ph ], [ %ind.end, %middle.block ] %i.233.ph = phi i32 [ %i.136, %for.body9.lr.ph ], [ %17, %middle.block ] br label %for.body9 for.body9: ; preds = %for.body9.preheader, %for.body9 %num3.034 = phi i32 [ %inc15, %for.body9 ], [ %num3.034.ph, %for.body9.preheader ] %i.233 = phi i32 [ %spec.select, %for.body9 ], [ %i.233.ph, %for.body9.preheader ] %add11 = add nuw nsw i32 %add10, %num3.034 %cmp12 = icmp eq i32 %add11, %2 %inc = zext i1 %cmp12 to i32 %spec.select = add nsw i32 %i.233, %inc %inc15 = add nuw nsw i32 %num3.034, 1 %cmp8.not.not = icmp slt i32 %num3.034, %3 br i1 %cmp8.not.not, label %for.body9, label %for.cond3.loopexit, !llvm.loop !15 for.end21: ; preds = %for.cond.loopexit, %for.cond.preheader %i.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %i.1.lcssa, %for.cond.loopexit ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %max, ptr noundef nonnull %answer) %18 = load i32, ptr %max, align 4, !tbaa !5 %cmp = icmp eq i32 %18, 0 %19 = load i32, ptr %answer, align 4 %cmp1 = icmp eq i32 %19, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end21, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %answer) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %max) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !14, !13}
#include <stdio.h> int main() { int n, x, count; int i, j, k; while(1) { count = 0; scanf("%d %d", &n, &x); if(n == 0 && x == 0) break; for(i = 1; i <= n - 2; i++) { for(j = i+1; j <= n - 1; j++) { for(k = j+1; k <= n; k++) { if(i+j+k == x) count++; } } } printf("%d\n", count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152629/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152629/source.c" target datalayout = "e-m:e-p270: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: %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 %call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp45 = icmp eq i32 %0, 0 %1 = load i32, ptr %x, align 4 %cmp146 = icmp eq i32 %1, 0 %or.cond47 = select i1 %cmp45, i1 %cmp146, i1 false br i1 %or.cond47, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end22 %2 = phi i32 [ %21, %for.end22 ], [ %1, %entry ] %3 = phi i32 [ %20, %for.end22 ], [ %0, %entry ] %cmp2.not40 = icmp slt i32 %3, 3 br i1 %cmp2.not40, label %for.end22, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %4 = add i32 %3, -2 %broadcast.splatinsert53 = insertelement <4 x i32> poison, i32 %2, i64 0 %broadcast.splat54 = shufflevector <4 x i32> %broadcast.splatinsert53, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.body for.cond.loopexit: ; preds = %for.cond3.loopexit, %for.body %count.1.lcssa = phi i32 [ %count.041, %for.body ], [ %spec.select.lcssa, %for.cond3.loopexit ] %exitcond48.not = icmp eq i32 %i.042, %4 %indvar.next = add i32 %indvar, 1 br i1 %exitcond48.not, label %for.end22, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ] %i.042 = phi i32 [ 1, %for.body.preheader ], [ %add, %for.cond.loopexit ] %count.041 = phi i32 [ 0, %for.body.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %5 = add i32 %indvar, 3 %add = add nuw nsw i32 %i.042, 1 %cmp5.not.not36 = icmp slt i32 %add, %3 br i1 %cmp5.not.not36, label %for.body10.lr.ph, label %for.cond.loopexit for.cond3.loopexit: ; preds = %for.body10, %middle.block %spec.select.lcssa = phi i32 [ %19, %middle.block ], [ %spec.select, %for.body10 ] %exitcond.not = icmp eq i32 %add7, %3 %indvar.next50 = add i32 %indvar49, 1 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body10.lr.ph, !llvm.loop !11 for.body10.lr.ph: ; preds = %for.body, %for.cond3.loopexit %indvar49 = phi i32 [ %indvar.next50, %for.cond3.loopexit ], [ 0, %for.body ] %j.038 = phi i32 [ %add7, %for.cond3.loopexit ], [ %add, %for.body ] %count.137 = phi i32 [ %spec.select.lcssa, %for.cond3.loopexit ], [ %count.041, %for.body ] %6 = add i32 %5, %indvar49 %smax = call i32 @llvm.smax.i32(i32 %3, i32 %6) %7 = add i32 %indvar, %indvar49 %reass.sub = sub i32 %smax, %7 %8 = add i32 %reass.sub, -2 %add7 = add nuw nsw i32 %j.038, 1 %add11 = add nuw nsw i32 %j.038, %i.042 %min.iters.check = icmp ult i32 %8, 8 br i1 %min.iters.check, label %for.body10.preheader, label %vector.ph vector.ph: ; preds = %for.body10.lr.ph %n.vec = and i32 %8, -8 %ind.end = add i32 %add7, %n.vec %.splatinsert = insertelement <4 x i32> poison, i32 %add7, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %induction = add nuw <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3> %9 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.137, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add11, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %vec.phi = phi <4 x i32> [ %9, %vector.ph ], [ %16, %vector.body ] %vec.phi52 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %10 = add nuw nsw <4 x i32> %broadcast.splat, %vec.ind %11 = add nuw nsw <4 x i32> %broadcast.splat, %step.add %12 = icmp eq <4 x i32> %10, %broadcast.splat54 %13 = icmp eq <4 x i32> %11, %broadcast.splat54 %14 = zext <4 x i1> %12 to <4 x i32> %15 = zext <4 x i1> %13 to <4 x i32> %16 = add <4 x i32> %vec.phi, %14 %17 = add <4 x i32> %vec.phi52, %15 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %18 = icmp eq i32 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %8, %n.vec br i1 %cmp.n, label %for.cond3.loopexit, label %for.body10.preheader for.body10.preheader: ; preds = %for.body10.lr.ph, %middle.block %k.035.ph = phi i32 [ %add7, %for.body10.lr.ph ], [ %ind.end, %middle.block ] %count.234.ph = phi i32 [ %count.137, %for.body10.lr.ph ], [ %19, %middle.block ] br label %for.body10 for.body10: ; preds = %for.body10.preheader, %for.body10 %k.035 = phi i32 [ %inc16, %for.body10 ], [ %k.035.ph, %for.body10.preheader ] %count.234 = phi i32 [ %spec.select, %for.body10 ], [ %count.234.ph, %for.body10.preheader ] %add12 = add nuw nsw i32 %add11, %k.035 %cmp13 = icmp eq i32 %add12, %2 %inc = zext i1 %cmp13 to i32 %spec.select = add nsw i32 %count.234, %inc %inc16 = add nuw nsw i32 %k.035, 1 %cmp9.not.not = icmp slt i32 %k.035, %3 br i1 %cmp9.not.not, label %for.body10, label %for.cond3.loopexit, !llvm.loop !15 for.end22: ; preds = %for.cond.loopexit, %for.cond.preheader %count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x) %20 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %20, 0 %21 = load i32, ptr %x, align 4 %cmp1 = icmp eq i32 %21, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end22, %entry 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.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !14, !13}
#include <stdio.h> int main(void) { int value_1,value_2,i,k,j,count; scanf("%d %d",&value_1,&value_2); while(value_1 != 0 || value_2 != 0) { count = 0; for(i=1;i<=value_1;i++) { for(k=i+1;k<value_1;k++) { for(j=k+1;j<=value_1;j++) { if((i + k + j) == value_2) { count++; } } } } printf("%d\n",count); scanf("%d %d",&value_1,&value_2); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152672/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152672/source.c" target datalayout = "e-m:e-p270: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: %value_1 = alloca i32, align 4 %value_2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %value_1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %value_2) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value_1, ptr noundef nonnull %value_2) %0 = load i32, ptr %value_1, align 4, !tbaa !5 %cmp42 = icmp ne i32 %0, 0 %1 = load i32, ptr %value_2, align 4 %cmp143 = icmp ne i32 %1, 0 %2 = select i1 %cmp42, i1 true, i1 %cmp143 br i1 %2, label %for.cond.preheader, label %while.end for.cond.preheader: ; preds = %entry, %for.end19 %3 = phi i32 [ %21, %for.end19 ], [ %1, %entry ] %4 = phi i32 [ %20, %for.end19 ], [ %0, %entry ] %cmp2.not38 = icmp slt i32 %4, 1 br i1 %cmp2.not38, label %for.end19, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %broadcast.splatinsert49 = insertelement <4 x i32> poison, i32 %3, i64 0 %broadcast.splat50 = shufflevector <4 x i32> %broadcast.splatinsert49, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.body for.cond.loopexit: ; preds = %for.cond3.loopexit, %for.body %count.1.lcssa = phi i32 [ %count.040, %for.body ], [ %spec.select.lcssa, %for.cond3.loopexit ] %exitcond44.not = icmp eq i32 %i.039, %4 %indvar.next = add i32 %indvar, 1 br i1 %exitcond44.not, label %for.end19, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvar = phi i32 [ %indvar.next, %for.cond.loopexit ], [ 0, %for.body.preheader ] %count.040 = phi i32 [ %count.1.lcssa, %for.cond.loopexit ], [ 0, %for.body.preheader ] %i.039 = phi i32 [ %add, %for.cond.loopexit ], [ 1, %for.body.preheader ] %5 = add i32 %indvar, 3 %add = add nuw nsw i32 %i.039, 1 %cmp434 = icmp slt i32 %add, %4 br i1 %cmp434, label %for.body9.lr.ph, label %for.cond.loopexit for.cond3.loopexit: ; preds = %for.body9, %middle.block %spec.select.lcssa = phi i32 [ %19, %middle.block ], [ %spec.select, %for.body9 ] %exitcond.not = icmp eq i32 %add6, %4 %indvar.next46 = add i32 %indvar45, 1 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body9.lr.ph, !llvm.loop !11 for.body9.lr.ph: ; preds = %for.body, %for.cond3.loopexit %indvar45 = phi i32 [ %indvar.next46, %for.cond3.loopexit ], [ 0, %for.body ] %count.136 = phi i32 [ %spec.select.lcssa, %for.cond3.loopexit ], [ %count.040, %for.body ] %k.035 = phi i32 [ %add6, %for.cond3.loopexit ], [ %add, %for.body ] %6 = add i32 %5, %indvar45 %smax = call i32 @llvm.smax.i32(i32 %4, i32 %6) %7 = add i32 %indvar, %indvar45 %reass.sub = sub i32 %smax, %7 %8 = add i32 %reass.sub, -2 %add6 = add nuw nsw i32 %k.035, 1 %add10 = add nuw nsw i32 %k.035, %i.039 %min.iters.check = icmp ult i32 %8, 8 br i1 %min.iters.check, label %for.body9.preheader, label %vector.ph vector.ph: ; preds = %for.body9.lr.ph %n.vec = and i32 %8, -8 %ind.end = add i32 %add6, %n.vec %9 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.136, i64 0 %.splatinsert = insertelement <4 x i32> poison, i32 %add6, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %induction = add nuw <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3> %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add10, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %9, %vector.ph ], [ %16, %vector.body ] %vec.phi47 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %10 = add nuw nsw <4 x i32> %broadcast.splat, %vec.ind %11 = add nuw nsw <4 x i32> %broadcast.splat, %step.add %12 = icmp eq <4 x i32> %10, %broadcast.splat50 %13 = icmp eq <4 x i32> %11, %broadcast.splat50 %14 = zext <4 x i1> %12 to <4 x i32> %15 = zext <4 x i1> %13 to <4 x i32> %16 = add <4 x i32> %vec.phi, %14 %17 = add <4 x i32> %vec.phi47, %15 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %18 = icmp eq i32 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %8, %n.vec br i1 %cmp.n, label %for.cond3.loopexit, label %for.body9.preheader for.body9.preheader: ; preds = %for.body9.lr.ph, %middle.block %count.233.ph = phi i32 [ %count.136, %for.body9.lr.ph ], [ %19, %middle.block ] %j.032.ph = phi i32 [ %add6, %for.body9.lr.ph ], [ %ind.end, %middle.block ] br label %for.body9 for.body9: ; preds = %for.body9.preheader, %for.body9 %count.233 = phi i32 [ %spec.select, %for.body9 ], [ %count.233.ph, %for.body9.preheader ] %j.032 = phi i32 [ %inc13, %for.body9 ], [ %j.032.ph, %for.body9.preheader ] %add11 = add nuw nsw i32 %add10, %j.032 %cmp12 = icmp eq i32 %add11, %3 %inc = zext i1 %cmp12 to i32 %spec.select = add nsw i32 %count.233, %inc %inc13 = add nuw nsw i32 %j.032, 1 %cmp8.not.not = icmp slt i32 %j.032, %4 br i1 %cmp8.not.not, label %for.body9, label %for.cond3.loopexit, !llvm.loop !15 for.end19: ; preds = %for.cond.loopexit, %for.cond.preheader %count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value_1, ptr noundef nonnull %value_2) %20 = load i32, ptr %value_1, align 4, !tbaa !5 %cmp = icmp ne i32 %20, 0 %21 = load i32, ptr %value_2, align 4 %cmp1 = icmp ne i32 %21, 0 %22 = select i1 %cmp, i1 true, i1 %cmp1 br i1 %22, label %for.cond.preheader, label %while.end, !llvm.loop !16 while.end: ; preds = %for.end19, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %value_2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %value_1) #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.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !14, !13} !16 = distinct !{!16, !10}
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};} //pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) int main(void){ int N; long T; scanf("%d%ld",&N,&T); //A[0]~A[N-1]に格納する long* A; NEW(A,N); for(int i=0;i<N;i++){ scanf("%ld",&A[i]); } long* min; NEW(min,N); min[0]=A[0]; for(int i=1;i<N;i++){ if(A[i]<min[i-1]) min[i]=A[i]; else min[i]=min[i-1]; } long B=A[0]-min[0]; for(int i=1;i<N;i++) B=MAX(B,A[i]-min[i]); int ans=0; for(int i=0;i<N;i++){ if(A[i]-min[i]==B) ans++; } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152715/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152715/source.c" target datalayout = "e-m:e-p270: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%ld\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str.4 = private unnamed_addr constant [18 x i8] c"not enough memory\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %T = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %T) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %T) %0 = load i32, ptr %N, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 3 %call1 = call noalias ptr @malloc(i64 noundef %mul) #8 %cmp = icmp eq ptr %call1, null br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp4127 = icmp sgt i32 %0, 0 br i1 %cmp4127, label %for.body, label %for.cond.cleanup if.then: ; preds = %entry %puts126 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) call void @exit(i32 noundef 1) #9 unreachable for.cond.cleanup.loopexit: ; preds = %for.body %.pre = shl nsw i64 %2, 3 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %for.cond.preheader %mul8.pre-phi = phi i64 [ %.pre, %for.cond.cleanup.loopexit ], [ %mul, %for.cond.preheader ] %.lcssa = phi i32 [ %1, %for.cond.cleanup.loopexit ], [ %0, %for.cond.preheader ] %call9 = call noalias ptr @malloc(i64 noundef %mul8.pre-phi) #8 %cmp10 = icmp eq ptr %call9, null br i1 %cmp10, label %if.then12, label %if.end14 for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp4 = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp4, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !9 if.then12: ; preds = %for.cond.cleanup %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) call void @exit(i32 noundef 1) #9 unreachable if.end14: ; preds = %for.cond.cleanup %3 = load i64, ptr %call1, align 8, !tbaa !11 store i64 %3, ptr %call9, align 8, !tbaa !11 %cmp19129 = icmp sgt i32 %.lcssa, 1 br i1 %cmp19129, label %for.body22.preheader, label %for.cond68.preheader for.body22.preheader: ; preds = %if.end14 %wide.trip.count = zext i32 %.lcssa to i64 %4 = add nsw i64 %wide.trip.count, -1 %5 = add nsw i64 %wide.trip.count, -2 %xtraiter = and i64 %4, 3 %6 = icmp ult i64 %5, 3 br i1 %6, label %for.cond.cleanup21.unr-lcssa, label %for.body22.preheader.new for.body22.preheader.new: ; preds = %for.body22.preheader %unroll_iter = and i64 %4, -4 br label %for.body22 for.cond.cleanup21.unr-lcssa: ; preds = %for.body22, %for.body22.preheader %.unr = phi i64 [ %3, %for.body22.preheader ], [ %spec.select157.3, %for.body22 ] %indvars.iv141.unr = phi i64 [ 1, %for.body22.preheader ], [ %indvars.iv.next142.3, %for.body22 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup21, label %for.body22.epil for.body22.epil: ; preds = %for.cond.cleanup21.unr-lcssa, %for.body22.epil %7 = phi i64 [ %spec.select157.epil, %for.body22.epil ], [ %.unr, %for.cond.cleanup21.unr-lcssa ] %indvars.iv141.epil = phi i64 [ %indvars.iv.next142.epil, %for.body22.epil ], [ %indvars.iv141.unr, %for.cond.cleanup21.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body22.epil ], [ 0, %for.cond.cleanup21.unr-lcssa ] %arrayidx24.epil = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv141.epil %8 = load i64, ptr %arrayidx24.epil, align 8, !tbaa !11 %spec.select157.epil = call i64 @llvm.smin.i64(i64 %8, i64 %7) %9 = getelementptr inbounds i64, ptr %call9, i64 %indvars.iv141.epil store i64 %spec.select157.epil, ptr %9, align 8 %indvars.iv.next142.epil = add nuw nsw i64 %indvars.iv141.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup21, label %for.body22.epil, !llvm.loop !13 for.cond.cleanup21: ; preds = %for.body22.epil, %for.cond.cleanup21.unr-lcssa br i1 %cmp19129, label %for.body51.preheader, label %for.cond68.preheader for.body51.preheader: ; preds = %for.cond.cleanup21 %wide.trip.count148 = zext i32 %.lcssa to i64 %10 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %.lcssa, 5 br i1 %min.iters.check, label %for.body51.preheader185, label %vector.ph vector.ph: ; preds = %for.body51.preheader %n.vec = and i64 %10, -4 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %vec.phi160 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ] %offset.idx = or i64 %index, 1 %11 = getelementptr inbounds i64, ptr %call1, i64 %offset.idx %wide.load = load <2 x i64>, ptr %11, align 8, !tbaa !11 %12 = getelementptr inbounds i64, ptr %11, i64 2 %wide.load161 = load <2 x i64>, ptr %12, align 8, !tbaa !11 %13 = getelementptr inbounds i64, ptr %call9, i64 %offset.idx %wide.load162 = load <2 x i64>, ptr %13, align 8, !tbaa !11 %14 = getelementptr inbounds i64, ptr %13, i64 2 %wide.load163 = load <2 x i64>, ptr %14, align 8, !tbaa !11 %15 = sub nsw <2 x i64> %wide.load, %wide.load162 %16 = sub nsw <2 x i64> %wide.load161, %wide.load163 %17 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %15) %18 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi160, <2 x i64> %16) %index.next = add nuw i64 %index, 4 %19 = icmp eq i64 %index.next, %n.vec br i1 %19, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %17, <2 x i64> %18) %20 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %10, %n.vec br i1 %cmp.n, label %for.cond68.preheader, label %for.body51.preheader185 for.body51.preheader185: ; preds = %for.body51.preheader, %middle.block %indvars.iv145.ph = phi i64 [ 1, %for.body51.preheader ], [ %ind.end, %middle.block ] %B.0132.ph = phi i64 [ 0, %for.body51.preheader ], [ %20, %middle.block ] br label %for.body51 for.body22: ; preds = %for.body22, %for.body22.preheader.new %21 = phi i64 [ %3, %for.body22.preheader.new ], [ %spec.select157.3, %for.body22 ] %indvars.iv141 = phi i64 [ 1, %for.body22.preheader.new ], [ %indvars.iv.next142.3, %for.body22 ] %niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.3, %for.body22 ] %arrayidx24 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv141 %22 = load i64, ptr %arrayidx24, align 8, !tbaa !11 %spec.select157 = call i64 @llvm.smin.i64(i64 %22, i64 %21) %23 = getelementptr inbounds i64, ptr %call9, i64 %indvars.iv141 store i64 %spec.select157, ptr %23, align 8 %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1 %arrayidx24.1 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv.next142 %24 = load i64, ptr %arrayidx24.1, align 8, !tbaa !11 %spec.select157.1 = call i64 @llvm.smin.i64(i64 %24, i64 %spec.select157) %25 = getelementptr inbounds i64, ptr %call9, i64 %indvars.iv.next142 store i64 %spec.select157.1, ptr %25, align 8 %indvars.iv.next142.1 = add nuw nsw i64 %indvars.iv141, 2 %arrayidx24.2 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv.next142.1 %26 = load i64, ptr %arrayidx24.2, align 8, !tbaa !11 %spec.select157.2 = call i64 @llvm.smin.i64(i64 %26, i64 %spec.select157.1) %27 = getelementptr inbounds i64, ptr %call9, i64 %indvars.iv.next142.1 store i64 %spec.select157.2, ptr %27, align 8 %indvars.iv.next142.2 = add nuw nsw i64 %indvars.iv141, 3 %arrayidx24.3 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv.next142.2 %28 = load i64, ptr %arrayidx24.3, align 8, !tbaa !11 %spec.select157.3 = call i64 @llvm.smin.i64(i64 %28, i64 %spec.select157.2) %29 = getelementptr inbounds i64, ptr %call9, i64 %indvars.iv.next142.2 store i64 %spec.select157.3, ptr %29, align 8 %indvars.iv.next142.3 = add nuw nsw i64 %indvars.iv141, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond.cleanup21.unr-lcssa, label %for.body22, !llvm.loop !18 for.cond68.preheader: ; preds = %for.body51, %middle.block, %if.end14, %for.cond.cleanup21 %B.0.lcssa = phi i64 [ 0, %for.cond.cleanup21 ], [ 0, %if.end14 ], [ %20, %middle.block ], [ %B.0.sub56, %for.body51 ] %cmp69135 = icmp sgt i32 %.lcssa, 0 br i1 %cmp69135, label %for.body72.preheader, label %for.cond.cleanup71 for.body72.preheader: ; preds = %for.cond68.preheader %wide.trip.count153 = zext i32 %.lcssa to i64 %min.iters.check166 = icmp ult i32 %.lcssa, 4 br i1 %min.iters.check166, label %for.body72.preheader182, label %vector.ph167 vector.ph167: ; preds = %for.body72.preheader %n.vec169 = and i64 %wide.trip.count153, 4294967292 %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %B.0.lcssa, i64 0 %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body172 vector.body172: ; preds = %vector.body172, %vector.ph167 %index173 = phi i64 [ 0, %vector.ph167 ], [ %index.next180, %vector.body172 ] %vec.phi174 = phi <2 x i32> [ zeroinitializer, %vector.ph167 ], [ %40, %vector.body172 ] %vec.phi175 = phi <2 x i32> [ zeroinitializer, %vector.ph167 ], [ %41, %vector.body172 ] %30 = getelementptr inbounds i64, ptr %call1, i64 %index173 %wide.load176 = load <2 x i64>, ptr %30, align 8, !tbaa !11 %31 = getelementptr inbounds i64, ptr %30, i64 2 %wide.load177 = load <2 x i64>, ptr %31, align 8, !tbaa !11 %32 = getelementptr inbounds i64, ptr %call9, i64 %index173 %wide.load178 = load <2 x i64>, ptr %32, align 8, !tbaa !11 %33 = getelementptr inbounds i64, ptr %32, i64 2 %wide.load179 = load <2 x i64>, ptr %33, align 8, !tbaa !11 %34 = sub nsw <2 x i64> %wide.load176, %wide.load178 %35 = sub nsw <2 x i64> %wide.load177, %wide.load179 %36 = icmp eq <2 x i64> %34, %broadcast.splat %37 = icmp eq <2 x i64> %35, %broadcast.splat %38 = zext <2 x i1> %36 to <2 x i32> %39 = zext <2 x i1> %37 to <2 x i32> %40 = add <2 x i32> %vec.phi174, %38 %41 = add <2 x i32> %vec.phi175, %39 %index.next180 = add nuw i64 %index173, 4 %42 = icmp eq i64 %index.next180, %n.vec169 br i1 %42, label %middle.block164, label %vector.body172, !llvm.loop !19 middle.block164: ; preds = %vector.body172 %bin.rdx = add <2 x i32> %41, %40 %43 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx) %cmp.n171 = icmp eq i64 %n.vec169, %wide.trip.count153 br i1 %cmp.n171, label %for.cond.cleanup71, label %for.body72.preheader182 for.body72.preheader182: ; preds = %for.body72.preheader, %middle.block164 %indvars.iv150.ph = phi i64 [ 0, %for.body72.preheader ], [ %n.vec169, %middle.block164 ] %ans.0136.ph = phi i32 [ 0, %for.body72.preheader ], [ %43, %middle.block164 ] br label %for.body72 for.body51: ; preds = %for.body51.preheader185, %for.body51 %indvars.iv145 = phi i64 [ %indvars.iv.next146, %for.body51 ], [ %indvars.iv145.ph, %for.body51.preheader185 ] %B.0132 = phi i64 [ %B.0.sub56, %for.body51 ], [ %B.0132.ph, %for.body51.preheader185 ] %arrayidx53 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv145 %44 = load i64, ptr %arrayidx53, align 8, !tbaa !11 %arrayidx55 = getelementptr inbounds i64, ptr %call9, i64 %indvars.iv145 %45 = load i64, ptr %arrayidx55, align 8, !tbaa !11 %sub56 = sub nsw i64 %44, %45 %B.0.sub56 = call i64 @llvm.smax.i64(i64 %B.0132, i64 %sub56) %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1 %exitcond149.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count148 br i1 %exitcond149.not, label %for.cond68.preheader, label %for.body51, !llvm.loop !20 for.cond.cleanup71: ; preds = %for.body72, %middle.block164, %for.cond68.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond68.preheader ], [ %43, %middle.block164 ], [ %spec.select, %for.body72 ] %call86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %T) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7 ret i32 0 for.body72: ; preds = %for.body72.preheader182, %for.body72 %indvars.iv150 = phi i64 [ %indvars.iv.next151, %for.body72 ], [ %indvars.iv150.ph, %for.body72.preheader182 ] %ans.0136 = phi i32 [ %spec.select, %for.body72 ], [ %ans.0136.ph, %for.body72.preheader182 ] %arrayidx74 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv150 %46 = load i64, ptr %arrayidx74, align 8, !tbaa !11 %arrayidx76 = getelementptr inbounds i64, ptr %call9, i64 %indvars.iv150 %47 = load i64, ptr %arrayidx76, align 8, !tbaa !11 %sub77 = sub nsw i64 %46, %47 %cmp78 = icmp eq i64 %sub77, %B.0.lcssa %inc81 = zext i1 %cmp78 to i32 %spec.select = add nuw nsw i32 %ans.0136, %inc81 %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1 %exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153 br i1 %exitcond154.not, label %for.cond.cleanup71, label %for.body72, !llvm.loop !21 } ; 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: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #6 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } attributes #8 = { nounwind allocsize(0) } attributes #9 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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", !7, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !10, !16, !17} !16 = !{!"llvm.loop.isvectorized", i32 1} !17 = !{!"llvm.loop.unroll.runtime.disable"} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !16, !17} !20 = distinct !{!20, !10, !17, !16} !21 = distinct !{!21, !10, !17, !16}
#include <stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #define ll unsigned long long #define length 100000 //10万 #define kw_len 10 ll factor[1000]; ll memory[1000]; int primefac(ll num){ int i = 0,kosuu=0,flag=0,sum,n=0; while(*(factor+i) != 0){ sum =1; flag=0; while(num % *(factor+i)==0){ num /= *(factor+i); memory[*(factor+i)] +=1; } i++; } return sum; } /*グローバルにあるfactorに素数書き込む.個数を返すので配列は-1しろ*/ int elast(ll number){ ll tmp=0; int flag=0; *factor = 2; for(int i=3;i <= number;i++){ flag=0; for(int j=0;j <= tmp ;j++){ if(i % (*(factor+j)) == 0){ flag=1; break; } } if(flag)continue; tmp += 1; *(factor+tmp) = i; } return tmp+2; } ll nCr(int n,int r){ ll val=1; int i; if(r==0)return 1; for(i=0;i<n-r;i++){ val *= (n-i); val /= (i+1); } return val; } ll nPr(int n,int r){ ll val=1; int i; for(i=0;i<r;i++){ val *= (n-i); } return val; } int main(){ ll three=0,nago=0,nigo=0,igo=0; ll five=0; ll N,i,j; ll sum=0; memset(factor ,0, sizeof(factor)); memset(memory,0,sizeof(memory)); scanf("%llu",&N); elast(N); for(i=1;i<N;i++){ primefac(i+1); } for(i=0;i<N;i++){ if(memory[i]+1>=75)nago++; if(memory[i]+1>=25)nigo++; if(memory[i]+1>=15)igo++; if(memory[i]+1>=5){ five++; three++; } else if(memory[i]+1>=3){ three++; } } if(three>=2){ sum += nCr(five,2)*(three-2); sum +=nago; sum += nigo*(three-1); sum += igo*(five-1); } printf("%llu",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152759/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152759/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @factor = dso_local local_unnamed_addr global [1000 x i64] zeroinitializer, align 16 @memory = dso_local local_unnamed_addr global [1000 x i64] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%llu\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @primefac(i64 noundef %num) local_unnamed_addr #0 { entry: %0 = load i64, ptr @factor, align 16, !tbaa !5 %cmp.not20 = icmp eq i64 %0, 0 br i1 %cmp.not20, label %while.end10, label %while.cond1.preheader while.cond1.preheader: ; preds = %entry, %while.end %indvars.iv = phi i64 [ %indvars.iv.next, %while.end ], [ 0, %entry ] %1 = phi i64 [ %2, %while.end ], [ %0, %entry ] %num.addr.022 = phi i64 [ %num.addr.1.lcssa, %while.end ], [ %num, %entry ] %rem16 = urem i64 %num.addr.022, %1 %cmp417 = icmp eq i64 %rem16, 0 br i1 %cmp417, label %while.body5.lr.ph, label %while.end while.body5.lr.ph: ; preds = %while.cond1.preheader %arrayidx = getelementptr inbounds [1000 x i64], ptr @memory, i64 0, i64 %1 %arrayidx.promoted = load i64, ptr %arrayidx, align 8, !tbaa !5 br label %while.body5 while.body5: ; preds = %while.body5.lr.ph, %while.body5 %add19 = phi i64 [ %arrayidx.promoted, %while.body5.lr.ph ], [ %add, %while.body5 ] %num.addr.118 = phi i64 [ %num.addr.022, %while.body5.lr.ph ], [ %div, %while.body5 ] %div = udiv i64 %num.addr.118, %1 %add = add i64 %add19, 1 %rem = urem i64 %div, %1 %cmp4 = icmp eq i64 %rem, 0 br i1 %cmp4, label %while.body5, label %while.cond1.while.end_crit_edge, !llvm.loop !9 while.cond1.while.end_crit_edge: ; preds = %while.body5 store i64 %add, ptr %arrayidx, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.cond1.while.end_crit_edge, %while.cond1.preheader %num.addr.1.lcssa = phi i64 [ %div, %while.cond1.while.end_crit_edge ], [ %num.addr.022, %while.cond1.preheader ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %add.ptr = getelementptr inbounds i64, ptr @factor, i64 %indvars.iv.next %2 = load i64, ptr %add.ptr, align 8, !tbaa !5 %cmp.not = icmp eq i64 %2, 0 br i1 %cmp.not, label %while.end10, label %while.cond1.preheader, !llvm.loop !11 while.end10: ; preds = %while.end, %entry ret i32 1 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @elast(i64 noundef %number) local_unnamed_addr #0 { entry: store i64 2, ptr @factor, align 16, !tbaa !5 %cmp.not33 = icmp ult i64 %number, 3 br i1 %cmp.not33, label %for.cond.cleanup, label %for.cond2.preheader for.cond2.preheader: ; preds = %entry, %for.inc15 %indvars.iv38 = phi i64 [ %indvars.iv.next39, %for.inc15 ], [ 3, %entry ] %tmp.034 = phi i64 [ %tmp.1, %for.inc15 ], [ 0, %entry ] %0 = add i64 %tmp.034, 1 br label %for.body7 for.cond.cleanup.loopexit: ; preds = %for.inc15 %1 = trunc i64 %tmp.1 to i32 %2 = add i32 %1, 2 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry %tmp.0.lcssa = phi i32 [ 2, %entry ], [ %2, %for.cond.cleanup.loopexit ] ret i32 %tmp.0.lcssa for.cond2: ; preds = %for.body7 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv, %tmp.034 br i1 %exitcond, label %if.end12, label %for.body7, !llvm.loop !12 for.body7: ; preds = %for.cond2.preheader, %for.cond2 %indvars.iv = phi i64 [ 0, %for.cond2.preheader ], [ %indvars.iv.next, %for.cond2 ] %add.ptr = getelementptr inbounds i64, ptr @factor, i64 %indvars.iv %3 = load i64, ptr %add.ptr, align 8, !tbaa !5 %rem = urem i64 %indvars.iv38, %3 %cmp9 = icmp eq i64 %rem, 0 br i1 %cmp9, label %for.inc15, label %for.cond2 if.end12: ; preds = %for.cond2 %add.ptr14 = getelementptr inbounds i64, ptr @factor, i64 %0 store i64 %indvars.iv38, ptr %add.ptr14, align 8, !tbaa !5 br label %for.inc15 for.inc15: ; preds = %for.body7, %if.end12 %tmp.1 = phi i64 [ %0, %if.end12 ], [ %tmp.034, %for.body7 ] %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1 %exitcond41 = icmp eq i64 %indvars.iv38, %number br i1 %exitcond41, label %for.cond.cleanup.loopexit, label %for.cond2.preheader, !llvm.loop !13 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @nCr(i32 noundef %n, i32 noundef %r) local_unnamed_addr #2 { entry: %cmp = icmp eq i32 %r, 0 br i1 %cmp, label %cleanup, label %for.cond.preheader for.cond.preheader: ; preds = %entry %sub = sub nsw i32 %n, %r %cmp112 = icmp sgt i32 %sub, 0 br i1 %cmp112, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %for.cond.preheader %0 = sext i32 %n to i64 %wide.trip.count = zext i32 %sub to i64 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %sub, 1 br i1 %1, label %cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %val.013 = phi i64 [ 1, %for.body.preheader.new ], [ %div.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %2 = sub nsw i64 %0, %indvars.iv %mul = mul i64 %val.013, %2 %indvars.iv.next = or i64 %indvars.iv, 1 %div = udiv i64 %mul, %indvars.iv.next %3 = sub nsw i64 %0, %indvars.iv.next %mul.1 = mul i64 %div, %3 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %div.1 = udiv i64 %mul.1, %indvars.iv.next.1 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !14 cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %div.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %div.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %val.013.unr = phi i64 [ 1, %for.body.preheader ], [ %div.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %cleanup, label %for.body.epil for.body.epil: ; preds = %cleanup.loopexit.unr-lcssa %4 = sub nsw i64 %0, %indvars.iv.unr %mul.epil = mul i64 %val.013.unr, %4 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.unr, 1 %div.epil = udiv i64 %mul.epil, %indvars.iv.next.epil br label %cleanup cleanup: ; preds = %for.body.epil, %cleanup.loopexit.unr-lcssa, %for.cond.preheader, %entry %retval.0 = phi i64 [ 1, %entry ], [ 1, %for.cond.preheader ], [ %div.lcssa.ph, %cleanup.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @nPr(i32 noundef %n, i32 noundef %r) local_unnamed_addr #2 { entry: %cmp4 = icmp sgt i32 %r, 0 br i1 %cmp4, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %n to i64 %wide.trip.count = zext i32 %r to i64 %xtraiter = and i64 %wide.trip.count, 7 %1 = icmp ult i32 %r, 8 br i1 %1, 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, 4294967288 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.7, %for.body ] %val.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %2 = sub nsw i64 %0, %indvars.iv %mul = mul i64 %val.05, %2 %indvars.iv.next.neg = xor i64 %indvars.iv, -1 %3 = add i64 %indvars.iv.next.neg, %0 %mul.1 = mul i64 %mul, %3 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %4 = sub nsw i64 %0, %indvars.iv.next.1 %mul.2 = mul i64 %mul.1, %4 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %5 = sub nsw i64 %0, %indvars.iv.next.2 %mul.3 = mul i64 %mul.2, %5 %indvars.iv.next.3 = or i64 %indvars.iv, 4 %6 = sub nsw i64 %0, %indvars.iv.next.3 %mul.4 = mul i64 %mul.3, %6 %indvars.iv.next.4 = or i64 %indvars.iv, 5 %7 = sub nsw i64 %0, %indvars.iv.next.4 %mul.5 = mul i64 %mul.4, %7 %indvars.iv.next.5 = or i64 %indvars.iv, 6 %8 = sub nsw i64 %0, %indvars.iv.next.5 %mul.6 = mul i64 %mul.5, %8 %indvars.iv.next.6 = or i64 %indvars.iv, 7 %9 = sub nsw i64 %0, %indvars.iv.next.6 %mul.7 = mul i64 %mul.6, %9 %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !15 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.7, %for.body ] %val.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ] %val.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %val.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %10 = sub nsw i64 %0, %indvars.iv.epil %mul.epil = mul i64 %val.05.epil, %10 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !16 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %val.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %val.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %N = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #6 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) @factor, i8 0, i64 8000, i1 false) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) @memory, i8 0, i64 8000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i64, ptr %N, align 8, !tbaa !5 store i64 2, ptr @factor, align 16, !tbaa !5 %cmp.not33.i = icmp ult i64 %0, 3 br i1 %cmp.not33.i, label %elast.exit, label %for.cond2.preheader.i for.cond2.preheader.i: ; preds = %entry, %for.inc15.i %indvars.iv38.i = phi i64 [ %indvars.iv.next39.i, %for.inc15.i ], [ 3, %entry ] %tmp.034.i = phi i64 [ %tmp.1.i, %for.inc15.i ], [ 0, %entry ] %1 = add i64 %tmp.034.i, 1 br label %for.body7.i for.cond2.i: ; preds = %for.body7.i %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 %exitcond.i = icmp eq i64 %indvars.iv.i, %tmp.034.i br i1 %exitcond.i, label %if.end12.i, label %for.body7.i, !llvm.loop !12 for.body7.i: ; preds = %for.cond2.i, %for.cond2.preheader.i %indvars.iv.i = phi i64 [ 0, %for.cond2.preheader.i ], [ %indvars.iv.next.i, %for.cond2.i ] %add.ptr.i = getelementptr inbounds i64, ptr @factor, i64 %indvars.iv.i %2 = load i64, ptr %add.ptr.i, align 8, !tbaa !5 %rem.i = urem i64 %indvars.iv38.i, %2 %cmp9.i = icmp eq i64 %rem.i, 0 br i1 %cmp9.i, label %for.inc15.i, label %for.cond2.i if.end12.i: ; preds = %for.cond2.i %add.ptr14.i = getelementptr inbounds i64, ptr @factor, i64 %1 store i64 %indvars.iv38.i, ptr %add.ptr14.i, align 8, !tbaa !5 br label %for.inc15.i for.inc15.i: ; preds = %for.body7.i, %if.end12.i %tmp.1.i = phi i64 [ %1, %if.end12.i ], [ %tmp.034.i, %for.body7.i ] %indvars.iv.next39.i = add nuw nsw i64 %indvars.iv38.i, 1 %exitcond41.i = icmp eq i64 %indvars.iv38.i, %0 br i1 %exitcond41.i, label %elast.exit, label %for.cond2.preheader.i, !llvm.loop !13 elast.exit: ; preds = %for.inc15.i, %entry %cmp80 = icmp ugt i64 %0, 1 br i1 %cmp80, label %for.body.lr.ph, label %for.cond3.preheader for.body.lr.ph: ; preds = %elast.exit %3 = load i64, ptr @factor, align 16, !tbaa !5 %cmp.not20.i = icmp eq i64 %3, 0 br i1 %cmp.not20.i, label %for.body5.preheader, label %for.body for.cond3.preheader: ; preds = %primefac.exit.loopexit, %elast.exit %cmp482.not = icmp eq i64 %0, 0 br i1 %cmp482.not, label %if.end48, label %for.body5.preheader for.body5.preheader: ; preds = %for.body.lr.ph, %for.cond3.preheader br label %for.body5 for.body: ; preds = %for.body.lr.ph, %primefac.exit.loopexit %i.081 = phi i64 [ %add, %primefac.exit.loopexit ], [ 1, %for.body.lr.ph ] %add = add nuw i64 %i.081, 1 br label %while.cond1.preheader.i while.cond1.preheader.i: ; preds = %for.body, %while.end.i %indvars.iv.i73 = phi i64 [ %indvars.iv.next.i74, %while.end.i ], [ 0, %for.body ] %4 = phi i64 [ %5, %while.end.i ], [ %3, %for.body ] %num.addr.022.i = phi i64 [ %num.addr.1.lcssa.i, %while.end.i ], [ %add, %for.body ] %rem16.i = urem i64 %num.addr.022.i, %4 %cmp417.i = icmp eq i64 %rem16.i, 0 br i1 %cmp417.i, label %while.body5.lr.ph.i, label %while.end.i while.body5.lr.ph.i: ; preds = %while.cond1.preheader.i %arrayidx.i = getelementptr inbounds [1000 x i64], ptr @memory, i64 0, i64 %4 %arrayidx.promoted.i = load i64, ptr %arrayidx.i, align 8, !tbaa !5 br label %while.body5.i while.body5.i: ; preds = %while.body5.i, %while.body5.lr.ph.i %add19.i = phi i64 [ %arrayidx.promoted.i, %while.body5.lr.ph.i ], [ %add.i, %while.body5.i ] %num.addr.118.i = phi i64 [ %num.addr.022.i, %while.body5.lr.ph.i ], [ %div.i, %while.body5.i ] %div.i = udiv i64 %num.addr.118.i, %4 %add.i = add i64 %add19.i, 1 %rem.i76 = urem i64 %div.i, %4 %cmp4.i = icmp eq i64 %rem.i76, 0 br i1 %cmp4.i, label %while.body5.i, label %while.cond1.while.end_crit_edge.i, !llvm.loop !9 while.cond1.while.end_crit_edge.i: ; preds = %while.body5.i store i64 %add.i, ptr %arrayidx.i, align 8, !tbaa !5 br label %while.end.i while.end.i: ; preds = %while.cond1.while.end_crit_edge.i, %while.cond1.preheader.i %num.addr.1.lcssa.i = phi i64 [ %div.i, %while.cond1.while.end_crit_edge.i ], [ %num.addr.022.i, %while.cond1.preheader.i ] %indvars.iv.next.i74 = add nuw nsw i64 %indvars.iv.i73, 1 %add.ptr.i75 = getelementptr inbounds i64, ptr @factor, i64 %indvars.iv.next.i74 %5 = load i64, ptr %add.ptr.i75, align 8, !tbaa !5 %cmp.not.i = icmp eq i64 %5, 0 br i1 %cmp.not.i, label %primefac.exit.loopexit, label %while.cond1.preheader.i, !llvm.loop !11 primefac.exit.loopexit: ; preds = %while.end.i %exitcond.not = icmp eq i64 %add, %0 br i1 %exitcond.not, label %for.cond3.preheader, label %for.body, !llvm.loop !18 for.body5: ; preds = %for.body5.preheader, %for.body5 %three.088 = phi i64 [ %spec.select72, %for.body5 ], [ 0, %for.body5.preheader ] %i.187 = phi i64 [ %inc35, %for.body5 ], [ 0, %for.body5.preheader ] %five.086 = phi i64 [ %five.1, %for.body5 ], [ 0, %for.body5.preheader ] %igo.085 = phi i64 [ %igo.1, %for.body5 ], [ 0, %for.body5.preheader ] %nigo.084 = phi i64 [ %nigo.1, %for.body5 ], [ 0, %for.body5.preheader ] %nago.083 = phi i64 [ %spec.select, %for.body5 ], [ 0, %for.body5.preheader ] %arrayidx = getelementptr inbounds [1000 x i64], ptr @memory, i64 0, i64 %i.187 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %7 = add i64 %6, -74 %cmp7 = icmp ult i64 %7, -75 %inc8 = zext i1 %cmp7 to i64 %spec.select = add i64 %nago.083, %inc8 %8 = add i64 %6, -24 %cmp11 = icmp ult i64 %8, -25 %inc13 = zext i1 %cmp11 to i64 %nigo.1 = add i64 %nigo.084, %inc13 %9 = add i64 %6, -14 %cmp17 = icmp ult i64 %9, -15 %inc19 = zext i1 %cmp17 to i64 %igo.1 = add i64 %igo.085, %inc19 %add22 = add i64 %6, 1 %cmp23 = icmp ugt i64 %add22, 4 %cmp29 = icmp ugt i64 %add22, 2 %inc31.sink = zext i1 %cmp29 to i64 %inc25 = zext i1 %cmp23 to i64 %five.1 = add i64 %five.086, %inc25 %spec.select72 = add i64 %three.088, %inc31.sink %inc35 = add nuw i64 %i.187, 1 %exitcond94.not = icmp eq i64 %inc35, %0 br i1 %exitcond94.not, label %for.end36, label %for.body5, !llvm.loop !19 for.end36: ; preds = %for.body5 %cmp37 = icmp ugt i64 %spec.select72, 1 br i1 %cmp37, label %if.then38, label %if.end48 if.then38: ; preds = %for.end36 %conv = trunc i64 %five.1 to i32 %cmp112.i = icmp sgt i32 %conv, 2 br i1 %cmp112.i, label %for.body.preheader.i, label %nCr.exit for.body.preheader.i: ; preds = %if.then38 %sub.i = add i64 %five.1, 4294967294 %sext = shl i64 %five.1, 32 %10 = ashr exact i64 %sext, 32 %wide.trip.count.i = and i64 %sub.i, 4294967295 %xtraiter = and i64 %five.1, 1 %11 = icmp eq i64 %wide.trip.count.i, 1 br i1 %11, label %nCr.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.i77 = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i78.1, %for.body.i ] %val.013.i = phi i64 [ 1, %for.body.preheader.i.new ], [ %div.i79.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ] %12 = sub nsw i64 %10, %indvars.iv.i77 %mul.i = mul i64 %val.013.i, %12 %indvars.iv.next.i78 = or i64 %indvars.iv.i77, 1 %div.i79 = udiv i64 %mul.i, %indvars.iv.next.i78 %13 = sub nsw i64 %10, %indvars.iv.next.i78 %mul.i.1 = mul i64 %div.i79, %13 %indvars.iv.next.i78.1 = add nuw nsw i64 %indvars.iv.i77, 2 %div.i79.1 = udiv i64 %mul.i.1, %indvars.iv.next.i78.1 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !14 nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i %div.i79.lcssa.ph = phi i64 [ undef, %for.body.preheader.i ], [ %div.i79.1, %for.body.i ] %indvars.iv.i77.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i78.1, %for.body.i ] %val.013.i.unr = phi i64 [ 1, %for.body.preheader.i ], [ %div.i79.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa %14 = sub nsw i64 %10, %indvars.iv.i77.unr %mul.i.epil = mul i64 %val.013.i.unr, %14 %indvars.iv.next.i78.epil = add nuw nsw i64 %indvars.iv.i77.unr, 1 %div.i79.epil = udiv i64 %mul.i.epil, %indvars.iv.next.i78.epil br label %nCr.exit nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %if.then38 %retval.0.i = phi i64 [ 1, %if.then38 ], [ %div.i79.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i79.epil, %for.body.i.epil ] %sub = add i64 %spec.select72, -2 %mul = mul i64 %retval.0.i, %sub %sub42 = add i64 %spec.select72, -1 %mul43 = mul i64 %sub42, %nigo.1 %sub45 = add i64 %five.1, -1 %mul46 = mul i64 %sub45, %igo.1 %add41 = add i64 %mul46, %spec.select %add44 = add i64 %add41, %mul43 %add47 = add i64 %add44, %mul br label %if.end48 if.end48: ; preds = %for.cond3.preheader, %nCr.exit, %for.end36 %sum.0 = phi i64 [ %add47, %nCr.exit ], [ 0, %for.end36 ], [ 0, %for.cond3.preheader ] %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sum.0) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #6 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) #4 ; 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 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include <stdio.h> #include <string.h> int main(){ int k,c=0; char S[20]; scanf("%s",S); k=strlen(S); for(int i=0;i<k;i++) if(S[i]=='o') c++; if((15-k)+c>=8) printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152801/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152801/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %S) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #7 %conv = trunc i64 %call2 to i32 %cmp19 = icmp sgt i32 %conv, 0 br i1 %cmp19, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; 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.preheader26, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %call2, 7 %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 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi24 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %0 = getelementptr inbounds [20 x i8], ptr %S, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i8, ptr %0, i64 4 %wide.load25 = load <4 x i8>, ptr %1, align 4, !tbaa !5 %2 = icmp eq <4 x i8> %wide.load, <i8 111, i8 111, i8 111, i8 111> %3 = icmp eq <4 x i8> %wide.load25, <i8 111, i8 111, i8 111, i8 111> %4 = zext <4 x i1> %2 to <4 x i32> %5 = zext <4 x i1> %3 to <4 x i32> %6 = add <4 x i32> %vec.phi, %4 %7 = add <4 x i32> %vec.phi24, %5 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader26 for.body.preheader26: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %c.020.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %c.0.lcssa = phi i32 [ 0, %entry ], [ %9, %middle.block ], [ %spec.select, %for.body ] %reass.sub22 = sub i32 %c.0.lcssa, %conv %add = add i32 %reass.sub22, 15 %cmp8 = icmp sgt i32 %add, 7 %str.3.str = select i1 %cmp8, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %S) #6 ret i32 0 for.body: ; preds = %for.body.preheader26, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader26 ] %c.020 = phi i32 [ %spec.select, %for.body ], [ %c.020.ph, %for.body.preheader26 ] %arrayidx = getelementptr inbounds [20 x i8], ptr %S, i64 0, i64 %indvars.iv %10 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp5 = icmp eq i8 %10, 111 %inc = zext i1 %cmp5 to i32 %spec.select = add nuw nsw i32 %c.020, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12 } ; 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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = 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, !11, !10}
#include <stdio.h> #include <string.h> int main(void) { int oCount = 0, xCount = 0; int len; char S[16] = {}; scanf("%s", S); len = strlen(S); for (int i = 0; i < len; i++) { if(S[i] == 'o') oCount++; else if(S[i] == 'x') xCount++; } int day = (15 - len) + oCount; if(day >= 8) printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152845/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152845/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [16 x i8], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %S) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %S, i8 0, i64 16, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #8 %conv = trunc i64 %call2 to i32 %cmp29 = icmp sgt i32 %conv, 0 br i1 %cmp29, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; 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.preheader37, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %call2, 7 %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 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi35 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %0 = getelementptr inbounds [16 x i8], ptr %S, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i8, ptr %0, i64 4 %wide.load36 = load <4 x i8>, ptr %1, align 4, !tbaa !5 %2 = icmp eq <4 x i8> %wide.load, <i8 111, i8 111, i8 111, i8 111> %3 = icmp eq <4 x i8> %wide.load36, <i8 111, i8 111, i8 111, i8 111> %4 = zext <4 x i1> %2 to <4 x i32> %5 = zext <4 x i1> %3 to <4 x i32> %6 = add <4 x i32> %vec.phi, %4 %7 = add <4 x i32> %vec.phi35, %5 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader37 for.body.preheader37: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %oCount.032.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %oCount.0.lcssa = phi i32 [ 0, %entry ], [ %9, %middle.block ], [ %spec.select, %for.body ] %reass.sub33 = sub i32 %oCount.0.lcssa, %conv %add = add i32 %reass.sub33, 15 %cmp16 = icmp sgt i32 %add, 7 %str.3.str = select i1 %cmp16, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %S) #7 ret i32 0 for.body: ; preds = %for.body.preheader37, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader37 ] %oCount.032 = phi i32 [ %spec.select, %for.body ], [ %oCount.032.ph, %for.body.preheader37 ] %arrayidx = getelementptr inbounds [16 x i8], ptr %S, i64 0, i64 %indvars.iv %10 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cond = icmp eq i8 %10, 111 %inc = zext i1 %cond to i32 %spec.select = add nuw nsw i32 %oCount.032, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10}
#include <stdio.h> int main(){ char s[16]; int i,n; scanf("%s",s); for (i=n=0;s[i]!='\0';i++) if (s[i]=='x') n++; if (15-n>=8) puts("YES"); else puts("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152889/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152889/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [16 x i8], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) br label %for.cond for.cond: ; preds = %for.inc, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %n.0 = phi i32 [ %n.1, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds [16 x i8], ptr %s, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %0, label %for.inc [ i8 0, label %for.end i8 120, label %if.then ] if.then: ; preds = %for.cond %inc = add nsw i32 %n.0, 1 br label %for.inc for.inc: ; preds = %for.cond, %if.then %n.1 = phi i32 [ %inc, %if.then ], [ %n.0, %for.cond ] %indvars.iv.next = add nuw i64 %indvars.iv, 1 br label %for.cond, !llvm.loop !8 for.end: ; preds = %for.cond %cmp8 = icmp slt i32 %n.0, 8 %.str.1..str.2 = select i1 %cmp8, ptr @.str.1, ptr @.str.2 %call12 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if( c>= b && b >= a ){ printf("%d",c*10+b+a); }else if( b>= a && a>= c){ printf("%d",b*10+a+c); }else if( a>= b && b>=c){ printf("%d",a*10+b+c); }else if( c>= a && a >= b){ printf("%d",c*10+a+b); }else if( b>= c && c>= a){ printf("%d",b*10+c+a); }else if(a >=c && c>=b){ printf("%d",a*10+c+b); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152931/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152931/source.c" target datalayout = "e-m:e-p270: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) #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 %c, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %.pre = load i32, ptr %a, align 4, !tbaa !5 %cmp1.not = icmp slt i32 %1, %.pre %or.cond78 = select i1 %cmp.not, i1 true, i1 %cmp1.not br i1 %or.cond78, label %if.else, label %if.then if.then: ; preds = %entry %mul = mul nsw i32 %0, 10 %add = add nsw i32 %mul, %1 %add2 = add nsw i32 %add, %.pre br label %if.end52.sink.split if.else: ; preds = %entry %cmp4.not = icmp slt i32 %1, %.pre %cmp6.not = icmp slt i32 %.pre, %0 %or.cond = or i1 %cmp4.not, %cmp6.not br i1 %or.cond, label %if.else12, label %if.then7 if.then7: ; preds = %if.else %mul8 = mul nsw i32 %1, 10 %add9 = add i32 %mul8, %0 %add10 = add i32 %add9, %.pre br label %if.end52.sink.split if.else12: ; preds = %if.else %cmp13.not = icmp slt i32 %.pre, %1 br i1 %cmp13.not, label %if.else30, label %land.lhs.true14 land.lhs.true14: ; preds = %if.else12 %cmp15.not = icmp slt i32 %1, %0 br i1 %cmp15.not, label %if.else21.thread, label %if.then16 if.then16: ; preds = %land.lhs.true14 %mul17 = mul nsw i32 %.pre, 10 %add18 = add i32 %1, %0 %add19 = add i32 %add18, %mul17 br label %if.end52.sink.split if.else21.thread: ; preds = %land.lhs.true14 %cmp22.not70 = icmp slt i32 %0, %.pre br i1 %cmp22.not70, label %if.else39, label %if.then25 if.then25: ; preds = %if.else21.thread %mul26 = mul nsw i32 %0, 10 %add27 = add i32 %1, %mul26 %add28 = add i32 %add27, %.pre br label %if.end52.sink.split if.else30: ; preds = %if.else12 %cmp22.not = icmp slt i32 %0, %.pre %cmp31.not = icmp slt i32 %1, %0 %brmerge = or i1 %cmp31.not, %cmp22.not br i1 %brmerge, label %if.else39, label %if.then34 if.then34: ; preds = %if.else30 %mul35 = mul nsw i32 %1, 10 %add36 = add nsw i32 %mul35, %0 %add37 = add nsw i32 %add36, %.pre br label %if.end52.sink.split if.else39: ; preds = %if.else21.thread, %if.else30 %brmerge74 = or i1 %cmp.not, %cmp6.not br i1 %brmerge74, label %if.end52, label %if.then43 if.then43: ; preds = %if.else39 %mul44 = mul nsw i32 %.pre, 10 %add45 = add i32 %1, %0 %add46 = add i32 %add45, %mul44 br label %if.end52.sink.split if.end52.sink.split: ; preds = %if.then, %if.then16, %if.then34, %if.then43, %if.then25, %if.then7 %add10.sink = phi i32 [ %add10, %if.then7 ], [ %add28, %if.then25 ], [ %add46, %if.then43 ], [ %add37, %if.then34 ], [ %add19, %if.then16 ], [ %add2, %if.then ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add10.sink) br label %if.end52 if.end52: ; preds = %if.end52.sink.split, %if.else39 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,out; scanf("%d%d%d",&a,&b,&c); if(b>=c && b>=a) b=b*10; else if(c>a && c>b) c=c*10; else a=a*10; out=a+b+c; printf("%d",out); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152975/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152975/source.c" target datalayout = "e-m:e-p270: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) #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 %b, align 4 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %2 = load i32, ptr %a, align 4 %cmp1.not = icmp slt i32 %0, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not br i1 %or.cond, label %if.else, label %if.then if.then: ; preds = %entry %mul = mul nsw i32 %0, 10 store i32 %mul, ptr %b, align 4, !tbaa !5 br label %if.end9 if.else: ; preds = %entry %cmp2 = icmp sgt i32 %1, %2 %or.cond13 = and i1 %cmp.not, %cmp2 br i1 %or.cond13, label %if.then5, label %if.else7 if.then5: ; preds = %if.else %mul6 = mul nsw i32 %1, 10 store i32 %mul6, ptr %c, align 4, !tbaa !5 br label %if.end9 if.else7: ; preds = %if.else %mul8 = mul nsw i32 %2, 10 store i32 %mul8, ptr %a, align 4, !tbaa !5 br label %if.end9 if.end9: ; preds = %if.then5, %if.else7, %if.then %3 = phi i32 [ %mul6, %if.then5 ], [ %1, %if.else7 ], [ %1, %if.then ] %4 = phi i32 [ %0, %if.then5 ], [ %0, %if.else7 ], [ %mul, %if.then ] %5 = phi i32 [ %2, %if.then5 ], [ %mul8, %if.else7 ], [ %2, %if.then ] %add = add nsw i32 %4, %5 %add10 = add nsw i32 %add, %3 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add10) 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,result; scanf(" %d %d %d",&a,&b,&c); if(a<10 && b<10 && c<10 && a>0 && b>0 && c>0) { if(a==b && b==c) result=(a*10)+b+c; else if((a>b && a>c)||(a>b && b==c)||(a==b && b>c)) result=(a*10)+b+c; else if((b>c && b>a)||(b>c && a==c)||(b==c && b>a)) result=(b*10)+c+a; else if((c>a && c>b)||(c>a && a==b)||(a==c && a>b)) result=(c*10)+a+b; if(a==b && b==c) result=(a*10)+b+c; } printf("%d",result); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153017/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153017/source.c" target datalayout = "e-m:e-p270: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 [11 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 %cmp = icmp ult i32 %0, 10 %1 = load i32, ptr %b, align 4 %cmp1 = icmp ult i32 %1, 10 %2 = load i32, ptr %c, align 4 %cmp3 = icmp ult i32 %2, 10 %cmp5 = icmp ne i32 %0, 0 %cmp7 = icmp ne i32 %1, 0 %cmp9 = icmp ne i32 %2, 0 call void @llvm.assume(i1 %cmp) call void @llvm.assume(i1 %cmp1) call void @llvm.assume(i1 %cmp3) call void @llvm.assume(i1 %cmp5) call void @llvm.assume(i1 %cmp7) call void @llvm.assume(i1 %cmp9) %cmp10 = icmp eq i32 %0, %1 %cmp12 = icmp eq i32 %1, %2 %or.cond92 = and i1 %cmp10, %cmp12 br i1 %or.cond92, label %if.then13, label %if.else if.then13: ; preds = %entry %add14 = mul nuw nsw i32 %0, 12 br label %if.end63 if.else: ; preds = %entry %cmp15 = icmp ugt i32 %0, %1 %cmp17 = icmp ugt i32 %0, %2 %or.cond94106 = or i1 %cmp17, %cmp12 %or.cond102 = and i1 %cmp15, %or.cond94106 br i1 %or.cond102, label %if.then25, label %lor.lhs.false21 lor.lhs.false21: ; preds = %if.else %cmp24 = icmp ugt i32 %1, %2 %or.cond95 = and i1 %cmp10, %cmp24 br i1 %or.cond95, label %if.then25, label %if.else29 if.then25: ; preds = %lor.lhs.false21, %if.else %mul26 = mul nuw nsw i32 %0, 10 %add27 = add nuw nsw i32 %mul26, %1 %add28 = add nuw nsw i32 %add27, %2 br label %if.end63 if.else29: ; preds = %lor.lhs.false21 %cmp32 = icmp ugt i32 %1, %0 %or.cond96 = and i1 %cmp32, %cmp24 br i1 %or.cond96, label %if.then41, label %lor.lhs.false33 lor.lhs.false33: ; preds = %if.else29 %cmp36 = icmp eq i32 %0, %2 %or.cond97 = and i1 %cmp24, %cmp36 %or.cond98 = and i1 %cmp32, %cmp12 %or.cond103 = or i1 %or.cond97, %or.cond98 br i1 %or.cond103, label %if.then41, label %if.else45 if.then41: ; preds = %lor.lhs.false33, %if.else29 %mul42 = mul nuw nsw i32 %1, 10 %add43 = add nuw nsw i32 %2, %0 %add44 = add nuw nsw i32 %add43, %mul42 br label %if.end63 if.else45: ; preds = %lor.lhs.false33 %cmp46 = icmp ugt i32 %2, %0 %cmp48 = icmp ugt i32 %2, %1 %or.cond100107 = or i1 %cmp10, %cmp48 %or.cond104 = and i1 %cmp46, %or.cond100107 %or.cond101 = and i1 %cmp15, %cmp36 %or.cond105 = or i1 %or.cond101, %or.cond104 br i1 %or.cond105, label %if.then57, label %if.end63 if.then57: ; preds = %if.else45 %mul58 = mul nuw nsw i32 %2, 10 %add59 = add nuw nsw i32 %1, %0 %add60 = add nuw nsw i32 %add59, %mul58 br label %if.end63 if.end63: ; preds = %if.else45, %if.then25, %if.then57, %if.then41, %if.then13 %result.0 = phi i32 [ %add14, %if.then13 ], [ %add28, %if.then25 ], [ %add44, %if.then41 ], [ %add60, %if.then57 ], [ undef, %if.else45 ] %mul68 = mul nuw nsw i32 %0, 10 %add69 = add nuw nsw i32 %mul68, %1 %add70 = add nuw nsw i32 %add69, %2 %result.1 = select i1 %or.cond92, i32 %add70, i32 %result.0 %call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %result.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 willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #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 willreturn memory(inaccessiblemem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> int main(void) { int n[3]; int A,B,C; scanf("%d %d %d",&A,&B,&C); n[0] = A,n[1]=B,n[2]=C; for (int i = 0;i<3;i++) { for(int j = 0;j<3;j++) { if (i<j){ if (n[i]<n[j]){ int a = n[i]; n[i] = n[j]; n[j] = a; } } } } printf("%d",n[0]*10+n[1]+n[2]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153060/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153060/source.c" target datalayout = "e-m:e-p270: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 { if.then.1: %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.select71 = call i32 @llvm.smax.i32(i32 %0, i32 %1) %n.sroa.30.0 = call i32 @llvm.smin.i32(i32 %spec.select71, i32 %2) %n.sroa.0.2 = call i32 @llvm.smax.i32(i32 %spec.select71, i32 %2) %n.sroa.30.1 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %n.sroa.30.0) %n.sroa.16.3 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %n.sroa.30.0) %mul = mul nsw i32 %n.sroa.0.2, 10 %add = add nsw i32 %mul, %n.sroa.16.3 %add28 = add nsw i32 %add, %n.sroa.30.1 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add28) 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.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(void){ int A,B,C,max; scanf("%d %d %d", &A, &B, &C); max = 10*A + B + C; if(10*B + A + C >= max){ max = 10*B + A + C; } if(10*C+B+A >= max){ max = 10*C+B+A; } printf("%d", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153103/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153103/source.c" target datalayout = "e-m:e-p270: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 %mul = mul nsw i32 %0, 10 %1 = load i32, ptr %B, align 4, !tbaa !5 %add = add nsw i32 %mul, %1 %2 = load i32, ptr %C, align 4, !tbaa !5 %mul2 = mul nsw i32 %1, 10 %add3 = add nsw i32 %mul2, %0 %spec.select = call i32 @llvm.smax.i32(i32 %add3, i32 %add) %max.0 = add nsw i32 %spec.select, %2 %mul8 = mul nsw i32 %2, 10 %add9 = add i32 %1, %0 %add10 = add i32 %add9, %mul8 %max.1 = call i32 @llvm.smax.i32(i32 %add10, i32 %max.0) %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.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.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 <stdlib.h> int compar(const int*,const int*); int main(void){ int array[3]; int a,b,c; scanf("%d %d %d",&a,&b,&c ); array[0] = a; array[1] = b; array[2] = c; qsort(array,sizeof(array)/sizeof(array[0]),sizeof(int),(int (*)(const void *, const void *))compar); printf("%d",array[2]*10 + array[1] + array[0]); return 0; } int compar(const int *val1, const int *val2) { if ( *val1 < *val2 ) { return -1; } else if ( *val1 == * val2 ) { return 0; } else { return 1; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153154/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153154/source.c" target datalayout = "e-m:e-p270: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: %array = alloca [3 x i32], align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %array) #5 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 %c) #5 %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 store i32 %0, ptr %array, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %arrayidx1 = getelementptr inbounds [3 x i32], ptr %array, i64 0, i64 1 store i32 %1, ptr %arrayidx1, align 4, !tbaa !5 %2 = load i32, ptr %c, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [3 x i32], ptr %array, i64 0, i64 2 store i32 %2, ptr %arrayidx2, align 4, !tbaa !5 call void @qsort(ptr noundef nonnull %array, i64 noundef 3, i64 noundef 4, ptr noundef nonnull @compar) #5 %3 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %mul = mul nsw i32 %3, 10 %4 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %add = add nsw i32 %mul, %4 %5 = load i32, ptr %array, align 4, !tbaa !5 %add6 = add nsw i32 %add, %5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add6) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #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 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %array) #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 declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compar(ptr nocapture noundef readonly %val1, ptr nocapture noundef readonly %val2) #4 { entry: %0 = load i32, ptr %val1, align 4, !tbaa !5 %1 = load i32, ptr %val2, 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 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 = { 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 #4 = { 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 #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> int main(){ int A,B,C,ans; scanf("%d %d %d",&A,&B,&C); ans=10*A+B+C; if(ans<A+10*B+C) ans=A+10*B+C; if(ans<A+B+10*C) ans=A+B+10*C; printf("%d",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153198/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153198/source.c" target datalayout = "e-m:e-p270: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 %mul = mul nsw i32 %0, 10 %1 = load i32, ptr %B, align 4, !tbaa !5 %add = add nsw i32 %mul, %1 %2 = load i32, ptr %C, align 4, !tbaa !5 %mul2 = mul nsw i32 %1, 10 %add3 = add nsw i32 %mul2, %0 %spec.select = call i32 @llvm.smax.i32(i32 %add, i32 %add3) %ans.0 = add nsw i32 %spec.select, %2 %add8 = add nsw i32 %1, %0 %mul9 = mul nsw i32 %2, 10 %add10 = add nsw i32 %add8, %mul9 %ans.1 = call i32 @llvm.smax.i32(i32 %ans.0, i32 %add10) %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.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.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() { long int n,a,b,c,count,i; scanf("%ld %ld %ld\n",&n,&a,&b); count=0; for(i=0;i<n;i++) { scanf("%ld",&c); if(c<a || c>=b) { count++; } } printf("%ld\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153240/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153240/source.c" target datalayout = "e-m:e-p270: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"%ld %ld %ld\0A\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %a = alloca i64, align 8 %b = alloca i64, align 8 %c = 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 %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp8 = icmp sgt i64 %0, 0 br i1 %cmp8, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.010 = phi i64 [ %inc4, %for.body ], [ 0, %entry ] %count.09 = phi i64 [ %count.1, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c) %1 = load i64, ptr %c, align 8, !tbaa !5 %2 = load i64, ptr %a, align 8, !tbaa !5 %cmp2 = icmp slt i64 %1, %2 %3 = load i64, ptr %b, align 8 %cmp3.not = icmp sge i64 %1, %3 %or.cond.not = select i1 %cmp2, i1 true, i1 %cmp3.not %inc = zext i1 %or.cond.not to i64 %count.1 = add nuw nsw i64 %count.09, %inc %inc4 = add nuw nsw i64 %i.010, 1 %4 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc4, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %count.0.lcssa = phi i64 [ 0, %entry ], [ %count.1, %for.body ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 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", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> int main(void) { //変数の宣言 int n; int a[110]; int sum; double ave; int near; //よく使う変数 int i,j,k,l; int flag=0; int ans=0; int count=0; int temp,temp1,temp2; int max,min; int len; //データの読み込み scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } // printf("nは%dです\n", n); // printf("データの読み込み終了\n"); //実際の処理 sum=0; for(i=0;i<n;i++){ sum=sum+a[i]; } ave=(double)sum/n; for(i=0;i<n;i++){ if(i==0){ temp=abs(a[i]*n-sum); // printf("i=%d,temp=%d\n",i,temp); ans=0; near=temp; }else{ temp=abs(a[i]*n-sum); // printf("i=%d,temp=%d\n",i,temp); if(temp<near){ near=temp; ans=i; } } } // printf("計算部分終了\n"); //出力 printf("%d\n",ans); // printf("結果の出力終了\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153299/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153299/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [110 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 440, 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 %cmp50 = icmp sgt i32 %0, 0 br i1 %cmp50, label %for.body, label %for.end29 for.cond2.preheader: ; preds = %for.body %cmp352 = icmp sgt i32 %7, 0 br i1 %cmp352, label %for.body4.preheader, label %for.end29 for.body4.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %7 to i64 %min.iters.check = icmp ult i32 %7, 8 br i1 %min.iters.check, label %for.body4.preheader81, label %vector.ph vector.ph: ; preds = %for.body4.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %vec.phi79 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ] %1 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !5 %2 = getelementptr inbounds i32, ptr %1, i64 4 %wide.load80 = load <4 x i32>, ptr %2, align 16, !tbaa !5 %3 = add <4 x i32> %wide.load, %vec.phi %4 = add <4 x i32> %wide.load80, %vec.phi79 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %4, %3 %6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond11.preheader, label %for.body4.preheader81 for.body4.preheader81: ; preds = %for.body4.preheader, %middle.block %indvars.iv63.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ] %sum.054.ph = phi i32 [ 0, %for.body4.preheader ], [ %6, %middle.block ] br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [110 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 %7 = load i32, ptr %n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13 for.cond11.preheader: ; preds = %for.body4, %middle.block %add.lcssa = phi i32 [ %6, %middle.block ], [ %add, %for.body4 ] %cmp352.not = xor i1 %cmp352, true %exitcond70.peel.not = icmp eq i32 %7, 1 %or.cond = or i1 %cmp352.not, %exitcond70.peel.not br i1 %or.cond, label %for.end29, label %for.inc27.preheader for.inc27.preheader: ; preds = %for.cond11.preheader %9 = load i32, ptr %a, align 16 %mul = mul nsw i32 %9, %7 %sub = sub nsw i32 %mul, %add.lcssa %10 = call i32 @llvm.abs.i32(i32 %sub, i1 true) %11 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %11, 1 %12 = icmp eq i32 %7, 2 br i1 %12, label %for.end29.loopexit.unr-lcssa, label %for.inc27.preheader.new for.inc27.preheader.new: ; preds = %for.inc27.preheader %unroll_iter = and i64 %11, -2 br label %for.inc27 for.body4: ; preds = %for.body4.preheader81, %for.body4 %indvars.iv63 = phi i64 [ %indvars.iv.next64, %for.body4 ], [ %indvars.iv63.ph, %for.body4.preheader81 ] %sum.054 = phi i32 [ %add, %for.body4 ], [ %sum.054.ph, %for.body4.preheader81 ] %arrayidx6 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv63 %13 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %add = add nsw i32 %13, %sum.054 %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1 %exitcond.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count br i1 %exitcond.not, label %for.cond11.preheader, label %for.body4, !llvm.loop !14 for.inc27: ; preds = %for.inc27, %for.inc27.preheader.new %indvars.iv66 = phi i64 [ 1, %for.inc27.preheader.new ], [ %indvars.iv.next67.1, %for.inc27 ] %near.059 = phi i32 [ %10, %for.inc27.preheader.new ], [ %spec.select49.1, %for.inc27 ] %ans.057 = phi i32 [ 0, %for.inc27.preheader.new ], [ %spec.select.1, %for.inc27 ] %niter = phi i64 [ 0, %for.inc27.preheader.new ], [ %niter.next.1, %for.inc27 ] %arrayidx20 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv66 %14 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %mul21 = mul nsw i32 %14, %7 %sub22 = sub nsw i32 %mul21, %add.lcssa %15 = call i32 @llvm.abs.i32(i32 %sub22, i1 true) %cmp23 = icmp slt i32 %15, %near.059 %16 = trunc i64 %indvars.iv66 to i32 %spec.select = select i1 %cmp23, i32 %16, i32 %ans.057 %spec.select49 = call i32 @llvm.smin.i32(i32 %15, i32 %near.059) %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1 %arrayidx20.1 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv.next67 %17 = load i32, ptr %arrayidx20.1, align 4, !tbaa !5 %mul21.1 = mul nsw i32 %17, %7 %sub22.1 = sub nsw i32 %mul21.1, %add.lcssa %18 = call i32 @llvm.abs.i32(i32 %sub22.1, i1 true) %cmp23.1 = icmp slt i32 %18, %spec.select49 %19 = trunc i64 %indvars.iv.next67 to i32 %spec.select.1 = select i1 %cmp23.1, i32 %19, i32 %spec.select %spec.select49.1 = call i32 @llvm.smin.i32(i32 %18, i32 %spec.select49) %indvars.iv.next67.1 = add nuw nsw i64 %indvars.iv66, 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.end29.loopexit.unr-lcssa, label %for.inc27, !llvm.loop !15 for.end29.loopexit.unr-lcssa: ; preds = %for.inc27, %for.inc27.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.inc27.preheader ], [ %spec.select.1, %for.inc27 ] %indvars.iv66.unr = phi i64 [ 1, %for.inc27.preheader ], [ %indvars.iv.next67.1, %for.inc27 ] %near.059.unr = phi i32 [ %10, %for.inc27.preheader ], [ %spec.select49.1, %for.inc27 ] %ans.057.unr = phi i32 [ 0, %for.inc27.preheader ], [ %spec.select.1, %for.inc27 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end29, label %for.inc27.epil for.inc27.epil: ; preds = %for.end29.loopexit.unr-lcssa %arrayidx20.epil = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv66.unr %20 = load i32, ptr %arrayidx20.epil, align 4, !tbaa !5 %mul21.epil = mul nsw i32 %20, %7 %sub22.epil = sub nsw i32 %mul21.epil, %add.lcssa %21 = call i32 @llvm.abs.i32(i32 %sub22.epil, i1 true) %cmp23.epil = icmp slt i32 %21, %near.059.unr %22 = trunc i64 %indvars.iv66.unr to i32 %spec.select.epil = select i1 %cmp23.epil, i32 %22, i32 %ans.057.unr br label %for.end29 for.end29: ; preds = %for.inc27.epil, %for.end29.loopexit.unr-lcssa, %entry, %for.cond2.preheader, %for.cond11.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond11.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %spec.select.lcssa.ph, %for.end29.loopexit.unr-lcssa ], [ %spec.select.epil, %for.inc27.epil ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 440, 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11} !15 = distinct !{!15, !10, !16} !16 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> typedef int value_type; typedef struct SkewHeap { struct SkewHeap *L, *R; value_type val; } SkewHeap; typedef SkewHeap* heap_ptr; void swap(heap_ptr a, heap_ptr b) { SkewHeap tmp = *a; *a = *b; *b = tmp; } void swap_ptr(heap_ptr* a, heap_ptr* b) { heap_ptr tmp = *a; *a = *b; *b = tmp; } heap_ptr meld_heap(heap_ptr a, heap_ptr b) { if (!a) return b; if (!b) return a; if (a->val > b->val) swap(a, b); a->R = meld_heap(a->R, b); swap_ptr(&a->L, &a->R); return a; } #define MAX_N (1010) SkewHeap pool_[MAX_N]; int pool_it_ = 0; heap_ptr new_heap(value_type val) { heap_ptr newp = pool_ + pool_it_; pool_it_++; newp->val = val; newp->L = newp->R = NULL; return newp; } void push_heap(heap_ptr* heap, value_type val) { heap_ptr x = new_heap(val); *heap = meld_heap(*heap, x); } value_type pop_heap(heap_ptr* heap) { value_type mini = (*heap)->val; *heap = meld_heap((*heap)->L, (*heap)->R); return mini; } int main(void) { heap_ptr root = NULL; int n, i; scanf("%d", &n); for (i = 0; i < n; i++) { int x; scanf("%d", &x); push_heap(&root, x); } for (i = 0; i < n; i++) { int x = pop_heap(&root); printf("%d%c", x, " \n"[i == n - 1]); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153349/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153349/source.c" target datalayout = "e-m:e-p270: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.SkewHeap = type { ptr, ptr, i32 } @pool_it_ = dso_local local_unnamed_addr global i32 0, align 4 @pool_ = dso_local global [1010 x %struct.SkewHeap] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c" \0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %tmp = alloca %struct.SkewHeap, align 8 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %tmp) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %tmp, ptr noundef nonnull align 8 dereferenceable(24) %a, i64 24, i1 false), !tbaa.struct !5 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %a, ptr noundef nonnull align 8 dereferenceable(24) %b, i64 24, i1 false), !tbaa.struct !5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %b, ptr noundef nonnull align 8 dereferenceable(24) %tmp, i64 24, i1 false), !tbaa.struct !5 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %tmp) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap_ptr(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #3 { entry: %0 = load ptr, ptr %a, align 8, !tbaa !6 %1 = load ptr, ptr %b, align 8, !tbaa !6 store ptr %1, ptr %a, align 8, !tbaa !6 store ptr %0, ptr %b, align 8, !tbaa !6 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local ptr @meld_heap(ptr noundef %a, ptr noundef %b) local_unnamed_addr #4 { entry: %tmp.i = alloca %struct.SkewHeap, align 8 %tobool.not = icmp eq ptr %a, null br i1 %tobool.not, label %common.ret21, label %if.end if.end: ; preds = %entry %tobool1.not = icmp eq ptr %b, null br i1 %tobool1.not, label %common.ret21, label %if.end3 if.end3: ; preds = %if.end %val = getelementptr inbounds %struct.SkewHeap, ptr %a, i64 0, i32 2 %0 = load i32, ptr %val, align 8, !tbaa !12 %val4 = getelementptr inbounds %struct.SkewHeap, ptr %b, i64 0, i32 2 %1 = load i32, ptr %val4, align 8, !tbaa !12 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %tmp.i) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %tmp.i, ptr noundef nonnull align 8 dereferenceable(24) %a, i64 24, i1 false), !tbaa.struct !5 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %a, ptr noundef nonnull align 8 dereferenceable(24) %b, i64 24, i1 false), !tbaa.struct !5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %b, ptr noundef nonnull align 8 dereferenceable(24) %tmp.i, i64 24, i1 false), !tbaa.struct !5 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %tmp.i) br label %if.end6 common.ret21: ; preds = %if.end, %entry, %if.end6 %common.ret21.op = phi ptr [ %a, %if.end6 ], [ %b, %entry ], [ %a, %if.end ] ret ptr %common.ret21.op if.end6: ; preds = %if.then5, %if.end3 %R = getelementptr inbounds %struct.SkewHeap, ptr %a, i64 0, i32 1 %2 = load ptr, ptr %R, align 8, !tbaa !14 %call = tail call ptr @meld_heap(ptr noundef %2, ptr noundef nonnull %b) %3 = load ptr, ptr %a, align 8, !tbaa !6 store ptr %call, ptr %a, align 8, !tbaa !6 store ptr %3, ptr %R, align 8, !tbaa !6 br label %common.ret21 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local nonnull ptr @new_heap(i32 noundef %val) local_unnamed_addr #5 { entry: %0 = load i32, ptr @pool_it_, align 4, !tbaa !10 %idx.ext = sext i32 %0 to i64 %add.ptr = getelementptr inbounds %struct.SkewHeap, ptr @pool_, i64 %idx.ext %inc = add nsw i32 %0, 1 store i32 %inc, ptr @pool_it_, align 4, !tbaa !10 %val1 = getelementptr inbounds %struct.SkewHeap, ptr @pool_, i64 %idx.ext, i32 2 store i32 %val, ptr %val1, align 8, !tbaa !12 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %add.ptr, i8 0, i64 16, i1 false) ret ptr %add.ptr } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @push_heap(ptr nocapture noundef %heap, i32 noundef %val) local_unnamed_addr #4 { entry: %0 = load i32, ptr @pool_it_, align 4, !tbaa !10 %idx.ext.i = sext i32 %0 to i64 %add.ptr.i = getelementptr inbounds %struct.SkewHeap, ptr @pool_, i64 %idx.ext.i %inc.i = add nsw i32 %0, 1 store i32 %inc.i, ptr @pool_it_, align 4, !tbaa !10 %val1.i = getelementptr inbounds %struct.SkewHeap, ptr @pool_, i64 %idx.ext.i, i32 2 store i32 %val, ptr %val1.i, align 8, !tbaa !12 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %add.ptr.i, i8 0, i64 16, i1 false) %1 = load ptr, ptr %heap, align 8, !tbaa !6 %call1 = tail call ptr @meld_heap(ptr noundef %1, ptr noundef nonnull %add.ptr.i) store ptr %call1, ptr %heap, align 8, !tbaa !6 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @pop_heap(ptr nocapture noundef %heap) local_unnamed_addr #4 { entry: %0 = load ptr, ptr %heap, align 8, !tbaa !6 %val = getelementptr inbounds %struct.SkewHeap, ptr %0, i64 0, i32 2 %1 = load i32, ptr %val, align 8, !tbaa !12 %2 = load ptr, ptr %0, align 8, !tbaa !15 %R = getelementptr inbounds %struct.SkewHeap, ptr %0, i64 0, i32 1 %3 = load ptr, ptr %R, align 8, !tbaa !14 %call = tail call ptr @meld_heap(ptr noundef %2, ptr noundef %3) store ptr %call, ptr %heap, align 8, !tbaa !6 ret i32 %1 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %n = alloca i32, align 4 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !10 %cmp18 = icmp sgt i32 %0, 0 br i1 %cmp18, label %for.body, label %for.end12 for.cond2.preheader: ; preds = %for.body %1 = icmp sgt i32 %4, 0 br i1 %1, label %for.body4, label %for.end12 for.body: ; preds = %entry, %for.body %i.020 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %root.019 = phi ptr [ %call1.i, %for.body ], [ null, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %2 = load i32, ptr %x, align 4, !tbaa !10 %3 = load i32, ptr @pool_it_, align 4, !tbaa !10 %idx.ext.i.i = sext i32 %3 to i64 %add.ptr.i.i = getelementptr inbounds %struct.SkewHeap, ptr @pool_, i64 %idx.ext.i.i %inc.i.i = add nsw i32 %3, 1 store i32 %inc.i.i, ptr @pool_it_, align 4, !tbaa !10 %val1.i.i = getelementptr inbounds %struct.SkewHeap, ptr @pool_, i64 %idx.ext.i.i, i32 2 store i32 %2, ptr %val1.i.i, align 8, !tbaa !12 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %add.ptr.i.i, i8 0, i64 16, i1 false) %call1.i = call ptr @meld_heap(ptr noundef %root.019, ptr noundef nonnull %add.ptr.i.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9 %inc = add nuw nsw i32 %i.020, 1 %4 = load i32, ptr %n, align 4, !tbaa !10 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !16 for.body4: ; preds = %for.cond2.preheader, %for.body4 %i.123 = phi i32 [ %inc11, %for.body4 ], [ 0, %for.cond2.preheader ] %root.122 = phi ptr [ %call.i, %for.body4 ], [ %call1.i, %for.cond2.preheader ] %val.i = getelementptr inbounds %struct.SkewHeap, ptr %root.122, i64 0, i32 2 %5 = load i32, ptr %val.i, align 8, !tbaa !12 %6 = load ptr, ptr %root.122, align 8, !tbaa !15 %R.i = getelementptr inbounds %struct.SkewHeap, ptr %root.122, i64 0, i32 1 %7 = load ptr, ptr %R.i, align 8, !tbaa !14 %call.i = call ptr @meld_heap(ptr noundef %6, ptr noundef %7) %8 = load i32, ptr %n, align 4, !tbaa !10 %sub = add nsw i32 %8, -1 %cmp7 = icmp eq i32 %i.123, %sub %idxprom = zext i1 %cmp7 to i64 %arrayidx = getelementptr inbounds [3 x i8], ptr @.str.2, i64 0, i64 %idxprom %9 = load i8, ptr %arrayidx, align 1, !tbaa !18 %conv8 = sext i8 %9 to i32 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %conv8) %inc11 = add nuw nsw i32 %i.123, 1 %10 = load i32, ptr %n, align 4, !tbaa !10 %cmp3 = icmp slt i32 %inc11, %10 br i1 %cmp3, label %for.body4, label %for.end12, !llvm.loop !19 for.end12: ; preds = %for.body4, %entry, %for.cond2.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #3 = { 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 #4 = { 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 #5 = { mustprogress nofree 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 #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #9 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{i64 0, i64 8, !6, i64 8, i64 8, !6, i64 16, i64 4, !10} !6 = !{!7, !7, i64 0} !7 = !{!"any pointer", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!11, !11, i64 0} !11 = !{!"int", !8, i64 0} !12 = !{!13, !11, i64 16} !13 = !{!"SkewHeap", !7, i64 0, !7, i64 8, !11, i64 16} !14 = !{!13, !7, i64 8} !15 = !{!13, !7, i64 0} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.mustprogress"} !18 = !{!8, !8, i64 0} !19 = distinct !{!19, !17}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> int main(){ int i,j,n,x; scanf("%d",&n); int a[n]; for(i=0;i<n;i++)scanf("%d",&a[i]); for(i=0;i<n-1;i++){ for(j=n-1;j>0;j--){ if(a[j-1]>a[j]){ x=a[j-1]; a[j-1]=a[j]; a[j]=x; } } } for(i=0;i<n;i++){ if(i==n-1)printf("%d\n",a[i]); else printf("%d ",a[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153392/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153392/source.c" target datalayout = "e-m:e-p270: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: %n = 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) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp64 = icmp sgt i32 %3, 0 br i1 %cmp64, label %for.body, label %for.end45 for.cond2.preheader: ; preds = %for.body %sub = add i32 %7, -1 %cmp368 = icmp sgt i32 %7, 1 br i1 %cmp368, label %for.cond6.preheader.us.preheader, label %for.cond30.preheader for.cond6.preheader.us.preheader: ; preds = %for.cond2.preheader %4 = zext i32 %sub to i64 br label %for.cond6.preheader.us for.cond6.preheader.us: ; preds = %for.cond6.preheader.us.preheader, %for.cond6.for.inc27_crit_edge.us %i.169.us = phi i32 [ %inc28.us, %for.cond6.for.inc27_crit_edge.us ], [ 0, %for.cond6.preheader.us.preheader ] br label %for.body8.us for.body8.us: ; preds = %for.cond6.preheader.us, %for.inc25.us %indvars.iv74 = phi i64 [ %4, %for.cond6.preheader.us ], [ %indvars.iv.next75, %for.inc25.us ] %indvars.iv.next75 = add nsw i64 %indvars.iv74, -1 %idxprom10.us = and i64 %indvars.iv.next75, 4294967295 %arrayidx11.us = getelementptr inbounds i32, ptr %vla, i64 %idxprom10.us %5 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5 %arrayidx13.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv74 %6 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.us = icmp sgt i32 %5, %6 br i1 %cmp14.us, label %if.then.us, label %for.inc25.us if.then.us: ; preds = %for.body8.us store i32 %6, ptr %arrayidx11.us, align 4, !tbaa !5 store i32 %5, ptr %arrayidx13.us, align 4, !tbaa !5 br label %for.inc25.us for.inc25.us: ; preds = %if.then.us, %for.body8.us %cmp7.us = icmp sgt i64 %indvars.iv74, 1 br i1 %cmp7.us, label %for.body8.us, label %for.cond6.for.inc27_crit_edge.us, !llvm.loop !9 for.cond6.for.inc27_crit_edge.us: ; preds = %for.inc25.us %inc28.us = add nuw nsw i32 %i.169.us, 1 %exitcond.not = icmp eq i32 %inc28.us, %sub br i1 %exitcond.not, label %for.cond30.preheader, label %for.cond6.preheader.us, !llvm.loop !11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !12 for.cond30.preheader: ; preds = %for.cond6.for.inc27_crit_edge.us, %for.cond2.preheader %cmp3170 = icmp sgt i32 %7, 0 br i1 %cmp3170, label %for.body32, label %for.end45 for.body32: ; preds = %for.cond30.preheader, %for.body32 %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body32 ], [ 0, %for.cond30.preheader ] %9 = phi i32 [ %12, %for.body32 ], [ %7, %for.cond30.preheader ] %sub33 = add nsw i32 %9, -1 %10 = zext i32 %sub33 to i64 %cmp34 = icmp eq i64 %indvars.iv77, %10 %arrayidx37 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv77 %11 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %.str.1..str.2 = select i1 %cmp34, ptr @.str.1, ptr @.str.2 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i32 noundef %11) %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp31 = icmp slt i64 %indvars.iv.next78, %13 br i1 %cmp31, label %for.body32, label %for.end45, !llvm.loop !13 for.end45: ; preds = %for.body32, %entry, %for.cond30.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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}
#include <stdio.h> int main(void) { int n; int j; int min; int i[1000]; int count; scanf("%d", &n); for (j = 0; j < n; j++){ scanf("%d", &i[j]); } count = 1; while (count != 0){ count = 0; for (j = 0; j < n; j++){ if (i[j] < i[j - 1]){ i[j - 1] += i[j]; i[j] = i[j - 1] - i[j]; i[j - 1] = i[j - 1] - i[j]; count++; } } } j = 0; while (1){ printf("%d", i[j]); j++; if (j >= n){ break; } printf(" "); } puts(""); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153435/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153435/source.c" target datalayout = "e-m:e-p270: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: %n = alloca i32, align 4 %i = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %i) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp69 = icmp sgt i32 %0, 0 br i1 %cmp69, label %for.body, label %while.cond37.preheader while.cond.preheader: ; preds = %for.body %cmp471 = icmp sgt i32 %10, 0 br i1 %cmp471, label %for.cond3.preheader.us.preheader, label %while.cond37.preheader for.cond3.preheader.us.preheader: ; preds = %while.cond.preheader %wide.trip.count = zext i32 %10 to i64 %arrayidx9.us.phi.trans.insert = getelementptr inbounds [1000 x i32], ptr %i, i64 0, i64 -1 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %10, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond3.preheader.us for.cond3.preheader.us: ; preds = %for.cond3.preheader.us.preheader, %for.cond3.while.cond.loopexit_crit_edge.us %.pre = load i32, ptr %arrayidx9.us.phi.trans.insert, align 4, !tbaa !5 br i1 %1, label %for.cond3.while.cond.loopexit_crit_edge.us.unr-lcssa, label %for.body5.us for.body5.us: ; preds = %for.cond3.preheader.us, %for.inc34.us.1 %2 = phi i32 [ %7, %for.inc34.us.1 ], [ %.pre, %for.cond3.preheader.us ] %indvars.iv80 = phi i64 [ %indvars.iv.next81.1, %for.inc34.us.1 ], [ 0, %for.cond3.preheader.us ] %count.173.us = phi i32 [ %count.2.us.1, %for.inc34.us.1 ], [ 0, %for.cond3.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc34.us.1 ], [ 0, %for.cond3.preheader.us ] %arrayidx7.us = getelementptr inbounds [1000 x i32], ptr %i, i64 0, i64 %indvars.iv80 %3 = load i32, ptr %arrayidx7.us, align 8, !tbaa !5 %cmp10.us = icmp slt i32 %3, %2 br i1 %cmp10.us, label %if.then.us, label %for.inc34.us if.then.us: ; preds = %for.body5.us %4 = add nsw i64 %indvars.iv80, -1 %arrayidx9.us = getelementptr inbounds [1000 x i32], ptr %i, i64 0, i64 %4 store i32 %2, ptr %arrayidx7.us, align 8, !tbaa !5 store i32 %3, ptr %arrayidx9.us, align 4, !tbaa !5 %inc33.us = add nsw i32 %count.173.us, 1 br label %for.inc34.us for.inc34.us: ; preds = %if.then.us, %for.body5.us %5 = phi i32 [ %2, %if.then.us ], [ %3, %for.body5.us ] %count.2.us = phi i32 [ %inc33.us, %if.then.us ], [ %count.173.us, %for.body5.us ] %indvars.iv.next81 = or i64 %indvars.iv80, 1 %arrayidx7.us.1 = getelementptr inbounds [1000 x i32], ptr %i, i64 0, i64 %indvars.iv.next81 %6 = load i32, ptr %arrayidx7.us.1, align 4, !tbaa !5 %cmp10.us.1 = icmp slt i32 %6, %5 br i1 %cmp10.us.1, label %if.then.us.1, label %for.inc34.us.1 if.then.us.1: ; preds = %for.inc34.us %arrayidx9.us.1 = getelementptr inbounds [1000 x i32], ptr %i, i64 0, i64 %indvars.iv80 store i32 %5, ptr %arrayidx7.us.1, align 4, !tbaa !5 store i32 %6, ptr %arrayidx9.us.1, align 8, !tbaa !5 %inc33.us.1 = add nsw i32 %count.2.us, 1 br label %for.inc34.us.1 for.inc34.us.1: ; preds = %if.then.us.1, %for.inc34.us %7 = phi i32 [ %5, %if.then.us.1 ], [ %6, %for.inc34.us ] %count.2.us.1 = phi i32 [ %inc33.us.1, %if.then.us.1 ], [ %count.2.us, %for.inc34.us ] %indvars.iv.next81.1 = add nuw nsw i64 %indvars.iv80, 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.cond3.while.cond.loopexit_crit_edge.us.unr-lcssa, label %for.body5.us, !llvm.loop !9 for.cond3.while.cond.loopexit_crit_edge.us.unr-lcssa: ; preds = %for.inc34.us.1, %for.cond3.preheader.us %count.2.us.lcssa.ph = phi i32 [ undef, %for.cond3.preheader.us ], [ %count.2.us.1, %for.inc34.us.1 ] %.unr = phi i32 [ %.pre, %for.cond3.preheader.us ], [ %7, %for.inc34.us.1 ] %indvars.iv80.unr = phi i64 [ 0, %for.cond3.preheader.us ], [ %indvars.iv.next81.1, %for.inc34.us.1 ] %count.173.us.unr = phi i32 [ 0, %for.cond3.preheader.us ], [ %count.2.us.1, %for.inc34.us.1 ] br i1 %lcmp.mod.not, label %for.cond3.while.cond.loopexit_crit_edge.us, label %for.body5.us.epil for.body5.us.epil: ; preds = %for.cond3.while.cond.loopexit_crit_edge.us.unr-lcssa %arrayidx7.us.epil = getelementptr inbounds [1000 x i32], ptr %i, i64 0, i64 %indvars.iv80.unr %8 = load i32, ptr %arrayidx7.us.epil, align 4, !tbaa !5 %cmp10.us.epil = icmp slt i32 %8, %.unr br i1 %cmp10.us.epil, label %if.then.us.epil, label %for.cond3.while.cond.loopexit_crit_edge.us if.then.us.epil: ; preds = %for.body5.us.epil %9 = add nsw i64 %indvars.iv80.unr, -1 %arrayidx9.us.epil = getelementptr inbounds [1000 x i32], ptr %i, i64 0, i64 %9 store i32 %.unr, ptr %arrayidx7.us.epil, align 4, !tbaa !5 store i32 %8, ptr %arrayidx9.us.epil, align 4, !tbaa !5 %inc33.us.epil = add nsw i32 %count.173.us.unr, 1 br label %for.cond3.while.cond.loopexit_crit_edge.us for.cond3.while.cond.loopexit_crit_edge.us: ; preds = %for.body5.us.epil, %if.then.us.epil, %for.cond3.while.cond.loopexit_crit_edge.us.unr-lcssa %count.2.us.lcssa = phi i32 [ %count.2.us.lcssa.ph, %for.cond3.while.cond.loopexit_crit_edge.us.unr-lcssa ], [ %inc33.us.epil, %if.then.us.epil ], [ %count.173.us.unr, %for.body5.us.epil ] %cmp2.not.us = icmp eq i32 %count.2.us.lcssa, 0 br i1 %cmp2.not.us, label %while.cond37.preheader, label %for.cond3.preheader.us, !llvm.loop !11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %i, 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 %10 = load i32, ptr %n, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next, %11 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !12 while.cond37.preheader: ; preds = %for.cond3.while.cond.loopexit_crit_edge.us, %entry, %while.cond.preheader %12 = load i32, ptr %i, align 16, !tbaa !5 %call4175 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12) %13 = load i32, ptr %n, align 4, !tbaa !5 %cmp43.not76 = icmp sgt i32 %13, 1 br i1 %cmp43.not76, label %if.end45, label %while.end47 if.end45: ; preds = %while.cond37.preheader, %if.end45 %indvars.iv84 = phi i64 [ %indvars.iv.next85, %if.end45 ], [ 1, %while.cond37.preheader ] %putchar = call i32 @putchar(i32 32) %arrayidx40 = getelementptr inbounds [1000 x i32], ptr %i, i64 0, i64 %indvars.iv84 %14 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14) %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %15 = load i32, ptr %n, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp43.not = icmp slt i64 %indvars.iv.next85, %16 br i1 %cmp43.not, label %if.end45, label %while.end47 while.end47: ; preds = %if.end45, %while.cond37.preheader %putchar68 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %i) #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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void) { int n; int a[1000]; int t; int i, j; scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%d", &a[i]); } t = 0; for(i = 0; i < n; i++) { for (j = 0; j < n - i - 1; j++){ if (a[j] > a[j + 1]){ t = a[j]; a[j] = a[j + 1]; a[j + 1] = t; } } } for(i = 0; i < n; i++) { printf("%d", a[i]); if (i == n - 1){ puts(""); } else { printf(" "); } } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153479/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153479/source.c" target datalayout = "e-m:e-p270: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: %n = alloca i32, align 4 %a = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp63 = icmp sgt i32 %0, 0 br i1 %cmp63, label %for.body, label %for.end44 for.cond2.preheader: ; preds = %for.body %cmp367 = icmp sgt i32 %1, 0 br i1 %cmp367, label %for.cond5.preheader, label %for.end44 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 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.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond2.preheader, %for.inc27 %i.168 = phi i32 [ %inc28, %for.inc27 ], [ 0, %for.cond2.preheader ] %3 = xor i32 %i.168, -1 %4 = add i32 %1, %3 %5 = zext i32 %4 to i64 %6 = xor i32 %i.168, -1 %sub6 = add i32 %1, %6 %cmp765 = icmp sgt i32 %sub6, 0 br i1 %cmp765, label %for.body8.preheader, label %for.inc27 for.body8.preheader: ; preds = %for.cond5.preheader %.pre = load i32, ptr %a, align 16, !tbaa !5 %xtraiter = and i64 %5, 1 %7 = icmp eq i32 %4, 1 br i1 %7, label %for.inc27.loopexit.unr-lcssa, label %for.body8.preheader.new for.body8.preheader.new: ; preds = %for.body8.preheader %unroll_iter = and i64 %5, 4294967294 br label %for.body8 for.cond30.preheader: ; preds = %for.inc27 br i1 %cmp367, label %for.body32, label %for.end44 for.body8: ; preds = %for.inc24.1, %for.body8.preheader.new %8 = phi i32 [ %.pre, %for.body8.preheader.new ], [ %12, %for.inc24.1 ] %indvars.iv73 = phi i64 [ 0, %for.body8.preheader.new ], [ %indvars.iv.next74.1, %for.inc24.1 ] %niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.inc24.1 ] %indvars.iv.next74 = or i64 %indvars.iv73, 1 %arrayidx12 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv.next74 %9 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp sgt i32 %8, %9 br i1 %cmp13, label %if.then, label %for.inc24 if.then: ; preds = %for.body8 %arrayidx10 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv73 store i32 %9, ptr %arrayidx10, align 8, !tbaa !5 store i32 %8, ptr %arrayidx12, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.body8, %if.then %10 = phi i32 [ %9, %for.body8 ], [ %8, %if.then ] %indvars.iv.next74.1 = add nuw nsw i64 %indvars.iv73, 2 %arrayidx12.1 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv.next74.1 %11 = load i32, ptr %arrayidx12.1, align 8, !tbaa !5 %cmp13.1 = icmp sgt i32 %10, %11 br i1 %cmp13.1, label %if.then.1, label %for.inc24.1 if.then.1: ; preds = %for.inc24 %arrayidx10.1 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv.next74 store i32 %11, ptr %arrayidx10.1, align 4, !tbaa !5 store i32 %10, ptr %arrayidx12.1, align 8, !tbaa !5 br label %for.inc24.1 for.inc24.1: ; preds = %if.then.1, %for.inc24 %12 = phi i32 [ %11, %for.inc24 ], [ %10, %if.then.1 ] %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.inc27.loopexit.unr-lcssa, label %for.body8, !llvm.loop !11 for.inc27.loopexit.unr-lcssa: ; preds = %for.inc24.1, %for.body8.preheader %.unr = phi i32 [ %.pre, %for.body8.preheader ], [ %12, %for.inc24.1 ] %indvars.iv73.unr = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next74.1, %for.inc24.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc27, label %for.body8.epil for.body8.epil: ; preds = %for.inc27.loopexit.unr-lcssa %indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.unr, 1 %arrayidx12.epil = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv.next74.epil %13 = load i32, ptr %arrayidx12.epil, align 4, !tbaa !5 %cmp13.epil = icmp sgt i32 %.unr, %13 br i1 %cmp13.epil, label %if.then.epil, label %for.inc27 if.then.epil: ; preds = %for.body8.epil %arrayidx10.epil = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv73.unr store i32 %13, ptr %arrayidx10.epil, align 4, !tbaa !5 store i32 %.unr, ptr %arrayidx12.epil, align 4, !tbaa !5 br label %for.inc27 for.inc27: ; preds = %for.inc27.loopexit.unr-lcssa, %if.then.epil, %for.body8.epil, %for.cond5.preheader %inc28 = add nuw nsw i32 %i.168, 1 %exitcond78.not = icmp eq i32 %inc28, %1 br i1 %exitcond78.not, label %for.cond30.preheader, label %for.cond5.preheader, !llvm.loop !12 for.body32: ; preds = %for.cond30.preheader, %for.body32 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body32 ], [ 0, %for.cond30.preheader ] %arrayidx34 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv79 %14 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14) %15 = load i32, ptr %n, align 4, !tbaa !5 %sub36 = add nsw i32 %15, -1 %16 = zext i32 %sub36 to i64 %cmp37 = icmp eq i64 %indvars.iv79, %16 %. = select i1 %cmp37, i32 10, i32 32 %putchar62 = call i32 @putchar(i32 %.) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp31 = icmp slt i64 %indvars.iv.next80, %18 br i1 %cmp31, label %for.body32, label %for.end44, !llvm.loop !13 for.end44: ; preds = %for.body32, %entry, %for.cond2.preheader, %for.cond30.preheader call void @llvm.lifetime.end.p0(i64 4000, 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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main(void) { int F = 0,f; scanf("%d", &F); f = (F - 30) / 2; printf("%d\n", f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153529/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153529/source.c" target datalayout = "e-m:e-p270: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: %F = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %F) #3 store i32 0, ptr %F, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %F) %0 = load i32, ptr %F, align 4, !tbaa !5 %sub = add nsw i32 %0, -30 %div = sdiv i32 %sub, 2 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %F) #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 f; scanf("%d",&f); printf("%d\n",((f-30)/2)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153572/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153572/source.c" target datalayout = "e-m:e-p270: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: %f = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %f) %0 = load i32, ptr %f, align 4, !tbaa !5 %sub = add nsw i32 %0, -30 %div = sdiv i32 %sub, 2 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #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() { long int n; scanf("%ld",&n); if(n%2==0) printf("%ld 4",n-4); else printf("%ld 9",n-9); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15363/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15363/source.c" target datalayout = "e-m:e-p270: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 [6 x i8] c"%ld 4\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%ld 9\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = and i64 %0, 1 %cmp = icmp eq i64 %1, 0 %. = select i1 %cmp, i64 -4, i64 -9 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %sub2 = add nsw i64 %0, %. %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i64 noundef %sub2) 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", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdint.h> // int64_t #define max(a,b) ((a) > (b) ? (a) : (b)) #define min(a,b) ((a) > (b) ? (b) : (a)) int get_int(void) { int num; scanf("%d", &num); return num; } // <arr[0]> <arr[1]> .. <arr[size-1]> int fget_array(int *arr, int size) { int i; for(i = 0; i < size; i++) { scanf("%d", &arr[i]); } return 0; } #define NUM_MAX 200000 int main(void) { int num = get_int(); static int arr[NUM_MAX]; fget_array(arr, num); static int deque[NUM_MAX*2]; int start = NUM_MAX; int end = NUM_MAX; int i; int dir = 1; for(i = 0; i < num; i++) { int val = arr[i]; if(i%2==0) { deque[end++] = val; } else { deque[--start] = val; } dir = -dir; } if(dir==1) { // str is [start, end) for(i = start; i < end; i++) { printf("%d%c", deque[i], i == end-1 ? '\n' : ' '); } } else { for(i = end-1; i >= start; i--) { printf("%d%c", deque[i], i == start ? '\n' : ' '); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153673/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153673/source.c" target datalayout = "e-m:e-p270: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 @main.arr = internal global [200000 x i32] zeroinitializer, align 16 @main.deque = internal unnamed_addr global [400000 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @get_int() local_unnamed_addr #0 { entry: %num = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, 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: 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 @fget_array(ptr noundef %arr, i32 noundef %size) local_unnamed_addr #0 { entry: %cmp3 = icmp sgt i32 %size, 0 br i1 %cmp3, 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 %arr, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %entry ret i32 0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num.i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num.i) #3 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num.i) %0 = load i32, ptr %num.i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num.i) #3 %cmp3.i = icmp sgt i32 %0, 0 br i1 %cmp3.i, label %for.body.preheader.i, label %if.end34 for.body.preheader.i: ; preds = %entry %wide.trip.count.i = zext i32 %0 to i64 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ] %arrayidx.i = getelementptr inbounds i32, ptr @main.arr, i64 %indvars.iv.i %call.i55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.i) %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %fget_array.exit, label %for.body.i, !llvm.loop !9 fget_array.exit: ; preds = %for.body.i br i1 %cmp3.i, label %for.body.preheader, label %if.end34 for.body.preheader: ; preds = %fget_array.exit %wide.trip.count = zext i32 %0 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 ] %start.061 = phi i32 [ 200000, %for.body.preheader ], [ %start.1, %for.body ] %dir.060.neg = phi i32 [ -1, %for.body.preheader ], [ %dir.060, %for.body ] %dir.060 = phi i32 [ 1, %for.body.preheader ], [ %dir.060.neg, %for.body ] %end.058 = phi i32 [ 200000, %for.body.preheader ], [ %end.1, %for.body ] %arrayidx = getelementptr inbounds [200000 x i32], ptr @main.arr, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %rem78 = and i64 %indvars.iv, 1 %cmp2 = icmp eq i64 %rem78, 0 %dec = add nsw i32 %start.061, -1 %dec.sink = select i1 %cmp2, i32 %end.058, i32 %dec %inc = zext i1 %cmp2 to i32 %end.1 = add nuw nsw i32 %end.058, %inc %start.1 = select i1 %cmp2, i32 %start.061, i32 %dec %idxprom5 = sext i32 %dec.sink to i64 %arrayidx6 = getelementptr inbounds [400000 x i32], ptr @main.deque, i64 0, i64 %idxprom5 store i32 %1, ptr %arrayidx6, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body %2 = icmp eq i32 %dir.060.neg, 1 br i1 %2, label %for.cond10.preheader, label %for.cond23.preheader for.cond23.preheader: ; preds = %for.end %cmp24.not.not64 = icmp sgt i32 %end.1, %start.1 br i1 %cmp24.not.not64, label %for.body25.preheader, label %if.end34 for.body25.preheader: ; preds = %for.cond23.preheader %3 = zext i32 %end.1 to i64 %4 = sext i32 %start.1 to i64 br label %for.body25 for.cond10.preheader: ; preds = %for.end %cmp1166 = icmp slt i32 %start.1, %end.1 br i1 %cmp1166, label %for.body12.lr.ph, label %if.end34 for.body12.lr.ph: ; preds = %for.cond10.preheader %sub15 = add nsw i32 %end.1, -1 %5 = sext i32 %start.1 to i64 %sext75 = sext i32 %sub15 to i64 br label %for.body12 for.body12: ; preds = %for.body12.lr.ph, %for.body12 %indvars.iv73 = phi i64 [ %5, %for.body12.lr.ph ], [ %indvars.iv.next74, %for.body12 ] %arrayidx14 = getelementptr inbounds [400000 x i32], ptr @main.deque, i64 0, i64 %indvars.iv73 %6 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %7 = icmp eq i64 %indvars.iv73, %sext75 %cond = select i1 %7, i32 10, i32 32 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6, i32 noundef %cond) %indvars.iv.next74 = add nsw i64 %indvars.iv73, 1 %lftr.wideiv = trunc i64 %indvars.iv.next74 to i32 %exitcond77.not = icmp eq i32 %end.1, %lftr.wideiv br i1 %exitcond77.not, label %if.end34, label %for.body12, !llvm.loop !12 for.body25: ; preds = %for.body25.preheader, %for.body25 %indvars.iv70 = phi i64 [ %3, %for.body25.preheader ], [ %indvars.iv.next71, %for.body25 ] %indvars.iv.next71 = add nsw i64 %indvars.iv70, -1 %arrayidx27 = getelementptr inbounds [400000 x i32], ptr @main.deque, i64 0, i64 %indvars.iv.next71 %8 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %9 = icmp eq i64 %indvars.iv.next71, %4 %cond29 = select i1 %9, i32 10, i32 32 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %cond29) %cmp24.not.not = icmp sgt i64 %indvars.iv.next71, %4 br i1 %cmp24.not.not, label %for.body25, label %if.end34, !llvm.loop !13 if.end34: ; preds = %for.body25, %for.body12, %fget_array.exit, %entry, %for.cond23.preheader, %for.cond10.preheader ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #include <stdlib.h> int main(void){ int n,i; long long int a,odd[100000],even[100000]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%lld",&a); if(i%2==1) even[i/2] = a; else odd[i/2] = a; } if(n%2==0){ for(i=n/2-1;i>=0;i--)printf("%d ",even[i]); for(i=0;i<n/2;i++)printf("%d ",odd[i]); }else{ for(i=n/2;i>=0;i--)printf("%d ",odd[i]); for(i=0;i<n/2;i++)printf("%d ",even[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153716/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153716/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i64, align 8 %odd = alloca [100000 x i64], align 16 %even = alloca [100000 x i64], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %odd) #3 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %even) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp69 = icmp sgt i32 %0, 0 br i1 %cmp69, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.070 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %rem = and i32 %i.070, 1 %cmp2.not = icmp eq i32 %rem, 0 %1 = load i64, ptr %a, align 8, !tbaa !9 %div366 = lshr i32 %i.070, 1 %idxprom4 = zext i32 %div366 to i64 %odd.even = select i1 %cmp2.not, ptr %odd, ptr %even %arrayidx = getelementptr inbounds [100000 x i64], ptr %odd.even, i64 0, i64 %idxprom4 store i64 %1, ptr %arrayidx, align 8, !tbaa !9 %inc = add nuw nsw i32 %i.070, 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 !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ] %3 = and i32 %.lcssa, 1 %cmp7 = icmp eq i32 %3, 0 br i1 %cmp7, label %if.then8, label %if.else28 if.then8: ; preds = %for.end %cmp1176 = icmp sgt i32 %.lcssa, 1 br i1 %cmp1176, label %for.body12.preheader, label %if.end49 for.body12.preheader: ; preds = %if.then8 %div997100 = lshr i32 %.lcssa, 1 %4 = zext i32 %div997100 to i64 br label %for.body12 for.cond18.preheader: ; preds = %for.body12 %.pre94 = load i32, ptr %n, align 4, !tbaa !5 %5 = icmp sgt i32 %.pre94, 1 br i1 %5, label %for.body21, label %if.end49 for.body12: ; preds = %for.body12.preheader, %for.body12 %indvars.iv87 = phi i64 [ %4, %for.body12.preheader ], [ %indvars.iv.next88, %for.body12 ] %indvars.iv.next88 = add nsw i64 %indvars.iv87, -1 %idxprom13 = and i64 %indvars.iv.next88, 4294967295 %arrayidx14 = getelementptr inbounds [100000 x i64], ptr %even, i64 0, i64 %idxprom13 %6 = load i64, ptr %arrayidx14, align 8, !tbaa !9 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %6) %cmp11 = icmp ugt i64 %indvars.iv87, 1 br i1 %cmp11, label %for.body12, label %for.cond18.preheader, !llvm.loop !13 for.body21: ; preds = %for.cond18.preheader, %for.body21 %indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.body21 ], [ 0, %for.cond18.preheader ] %arrayidx23 = getelementptr inbounds [100000 x i64], ptr %odd, i64 0, i64 %indvars.iv90 %7 = load i64, ptr %arrayidx23, align 8, !tbaa !9 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %7) %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %div19 = sdiv i32 %8, 2 %9 = sext i32 %div19 to i64 %cmp20 = icmp slt i64 %indvars.iv.next91, %9 br i1 %cmp20, label %for.body21, label %if.end49, !llvm.loop !14 if.else28: ; preds = %for.end %cmp3171 = icmp sgt i32 %.lcssa, -2 br i1 %cmp3171, label %for.body32.preheader, label %if.end49 for.body32.preheader: ; preds = %if.else28 %div29 = sdiv i32 %.lcssa, 2 %10 = zext i32 %div29 to i64 br label %for.body32 for.cond39.preheader: ; preds = %for.body32 %.pre = load i32, ptr %n, align 4, !tbaa !5 %11 = icmp sgt i32 %.pre, 1 br i1 %11, label %for.body42, label %if.end49 for.body32: ; preds = %for.body32.preheader, %for.body32 %indvars.iv = phi i64 [ %10, %for.body32.preheader ], [ %indvars.iv.next, %for.body32 ] %arrayidx34 = getelementptr inbounds [100000 x i64], ptr %odd, i64 0, i64 %indvars.iv %12 = load i64, ptr %arrayidx34, align 8, !tbaa !9 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %12) %indvars.iv.next = add nsw i64 %indvars.iv, -1 %cmp31.not = icmp eq i64 %indvars.iv, 0 br i1 %cmp31.not, label %for.cond39.preheader, label %for.body32, !llvm.loop !15 for.body42: ; preds = %for.cond39.preheader, %for.body42 %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.body42 ], [ 0, %for.cond39.preheader ] %arrayidx44 = getelementptr inbounds [100000 x i64], ptr %even, i64 0, i64 %indvars.iv84 %13 = load i64, ptr %arrayidx44, align 8, !tbaa !9 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %13) %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %14 = load i32, ptr %n, align 4, !tbaa !5 %div40 = sdiv i32 %14, 2 %15 = sext i32 %div40 to i64 %cmp41 = icmp slt i64 %indvars.iv.next85, %15 br i1 %cmp41, label %for.body42, label %if.end49, !llvm.loop !16 if.end49: ; preds = %for.body42, %for.body21, %if.else28, %if.then8, %for.cond39.preheader, %for.cond18.preheader call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %even) #3 call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %odd) #3 call void @llvm.lifetime.end.p0(i64 8, 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 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12} !15 = distinct !{!15, !12} !16 = distinct !{!16, !12}
#include<stdio.h> int main() { int n; scanf("%d",&n); // ans=n/2; if(n%2==0) { printf("4 %d",n-4); } else { printf("9 %d",n-9); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15376/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15376/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"4 %d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"9 %d\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 %1 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 %. = select i1 %cmp, i32 -4, i32 -9 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %sub2 = add nsw i32 %0, %. %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i32 noundef %sub2) 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> /* main */ int main(int argc, char **argv) { int d1, d2, i, max_d, max_p, n, p; while (1) { scanf("%d", &n); if (n == 0) break; max_d = max_p = -1; for (i = 0; i < n; i++) { scanf("%d %d %d", &p, &d1, &d2); if (max_d < d1 + d2) { max_d = d1 + d2; max_p = p; } } printf("%d %d\n", max_p, max_d); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153802/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153802/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %d1 = alloca i32, align 4 %d2 = alloca i32, align 4 %n = alloca i32, align 4 %p = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp17 = icmp eq i32 %0, 0 br i1 %cmp17, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %6, %for.end ], [ %0, %entry ] %cmp111 = icmp sgt i32 %1, 0 br i1 %cmp111, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.body %max_p.014 = phi i32 [ %spec.select10, %for.body ], [ -1, %for.cond.preheader ] %max_d.013 = phi i32 [ %spec.select, %for.body ], [ -1, %for.cond.preheader ] %i.012 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %p, ptr noundef nonnull %d1, ptr noundef nonnull %d2) %2 = load i32, ptr %d1, align 4, !tbaa !5 %3 = load i32, ptr %d2, align 4, !tbaa !5 %add = add nsw i32 %3, %2 %cmp3 = icmp slt i32 %max_d.013, %add %4 = load i32, ptr %p, align 4 %spec.select = call i32 @llvm.smax.i32(i32 %max_d.013, i32 %add) %spec.select10 = select i1 %cmp3, i32 %4, i32 %max_p.014 %inc = add nuw nsw i32 %i.012, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp1 = icmp slt i32 %inc, %5 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond.preheader %max_d.0.lcssa = phi i32 [ -1, %for.cond.preheader ], [ %spec.select, %for.body ] %max_p.0.lcssa = phi i32 [ -1, %for.cond.preheader ], [ %spec.select10, %for.body ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max_p.0.lcssa, i32 noundef %max_d.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %6, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d1) #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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int n,p,x,y,a,b,i; while(scanf("%d",&n)!=EOF){ if(n==0)break; a=0; for(i=0;i<n;i++){ scanf("%d%d%d",&p,&x,&y); if(x+y>a)a=x+y,b=p; } printf("%d %d\n",b,a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153853/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153853/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %p = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp18 = icmp eq i32 %call17, -1 %0 = load i32, ptr %n, align 4 %cmp119 = icmp eq i32 %0, 0 %or.cond20 = select i1 %cmp18, i1 true, i1 %cmp119 br i1 %or.cond20, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %6, %for.end ], [ %0, %entry ] %b.021 = phi i32 [ %b.1.lcssa, %for.end ], [ undef, %entry ] %cmp212 = icmp sgt i32 %1, 0 br i1 %cmp212, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.body %i.015 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ] %b.114 = phi i32 [ %spec.select11, %for.body ], [ %b.021, %for.cond.preheader ] %a.013 = phi i32 [ %spec.select, %for.body ], [ 0, %for.cond.preheader ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %p, ptr noundef nonnull %x, ptr noundef nonnull %y) %2 = load i32, ptr %x, align 4, !tbaa !5 %3 = load i32, ptr %y, align 4, !tbaa !5 %add = add nsw i32 %3, %2 %cmp4 = icmp sgt i32 %add, %a.013 %4 = load i32, ptr %p, align 4 %spec.select = call i32 @llvm.smax.i32(i32 %add, i32 %a.013) %spec.select11 = select i1 %cmp4, i32 %4, i32 %b.114 %inc = add nuw nsw i32 %i.015, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc, %5 br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond.preheader %a.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %spec.select, %for.body ] %b.1.lcssa = phi i32 [ %b.021, %for.cond.preheader ], [ %spec.select11, %for.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %b.1.lcssa, i32 noundef %a.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp = icmp eq i32 %call, -1 %6 = load i32, ptr %n, align 4 %cmp1 = icmp eq i32 %6, 0 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 br i1 %or.cond, label %while.end, label %for.cond.preheader, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; 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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
// Aizu 0262: Making Sugoroku // 2017.10.26 bal4u@uu #include <stdio.h> #include <string.h> char g[255][255]; int d[255]; int main() { int m, n, i, j, k, ans; while (scanf("%d", &m) && m > 0) { memset(g, 0, sizeof(g)); scanf("%d", &n); for (i = 1; i <= n; i++) scanf("%d", d+i); for (i = 0; i <= n; i++) for (j = 1; j <= m; j++) { k = i + j + d[i+j]; if (k < 0) k = 0; else if (k > n+1) k = n+1; g[i][k] = 1; } for (k = 0; k <= n+1; k++) for (i = 0; i <= n+1; i++) for (j = 0; j <= n+1; j++) if (g[i][k] && g[k][j]) g[i][j] = 1; ans = 1; for (i = 0; i <= n; i++) { if (g[0][i] && !g[i][n+1]) { ans = 0; break; } } puts(ans ? "OK" : "NG"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153903/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153903/source.c" target datalayout = "e-m:e-p270: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 @g = dso_local local_unnamed_addr global [255 x [255 x i8]] zeroinitializer, align 16 @d = dso_local global [255 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [3 x i8] c"OK\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NG\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) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call133 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %tobool134 = icmp ne i32 %call133, 0 %0 = load i32, ptr %m, align 4 %cmp135 = icmp sgt i32 %0, 0 %1 = select i1 %tobool134, i1 %cmp135, i1 false br i1 %1, label %while.body, label %while.end while.body: ; preds = %entry, %for.end85 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(65025) @g, i8 0, i64 65025, i1 false) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %2 = load i32, ptr %n, align 4 %cmp2.not116 = icmp slt i32 %2, 1 br i1 %cmp2.not116, label %for.cond4.preheader, label %for.body for.cond4.preheader: ; preds = %for.body, %while.body %.lcssa = phi i32 [ %2, %while.body ], [ %6, %for.body ] %cmp5.not120 = icmp slt i32 %.lcssa, 0 br i1 %cmp5.not120, label %for.cond4.preheader.for.cond28.preheader_crit_edge, label %for.cond7.preheader.lr.ph for.cond4.preheader.for.cond28.preheader_crit_edge: ; preds = %for.cond4.preheader %.pre = add nsw i32 %.lcssa, 1 br label %for.cond28.preheader for.cond7.preheader.lr.ph: ; preds = %for.cond4.preheader %3 = load i32, ptr %m, align 4, !tbaa !5 %cmp8.not118 = icmp slt i32 %3, 1 %add13 = add nuw i32 %.lcssa, 1 br i1 %cmp8.not118, label %for.cond32.preheader.preheader, label %for.cond7.preheader.preheader for.cond7.preheader.preheader: ; preds = %for.cond7.preheader.lr.ph %wide.trip.count147 = zext i32 %add13 to i64 %4 = zext i32 %3 to i64 %xtraiter = and i64 %4, 1 %5 = icmp eq i32 %3, 1 %unroll_iter = and i64 %4, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond7.preheader for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %while.body ] %add.ptr = getelementptr inbounds i32, ptr @d, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %n, align 4 %7 = sext i32 %6 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv, %7 br i1 %cmp2.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.cond28.preheader: ; preds = %for.cond7.for.inc25_crit_edge, %for.cond4.preheader.for.cond28.preheader_crit_edge %add29.pre-phi = phi i32 [ %.pre, %for.cond4.preheader.for.cond28.preheader_crit_edge ], [ %add13, %for.cond7.for.inc25_crit_edge ] %cmp30.not126 = icmp slt i32 %.lcssa, -1 br i1 %cmp30.not126, label %for.end85, label %for.cond32.preheader.preheader for.cond32.preheader.preheader: ; preds = %for.cond7.preheader.lr.ph, %for.cond28.preheader %add29.pre-phi171 = phi i32 [ %add29.pre-phi, %for.cond28.preheader ], [ %add13, %for.cond7.preheader.lr.ph ] %8 = add i32 %.lcssa, 2 %wide.trip.count162 = zext i32 %8 to i64 br label %for.cond32.preheader for.cond7.preheader: ; preds = %for.cond7.preheader.preheader, %for.cond7.for.inc25_crit_edge %indvars.iv144 = phi i64 [ 0, %for.cond7.preheader.preheader ], [ %indvars.iv.next145, %for.cond7.for.inc25_crit_edge ] br i1 %5, label %for.cond7.for.inc25_crit_edge.unr-lcssa, label %for.body9 for.body9: ; preds = %for.cond7.preheader, %for.body9 %indvars.iv140 = phi i64 [ %indvars.iv.next141.1, %for.body9 ], [ 1, %for.cond7.preheader ] %niter = phi i64 [ %niter.next.1, %for.body9 ], [ 0, %for.cond7.preheader ] %9 = add nuw nsw i64 %indvars.iv140, %indvars.iv144 %arrayidx = getelementptr inbounds [255 x i32], ptr @d, i64 0, i64 %9 %10 = load i32, ptr %arrayidx, align 4, !tbaa !5 %11 = trunc i64 %9 to i32 %add11 = add nsw i32 %10, %11 %cmp12 = icmp slt i32 %add11, 0 %spec.select = call i32 @llvm.smin.i32(i32 %add11, i32 %add13) %k.0 = select i1 %cmp12, i32 0, i32 %spec.select %idxprom20 = sext i32 %k.0 to i64 %arrayidx21 = getelementptr inbounds [255 x [255 x i8]], ptr @g, i64 0, i64 %indvars.iv144, i64 %idxprom20 store i8 1, ptr %arrayidx21, align 1, !tbaa !11 %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1 %12 = add nuw nsw i64 %indvars.iv.next141, %indvars.iv144 %arrayidx.1 = getelementptr inbounds [255 x i32], ptr @d, i64 0, i64 %12 %13 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %14 = trunc i64 %12 to i32 %add11.1 = add nsw i32 %13, %14 %cmp12.1 = icmp slt i32 %add11.1, 0 %spec.select.1 = call i32 @llvm.smin.i32(i32 %add11.1, i32 %add13) %k.0.1 = select i1 %cmp12.1, i32 0, i32 %spec.select.1 %idxprom20.1 = sext i32 %k.0.1 to i64 %arrayidx21.1 = getelementptr inbounds [255 x [255 x i8]], ptr @g, i64 0, i64 %indvars.iv144, i64 %idxprom20.1 store i8 1, ptr %arrayidx21.1, align 1, !tbaa !11 %indvars.iv.next141.1 = add nuw nsw i64 %indvars.iv140, 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.cond7.for.inc25_crit_edge.unr-lcssa, label %for.body9, !llvm.loop !12 for.cond7.for.inc25_crit_edge.unr-lcssa: ; preds = %for.body9, %for.cond7.preheader %indvars.iv140.unr = phi i64 [ 1, %for.cond7.preheader ], [ %indvars.iv.next141.1, %for.body9 ] br i1 %lcmp.mod.not, label %for.cond7.for.inc25_crit_edge, label %for.body9.epil for.body9.epil: ; preds = %for.cond7.for.inc25_crit_edge.unr-lcssa %15 = add nuw nsw i64 %indvars.iv140.unr, %indvars.iv144 %arrayidx.epil = getelementptr inbounds [255 x i32], ptr @d, i64 0, i64 %15 %16 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %17 = trunc i64 %15 to i32 %add11.epil = add nsw i32 %16, %17 %cmp12.epil = icmp slt i32 %add11.epil, 0 %spec.select.epil = call i32 @llvm.smin.i32(i32 %add11.epil, i32 %add13) %k.0.epil = select i1 %cmp12.epil, i32 0, i32 %spec.select.epil %idxprom20.epil = sext i32 %k.0.epil to i64 %arrayidx21.epil = getelementptr inbounds [255 x [255 x i8]], ptr @g, i64 0, i64 %indvars.iv144, i64 %idxprom20.epil store i8 1, ptr %arrayidx21.epil, align 1, !tbaa !11 br label %for.cond7.for.inc25_crit_edge for.cond7.for.inc25_crit_edge: ; preds = %for.cond7.for.inc25_crit_edge.unr-lcssa, %for.body9.epil %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1 %exitcond148.not = icmp eq i64 %indvars.iv.next145, %wide.trip.count147 br i1 %exitcond148.not, label %for.cond28.preheader, label %for.cond7.preheader, !llvm.loop !13 for.cond66.preheader: ; preds = %for.cond32.for.inc63_crit_edge.split %idxprom78 = sext i32 %add29.pre-phi171 to i64 br i1 %cmp5.not120, label %for.end85, label %for.body69.preheader for.body69.preheader: ; preds = %for.cond66.preheader %wide.trip.count167 = zext i32 %add29.pre-phi171 to i64 br label %for.body69 for.cond32.preheader: ; preds = %for.cond32.preheader.preheader, %for.cond32.for.inc63_crit_edge.split %indvars.iv159 = phi i64 [ 0, %for.cond32.preheader.preheader ], [ %indvars.iv.next160, %for.cond32.for.inc63_crit_edge.split ] br label %for.cond36.preheader for.cond36.preheader: ; preds = %for.cond32.preheader, %for.cond36.for.inc60_crit_edge %indvars.iv154 = phi i64 [ 0, %for.cond32.preheader ], [ %indvars.iv.next155, %for.cond36.for.inc60_crit_edge ] %arrayidx43 = getelementptr inbounds [255 x [255 x i8]], ptr @g, i64 0, i64 %indvars.iv154, i64 %indvars.iv159 %18 = load i8, ptr %arrayidx43, align 1, !tbaa !11 %19 = icmp eq i8 %18, 0 br i1 %19, label %for.cond36.for.inc60_crit_edge, label %for.body39 for.body39thread-pre-split: ; preds = %for.inc57 %.pr = load i8, ptr %arrayidx43, align 1, !tbaa !11 br label %for.body39 for.body39: ; preds = %for.cond36.preheader, %for.body39thread-pre-split %20 = phi i8 [ %.pr, %for.body39thread-pre-split ], [ 1, %for.cond36.preheader ] %indvars.iv149 = phi i64 [ %indvars.iv.next150, %for.body39thread-pre-split ], [ 0, %for.cond36.preheader ] %tobool44.not = icmp eq i8 %20, 0 br i1 %tobool44.not, label %for.inc57, label %land.lhs.true land.lhs.true: ; preds = %for.body39 %arrayidx48 = getelementptr inbounds [255 x [255 x i8]], ptr @g, i64 0, i64 %indvars.iv159, i64 %indvars.iv149 %21 = load i8, ptr %arrayidx48, align 1, !tbaa !11 %tobool50.not = icmp eq i8 %21, 0 br i1 %tobool50.not, label %for.inc57, label %if.then51 if.then51: ; preds = %land.lhs.true %arrayidx55 = getelementptr inbounds [255 x [255 x i8]], ptr @g, i64 0, i64 %indvars.iv154, i64 %indvars.iv149 store i8 1, ptr %arrayidx55, align 1, !tbaa !11 br label %for.inc57 for.inc57: ; preds = %for.body39, %land.lhs.true, %if.then51 %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1 %exitcond153 = icmp eq i64 %indvars.iv.next150, %wide.trip.count162 br i1 %exitcond153, label %for.cond36.for.inc60_crit_edge, label %for.body39thread-pre-split, !llvm.loop !14 for.cond36.for.inc60_crit_edge: ; preds = %for.inc57, %for.cond36.preheader %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1 %exitcond158 = icmp eq i64 %indvars.iv.next155, %wide.trip.count162 br i1 %exitcond158, label %for.cond32.for.inc63_crit_edge.split, label %for.cond36.preheader, !llvm.loop !16 for.cond32.for.inc63_crit_edge.split: ; preds = %for.cond36.for.inc60_crit_edge %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1 %exitcond163 = icmp eq i64 %indvars.iv.next160, %wide.trip.count162 br i1 %exitcond163, label %for.cond66.preheader, label %for.cond32.preheader, !llvm.loop !17 for.body69: ; preds = %for.body69.preheader, %for.inc83 %indvars.iv164 = phi i64 [ 0, %for.body69.preheader ], [ %indvars.iv.next165, %for.inc83 ] %arrayidx71 = getelementptr inbounds [255 x i8], ptr @g, i64 0, i64 %indvars.iv164 %22 = load i8, ptr %arrayidx71, align 1, !tbaa !11 %tobool73.not = icmp eq i8 %22, 0 br i1 %tobool73.not, label %for.inc83, label %land.lhs.true74 land.lhs.true74: ; preds = %for.body69 %arrayidx79 = getelementptr inbounds [255 x [255 x i8]], ptr @g, i64 0, i64 %indvars.iv164, i64 %idxprom78 %23 = load i8, ptr %arrayidx79, align 1, !tbaa !11 %tobool80.not = icmp eq i8 %23, 0 br i1 %tobool80.not, label %for.end85, label %for.inc83 for.inc83: ; preds = %for.body69, %land.lhs.true74 %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1 %exitcond168.not = icmp eq i64 %indvars.iv.next165, %wide.trip.count167 br i1 %exitcond168.not, label %for.end85, label %for.body69, !llvm.loop !18 for.end85: ; preds = %for.inc83, %land.lhs.true74, %for.cond28.preheader, %for.cond66.preheader %cond = phi ptr [ @.str.1, %for.cond66.preheader ], [ @.str.1, %for.cond28.preheader ], [ @.str.2, %land.lhs.true74 ], [ @.str.1, %for.inc83 ] %call87 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %tobool = icmp ne i32 %call, 0 %24 = load i32, ptr %m, align 4 %cmp = icmp sgt i32 %24, 0 %25 = select i1 %tobool, i1 %cmp, i1 false br i1 %25, label %while.body, label %while.end, !llvm.loop !19 while.end: ; preds = %for.end85, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #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 @puts(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) #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 = { 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 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !15} !15 = !{!"llvm.loop.unswitch.partial.disable"} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include<stdio.h> int main(void){ int n,a,b,c,N; scanf("%d",&n); a=n%10; if(a==9) a-=8; else a+=8; n/=10; b=n%10; if(b==9) b-=8; else b+=8; n/=10; c=n; if(c==9) c-=8; else c+=8; N=(100*c)+(10*b)+a; printf("%d\n",N); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153947/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153947/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %0, 10 %cmp = icmp eq i32 %rem, 9 %add = add nsw i32 %rem, 8 %a.0 = select i1 %cmp, i32 1, i32 %add %div = sdiv i32 %0, 10 %rem1 = srem i32 %div, 10 %cmp2 = icmp eq i32 %rem1, 9 %1 = mul nsw i32 %rem1, 10 %2 = add nsw i32 %1, 80 %b.0 = select i1 %cmp2, i32 10, i32 %2 %div8 = sdiv i32 %0, 100 store i32 %div8, ptr %n, align 4, !tbaa !5 %.off = add nsw i32 %div, -90 %cmp9 = icmp ult i32 %.off, 10 %3 = mul nsw i32 %div8, 100 %4 = add i32 %3, 800 %c.0 = select i1 %cmp9, i32 100, i32 %4 %add16 = add i32 %c.0, %a.0 %add17 = add i32 %add16, %b.0 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add17) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ char n[5]; int i,j; scanf("%s",n); for(j=0;n[j]!='\0';j++); for(i=0;i<j;i++){ if(n[i]=='9'){ n[i]='1'; }else if(n[i]=='1'){ n[i]='9'; } } printf("%s",n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153990/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153990/source.c" target datalayout = "e-m:e-p270: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: %n = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) br label %for.cond for.cond: ; preds = %for.cond, %entry %indvars.iv40 = phi i32 [ %indvars.iv.next41, %for.cond ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [5 x i8], ptr %n, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %0, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next41 = add i32 %indvars.iv40, 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 %cmp334.not = icmp eq i64 %1, 0 br i1 %cmp334.not, label %for.end24, label %for.body5.preheader for.body5.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %indvars.iv40 to i64 %xtraiter = and i64 %wide.trip.count, 1 %2 = icmp eq i32 %indvars.iv40, 1 br i1 %2, label %for.end24.loopexit.unr-lcssa, label %for.body5.preheader.new for.body5.preheader.new: ; preds = %for.body5.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body5 for.body5: ; preds = %for.inc22.1, %for.body5.preheader.new %indvars.iv37 = phi i64 [ 0, %for.body5.preheader.new ], [ %indvars.iv.next38.1, %for.inc22.1 ] %niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.inc22.1 ] %arrayidx7 = getelementptr inbounds [5 x i8], ptr %n, i64 0, i64 %indvars.iv37 %3 = load i8, ptr %arrayidx7, align 1, !tbaa !5 switch i8 %3, label %for.inc22 [ i8 57, label %for.inc22.sink.split i8 49, label %if.then18 ] if.then18: ; preds = %for.body5 br label %for.inc22.sink.split for.inc22.sink.split: ; preds = %for.body5, %if.then18 %.sink = phi i8 [ 57, %if.then18 ], [ 49, %for.body5 ] store i8 %.sink, ptr %arrayidx7, align 1, !tbaa !5 br label %for.inc22 for.inc22: ; preds = %for.inc22.sink.split, %for.body5 %indvars.iv.next38 = or i64 %indvars.iv37, 1 %arrayidx7.1 = getelementptr inbounds [5 x i8], ptr %n, i64 0, i64 %indvars.iv.next38 %4 = load i8, ptr %arrayidx7.1, align 1, !tbaa !5 switch i8 %4, label %for.inc22.1 [ i8 57, label %for.inc22.sink.split.1 i8 49, label %if.then18.1 ] if.then18.1: ; preds = %for.inc22 br label %for.inc22.sink.split.1 for.inc22.sink.split.1: ; preds = %if.then18.1, %for.inc22 %.sink.1 = phi i8 [ 57, %if.then18.1 ], [ 49, %for.inc22 ] store i8 %.sink.1, ptr %arrayidx7.1, align 1, !tbaa !5 br label %for.inc22.1 for.inc22.1: ; preds = %for.inc22.sink.split.1, %for.inc22 %indvars.iv.next38.1 = add nuw nsw i64 %indvars.iv37, 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.end24.loopexit.unr-lcssa, label %for.body5, !llvm.loop !10 for.end24.loopexit.unr-lcssa: ; preds = %for.inc22.1, %for.body5.preheader %indvars.iv37.unr = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next38.1, %for.inc22.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end24, label %for.body5.epil for.body5.epil: ; preds = %for.end24.loopexit.unr-lcssa %arrayidx7.epil = getelementptr inbounds [5 x i8], ptr %n, i64 0, i64 %indvars.iv37.unr %5 = load i8, ptr %arrayidx7.epil, align 1, !tbaa !5 switch i8 %5, label %for.end24 [ i8 57, label %for.inc22.sink.split.epil i8 49, label %if.then18.epil ] if.then18.epil: ; preds = %for.body5.epil br label %for.inc22.sink.split.epil for.inc22.sink.split.epil: ; preds = %if.then18.epil, %for.body5.epil %.sink.epil = phi i8 [ 57, %if.then18.epil ], [ 49, %for.body5.epil ] store i8 %.sink.epil, ptr %arrayidx7.epil, align 1, !tbaa !5 br label %for.end24 for.end24: ; preds = %for.end24.loopexit.unr-lcssa, %for.inc22.sink.split.epil, %for.body5.epil, %for.cond2.preheader %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %n) call void @llvm.lifetime.end.p0(i64 5, 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 = !{!"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){ // Your code here! int n; scanf("%d",&n); int i,p[4],r; for(i=0;i<3;++i){ r = n%10; n = n/10; p[i] = r; } for(i=0; i<3;++i){ if(p[i] == 1) p[i] = 9; else if (p[i] == 9) p[i] = 1; } printf("%d%d%d",p[2],p[1],p[0]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154076/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154076/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\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) %n.promoted = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %n.promoted, 10 %div = sdiv i32 %n.promoted, 10 %rem.1 = srem i32 %div, 10 %div.1 = sdiv i32 %n.promoted, 100 %rem.2 = srem i32 %div.1, 10 %div.2 = sdiv i32 %n.promoted, 1000 store i32 %div.2, ptr %n, align 4, !tbaa !5 switch i32 %rem, label %for.inc16 [ i32 1, label %if.then i32 9, label %if.then12 ] if.then: ; preds = %entry br label %for.inc16 if.then12: ; preds = %entry br label %for.inc16 for.inc16: ; preds = %entry, %if.then, %if.then12 %p.sroa.0.0 = phi i32 [ %rem, %entry ], [ 1, %if.then12 ], [ 9, %if.then ] switch i32 %rem.1, label %for.inc16.1 [ i32 1, label %if.then.1 i32 9, label %if.then12.1 ] if.then12.1: ; preds = %for.inc16 br label %for.inc16.1 if.then.1: ; preds = %for.inc16 br label %for.inc16.1 for.inc16.1: ; preds = %if.then.1, %if.then12.1, %for.inc16 %p.sroa.7.0 = phi i32 [ %rem.1, %for.inc16 ], [ 1, %if.then12.1 ], [ 9, %if.then.1 ] switch i32 %rem.2, label %for.inc16.2 [ i32 1, label %if.then.2 i32 9, label %if.then12.2 ] if.then12.2: ; preds = %for.inc16.1 br label %for.inc16.2 if.then.2: ; preds = %for.inc16.1 br label %for.inc16.2 for.inc16.2: ; preds = %if.then.2, %if.then12.2, %for.inc16.1 %p.sroa.12.0 = phi i32 [ %rem.2, %for.inc16.1 ], [ 1, %if.then12.2 ], [ 9, %if.then.2 ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p.sroa.12.0, i32 noundef %p.sroa.7.0, i32 noundef %p.sroa.0.0) 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 <string.h> int main(void){ int i, n; char x[10]; scanf("%d", &n); sprintf(x, "%d", n); for(i = 0; i < 3; i++){ if(x[i] == '0' + 9){ x[i] = 1; }else if(x[i] == '0' + 1) { x[i] = 9; } } for(i = 0; i < 3; i++){ printf("%d",x[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154126/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154126/source.c" target datalayout = "e-m:e-p270: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: %n = alloca i32, align 4 %x = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %call1 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %x, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0) #3 %1 = load i8, ptr %x, align 1, !tbaa !9 switch i8 %1, label %for.inc [ i8 57, label %if.then i8 49, label %if.then11 ] if.then: ; preds = %entry br label %for.inc if.then11: ; preds = %entry br label %for.inc for.inc: ; preds = %entry, %if.then, %if.then11 %2 = phi i8 [ %1, %entry ], [ 1, %if.then ], [ 9, %if.then11 ] %arrayidx.1 = getelementptr inbounds [10 x i8], ptr %x, i64 0, i64 1 %3 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 switch i8 %3, label %for.inc.1 [ i8 57, label %if.then.1 i8 49, label %if.then11.1 ] if.then11.1: ; preds = %for.inc br label %for.inc.1 if.then.1: ; preds = %for.inc br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.then11.1, %for.inc %4 = phi i8 [ 1, %if.then.1 ], [ 9, %if.then11.1 ], [ %3, %for.inc ] %arrayidx.2 = getelementptr inbounds [10 x i8], ptr %x, i64 0, i64 2 %5 = load i8, ptr %arrayidx.2, align 1, !tbaa !9 switch i8 %5, label %for.inc.2 [ i8 57, label %if.then.2 i8 49, label %if.then11.2 ] if.then11.2: ; preds = %for.inc.1 br label %for.inc.2 if.then.2: ; preds = %for.inc.1 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %if.then11.2, %for.inc.1 %6 = phi i8 [ 1, %if.then.2 ], [ 9, %if.then11.2 ], [ %5, %for.inc.1 ] %conv21 = sext i8 %2 to i32 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %conv21) %conv21.1 = sext i8 %4 to i32 %call22.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %conv21.1) %conv21.2 = sext i8 %6 to i32 %call22.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %conv21.2) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, 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 = !{!7, !7, i64 0}