Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> #include <math.h> int main(void) { // 1_4-B Circle double r,s,l; //double pi=3.1415926; scanf("%lf",&r); s = r*r*M_PI; l = 2*r*M_PI; printf(" %.5lf %.5lf",s,l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262674/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262674/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c" %.5lf %.5lf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main(void) { double r,l,S; scanf("%lf",&r); S=M_PI*r*r; l=2*M_PI*r; printf("%.6lf %.6lf",S,l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262717/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262717/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%.6lf %.6lf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D18 %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { double r; double men,syu; scanf("%lf", &r); men = r * r * 3.14159265358979; syu = 2 * r * 3.14159265358979; printf("%lf %lf\n", men, syu); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262760/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262760/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D11 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D11 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main(void) { double r,s,l; scanf("%lf",&r); s = r*r*M_PI; l = 2*r*M_PI; printf("%.6lf %.6lf\n",s,l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262810/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262810/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%.6lf %.6lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main (void){ double r,pi=3.141592653589; scanf("%lf",&r); printf("%lf %lf\n",r*r*pi,2*r*pi); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262854/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262854/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main(){ double r; double c; double area; scanf("%lf",&r); c = r*2*M_PI; area = r*r*M_PI; printf("%.6f %.6f\n",area,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262898/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262898/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%.6f %.6f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 2.000000e+00 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, %0 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3, double noundef %mul1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main(int argc, const char * argv[]) { // insert code here... double r; scanf("%lf", &r); printf("%f %f\n", r*r*M_PI, r*2*M_PI); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262940/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262940/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\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: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> #define M_PI 3.14159265358979 int main(void){ double num; //????????\??? scanf("%lf",&num); double circumference=num*2*M_PI; double circlearea=num*num*M_PI; printf("%.6f %.6f\n",circlearea,circumference); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262984/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262984/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%.6f %.6f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %num) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load double, ptr %num, align 8, !tbaa !5 %mul = fmul double %0, 2.000000e+00 %mul1 = fmul double %mul, 0x400921FB54442D11 %mul2 = fmul double %0, %0 %mul3 = fmul double %mul2, 0x400921FB54442D11 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3, double noundef %mul1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %num) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { double pi, are, circ, r; pi = 3.141592653589; scanf("%lf", &r); are = r*r*pi; circ = r*2*pi; printf("%f %f\n", are,circ); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263026/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263026/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { long int k,r,n,i ; scanf("%ld %ld",&k,&r) ; for( i=1 ;i<=9 ;i++ ) { n=i*k ; if( n%10==r ) break ; } if(i!=10) printf("%ld\n", i) ; else { for(i=1 ;i<=12 ;i++) if( n*i%10==0 ) break ; printf("%ld\n", i) ; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26307/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26307/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i64, align 8 %r = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %r) %0 = load i64, ptr %k, align 8, !tbaa !5 %1 = load i64, ptr %r, align 8, !tbaa !5 %2 = mul i64 %0, 9 %rem = srem i64 %0, 10 %cmp1 = icmp eq i64 %rem, %1 br i1 %cmp1, label %if.end17, label %for.inc for.inc: ; preds = %entry %mul.1 = shl nsw i64 %0, 1 %rem.1 = srem i64 %mul.1, 10 %cmp1.1 = icmp eq i64 %rem.1, %1 br i1 %cmp1.1, label %if.end17, label %for.inc.1 for.inc.1: ; preds = %for.inc %mul.2 = mul nsw i64 %0, 3 %rem.2 = srem i64 %mul.2, 10 %cmp1.2 = icmp eq i64 %rem.2, %1 br i1 %cmp1.2, label %if.end17, label %for.inc.2 for.inc.2: ; preds = %for.inc.1 %mul.3 = shl nsw i64 %0, 2 %rem.3 = srem i64 %mul.3, 10 %cmp1.3 = icmp eq i64 %rem.3, %1 br i1 %cmp1.3, label %if.end17, label %for.inc.3 for.inc.3: ; preds = %for.inc.2 %mul.4 = mul nsw i64 %0, 5 %rem.4 = srem i64 %mul.4, 10 %cmp1.4 = icmp eq i64 %rem.4, %1 br i1 %cmp1.4, label %if.end17, label %for.inc.4 for.inc.4: ; preds = %for.inc.3 %mul.5 = mul nsw i64 %0, 6 %rem.5 = srem i64 %mul.5, 10 %cmp1.5 = icmp eq i64 %rem.5, %1 br i1 %cmp1.5, label %if.end17, label %for.inc.5 for.inc.5: ; preds = %for.inc.4 %mul.6 = mul nsw i64 %0, 7 %rem.6 = srem i64 %mul.6, 10 %cmp1.6 = icmp eq i64 %rem.6, %1 br i1 %cmp1.6, label %if.end17, label %for.inc.6 for.inc.6: ; preds = %for.inc.5 %mul.7 = shl nsw i64 %0, 3 %rem.7 = srem i64 %mul.7, 10 %cmp1.7 = icmp eq i64 %rem.7, %1 br i1 %cmp1.7, label %if.end17, label %for.inc.7 for.inc.7: ; preds = %for.inc.6 %rem.8 = srem i64 %2, 10 %cmp1.8 = icmp eq i64 %rem.8, %1 br i1 %cmp1.8, label %if.end17, label %for.body7.preheader for.body7.preheader: ; preds = %for.inc.7 %cmp10 = icmp eq i64 %rem.8, 0 br i1 %cmp10, label %if.end17, label %for.inc13 for.inc13: ; preds = %for.body7.preheader %mul8.1 = mul i64 %0, 18 %rem9.1 = srem i64 %mul8.1, 10 %cmp10.1 = icmp eq i64 %rem9.1, 0 br i1 %cmp10.1, label %if.end17, label %for.inc13.1 for.inc13.1: ; preds = %for.inc13 %mul8.2 = mul i64 %0, 27 %rem9.2 = srem i64 %mul8.2, 10 %cmp10.2 = icmp eq i64 %rem9.2, 0 br i1 %cmp10.2, label %if.end17, label %for.inc13.2 for.inc13.2: ; preds = %for.inc13.1 %mul8.3 = mul i64 %0, 36 %rem9.3 = srem i64 %mul8.3, 10 %cmp10.3 = icmp eq i64 %rem9.3, 0 br i1 %cmp10.3, label %if.end17, label %for.inc13.3 for.inc13.3: ; preds = %for.inc13.2 %mul8.4 = mul i64 %0, 45 %rem9.4 = srem i64 %mul8.4, 10 %cmp10.4 = icmp eq i64 %rem9.4, 0 br i1 %cmp10.4, label %if.end17, label %for.inc13.4 for.inc13.4: ; preds = %for.inc13.3 %mul8.5 = mul i64 %0, 54 %rem9.5 = srem i64 %mul8.5, 10 %cmp10.5 = icmp eq i64 %rem9.5, 0 br i1 %cmp10.5, label %if.end17, label %for.inc13.5 for.inc13.5: ; preds = %for.inc13.4 %mul8.6 = mul i64 %0, 63 %rem9.6 = srem i64 %mul8.6, 10 %cmp10.6 = icmp eq i64 %rem9.6, 0 br i1 %cmp10.6, label %if.end17, label %for.inc13.6 for.inc13.6: ; preds = %for.inc13.5 %mul8.7 = mul i64 %0, 72 %rem9.7 = srem i64 %mul8.7, 10 %cmp10.7 = icmp eq i64 %rem9.7, 0 br i1 %cmp10.7, label %if.end17, label %for.inc13.7 for.inc13.7: ; preds = %for.inc13.6 %mul8.8 = mul i64 %0, 81 %rem9.8 = srem i64 %mul8.8, 10 %cmp10.8 = icmp eq i64 %rem9.8, 0 %spec.select = select i1 %cmp10.8, i64 9, i64 10 br label %if.end17 if.end17: ; preds = %for.body7.preheader, %for.inc13, %for.inc13.1, %for.inc13.2, %for.inc13.3, %for.inc13.4, %for.inc13.5, %for.inc13.6, %for.inc13.7, %for.inc.7, %for.inc.6, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry %i.1.lcssa.sink = phi i64 [ 1, %entry ], [ 2, %for.inc ], [ 3, %for.inc.1 ], [ 4, %for.inc.2 ], [ 5, %for.inc.3 ], [ 6, %for.inc.4 ], [ 7, %for.inc.5 ], [ 8, %for.inc.6 ], [ 9, %for.inc.7 ], [ 1, %for.body7.preheader ], [ 2, %for.inc13 ], [ 3, %for.inc13.1 ], [ 4, %for.inc13.2 ], [ 5, %for.inc13.3 ], [ 6, %for.inc13.4 ], [ 7, %for.inc13.5 ], [ 8, %for.inc13.6 ], [ %spec.select, %for.inc13.7 ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %i.1.lcssa.sink) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #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<math.h> #include<string.h> int main() { int n,i,c,ans; scanf("%d%d",&n,&c); for(i=1,n=n%10;i<10;i++) { if (n==0) { printf("%d\n",i); return 0; } else { if((n*i)%10==c||(n*i)%10==0)break; } } printf("%d\n",i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26312/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26312/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %c = 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 %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %c) %0 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %0, 10 store i32 %rem, ptr %n, align 4, !tbaa !5 %cmp1 = icmp eq i32 %rem, 0 %1 = load i32, ptr %c, align 4 %cmp4 = icmp eq i32 %rem, %1 %or.cond = select i1 %cmp1, i1 true, i1 %cmp4 br i1 %or.cond, label %cleanup, label %for.inc for.inc: ; preds = %entry %mul.1 = shl nsw i32 %rem, 1 %rem3.1 = srem i32 %mul.1, 10 %cmp4.1 = icmp eq i32 %rem3.1, %1 %cmp7.1 = icmp eq i32 %rem3.1, 0 %or.cond.1 = or i1 %cmp7.1, %cmp4.1 br i1 %or.cond.1, label %cleanup, label %for.inc.1 for.inc.1: ; preds = %for.inc %2 = trunc i32 %rem to i8 %rem3.2.lhs.trunc = mul nsw i8 %2, 3 %rem3.221 = srem i8 %rem3.2.lhs.trunc, 10 %rem3.2.sext = sext i8 %rem3.221 to i32 %cmp4.2 = icmp eq i32 %1, %rem3.2.sext %cmp7.2 = icmp eq i8 %rem3.221, 0 %or.cond.2 = or i1 %cmp7.2, %cmp4.2 br i1 %or.cond.2, label %cleanup, label %for.inc.2 for.inc.2: ; preds = %for.inc.1 %mul.3 = shl nsw i32 %rem, 2 %rem3.3 = srem i32 %mul.3, 10 %cmp4.3 = icmp eq i32 %rem3.3, %1 %cmp7.3 = icmp eq i32 %rem3.3, 0 %or.cond.3 = or i1 %cmp7.3, %cmp4.3 br i1 %or.cond.3, label %cleanup, label %for.inc.3 for.inc.3: ; preds = %for.inc.2 %3 = trunc i32 %rem to i8 %rem3.4.lhs.trunc = mul nsw i8 %3, 5 %rem3.422 = srem i8 %rem3.4.lhs.trunc, 10 %rem3.4.sext = sext i8 %rem3.422 to i32 %cmp4.4 = icmp eq i32 %1, %rem3.4.sext %cmp7.4 = icmp eq i8 %rem3.422, 0 %or.cond.4 = or i1 %cmp7.4, %cmp4.4 br i1 %or.cond.4, label %cleanup, label %for.inc.4 for.inc.4: ; preds = %for.inc.3 %4 = trunc i32 %rem to i8 %rem3.5.lhs.trunc = mul nsw i8 %4, 6 %rem3.523 = srem i8 %rem3.5.lhs.trunc, 10 %rem3.5.sext = sext i8 %rem3.523 to i32 %cmp4.5 = icmp eq i32 %1, %rem3.5.sext %cmp7.5 = icmp eq i8 %rem3.523, 0 %or.cond.5 = or i1 %cmp7.5, %cmp4.5 br i1 %or.cond.5, label %cleanup, label %for.inc.5 for.inc.5: ; preds = %for.inc.4 %5 = trunc i32 %rem to i8 %rem3.6.lhs.trunc = mul nsw i8 %5, 7 %rem3.624 = srem i8 %rem3.6.lhs.trunc, 10 %rem3.6.sext = sext i8 %rem3.624 to i32 %cmp4.6 = icmp eq i32 %1, %rem3.6.sext %cmp7.6 = icmp eq i8 %rem3.624, 0 %or.cond.6 = or i1 %cmp7.6, %cmp4.6 br i1 %or.cond.6, label %cleanup, label %for.inc.6 for.inc.6: ; preds = %for.inc.5 %mul.7 = shl nsw i32 %rem, 3 %rem3.7 = srem i32 %mul.7, 10 %cmp4.7 = icmp eq i32 %rem3.7, %1 %cmp7.7 = icmp eq i32 %rem3.7, 0 %or.cond.7 = or i1 %cmp7.7, %cmp4.7 br i1 %or.cond.7, label %cleanup, label %for.inc.7 for.inc.7: ; preds = %for.inc.6 %6 = trunc i32 %rem to i8 %rem3.8.lhs.trunc = mul i8 %6, 9 %rem3.825 = srem i8 %rem3.8.lhs.trunc, 10 %rem3.8.sext = sext i8 %rem3.825 to i32 %cmp4.8 = icmp eq i32 %1, %rem3.8.sext %cmp7.8 = icmp eq i8 %rem3.825, 0 %or.cond.8 = or i1 %cmp7.8, %cmp4.8 %spec.select = select i1 %or.cond.8, i32 9, i32 10 br label %cleanup cleanup: ; preds = %for.inc, %for.inc.1, %for.inc.2, %for.inc.3, %for.inc.4, %for.inc.5, %for.inc.6, %for.inc.7, %entry %i.0.lcssa.sink = phi i32 [ 1, %entry ], [ 2, %for.inc ], [ 3, %for.inc.1 ], [ 4, %for.inc.2 ], [ 5, %for.inc.3 ], [ 6, %for.inc.4 ], [ 7, %for.inc.5 ], [ 8, %for.inc.6 ], [ %spec.select, %for.inc.7 ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #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> #include<math.h> int main(){ double r; double size, alou; scanf("%lf", &r); size = r * r * M_PI; alou = r * 2 * M_PI; printf("%f %f", size, alou); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263163/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263163/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%f %f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main(void) { double pr, tpr, r; scanf("%lf", &r); pr = M_PI * r * r; tpr = M_PI * 2 * r; printf("%lf %lf\n", pr, tpr); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263206/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263206/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D18 %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main() { int k , r , n; scanf("%d %d",&k ,&r); if( (k <= r) && ( r % k == 0)) { printf("%d\n",r / k); return 0; } for( n = 10; ; n = n + 10 ) { if ( ( ( n + r) % k ) == 0 ) { printf("%d\n",(n + r)/ k); return 0; } if ( ( ( n ) % k ) == 0 ) { printf("%d\n", n / k); return 0; } } printf("%d\n",(n + r)/ k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26325/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26325/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %k = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %r) %0 = load i32, ptr %k, align 4, !tbaa !5 %1 = load i32, ptr %r, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 br i1 %cmp.not, label %if.end, label %land.lhs.true land.lhs.true: ; preds = %entry %rem = srem i32 %1, %0 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %cleanup, label %if.end if.end: ; preds = %land.lhs.true, %entry %add26 = add nsw i32 %1, 10 %rem327 = srem i32 %add26, %0 %cmp428 = icmp eq i32 %rem327, 0 br i1 %cmp428, label %cleanup, label %if.end9 if.end9: ; preds = %if.end, %for.inc %n.029 = phi i32 [ %add16, %for.inc ], [ 10, %if.end ] %rem10 = srem i32 %n.029, %0 %cmp11 = icmp eq i32 %rem10, 0 br i1 %cmp11, label %cleanup, label %for.inc for.inc: ; preds = %if.end9 %add16 = add nuw nsw i32 %n.029, 10 %add = add nsw i32 %add16, %1 %rem3 = srem i32 %add, %0 %cmp4 = icmp eq i32 %rem3, 0 br i1 %cmp4, label %cleanup, label %if.end9 cleanup: ; preds = %if.end9, %for.inc, %if.end, %land.lhs.true %n.029.lcssa.sink = phi i32 [ %1, %land.lhs.true ], [ %add26, %if.end ], [ %add, %for.inc ], [ %n.029, %if.end9 ] %div13 = sdiv i32 %n.029.lcssa.sink, %0 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div13) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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> int main(int argc, const char * argv[]) { double r, l, s; scanf("%lf", &r); l = r * 2 * M_PI; s = r * r * M_PI; printf("%lf %lf\n", s, l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263293/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263293/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\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: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 2.000000e+00 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, %0 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3, double noundef %mul1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> #define PI 3.141592653589793 int main(void){ double r; scanf("%lf",&r); printf("%f %f",r*r*PI,2*r*PI); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263336/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263336/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%f %f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int n,k,a[500]; scanf("%d %d\n",&n,&k); int i=0; for(i=0;i<n;i++){ scanf("%d ",a+i); } int steps=0,temp; for(i=1;i<n;i++) { if(a[i-1]+a[i]<=k) { temp=a[i]; a[i]=k-a[i-1]; steps+=(a[i]-temp); } } printf("%d\n",steps); for(i=0;i<n;i++){ printf("%d ",a[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26338/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26338/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %a = alloca [500 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp47 = icmp sgt i32 %0, 0 br i1 %cmp47, label %for.body, label %for.end22 for.cond2.preheader: ; preds = %for.body %cmp349 = icmp sgt i32 %4, 1 br i1 %cmp349, label %for.body4.lr.ph, label %for.end22 for.body4.lr.ph: ; preds = %for.cond2.preheader %1 = load i32, ptr %k, align 4, !tbaa !5 %wide.trip.count = zext i32 %4 to i64 %.pre = load i32, ptr %a, align 16, !tbaa !5 %2 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %2, 1 %3 = icmp eq i32 %4, 2 br i1 %3, label %for.end22.loopexit.unr-lcssa, label %for.body4.lr.ph.new for.body4.lr.ph.new: ; preds = %for.body4.lr.ph %unroll_iter = and i64 %2, -2 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.inc20.1, %for.body4.lr.ph.new %6 = phi i32 [ %.pre, %for.body4.lr.ph.new ], [ %10, %for.inc20.1 ] %indvars.iv57 = phi i64 [ 1, %for.body4.lr.ph.new ], [ %indvars.iv.next58.1, %for.inc20.1 ] %steps.050 = phi i32 [ 0, %for.body4.lr.ph.new ], [ %steps.1.1, %for.inc20.1 ] %niter = phi i64 [ 0, %for.body4.lr.ph.new ], [ %niter.next.1, %for.inc20.1 ] %arrayidx6 = getelementptr inbounds [500 x i32], ptr %a, i64 0, i64 %indvars.iv57 %7 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %add = add nsw i32 %7, %6 %cmp7.not = icmp sgt i32 %add, %1 br i1 %cmp7.not, label %for.inc20, label %if.then if.then: ; preds = %for.body4 %sub13 = sub nsw i32 %1, %6 store i32 %sub13, ptr %arrayidx6, align 4, !tbaa !5 %sub18 = sub i32 %steps.050, %7 %add19 = add i32 %sub18, %sub13 br label %for.inc20 for.inc20: ; preds = %for.body4, %if.then %8 = phi i32 [ %sub13, %if.then ], [ %7, %for.body4 ] %steps.1 = phi i32 [ %add19, %if.then ], [ %steps.050, %for.body4 ] %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %arrayidx6.1 = getelementptr inbounds [500 x i32], ptr %a, i64 0, i64 %indvars.iv.next58 %9 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5 %add.1 = add nsw i32 %9, %8 %cmp7.not.1 = icmp sgt i32 %add.1, %1 br i1 %cmp7.not.1, label %for.inc20.1, label %if.then.1 if.then.1: ; preds = %for.inc20 %sub13.1 = sub nsw i32 %1, %8 store i32 %sub13.1, ptr %arrayidx6.1, align 4, !tbaa !5 %sub18.1 = sub i32 %steps.1, %9 %add19.1 = add i32 %sub18.1, %sub13.1 br label %for.inc20.1 for.inc20.1: ; preds = %if.then.1, %for.inc20 %10 = phi i32 [ %sub13.1, %if.then.1 ], [ %9, %for.inc20 ] %steps.1.1 = phi i32 [ %add19.1, %if.then.1 ], [ %steps.1, %for.inc20 ] %indvars.iv.next58.1 = add nuw nsw i64 %indvars.iv57, 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.end22.loopexit.unr-lcssa, label %for.body4, !llvm.loop !11 for.end22.loopexit.unr-lcssa: ; preds = %for.inc20.1, %for.body4.lr.ph %steps.1.lcssa.ph = phi i32 [ undef, %for.body4.lr.ph ], [ %steps.1.1, %for.inc20.1 ] %.unr = phi i32 [ %.pre, %for.body4.lr.ph ], [ %10, %for.inc20.1 ] %indvars.iv57.unr = phi i64 [ 1, %for.body4.lr.ph ], [ %indvars.iv.next58.1, %for.inc20.1 ] %steps.050.unr = phi i32 [ 0, %for.body4.lr.ph ], [ %steps.1.1, %for.inc20.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end22, label %for.body4.epil for.body4.epil: ; preds = %for.end22.loopexit.unr-lcssa %arrayidx6.epil = getelementptr inbounds [500 x i32], ptr %a, i64 0, i64 %indvars.iv57.unr %11 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %11, %.unr %cmp7.not.epil = icmp sgt i32 %add.epil, %1 br i1 %cmp7.not.epil, label %for.end22, label %if.then.epil if.then.epil: ; preds = %for.body4.epil %sub13.epil = sub nsw i32 %1, %.unr store i32 %sub13.epil, ptr %arrayidx6.epil, align 4, !tbaa !5 %sub18.epil = sub i32 %steps.050.unr, %11 %add19.epil = add i32 %sub18.epil, %sub13.epil br label %for.end22 for.end22: ; preds = %for.end22.loopexit.unr-lcssa, %if.then.epil, %for.body4.epil, %entry, %for.cond2.preheader %steps.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %steps.1.lcssa.ph, %for.end22.loopexit.unr-lcssa ], [ %add19.epil, %if.then.epil ], [ %steps.050.unr, %for.body4.epil ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %steps.0.lcssa) %12 = load i32, ptr %n, align 4, !tbaa !5 %cmp2553 = icmp sgt i32 %12, 0 br i1 %cmp2553, label %for.body26, label %for.end32 for.body26: ; preds = %for.end22, %for.body26 %indvars.iv61 = phi i64 [ %indvars.iv.next62, %for.body26 ], [ 0, %for.end22 ] %arrayidx28 = getelementptr inbounds [500 x i32], ptr %a, i64 0, i64 %indvars.iv61 %13 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %13) %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1 %14 = load i32, ptr %n, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp25 = icmp slt i64 %indvars.iv.next62, %15 br i1 %cmp25, label %for.body26, label %for.end32, !llvm.loop !12 for.end32: ; preds = %for.body26, %for.end22 call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <math.h> int main(void) { double r, c, s; while(scanf("%lf", &r) != EOF) { c = 2.0 * r * M_PI; s = r * r * M_PI; printf("%.6lf %.6lf\n", s, c); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263422/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%.6lf %.6lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %cmp.not6 = icmp eq i32 %call5, -1 br i1 %cmp.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 2.000000e+00 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, %0 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3, double noundef %mul1) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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> int main(void) { double r,pi; scanf("%lf",&r); pi=3.1415926535897932; printf("%f %f\n",r*r*pi,2*r*pi); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263488/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263488/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #define pi 3.141592653589 int main(){ double r; double s,c; scanf("%lf",&r); s = (double)r*r*pi; c = (double)2*r*pi; printf("%f %f\n",s,c); /*int FILE *fp; fp = fopen ("filename.txt","r"); if (fp!=NULL) { fscanf(fp,"Some String\n", &var); fclose (fp); }*/ }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263538/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263538/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ double r; double PI=3.14159265358979; scanf("%lf",&r); printf("%lf %lf\n",r*r*PI,2*r*PI); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263581/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263581/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D11 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D11 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<math.h> int main(){ double r,pi; scanf("%lf",&r); pi = acos(-1); printf("%lf %lf\n",pi*r*r,2*pi*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263624/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263624/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D18 %mul2 = fmul double %0, %mul %mul4 = fmul double %0, 0x401921FB54442D18 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul2, double noundef %mul4) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main(){ double r; scanf("%lf",&r); printf("%f %f\n", r*r*M_PI, 2*r*M_PI); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263668/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263668/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<math.h> int main(void){ double r; scanf("%lf",&r); printf("%f %f\n",r*r*M_PI,r*2*M_PI); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263718/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263718/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { double r; //半径 double area; //面積 double circle; //円周 double pi = 3.14159265359; //円周率 scanf("%lf", &r); area = r*r*pi; circle = 2 * pi*r; printf("%f %f\n", area, circle); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263783/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263783/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442EEA %mul3 = fmul double %0, 0x401921FB54442EEA %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main() { double r; scanf("%lf", &r); printf("%.8lf %lf\n", 3.141592653589 * r * r, 2 * 3.141592653589 * r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263826/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263826/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%.8lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB5444261E %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int k,m; scanf("%d %d", &k, &m); int i,p; for (i=1; ;i++) { p=(k*i)-m; if ((p%10==0) || ((k*i)%10==0)) { printf("%d\n", i); break; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26387/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26387/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %k = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #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 %k, ptr noundef nonnull %m) %0 = load i32, ptr %k, align 4, !tbaa !5 %1 = load i32, ptr %m, align 4, !tbaa !5 br label %for.cond for.cond: ; preds = %for.cond, %entry %i.0 = phi i32 [ 1, %entry ], [ %inc, %for.cond ] %mul = mul nsw i32 %0, %i.0 %sub = sub nsw i32 %mul, %1 %rem = srem i32 %sub, 10 %cmp = icmp eq i32 %rem, 0 %rem2 = srem i32 %mul, 10 %cmp3 = icmp eq i32 %rem2, 0 %or.cond = or i1 %cmp3, %cmp %inc = add nuw nsw i32 %i.0, 1 br i1 %or.cond, label %if.then, label %for.cond if.then: ; preds = %for.cond %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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){ double r,l,s,pie = 3.141592653589; scanf("%lf",&r); l = 2*pie*r; s = pie*r*r; printf("%lf %lf\n",s,l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263912/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263912/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul1 = fmul double %0, 0x401921FB5444261E %mul2 = fmul double %0, 0x400921FB5444261E %mul3 = fmul double %0, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3, double noundef %mul1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<math.h> int main() { int n, m; scanf("%d %d", &n, &m); int ans = (100*n+1800*m)* pow(2, m); printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263978/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263978/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 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 !5 %mul = mul nsw i32 %0, 100 %1 = load i32, ptr %m, align 4, !tbaa !5 %mul1 = mul nsw i32 %1, 1800 %add = add nsw i32 %mul1, %mul %conv = sitofp i32 %add to double %ldexp = call double @ldexp(double 1.000000e+00, i32 %1) #4 %mul4 = fmul double %ldexp, %conv %conv5 = fptosi double %mul4 to i32 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @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 willreturn declare double @ldexp(double, i32) 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 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"}
#include<stdio.h> int main(){ int unused __attribute__((unused)); char s1[10], s2[10], s3[10]; unused = scanf("%s %s %s", s1, s2, s3); s1[0] = s1[0] - ('a'-'A'); s2[0] = s2[0] - ('a'-'A'); s3[0] = s3[0] - ('a'-'A'); printf("%c%c%c", s1[0], s2[0], s3[0]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264027/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264027/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s %s\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%c%c%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s1 = alloca [10 x i8], align 1 %s2 = alloca [10 x i8], align 1 %s3 = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s1) #3 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s2) #3 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s3) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3) %0 = load i8, ptr %s1, align 1, !tbaa !5 %sub = add i8 %0, -32 store i8 %sub, ptr %s1, align 1, !tbaa !5 %1 = load i8, ptr %s2, align 1, !tbaa !5 %sub7 = add i8 %1, -32 store i8 %sub7, ptr %s2, align 1, !tbaa !5 %2 = load i8, ptr %s3, align 1, !tbaa !5 %sub12 = add i8 %2, -32 store i8 %sub12, ptr %s3, align 1, !tbaa !5 %conv16 = sext i8 %sub to i32 %conv18 = sext i8 %sub7 to i32 %conv20 = sext i8 %sub12 to i32 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv16, i32 noundef %conv18, i32 noundef %conv20) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s3) #3 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s2) #3 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s1) #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> #include<ctype.h> int main(void){ char s[3][10]; int i; for(i = 0;i < 3;i++){ scanf("%s",s[i]); } for(i = 0;i < 3;i++){ printf("%c",toupper(s[i][0])); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264078/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264078/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [3 x [10 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %arrayidx.1 = getelementptr inbounds [3 x [10 x i8]], ptr %s, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [3 x [10 x i8]], ptr %s, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %call4 = tail call ptr @__ctype_toupper_loc() #6 %0 = load ptr, ptr %call4, align 8, !tbaa !5 %1 = load i8, ptr %s, align 16, !tbaa !9 %idxprom8 = sext i8 %1 to i64 %arrayidx9 = getelementptr inbounds i32, ptr %0, i64 %idxprom8 %2 = load i32, ptr %arrayidx9, align 4, !tbaa !10 %putchar20 = call i32 @putchar(i32 %2) %3 = load ptr, ptr %call4, align 8, !tbaa !5 %4 = load i8, ptr %arrayidx.1, align 2, !tbaa !9 %idxprom8.1 = sext i8 %4 to i64 %arrayidx9.1 = getelementptr inbounds i32, ptr %3, i64 %idxprom8.1 %5 = load i32, ptr %arrayidx9.1, align 4, !tbaa !10 %putchar20.1 = call i32 @putchar(i32 %5) %6 = load ptr, ptr %call4, align 8, !tbaa !5 %7 = load i8, ptr %arrayidx.2, align 4, !tbaa !9 %idxprom8.2 = sext i8 %7 to i64 %arrayidx9.2 = getelementptr inbounds i32, ptr %6, i64 %idxprom8.2 %8 = load i32, ptr %arrayidx9.2, align 4, !tbaa !10 %putchar20.2 = call i32 @putchar(i32 %8) %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 30, 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 nosync nounwind willreturn memory(none) declare ptr @__ctype_toupper_loc() local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"int", !7, i64 0}
#include<stdio.h> int i; char c; int main(){ c=getchar(); putchar(c-'a'+'A'); while(c!=32){ c=getchar(); } c=getchar(); putchar(c-'a'+'A'); while(c!=32){ c=getchar(); } c=getchar(); putchar(c-'a'+'A'); putchar(10); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264120/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264120/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @c = dso_local local_unnamed_addr global i8 0, align 1 @i = dso_local local_unnamed_addr global i32 0, align 4 @stdin = external local_unnamed_addr global ptr, align 8 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %conv = trunc i32 %call.i to i8 store i8 %conv, ptr @c, align 1, !tbaa !9 %sext = shl i32 %call.i, 24 %conv1 = ashr exact i32 %sext, 24 %add = add nsw i32 %conv1, -32 %1 = load ptr, ptr @stdout, align 8, !tbaa !5 %call.i30 = tail call i32 @putc(i32 noundef %add, ptr noundef %1) %.pr = load i8, ptr @c, align 1, !tbaa !9 %cmp.not39 = icmp eq i8 %.pr, 32 br i1 %cmp.not39, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i31 = tail call i32 @getc(ptr noundef %2) %conv6 = trunc i32 %call.i31 to i8 store i8 %conv6, ptr @c, align 1, !tbaa !9 %cmp.not = icmp eq i8 %conv6, 32 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %while.body, %entry %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i32 = tail call i32 @getc(ptr noundef %3) %conv8 = trunc i32 %call.i32 to i8 store i8 %conv8, ptr @c, align 1, !tbaa !9 %sext28 = shl i32 %call.i32, 24 %conv9 = ashr exact i32 %sext28, 24 %add11 = add nsw i32 %conv9, -32 %4 = load ptr, ptr @stdout, align 8, !tbaa !5 %call.i33 = tail call i32 @putc(i32 noundef %add11, ptr noundef %4) %.pr38 = load i8, ptr @c, align 1, !tbaa !9 %cmp15.not40 = icmp eq i8 %.pr38, 32 br i1 %cmp15.not40, label %while.end20, label %while.body17 while.body17: ; preds = %while.end, %while.body17 %5 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i34 = tail call i32 @getc(ptr noundef %5) %conv19 = trunc i32 %call.i34 to i8 store i8 %conv19, ptr @c, align 1, !tbaa !9 %cmp15.not = icmp eq i8 %conv19, 32 br i1 %cmp15.not, label %while.end20, label %while.body17, !llvm.loop !12 while.end20: ; preds = %while.body17, %while.end %6 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i35 = tail call i32 @getc(ptr noundef %6) %conv22 = trunc i32 %call.i35 to i8 store i8 %conv22, ptr @c, align 1, !tbaa !9 %sext29 = shl i32 %call.i35, 24 %conv23 = ashr exact i32 %sext29, 24 %add25 = add nsw i32 %conv23, -32 %7 = load ptr, ptr @stdout, align 8, !tbaa !5 %call.i36 = tail call i32 @putc(i32 noundef %add25, ptr noundef %7) %8 = load ptr, ptr @stdout, align 8, !tbaa !5 %call.i37 = tail call i32 @putc(i32 noundef 10, ptr noundef %8) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include <stdio.h> #include <ctype.h> int main(void) { enum { S = 11 }; char s1[S], s2[S], s3[S]; scanf("%s %s %s", s1, s2, s3); printf("%c%c%c\n", toupper(s1[0]), toupper(s2[0]), toupper(s3[0])); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264171/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264171/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s %s\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%c%c%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s1 = alloca [11 x i8], align 1 %s2 = alloca [11 x i8], align 1 %s3 = alloca [11 x i8], align 1 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s1) #4 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s2) #4 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s3) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3) %call3 = tail call ptr @__ctype_toupper_loc() #5 %0 = load ptr, ptr %call3, align 8, !tbaa !5 %1 = load i8, ptr %s1, align 1, !tbaa !9 %idxprom = sext i8 %1 to i64 %arrayidx4 = getelementptr inbounds i32, ptr %0, i64 %idxprom %2 = load i32, ptr %arrayidx4, align 4, !tbaa !10 %3 = load i8, ptr %s2, align 1, !tbaa !9 %idxprom9 = sext i8 %3 to i64 %arrayidx10 = getelementptr inbounds i32, ptr %0, i64 %idxprom9 %4 = load i32, ptr %arrayidx10, align 4, !tbaa !10 %5 = load i8, ptr %s3, align 1, !tbaa !9 %idxprom16 = sext i8 %5 to i64 %arrayidx17 = getelementptr inbounds i32, ptr %0, i64 %idxprom16 %6 = load i32, ptr %arrayidx17, align 4, !tbaa !10 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %4, i32 noundef %6) call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s3) #4 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s2) #4 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s1) #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 nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_toupper_loc() local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"int", !7, i64 0}
#include<stdio.h> #include<ctype.h> int main(void){ char str1[100],str2[100],str3[100]; scanf("%s%s%s",str1,str2,str3); printf("%c%c%c\n",toupper(str1[0]),toupper(str2[0]),toupper(str3[0])); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264214/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264214/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s%s\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%c%c%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str1 = alloca [100 x i8], align 16 %str2 = alloca [100 x i8], align 16 %str3 = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str1) #4 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str2) #4 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str3) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str1, ptr noundef nonnull %str2, ptr noundef nonnull %str3) %call3 = tail call ptr @__ctype_toupper_loc() #5 %0 = load ptr, ptr %call3, align 8, !tbaa !5 %1 = load i8, ptr %str1, align 16, !tbaa !9 %idxprom = sext i8 %1 to i64 %arrayidx4 = getelementptr inbounds i32, ptr %0, i64 %idxprom %2 = load i32, ptr %arrayidx4, align 4, !tbaa !10 %3 = load i8, ptr %str2, align 16, !tbaa !9 %idxprom9 = sext i8 %3 to i64 %arrayidx10 = getelementptr inbounds i32, ptr %0, i64 %idxprom9 %4 = load i32, ptr %arrayidx10, align 4, !tbaa !10 %5 = load i8, ptr %str3, align 16, !tbaa !9 %idxprom16 = sext i8 %5 to i64 %arrayidx17 = getelementptr inbounds i32, ptr %0, i64 %idxprom16 %6 = load i32, ptr %arrayidx17, align 4, !tbaa !10 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %4, i32 noundef %6) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str3) #4 call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str2) #4 call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str1) #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 nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_toupper_loc() local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"int", !7, i64 0}
#include<stdio.h> #include<math.h> int main(void){ long long int a,b,n,x,ans=0; scanf("%lld %lld %lld",&a,&b,&n); if(b-1<=n){ x=b-1; }else{ x=n; } ans=floor((a*x)/b)-(x/b); printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264258/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264258/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n) %0 = load i64, ptr %b, align 8, !tbaa !5 %sub = add nsw i64 %0, -1 %1 = load i64, ptr %n, align 8, !tbaa !5 %.sub = call i64 @llvm.smin.i64(i64 %sub, i64 %1) %2 = load i64, ptr %a, align 8, !tbaa !5 %mul = mul nsw i64 %2, %.sub %div = sdiv i64 %mul, %0 %conv = sitofp i64 %div to double %div2 = sdiv i64 %.sub, %0 %conv3 = sitofp i64 %div2 to double %sub4 = fsub double %conv, %conv3 %conv5 = fptosi double %sub4 to i64 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %conv5) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ long long int a, b, n; scanf("%lld%lld%lld",&a, &b, &n); if(n>=b) n=b-1; long long int ans=(a*n)/b; printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264300/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264300/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %n = alloca i64, align 8 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 %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp.not = icmp slt i64 %0, %1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %sub = add nsw i64 %1, -1 store i64 %sub, ptr %n, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i64 [ %sub, %if.then ], [ %0, %entry ] %3 = load i64, ptr %a, align 8, !tbaa !5 %mul = mul nsw i64 %2, %3 %div = sdiv i64 %mul, %1 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { long long memo,A,B,N,x,max=0; scanf("%lld",&A); scanf("%lld",&B); scanf("%lld",&N); if(B<=N){ max=A*(B-1)/B; }else{ max=A*N/B; } printf("%lld",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264344/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264344/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i64, align 8 %B = alloca i64, align 8 %N = alloca i64, align 8 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 %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i64, ptr %B, align 8, !tbaa !5 %1 = load i64, ptr %N, align 8, !tbaa !5 %cmp.not = icmp sgt i64 %0, %1 %2 = load i64, ptr %A, align 8, !tbaa !5 %sub = add nsw i64 %0, -1 %.sink = select i1 %cmp.not, i64 %1, i64 %sub %mul3 = mul nsw i64 %2, %.sink %max.0 = sdiv i64 %mul3, %0 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %max.0) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
//Lowest Common Ancestor - doubling //ABC014-D #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.h> #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int max(int a,int b){if(a>b){return a;}return b;} int min(int a,int b){if(a<b){return a;}return b;} int zt(int a,int b){return max(a,b)-min(a,b);} int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} int nHr(int a,int b){return nCr(a+b-1,b);} int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} int sankaku(int x){return ((1+x)*x)/2;} long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llnHr(long long a,long long b){return llnCr(a+b-1,b);} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;} long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;} long long llsankaku(long long x){return ((1+x)*x)/2;} double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);} int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);} void shuffledget(int x[],int n){ srand(time(0)); int i,b[524288],p,c; for(i=0;i<n;i++){ b[i]=i; } for(i=n;i>=1;i--){ p=rand()%i; c=b[i-1];b[i-1]=b[p];b[p]=c; } for(i=0;i<n;i++){ scanf("%d",&x[b[i]]); } } int dx4[4]={1,-1,0,0}; int dy4[4]={0,0,1,-1}; int dx8[8]={-1,-1,-1,0,0,1,1,1}; int dy8[8]={-1,0,1,-1,1,-1,0,1}; int search(int x,int a[],int n){ int st=0,fi=n-1,te; while(st<=fi){ te=(st+fi)/2; if(a[te]<x){st=te+1;}else{fi=te-1;} } return st; } typedef struct{ int val; int node; }sd; int sdsortfnc(const void *a,const void *b){ if(((sd*)a)->val < ((sd*)b)->val){return -1;} if(((sd*)a)->val > ((sd*)b)->val){return 1;} return 0; } typedef struct{ long long st; long long fi; long long cl; long long kr; long long id; }rs; typedef struct{ long long st; long long kz; }mkj; int sortfnc(const void *a,const void *b){ if(((rs*)a)->st == ((rs*)b)->st){return 0;} if(((rs*)a)->st < ((rs*)b)->st){return -1;} return 1; } void makemkj(rs g[],mkj x[],long long n){ long long i,ms=0,nst=g[0].st; for(i=1;i<n;i++){ if(g[i].st!=g[i-1].st){ x[nst].kz=i-ms; x[nst].st=ms; nst=g[i].st;ms=i; } } x[nst].kz=n-ms; x[nst].st=ms; } long long dist[524288],nrep[524288],doubling[524288][32]; void dfs(long long t,long long l,rs g[],mkj x[]){ long long i; if(dist[t]<=l){return;} dist[t]=l; for(i=0;i<30;i++){ if((l-(1<<i))<0){break;} doubling[t][i]=nrep[(l-(1<<i))]; } nrep[l]=t; for(i=x[t].st;i<x[t].st+x[t].kz;i++){ dfs(g[i].fi,l+1,g,x); } nrep[l]=-1; } long long query(long long a,long long b){ long long ah,bh,dh,i,st,fi,te; if(dist[a]<dist[b]){i=a;a=b;b=i;} ah=dist[a]; bh=dist[b]; dh=ah-bh; for(i=29;i>=0;i--){ if((dh&(1<<i)) != 0){ a=doubling[a][i]; } } //printf("[[%d %d]]\n",a,b); while(a!=b){ //printf("[%d %d]\n",a,b); st=0;fi=29; while(st<=fi){ te=(st+fi)/2; if(doubling[a][te]==doubling[b][te]){fi=te-1;} else{st=te+1;} } if(fi==-1){ return doubling[a][0]; } a=doubling[a][fi]; b=doubling[b][fi]; } return a; } rs qg[524288]; mkj qx[524288]; long long res[524288]={0}; bool fl[524288]={0}; long long ec[524288]={0}; long long dc[524288]={0}; void tdfs(long long nv,long long bv,rs g[],mkj x[]){ long long i,j; if(fl[nv]==0){ for(i=qx[nv].st;i<qx[nv].st+qx[nv].kz;i++){ res[qg[i].id]+=dc[0]*qg[i].fi; res[qg[i].id]-=dc[qg[i].cl]*qg[i].fi; res[qg[i].id]+=ec[qg[i].cl]*qg[i].kr*qg[i].fi; } fl[nv]=1; } for(i=x[nv].st;i<x[nv].st+x[nv].kz;i++){ if(g[i].fi==bv){continue;} ec[0]++;ec[g[i].cl]++; dc[0]+=g[i].kr;dc[g[i].cl]+=g[i].kr; tdfs(g[i].fi,nv,g,x); ec[0]--;ec[g[i].cl]--; dc[0]-=g[i].kr;dc[g[i].cl]-=g[i].kr; } } int main(void){ long long i,j,n,m,k,a,b,c,h,w,r=0,l,t,q; rs g[524288]; mkj x[524288]; scanf("%lld%lld",&n,&q); for(i=0;i<n-1;i++){ scanf("%lld%lld",&a,&b); scanf("%lld%lld",&g[2*i].cl,&g[2*i].kr); g[2*i].st=a; g[2*i].fi=b; g[2*i+1].st=b; g[2*i+1].fi=a; g[2*i+1].cl=g[2*i].cl; g[2*i+1].kr=g[2*i].kr; } qsort(g,2*(n-1),sizeof(g[0]),sortfnc); makemkj(g,x,2*(n-1)); for(i=0;i<=n;i++){ dist[i]=inf; nrep[i]=-1; for(j=0;j<30;j++){doubling[i][j]=-1;} } dfs(1,0,g,x); for(i=0;i<q;i++){ scanf("%lld%lld%lld%lld",&h,&w,&a,&b); t=query(a,b); qg[3*i].st=a; qg[3*i].fi=1; qg[3*i].cl=h; qg[3*i].kr=w; qg[3*i].id=i; qg[3*i+1].st=b; qg[3*i+1].fi=1; qg[3*i+1].cl=h; qg[3*i+1].kr=w; qg[3*i+1].id=i; qg[3*i+2].st=t; qg[3*i+2].fi=-2; qg[3*i+2].cl=h; qg[3*i+2].kr=w; qg[3*i+2].id=i; } qsort(qg,3*q,sizeof(qg[0]),sortfnc); makemkj(qg,qx,3*q); tdfs(1,-1,g,x); for(i=0;i<q;i++){ printf("%lld\n",res[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264395/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264395/source.c" target datalayout = "e-m:e-p270: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.mkj = type { i64, i64 } %struct.rs = type { i64, i64, i64, i64, i64 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16 @dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16 @dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16 @dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16 @dist = dso_local local_unnamed_addr global [524288 x i64] zeroinitializer, align 16 @nrep = dso_local local_unnamed_addr global [524288 x i64] zeroinitializer, align 16 @doubling = dso_local local_unnamed_addr global [524288 x [32 x i64]] zeroinitializer, align 16 @res = dso_local local_unnamed_addr global [524288 x i64] zeroinitializer, align 16 @fl = dso_local local_unnamed_addr global [524288 x i8] zeroinitializer, align 16 @ec = dso_local local_unnamed_addr global [524288 x i64] zeroinitializer, align 16 @dc = dso_local local_unnamed_addr global [524288 x i64] zeroinitializer, align 16 @qx = dso_local local_unnamed_addr global [524288 x %struct.mkj] zeroinitializer, align 16 @qg = dso_local global [524288 x %struct.rs] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.2 = private unnamed_addr constant [17 x i8] c"%lld%lld%lld%lld\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local 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: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i32 %a, %b %sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true) ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %mul = shl nsw i32 %rem, 1 %cmp.not = icmp sge i32 %mul, %b %div1 = sdiv i32 %a, %b %add = zext i1 %cmp.not to i32 %retval.0 = add nsw i32 %div1, %add ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %cmp = icmp ne i32 %rem, 0 %div = sdiv i32 %a, %b %add = zext i1 %cmp to i32 %retval.0 = add nsw i32 %div, %add ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i32 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i32 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i32 %a.addr.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i32 %b, 0 br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i32 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5 gcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i32 %a, %a.addr.0.lcssa.i %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i32 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i32 %a, 1 %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, 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 i32 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i32 %add, %i.07 %mul = mul nsw i32 %r.08, %sub %div = sdiv i32 %mul, %i.07 %inc = add nuw i32 %i.07, 1 %sub.1 = sub i32 %add, %inc %mul.1 = mul nsw i32 %div, %sub.1 %div.1 = sdiv i32 %mul.1, %inc %inc.1 = add nuw i32 %i.07, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i32 %add, %i.07.unr %mul.epil = mul nsw i32 %r.08.unr, %sub.epil %div.epil = sdiv i32 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i32 %b, %a %cmp.not6.i = icmp slt i32 %b, 1 br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i32 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i32 %add, %i.07.i %mul.i = mul nsw i32 %sub.i, %r.08.i %div.i = sdiv i32 %mul.i, %i.07.i %inc.i = add nuw i32 %i.07.i, 1 %sub.i.1 = sub i32 %add, %inc.i %mul.i.1 = mul nsw i32 %sub.i.1, %div.i %div.i.1 = sdiv i32 %mul.i.1, %inc.i %inc.i.1 = add nuw i32 %i.07.i, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7 nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i32 %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 %sub.i.epil = sub i32 %add, %i.07.i.unr %mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr br label %nCr.exit nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i32 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i32 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %a, 8 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %a, -8 %ind.end = or i32 %n.vec, 1 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.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %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> %0 = mul <4 x i32> %vec.phi, %vec.ind %1 = mul <4 x i32> %vec.phi7, %step.add %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8 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, %a br i1 %cmp.n, label %for.end, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader9, %for.body %r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ] %i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ] %mul = mul nsw i32 %r.06, %i.05 %inc = add nuw i32 %i.05, 1 %exitcond.not = icmp eq i32 %i.05, %a br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i32 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %b, 8 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %b, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, 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 !12 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, %b br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ] %i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ] %mul = mul nsw i32 %r.05, %a %inc = add nuw i32 %i.04, 1 %exitcond.not = icmp eq i32 %i.04, %b br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i32 %x, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ] %x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ] %rem = srem i32 %x.addr.05, 10 %add = add nsw i32 %r.06, %rem %div = sdiv i32 %x.addr.05, 10 %x.addr.05.off = add i32 %x.addr.05, 9 %tobool.not = icmp ult i32 %x.addr.05.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i32 %x, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ] %x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ] %rem = srem i32 %x.addr.06, %b %add = add nsw i32 %rem, %r.07 %div = sdiv i32 %x.addr.06, %b %tobool.not = icmp eq i32 %div, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 { entry: %add = add nsw i32 %x, 1 %mul = mul nsw i32 %add, %x %div = sdiv i32 %mul, 2 ret i32 %div } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i64 %a, %b %sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true) ret i64 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %mul = shl nsw i64 %rem, 1 %cmp.not = icmp sge i64 %mul, %b %div1 = sdiv i64 %a, %b %add = zext i1 %cmp.not to i64 %retval.0 = add nsw i64 %div1, %add ret i64 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %cmp = icmp ne i64 %rem, 0 %div = sdiv i64 %a, %b %add = zext i1 %cmp to i64 %retval.0 = add nsw i64 %div, %add ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i64 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i64 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !16 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i64 %a.addr.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i64 %b, 0 br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i64 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !16 llgcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i64 %a, %a.addr.0.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i64 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i64 %a, 1 %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, 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 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i64 %add, %i.07 %mul = mul nsw i64 %r.08, %sub %div = sdiv i64 %mul, %i.07 %inc = add nuw i64 %i.07, 1 %sub.1 = sub i64 %add, %inc %mul.1 = mul nsw i64 %div, %sub.1 %div.1 = sdiv i64 %mul.1, %inc %inc.1 = add nuw i64 %i.07, 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 !17 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.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 %sub.epil = sub i64 %add, %i.07.unr %mul.epil = mul nsw i64 %r.08.unr, %sub.epil %div.epil = sdiv i64 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i64 %b, %a %cmp.not6.i = icmp slt i64 %b, 1 br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i64 %add, %i.07.i %mul.i = mul nsw i64 %sub.i, %r.08.i %div.i = sdiv i64 %mul.i, %i.07.i %inc.i = add nuw i64 %i.07.i, 1 %sub.i.1 = sub i64 %add, %inc.i %mul.i.1 = mul nsw i64 %sub.i.1, %div.i %div.i.1 = sdiv i64 %mul.i.1, %inc.i %inc.i.1 = add nuw i64 %i.07.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 %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !17 llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i64 %add, %i.07.i.unr %mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr br label %llnCr.exit llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i64 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i64 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %a, 7 %0 = icmp ult i64 %a, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %a, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.06, %i.05 %inc = add nuw nsw i64 %i.05, 1 %mul.1 = mul nsw i64 %mul, %inc %inc.1 = add nuw nsw i64 %i.05, 2 %mul.2 = mul nsw i64 %mul.1, %inc.1 %inc.2 = add nuw nsw i64 %i.05, 3 %mul.3 = mul nsw i64 %mul.2, %inc.2 %inc.3 = add nuw nsw i64 %i.05, 4 %mul.4 = mul nsw i64 %mul.3, %inc.3 %inc.4 = add nuw nsw i64 %i.05, 5 %mul.5 = mul nsw i64 %mul.4, %inc.4 %inc.5 = add nuw nsw i64 %i.05, 6 %mul.6 = mul nsw i64 %mul.5, %inc.5 %inc.6 = add nuw i64 %i.05, 7 %mul.7 = mul nsw i64 %mul.6, %inc.6 %inc.7 = add nuw i64 %i.05, 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 !18 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.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 %r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ] %i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.06.epil, %i.05.epil %inc.epil = add nuw i64 %i.05.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 !19 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i64 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.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 ] %mul = mul nsw i64 %r.05, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !21 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.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 %r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.05.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !22 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i64 %x, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ] %x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ] %rem = srem i64 %x.addr.05, 10 %add = add nsw i64 %r.06, %rem %div = sdiv i64 %x.addr.05, 10 %x.addr.05.off = add i64 %x.addr.05, 9 %tobool.not = icmp ult i64 %x.addr.05.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i64 %x, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ] %x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ] %rem = srem i64 %x.addr.06, %b %add = add nsw i64 %rem, %r.07 %div = sdiv i64 %x.addr.06, %b %tobool.not = icmp eq i64 %div, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !24 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] ret i64 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 { entry: %add = add nsw i64 %x, 1 %mul = mul nsw i64 %add, %x %div = sdiv i64 %mul, 2 ret i64 %div } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp ogt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp olt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp.i = fcmp ogt double %a, %b %a.b.i = select i1 %cmp.i, double %a, double %b %cmp.i4 = fcmp olt double %a, %b %a.b.i5 = select i1 %cmp.i4, double %a, double %b %sub = fsub double %a.b.i, %a.b.i5 ret double %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !25 %1 = load i32, ptr %b, align 4, !tbaa !25 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext 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 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !25 %1 = load i32, ptr %b, align 4, !tbaa !25 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext 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 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext 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 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext 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 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 %cmp = fcmp ogt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext 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 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #18 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #18 ret i32 %call } ; Function Attrs: nounwind uwtable define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #7 { entry: %b = alloca [524288 x i32], align 16 %call = tail call i64 @time(ptr noundef null) #19 %conv = trunc i64 %call to i32 tail call void @srand(i32 noundef %conv) #19 call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #19 %cmp44 = icmp sgt i32 %n, 0 br i1 %cmp44, label %for.body.preheader, label %for.end29 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader61, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !25 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 16, !tbaa !25 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i64 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !33 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader61 for.body.preheader61: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond2.preheader: ; preds = %for.body, %middle.block br i1 %cmp44, label %for.body5.preheader, label %for.end29 for.body5.preheader: ; preds = %for.cond2.preheader %3 = zext i32 %n to i64 br label %for.body5 for.body: ; preds = %for.body.preheader61, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ] %arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv %4 = trunc i64 %indvars.iv to i32 store i32 %4, ptr %arrayidx, align 4, !tbaa !25 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond2.preheader, label %for.body, !llvm.loop !34 for.cond18.preheader: ; preds = %for.body5 br i1 %cmp44, label %for.body21.preheader, label %for.end29 for.body21.preheader: ; preds = %for.cond18.preheader %wide.trip.count58 = zext i32 %n to i64 br label %for.body21 for.body5: ; preds = %for.body5.preheader, %for.body5 %indvars.iv51 = phi i64 [ %3, %for.body5.preheader ], [ %indvars.iv.next52, %for.body5 ] %call6 = tail call i32 @rand() #19 %5 = trunc i64 %indvars.iv51 to i32 %rem = srem i32 %call6, %5 %indvars.iv.next52 = add nsw i64 %indvars.iv51, -1 %idxprom7 = and i64 %indvars.iv.next52, 4294967295 %arrayidx8 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom7 %6 = load i32, ptr %arrayidx8, align 4, !tbaa !25 %idxprom9 = sext i32 %rem to i64 %arrayidx10 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom9 %7 = load i32, ptr %arrayidx10, align 4, !tbaa !25 store i32 %7, ptr %arrayidx8, align 4, !tbaa !25 store i32 %6, ptr %arrayidx10, align 4, !tbaa !25 %cmp3 = icmp ugt i64 %indvars.iv51, 1 br i1 %cmp3, label %for.body5, label %for.cond18.preheader, !llvm.loop !35 for.body21: ; preds = %for.body21.preheader, %for.body21 %indvars.iv54 = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next55, %for.body21 ] %arrayidx23 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv54 %8 = load i32, ptr %arrayidx23, align 4, !tbaa !25 %idxprom24 = sext i32 %8 to i64 %arrayidx25 = getelementptr inbounds i32, ptr %x, i64 %idxprom24 %call26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx25) %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1 %exitcond59.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count58 br i1 %exitcond59.not, label %for.end29, label %for.body21, !llvm.loop !36 for.end29: ; preds = %for.body21, %entry, %for.cond2.preheader, %for.cond18.preheader call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #19 ret void } ; Function Attrs: nounwind declare void @srand(i32 noundef) local_unnamed_addr #8 ; Function Attrs: nounwind declare i64 @time(ptr noundef) local_unnamed_addr #8 ; Function Attrs: nounwind declare i32 @rand() local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #10 { entry: %cmp.not9 = icmp slt i32 %n, 1 br i1 %cmp.not9, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %sub = add nsw i32 %n, -1 br label %while.body while.body: ; preds = %while.body.preheader, %while.body %st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ] %fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ] %add = add nsw i32 %st.011, %fi.010 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !25 %cmp1 = icmp slt i32 %0, %x %add2 = add nsw i32 %div, 1 %sub3 = add nsw i32 %div, -1 %fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3 %st.1 = select i1 %cmp1, i32 %add2, i32 %st.011 %cmp.not = icmp sgt i32 %st.1, %fi.1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !37 while.end: ; preds = %while.body, %entry %st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ] ret i32 %st.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !38 %1 = load i32, ptr %b, align 4, !tbaa !38 %cmp = icmp slt i32 %0, %1 %cmp4 = icmp sgt i32 %0, %1 %. = zext i1 %cmp4 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 @sortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !40 %1 = load i64, ptr %b, align 8, !tbaa !40 %cmp = icmp eq i64 %0, %1 %cmp4 = icmp slt i64 %0, %1 %. = select i1 %cmp4, i32 -1, i32 1 %retval.0 = select i1 %cmp, i32 0, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @makemkj(ptr nocapture noundef readonly %g, ptr nocapture noundef writeonly %x, i64 noundef %n) local_unnamed_addr #11 { entry: %0 = load i64, ptr %g, align 8, !tbaa !40 %cmp36 = icmp sgt i64 %n, 1 br i1 %cmp36, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %nst.039 = phi i64 [ %nst.1, %for.inc ], [ %0, %entry ] %ms.038 = phi i64 [ %ms.1, %for.inc ], [ 0, %entry ] %i.037 = phi i64 [ %inc, %for.inc ], [ 1, %entry ] %arrayidx1 = getelementptr inbounds %struct.rs, ptr %g, i64 %i.037 %1 = load i64, ptr %arrayidx1, align 8, !tbaa !40 %arrayidx3 = getelementptr %struct.rs, ptr %arrayidx1, i64 -1 %2 = load i64, ptr %arrayidx3, align 8, !tbaa !40 %cmp5.not = icmp eq i64 %1, %2 br i1 %cmp5.not, label %for.inc, label %if.then if.then: ; preds = %for.body %sub6 = sub nsw i64 %i.037, %ms.038 %arrayidx7 = getelementptr inbounds %struct.mkj, ptr %x, i64 %nst.039 %kz = getelementptr inbounds %struct.mkj, ptr %x, i64 %nst.039, i32 1 store i64 %sub6, ptr %kz, align 8, !tbaa !42 store i64 %ms.038, ptr %arrayidx7, align 8, !tbaa !44 br label %for.inc for.inc: ; preds = %for.body, %if.then %ms.1 = phi i64 [ %i.037, %if.then ], [ %ms.038, %for.body ] %nst.1 = phi i64 [ %1, %if.then ], [ %nst.039, %for.body ] %inc = add nuw nsw i64 %i.037, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !45 for.end: ; preds = %for.inc, %entry %ms.0.lcssa = phi i64 [ 0, %entry ], [ %ms.1, %for.inc ] %nst.0.lcssa = phi i64 [ %0, %entry ], [ %nst.1, %for.inc ] %sub12 = sub nsw i64 %n, %ms.0.lcssa %arrayidx13 = getelementptr inbounds %struct.mkj, ptr %x, i64 %nst.0.lcssa %kz14 = getelementptr inbounds %struct.mkj, ptr %x, i64 %nst.0.lcssa, i32 1 store i64 %sub12, ptr %kz14, align 8, !tbaa !42 store i64 %ms.0.lcssa, ptr %arrayidx13, align 8, !tbaa !44 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local void @dfs(i64 noundef %t, i64 noundef %l, ptr nocapture noundef readonly %g, ptr nocapture noundef readonly %x) local_unnamed_addr #12 { entry: %arrayidx = getelementptr inbounds [524288 x i64], ptr @dist, i64 0, i64 %t %0 = load i64, ptr %arrayidx, align 8, !tbaa !29 %cmp.not = icmp sgt i64 %0, %l br i1 %cmp.not, label %if.end, label %cleanup if.end: ; preds = %entry store i64 %l, ptr %arrayidx, align 8, !tbaa !29 br label %for.body for.body: ; preds = %if.end6.1, %if.end %i.052 = phi i64 [ 0, %if.end ], [ %inc.1, %if.end6.1 ] %sh_prom = trunc i64 %i.052 to i32 %shl = shl nuw nsw i32 1, %sh_prom %conv = zext i32 %shl to i64 %sub = sub nsw i64 %l, %conv %cmp3 = icmp slt i64 %sub, 0 br i1 %cmp3, label %for.end, label %if.end6 if.end6: ; preds = %for.body %arrayidx11 = getelementptr inbounds [524288 x i64], ptr @nrep, i64 0, i64 %sub %1 = load i64, ptr %arrayidx11, align 8, !tbaa !29 %arrayidx13 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %t, i64 %i.052 store i64 %1, ptr %arrayidx13, align 16, !tbaa !29 %inc = or i64 %i.052, 1 %sh_prom.1 = trunc i64 %inc to i32 %shl.1 = shl nuw nsw i32 1, %sh_prom.1 %conv.1 = zext i32 %shl.1 to i64 %sub.1 = sub nsw i64 %l, %conv.1 %cmp3.1 = icmp slt i64 %sub.1, 0 br i1 %cmp3.1, label %for.end, label %if.end6.1 if.end6.1: ; preds = %if.end6 %arrayidx11.1 = getelementptr inbounds [524288 x i64], ptr @nrep, i64 0, i64 %sub.1 %2 = load i64, ptr %arrayidx11.1, align 8, !tbaa !29 %arrayidx13.1 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %t, i64 %inc store i64 %2, ptr %arrayidx13.1, align 8, !tbaa !29 %inc.1 = add nuw nsw i64 %i.052, 2 %exitcond.not.1 = icmp eq i64 %inc.1, 30 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !46 for.end: ; preds = %if.end6.1, %if.end6, %for.body %arrayidx14 = getelementptr inbounds [524288 x i64], ptr @nrep, i64 0, i64 %l store i64 %t, ptr %arrayidx14, align 8, !tbaa !29 %arrayidx15 = getelementptr inbounds %struct.mkj, ptr %x, i64 %t %kz = getelementptr inbounds %struct.mkj, ptr %x, i64 %t, i32 1 %3 = load i64, ptr %kz, align 8, !tbaa !42 %cmp2054 = icmp sgt i64 %3, 0 br i1 %cmp2054, label %for.body22.lr.ph, label %for.end27 for.body22.lr.ph: ; preds = %for.end %4 = load i64, ptr %arrayidx15, align 8, !tbaa !44 %add24 = add nsw i64 %l, 1 br label %for.body22 for.body22: ; preds = %for.body22.lr.ph, %for.body22 %i.155 = phi i64 [ %4, %for.body22.lr.ph ], [ %inc26, %for.body22 ] %fi = getelementptr inbounds %struct.rs, ptr %g, i64 %i.155, i32 1 %5 = load i64, ptr %fi, align 8, !tbaa !47 tail call void @dfs(i64 noundef %5, i64 noundef %add24, ptr noundef %g, ptr noundef nonnull %x) %inc26 = add nsw i64 %i.155, 1 %6 = load i64, ptr %arrayidx15, align 8, !tbaa !44 %7 = load i64, ptr %kz, align 8, !tbaa !42 %add = add nsw i64 %7, %6 %cmp20 = icmp slt i64 %inc26, %add br i1 %cmp20, label %for.body22, label %for.end27, !llvm.loop !48 for.end27: ; preds = %for.body22, %for.end store i64 -1, ptr %arrayidx14, align 8, !tbaa !29 br label %cleanup cleanup: ; preds = %entry, %for.end27 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @query(i64 noundef %a, i64 noundef %b) local_unnamed_addr #13 { entry: %arrayidx = getelementptr inbounds [524288 x i64], ptr @dist, i64 0, i64 %a %0 = load i64, ptr %arrayidx, align 8, !tbaa !29 %arrayidx1 = getelementptr inbounds [524288 x i64], ptr @dist, i64 0, i64 %b %1 = load i64, ptr %arrayidx1, align 8, !tbaa !29 %cmp = icmp slt i64 %0, %1 %spec.select = select i1 %cmp, i64 %a, i64 %b %spec.select69 = select i1 %cmp, i64 %b, i64 %a %arrayidx2 = getelementptr inbounds [524288 x i64], ptr @dist, i64 0, i64 %spec.select69 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !29 %arrayidx3 = getelementptr inbounds [524288 x i64], ptr @dist, i64 0, i64 %spec.select %3 = load i64, ptr %arrayidx3, align 8, !tbaa !29 %sub = sub nsw i64 %2, %3 %and = and i64 %sub, 536870912 %cmp5.not = icmp eq i64 %and, 0 br i1 %cmp5.not, label %for.inc, label %if.then7 if.then7: ; preds = %entry %arrayidx9 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %spec.select69, i64 29 %4 = load i64, ptr %arrayidx9, align 8, !tbaa !29 br label %for.inc for.inc: ; preds = %entry, %if.then7 %a.addr.2 = phi i64 [ %4, %if.then7 ], [ %spec.select69, %entry ] %and.1 = and i64 %sub, 268435456 %cmp5.not.1 = icmp eq i64 %and.1, 0 br i1 %cmp5.not.1, label %for.inc.1, label %if.then7.1 if.then7.1: ; preds = %for.inc %arrayidx9.1 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2, i64 28 %5 = load i64, ptr %arrayidx9.1, align 16, !tbaa !29 br label %for.inc.1 for.inc.1: ; preds = %if.then7.1, %for.inc %a.addr.2.1 = phi i64 [ %5, %if.then7.1 ], [ %a.addr.2, %for.inc ] %and.2 = and i64 %sub, 134217728 %cmp5.not.2 = icmp eq i64 %and.2, 0 br i1 %cmp5.not.2, label %for.inc.2, label %if.then7.2 if.then7.2: ; preds = %for.inc.1 %arrayidx9.2 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.1, i64 27 %6 = load i64, ptr %arrayidx9.2, align 8, !tbaa !29 br label %for.inc.2 for.inc.2: ; preds = %if.then7.2, %for.inc.1 %a.addr.2.2 = phi i64 [ %6, %if.then7.2 ], [ %a.addr.2.1, %for.inc.1 ] %and.3 = and i64 %sub, 67108864 %cmp5.not.3 = icmp eq i64 %and.3, 0 br i1 %cmp5.not.3, label %for.inc.3, label %if.then7.3 if.then7.3: ; preds = %for.inc.2 %arrayidx9.3 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.2, i64 26 %7 = load i64, ptr %arrayidx9.3, align 16, !tbaa !29 br label %for.inc.3 for.inc.3: ; preds = %if.then7.3, %for.inc.2 %a.addr.2.3 = phi i64 [ %7, %if.then7.3 ], [ %a.addr.2.2, %for.inc.2 ] %and.4 = and i64 %sub, 33554432 %cmp5.not.4 = icmp eq i64 %and.4, 0 br i1 %cmp5.not.4, label %for.inc.4, label %if.then7.4 if.then7.4: ; preds = %for.inc.3 %arrayidx9.4 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.3, i64 25 %8 = load i64, ptr %arrayidx9.4, align 8, !tbaa !29 br label %for.inc.4 for.inc.4: ; preds = %if.then7.4, %for.inc.3 %a.addr.2.4 = phi i64 [ %8, %if.then7.4 ], [ %a.addr.2.3, %for.inc.3 ] %and.5 = and i64 %sub, 16777216 %cmp5.not.5 = icmp eq i64 %and.5, 0 br i1 %cmp5.not.5, label %for.inc.5, label %if.then7.5 if.then7.5: ; preds = %for.inc.4 %arrayidx9.5 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.4, i64 24 %9 = load i64, ptr %arrayidx9.5, align 16, !tbaa !29 br label %for.inc.5 for.inc.5: ; preds = %if.then7.5, %for.inc.4 %a.addr.2.5 = phi i64 [ %9, %if.then7.5 ], [ %a.addr.2.4, %for.inc.4 ] %and.6 = and i64 %sub, 8388608 %cmp5.not.6 = icmp eq i64 %and.6, 0 br i1 %cmp5.not.6, label %for.inc.6, label %if.then7.6 if.then7.6: ; preds = %for.inc.5 %arrayidx9.6 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.5, i64 23 %10 = load i64, ptr %arrayidx9.6, align 8, !tbaa !29 br label %for.inc.6 for.inc.6: ; preds = %if.then7.6, %for.inc.5 %a.addr.2.6 = phi i64 [ %10, %if.then7.6 ], [ %a.addr.2.5, %for.inc.5 ] %and.7 = and i64 %sub, 4194304 %cmp5.not.7 = icmp eq i64 %and.7, 0 br i1 %cmp5.not.7, label %for.inc.7, label %if.then7.7 if.then7.7: ; preds = %for.inc.6 %arrayidx9.7 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.6, i64 22 %11 = load i64, ptr %arrayidx9.7, align 16, !tbaa !29 br label %for.inc.7 for.inc.7: ; preds = %if.then7.7, %for.inc.6 %a.addr.2.7 = phi i64 [ %11, %if.then7.7 ], [ %a.addr.2.6, %for.inc.6 ] %and.8 = and i64 %sub, 2097152 %cmp5.not.8 = icmp eq i64 %and.8, 0 br i1 %cmp5.not.8, label %for.inc.8, label %if.then7.8 if.then7.8: ; preds = %for.inc.7 %arrayidx9.8 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.7, i64 21 %12 = load i64, ptr %arrayidx9.8, align 8, !tbaa !29 br label %for.inc.8 for.inc.8: ; preds = %if.then7.8, %for.inc.7 %a.addr.2.8 = phi i64 [ %12, %if.then7.8 ], [ %a.addr.2.7, %for.inc.7 ] %and.9 = and i64 %sub, 1048576 %cmp5.not.9 = icmp eq i64 %and.9, 0 br i1 %cmp5.not.9, label %for.inc.9, label %if.then7.9 if.then7.9: ; preds = %for.inc.8 %arrayidx9.9 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.8, i64 20 %13 = load i64, ptr %arrayidx9.9, align 16, !tbaa !29 br label %for.inc.9 for.inc.9: ; preds = %if.then7.9, %for.inc.8 %a.addr.2.9 = phi i64 [ %13, %if.then7.9 ], [ %a.addr.2.8, %for.inc.8 ] %and.10 = and i64 %sub, 524288 %cmp5.not.10 = icmp eq i64 %and.10, 0 br i1 %cmp5.not.10, label %for.inc.10, label %if.then7.10 if.then7.10: ; preds = %for.inc.9 %arrayidx9.10 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.9, i64 19 %14 = load i64, ptr %arrayidx9.10, align 8, !tbaa !29 br label %for.inc.10 for.inc.10: ; preds = %if.then7.10, %for.inc.9 %a.addr.2.10 = phi i64 [ %14, %if.then7.10 ], [ %a.addr.2.9, %for.inc.9 ] %and.11 = and i64 %sub, 262144 %cmp5.not.11 = icmp eq i64 %and.11, 0 br i1 %cmp5.not.11, label %for.inc.11, label %if.then7.11 if.then7.11: ; preds = %for.inc.10 %arrayidx9.11 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.10, i64 18 %15 = load i64, ptr %arrayidx9.11, align 16, !tbaa !29 br label %for.inc.11 for.inc.11: ; preds = %if.then7.11, %for.inc.10 %a.addr.2.11 = phi i64 [ %15, %if.then7.11 ], [ %a.addr.2.10, %for.inc.10 ] %and.12 = and i64 %sub, 131072 %cmp5.not.12 = icmp eq i64 %and.12, 0 br i1 %cmp5.not.12, label %for.inc.12, label %if.then7.12 if.then7.12: ; preds = %for.inc.11 %arrayidx9.12 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.11, i64 17 %16 = load i64, ptr %arrayidx9.12, align 8, !tbaa !29 br label %for.inc.12 for.inc.12: ; preds = %if.then7.12, %for.inc.11 %a.addr.2.12 = phi i64 [ %16, %if.then7.12 ], [ %a.addr.2.11, %for.inc.11 ] %and.13 = and i64 %sub, 65536 %cmp5.not.13 = icmp eq i64 %and.13, 0 br i1 %cmp5.not.13, label %for.inc.13, label %if.then7.13 if.then7.13: ; preds = %for.inc.12 %arrayidx9.13 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.12, i64 16 %17 = load i64, ptr %arrayidx9.13, align 16, !tbaa !29 br label %for.inc.13 for.inc.13: ; preds = %if.then7.13, %for.inc.12 %a.addr.2.13 = phi i64 [ %17, %if.then7.13 ], [ %a.addr.2.12, %for.inc.12 ] %and.14 = and i64 %sub, 32768 %cmp5.not.14 = icmp eq i64 %and.14, 0 br i1 %cmp5.not.14, label %for.inc.14, label %if.then7.14 if.then7.14: ; preds = %for.inc.13 %arrayidx9.14 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.13, i64 15 %18 = load i64, ptr %arrayidx9.14, align 8, !tbaa !29 br label %for.inc.14 for.inc.14: ; preds = %if.then7.14, %for.inc.13 %a.addr.2.14 = phi i64 [ %18, %if.then7.14 ], [ %a.addr.2.13, %for.inc.13 ] %and.15 = and i64 %sub, 16384 %cmp5.not.15 = icmp eq i64 %and.15, 0 br i1 %cmp5.not.15, label %for.inc.15, label %if.then7.15 if.then7.15: ; preds = %for.inc.14 %arrayidx9.15 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.14, i64 14 %19 = load i64, ptr %arrayidx9.15, align 16, !tbaa !29 br label %for.inc.15 for.inc.15: ; preds = %if.then7.15, %for.inc.14 %a.addr.2.15 = phi i64 [ %19, %if.then7.15 ], [ %a.addr.2.14, %for.inc.14 ] %and.16 = and i64 %sub, 8192 %cmp5.not.16 = icmp eq i64 %and.16, 0 br i1 %cmp5.not.16, label %for.inc.16, label %if.then7.16 if.then7.16: ; preds = %for.inc.15 %arrayidx9.16 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.15, i64 13 %20 = load i64, ptr %arrayidx9.16, align 8, !tbaa !29 br label %for.inc.16 for.inc.16: ; preds = %if.then7.16, %for.inc.15 %a.addr.2.16 = phi i64 [ %20, %if.then7.16 ], [ %a.addr.2.15, %for.inc.15 ] %and.17 = and i64 %sub, 4096 %cmp5.not.17 = icmp eq i64 %and.17, 0 br i1 %cmp5.not.17, label %for.inc.17, label %if.then7.17 if.then7.17: ; preds = %for.inc.16 %arrayidx9.17 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.16, i64 12 %21 = load i64, ptr %arrayidx9.17, align 16, !tbaa !29 br label %for.inc.17 for.inc.17: ; preds = %if.then7.17, %for.inc.16 %a.addr.2.17 = phi i64 [ %21, %if.then7.17 ], [ %a.addr.2.16, %for.inc.16 ] %and.18 = and i64 %sub, 2048 %cmp5.not.18 = icmp eq i64 %and.18, 0 br i1 %cmp5.not.18, label %for.inc.18, label %if.then7.18 if.then7.18: ; preds = %for.inc.17 %arrayidx9.18 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.17, i64 11 %22 = load i64, ptr %arrayidx9.18, align 8, !tbaa !29 br label %for.inc.18 for.inc.18: ; preds = %if.then7.18, %for.inc.17 %a.addr.2.18 = phi i64 [ %22, %if.then7.18 ], [ %a.addr.2.17, %for.inc.17 ] %and.19 = and i64 %sub, 1024 %cmp5.not.19 = icmp eq i64 %and.19, 0 br i1 %cmp5.not.19, label %for.inc.19, label %if.then7.19 if.then7.19: ; preds = %for.inc.18 %arrayidx9.19 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.18, i64 10 %23 = load i64, ptr %arrayidx9.19, align 16, !tbaa !29 br label %for.inc.19 for.inc.19: ; preds = %if.then7.19, %for.inc.18 %a.addr.2.19 = phi i64 [ %23, %if.then7.19 ], [ %a.addr.2.18, %for.inc.18 ] %and.20 = and i64 %sub, 512 %cmp5.not.20 = icmp eq i64 %and.20, 0 br i1 %cmp5.not.20, label %for.inc.20, label %if.then7.20 if.then7.20: ; preds = %for.inc.19 %arrayidx9.20 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.19, i64 9 %24 = load i64, ptr %arrayidx9.20, align 8, !tbaa !29 br label %for.inc.20 for.inc.20: ; preds = %if.then7.20, %for.inc.19 %a.addr.2.20 = phi i64 [ %24, %if.then7.20 ], [ %a.addr.2.19, %for.inc.19 ] %and.21 = and i64 %sub, 256 %cmp5.not.21 = icmp eq i64 %and.21, 0 br i1 %cmp5.not.21, label %for.inc.21, label %if.then7.21 if.then7.21: ; preds = %for.inc.20 %arrayidx9.21 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.20, i64 8 %25 = load i64, ptr %arrayidx9.21, align 16, !tbaa !29 br label %for.inc.21 for.inc.21: ; preds = %if.then7.21, %for.inc.20 %a.addr.2.21 = phi i64 [ %25, %if.then7.21 ], [ %a.addr.2.20, %for.inc.20 ] %and.22 = and i64 %sub, 128 %cmp5.not.22 = icmp eq i64 %and.22, 0 br i1 %cmp5.not.22, label %for.inc.22, label %if.then7.22 if.then7.22: ; preds = %for.inc.21 %arrayidx9.22 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.21, i64 7 %26 = load i64, ptr %arrayidx9.22, align 8, !tbaa !29 br label %for.inc.22 for.inc.22: ; preds = %if.then7.22, %for.inc.21 %a.addr.2.22 = phi i64 [ %26, %if.then7.22 ], [ %a.addr.2.21, %for.inc.21 ] %and.23 = and i64 %sub, 64 %cmp5.not.23 = icmp eq i64 %and.23, 0 br i1 %cmp5.not.23, label %for.inc.23, label %if.then7.23 if.then7.23: ; preds = %for.inc.22 %arrayidx9.23 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.22, i64 6 %27 = load i64, ptr %arrayidx9.23, align 16, !tbaa !29 br label %for.inc.23 for.inc.23: ; preds = %if.then7.23, %for.inc.22 %a.addr.2.23 = phi i64 [ %27, %if.then7.23 ], [ %a.addr.2.22, %for.inc.22 ] %and.24 = and i64 %sub, 32 %cmp5.not.24 = icmp eq i64 %and.24, 0 br i1 %cmp5.not.24, label %for.inc.24, label %if.then7.24 if.then7.24: ; preds = %for.inc.23 %arrayidx9.24 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.23, i64 5 %28 = load i64, ptr %arrayidx9.24, align 8, !tbaa !29 br label %for.inc.24 for.inc.24: ; preds = %if.then7.24, %for.inc.23 %a.addr.2.24 = phi i64 [ %28, %if.then7.24 ], [ %a.addr.2.23, %for.inc.23 ] %and.25 = and i64 %sub, 16 %cmp5.not.25 = icmp eq i64 %and.25, 0 br i1 %cmp5.not.25, label %for.inc.25, label %if.then7.25 if.then7.25: ; preds = %for.inc.24 %arrayidx9.25 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.24, i64 4 %29 = load i64, ptr %arrayidx9.25, align 16, !tbaa !29 br label %for.inc.25 for.inc.25: ; preds = %if.then7.25, %for.inc.24 %a.addr.2.25 = phi i64 [ %29, %if.then7.25 ], [ %a.addr.2.24, %for.inc.24 ] %and.26 = and i64 %sub, 8 %cmp5.not.26 = icmp eq i64 %and.26, 0 br i1 %cmp5.not.26, label %for.inc.26, label %if.then7.26 if.then7.26: ; preds = %for.inc.25 %arrayidx9.26 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.25, i64 3 %30 = load i64, ptr %arrayidx9.26, align 8, !tbaa !29 br label %for.inc.26 for.inc.26: ; preds = %if.then7.26, %for.inc.25 %a.addr.2.26 = phi i64 [ %30, %if.then7.26 ], [ %a.addr.2.25, %for.inc.25 ] %and.27 = and i64 %sub, 4 %cmp5.not.27 = icmp eq i64 %and.27, 0 br i1 %cmp5.not.27, label %for.inc.27, label %if.then7.27 if.then7.27: ; preds = %for.inc.26 %arrayidx9.27 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.26, i64 2 %31 = load i64, ptr %arrayidx9.27, align 16, !tbaa !29 br label %for.inc.27 for.inc.27: ; preds = %if.then7.27, %for.inc.26 %a.addr.2.27 = phi i64 [ %31, %if.then7.27 ], [ %a.addr.2.26, %for.inc.26 ] %and.28 = and i64 %sub, 2 %cmp5.not.28 = icmp eq i64 %and.28, 0 br i1 %cmp5.not.28, label %for.inc.28, label %if.then7.28 if.then7.28: ; preds = %for.inc.27 %arrayidx9.28 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.27, i64 1 %32 = load i64, ptr %arrayidx9.28, align 8, !tbaa !29 br label %for.inc.28 for.inc.28: ; preds = %if.then7.28, %for.inc.27 %a.addr.2.28 = phi i64 [ %32, %if.then7.28 ], [ %a.addr.2.27, %for.inc.27 ] %and.29 = and i64 %sub, 1 %cmp5.not.29 = icmp eq i64 %and.29, 0 br i1 %cmp5.not.29, label %for.inc.29, label %if.then7.29 if.then7.29: ; preds = %for.inc.28 %arrayidx9.29 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.2.28, i64 0 %33 = load i64, ptr %arrayidx9.29, align 16, !tbaa !29 br label %for.inc.29 for.inc.29: ; preds = %if.then7.29, %for.inc.28 %a.addr.2.29 = phi i64 [ %33, %if.then7.29 ], [ %a.addr.2.28, %for.inc.28 ] %cmp11.not75 = icmp eq i64 %a.addr.2.29, %spec.select br i1 %cmp11.not75, label %cleanup, label %while.cond13.preheader while.cond13.preheader: ; preds = %for.inc.29, %if.end32 %a.addr.377 = phi i64 [ %37, %if.end32 ], [ %a.addr.2.29, %for.inc.29 ] %b.addr.176 = phi i64 [ %38, %if.end32 ], [ %spec.select, %for.inc.29 ] br label %while.body16 while.body16: ; preds = %while.cond13.preheader, %while.body16 %fi.074 = phi i64 [ 29, %while.cond13.preheader ], [ %fi.1, %while.body16 ] %st.073 = phi i64 [ 0, %while.cond13.preheader ], [ %st.1, %while.body16 ] %add = add nsw i64 %fi.074, %st.073 %div = sdiv i64 %add, 2 %arrayidx18 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.377, i64 %div %34 = load i64, ptr %arrayidx18, align 8, !tbaa !29 %arrayidx20 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %b.addr.176, i64 %div %35 = load i64, ptr %arrayidx20, align 8, !tbaa !29 %cmp21 = icmp eq i64 %34, %35 %sub24 = add nsw i64 %div, -1 %add25 = add nsw i64 %div, 1 %st.1 = select i1 %cmp21, i64 %st.073, i64 %add25 %fi.1 = select i1 %cmp21, i64 %sub24, i64 %fi.074 %cmp14.not = icmp sgt i64 %st.1, %fi.1 br i1 %cmp14.not, label %while.end, label %while.body16, !llvm.loop !49 while.end: ; preds = %while.body16 %cmp27 = icmp eq i64 %fi.1, -1 br i1 %cmp27, label %if.then29, label %if.end32 if.then29: ; preds = %while.end %arrayidx30 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.377 %36 = load i64, ptr %arrayidx30, align 16, !tbaa !29 br label %cleanup if.end32: ; preds = %while.end %arrayidx34 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %a.addr.377, i64 %fi.1 %37 = load i64, ptr %arrayidx34, align 8, !tbaa !29 %arrayidx36 = getelementptr inbounds [524288 x [32 x i64]], ptr @doubling, i64 0, i64 %b.addr.176, i64 %fi.1 %38 = load i64, ptr %arrayidx36, align 8, !tbaa !29 %cmp11.not = icmp eq i64 %37, %38 br i1 %cmp11.not, label %cleanup, label %while.cond13.preheader, !llvm.loop !50 cleanup: ; preds = %if.end32, %for.inc.29, %if.then29 %retval.0 = phi i64 [ %36, %if.then29 ], [ %spec.select, %for.inc.29 ], [ %37, %if.end32 ] ret i64 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local void @tdfs(i64 noundef %nv, i64 noundef %bv, ptr nocapture noundef readonly %g, ptr nocapture noundef readonly %x) local_unnamed_addr #12 { entry: %arrayidx = getelementptr inbounds [524288 x i8], ptr @fl, i64 0, i64 %nv %0 = load i8, ptr %arrayidx, align 1, !tbaa !51, !range !53, !noundef !54 %cmp = icmp eq i8 %0, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %arrayidx2 = getelementptr inbounds [524288 x %struct.mkj], ptr @qx, i64 0, i64 %nv %1 = load i64, ptr %arrayidx2, align 16, !tbaa !44 %kz = getelementptr inbounds [524288 x %struct.mkj], ptr @qx, i64 0, i64 %nv, i32 1 %2 = load i64, ptr %kz, align 8, !tbaa !42 %add = add nsw i64 %2, %1 %cmp6125 = icmp sgt i64 %2, 0 br i1 %cmp6125, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %if.then %3 = load i64, ptr @dc, align 16, !tbaa !29 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %i.0126 = phi i64 [ %1, %for.body.lr.ph ], [ %inc, %for.body ] %fi = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %i.0126, i32 1 %4 = load i64, ptr %fi, align 8, !tbaa !47 %mul = mul nsw i64 %4, %3 %id = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %i.0126, i32 4 %5 = load i64, ptr %id, align 8, !tbaa !55 %arrayidx10 = getelementptr inbounds [524288 x i64], ptr @res, i64 0, i64 %5 %6 = load i64, ptr %arrayidx10, align 8, !tbaa !29 %add11 = add nsw i64 %6, %mul %cl = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %i.0126, i32 2 %7 = load i64, ptr %cl, align 8, !tbaa !56 %arrayidx13 = getelementptr inbounds [524288 x i64], ptr @dc, i64 0, i64 %7 %8 = load i64, ptr %arrayidx13, align 8, !tbaa !29 %mul16 = mul nsw i64 %8, %4 %sub = sub nsw i64 %add11, %mul16 %arrayidx22 = getelementptr inbounds [524288 x i64], ptr @ec, i64 0, i64 %7 %9 = load i64, ptr %arrayidx22, align 8, !tbaa !29 %kr = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %i.0126, i32 3 %10 = load i64, ptr %kr, align 8, !tbaa !57 %mul24 = mul i64 %9, %4 %mul27 = mul i64 %mul24, %10 %add31 = add nsw i64 %mul27, %sub store i64 %add31, ptr %arrayidx10, align 8, !tbaa !29 %inc = add nsw i64 %i.0126, 1 %cmp6 = icmp slt i64 %inc, %add br i1 %cmp6, label %for.body, label %for.end, !llvm.loop !58 for.end: ; preds = %for.body, %if.then store i8 1, ptr %arrayidx, align 1, !tbaa !51 br label %if.end if.end: ; preds = %for.end, %entry %arrayidx33 = getelementptr inbounds %struct.mkj, ptr %x, i64 %nv %kz39 = getelementptr inbounds %struct.mkj, ptr %x, i64 %nv, i32 1 %11 = load i64, ptr %kz39, align 8, !tbaa !42 %cmp41128 = icmp sgt i64 %11, 0 br i1 %cmp41128, label %for.body43.preheader, label %for.end81 for.body43.preheader: ; preds = %if.end %12 = load i64, ptr %arrayidx33, align 8, !tbaa !44 br label %for.body43 for.body43: ; preds = %for.body43.preheader, %for.inc79 %13 = phi i64 [ %33, %for.inc79 ], [ %11, %for.body43.preheader ] %14 = phi i64 [ %34, %for.inc79 ], [ %12, %for.body43.preheader ] %i.1129 = phi i64 [ %inc80, %for.inc79 ], [ %12, %for.body43.preheader ] %fi45 = getelementptr inbounds %struct.rs, ptr %g, i64 %i.1129, i32 1 %15 = load i64, ptr %fi45, align 8, !tbaa !47 %cmp46 = icmp eq i64 %15, %bv br i1 %cmp46, label %for.inc79, label %if.end49 if.end49: ; preds = %for.body43 %16 = load i64, ptr @ec, align 16, !tbaa !29 %inc50 = add nsw i64 %16, 1 store i64 %inc50, ptr @ec, align 16, !tbaa !29 %cl52 = getelementptr inbounds %struct.rs, ptr %g, i64 %i.1129, i32 2 %17 = load i64, ptr %cl52, align 8, !tbaa !56 %arrayidx53 = getelementptr inbounds [524288 x i64], ptr @ec, i64 0, i64 %17 %18 = load i64, ptr %arrayidx53, align 8, !tbaa !29 %inc54 = add nsw i64 %18, 1 store i64 %inc54, ptr %arrayidx53, align 8, !tbaa !29 %kr56 = getelementptr inbounds %struct.rs, ptr %g, i64 %i.1129, i32 3 %19 = load i64, ptr %kr56, align 8, !tbaa !57 %20 = load i64, ptr @dc, align 16, !tbaa !29 %add57 = add nsw i64 %20, %19 store i64 %add57, ptr @dc, align 16, !tbaa !29 %21 = load i64, ptr %kr56, align 8, !tbaa !57 %22 = load i64, ptr %cl52, align 8, !tbaa !56 %arrayidx62 = getelementptr inbounds [524288 x i64], ptr @dc, i64 0, i64 %22 %23 = load i64, ptr %arrayidx62, align 8, !tbaa !29 %add63 = add nsw i64 %23, %21 store i64 %add63, ptr %arrayidx62, align 8, !tbaa !29 %24 = load i64, ptr %fi45, align 8, !tbaa !47 tail call void @tdfs(i64 noundef %24, i64 noundef %nv, ptr noundef nonnull %g, ptr noundef nonnull %x) %25 = load i64, ptr @ec, align 16, !tbaa !29 %dec = add nsw i64 %25, -1 store i64 %dec, ptr @ec, align 16, !tbaa !29 %26 = load i64, ptr %cl52, align 8, !tbaa !56 %arrayidx68 = getelementptr inbounds [524288 x i64], ptr @ec, i64 0, i64 %26 %27 = load i64, ptr %arrayidx68, align 8, !tbaa !29 %dec69 = add nsw i64 %27, -1 store i64 %dec69, ptr %arrayidx68, align 8, !tbaa !29 %28 = load i64, ptr %kr56, align 8, !tbaa !57 %29 = load i64, ptr @dc, align 16, !tbaa !29 %sub72 = sub nsw i64 %29, %28 store i64 %sub72, ptr @dc, align 16, !tbaa !29 %30 = load i64, ptr %kr56, align 8, !tbaa !57 %31 = load i64, ptr %cl52, align 8, !tbaa !56 %arrayidx77 = getelementptr inbounds [524288 x i64], ptr @dc, i64 0, i64 %31 %32 = load i64, ptr %arrayidx77, align 8, !tbaa !29 %sub78 = sub nsw i64 %32, %30 store i64 %sub78, ptr %arrayidx77, align 8, !tbaa !29 %.pre = load i64, ptr %arrayidx33, align 8, !tbaa !44 %.pre130 = load i64, ptr %kz39, align 8, !tbaa !42 br label %for.inc79 for.inc79: ; preds = %for.body43, %if.end49 %33 = phi i64 [ %13, %for.body43 ], [ %.pre130, %if.end49 ] %34 = phi i64 [ %14, %for.body43 ], [ %.pre, %if.end49 ] %inc80 = add nsw i64 %i.1129, 1 %add40 = add nsw i64 %33, %34 %cmp41 = icmp slt i64 %inc80, %add40 br i1 %cmp41, label %for.body43, label %for.end81, !llvm.loop !59 for.end81: ; preds = %for.inc79, %if.end ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #14 { entry: %n = alloca i64, align 8 %a = alloca i64, align 8 %b = alloca i64, align 8 %h = alloca i64, align 8 %w = alloca i64, align 8 %q = alloca i64, align 8 %g = alloca [524288 x %struct.rs], align 16 %x = alloca [524288 x %struct.mkj], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #19 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #19 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #19 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #19 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %w) #19 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #19 call void @llvm.lifetime.start.p0(i64 20971520, ptr nonnull %g) #19 call void @llvm.lifetime.start.p0(i64 8388608, ptr nonnull %x) #19 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %q) %0 = load i64, ptr %n, align 8, !tbaa !29 %sub192 = add nsw i64 %0, -1 %cmp193 = icmp sgt i64 %0, 1 br i1 %cmp193, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.0194 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %mul = shl nuw nsw i64 %i.0194, 1 %arrayidx = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %mul %cl = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %mul, i32 2 %kr = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %mul, i32 3 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %cl, ptr noundef nonnull %kr) %1 = load i64, ptr %a, align 8, !tbaa !29 store i64 %1, ptr %arrayidx, align 16, !tbaa !40 %2 = load i64, ptr %b, align 8, !tbaa !29 %fi = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %mul, i32 1 store i64 %2, ptr %fi, align 8, !tbaa !47 %add = or i64 %mul, 1 %arrayidx10 = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %add store i64 %2, ptr %arrayidx10, align 8, !tbaa !40 %fi15 = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %add, i32 1 store i64 %1, ptr %fi15, align 16, !tbaa !47 %cl22 = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %add, i32 2 %3 = load <2 x i64>, ptr %cl, align 16, !tbaa !29 store <2 x i64> %3, ptr %cl22, align 8, !tbaa !29 %inc = add nuw nsw i64 %i.0194, 1 %4 = load i64, ptr %n, align 8, !tbaa !29 %sub = add nsw i64 %4, -1 %cmp = icmp slt i64 %inc, %sub br i1 %cmp, label %for.body, label %for.end, !llvm.loop !60 for.end: ; preds = %for.body, %entry %sub.lcssa = phi i64 [ %sub192, %entry ], [ %sub, %for.body ] %mul31 = shl nsw i64 %sub.lcssa, 1 call void @qsort(ptr noundef nonnull %g, i64 noundef %mul31, i64 noundef 40, ptr noundef nonnull @sortfnc) #19 %5 = load i64, ptr %n, align 8, !tbaa !29 %sub34 = shl i64 %5, 1 %mul35 = add i64 %sub34, -2 %6 = load i64, ptr %g, align 16, !tbaa !40 %cmp36.i = icmp sgt i64 %mul35, 1 br i1 %cmp36.i, label %for.body.i, label %makemkj.exit for.body.i: ; preds = %for.end, %for.inc.i %nst.039.i = phi i64 [ %nst.1.i, %for.inc.i ], [ %6, %for.end ] %ms.038.i = phi i64 [ %ms.1.i, %for.inc.i ], [ 0, %for.end ] %i.037.i = phi i64 [ %inc.i, %for.inc.i ], [ 1, %for.end ] %arrayidx1.i = getelementptr inbounds %struct.rs, ptr %g, i64 %i.037.i %7 = load i64, ptr %arrayidx1.i, align 8, !tbaa !40 %arrayidx3.i = getelementptr %struct.rs, ptr %arrayidx1.i, i64 -1 %8 = load i64, ptr %arrayidx3.i, align 8, !tbaa !40 %cmp5.not.i = icmp eq i64 %7, %8 br i1 %cmp5.not.i, label %for.inc.i, label %if.then.i if.then.i: ; preds = %for.body.i %sub6.i = sub nsw i64 %i.037.i, %ms.038.i %arrayidx7.i = getelementptr inbounds %struct.mkj, ptr %x, i64 %nst.039.i %kz.i = getelementptr inbounds %struct.mkj, ptr %x, i64 %nst.039.i, i32 1 store i64 %sub6.i, ptr %kz.i, align 8, !tbaa !42 store i64 %ms.038.i, ptr %arrayidx7.i, align 16, !tbaa !44 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body.i %ms.1.i = phi i64 [ %i.037.i, %if.then.i ], [ %ms.038.i, %for.body.i ] %nst.1.i = phi i64 [ %7, %if.then.i ], [ %nst.039.i, %for.body.i ] %inc.i = add nuw nsw i64 %i.037.i, 1 %exitcond.not.i = icmp eq i64 %inc.i, %mul35 br i1 %exitcond.not.i, label %makemkj.exit, label %for.body.i, !llvm.loop !45 makemkj.exit: ; preds = %for.inc.i, %for.end %ms.0.lcssa.i = phi i64 [ 0, %for.end ], [ %ms.1.i, %for.inc.i ] %nst.0.lcssa.i = phi i64 [ %6, %for.end ], [ %nst.1.i, %for.inc.i ] %sub12.i = sub nsw i64 %mul35, %ms.0.lcssa.i %arrayidx13.i = getelementptr inbounds %struct.mkj, ptr %x, i64 %nst.0.lcssa.i %kz14.i = getelementptr inbounds %struct.mkj, ptr %x, i64 %nst.0.lcssa.i, i32 1 store i64 %sub12.i, ptr %kz14.i, align 8, !tbaa !42 store i64 %ms.0.lcssa.i, ptr %arrayidx13.i, align 16, !tbaa !44 %cmp37.not196 = icmp slt i64 %5, 0 br i1 %cmp37.not196, label %for.end51, label %for.body38.preheader for.body38.preheader: ; preds = %makemkj.exit %9 = shl i64 %5, 3 %10 = add i64 %9, 8 call void @llvm.memset.p0.i64(ptr nonnull align 16 @nrep, i8 -1, i64 %10, i1 false), !tbaa !29 %11 = add i64 %5, 1 %xtraiter = and i64 %11, 3 %12 = icmp ult i64 %5, 3 br i1 %12, label %for.end51.loopexit.unr-lcssa, label %for.body38.preheader.new for.body38.preheader.new: ; preds = %for.body38.preheader %unroll_iter = and i64 %11, -4 br label %for.body38 for.body38: ; preds = %for.body38, %for.body38.preheader.new %i.1197 = phi i64 [ 0, %for.body38.preheader.new ], [ %inc50.3, %for.body38 ] %niter = phi i64 [ 0, %for.body38.preheader.new ], [ %niter.next.3, %for.body38 ] %13 = shl i64 %i.1197, 8 %scevgep = getelementptr i8, ptr @doubling, i64 %13 %arrayidx39 = getelementptr inbounds [524288 x i64], ptr @dist, i64 0, i64 %i.1197 store i64 1072114514, ptr %arrayidx39, align 16, !tbaa !29 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(240) %scevgep, i8 -1, i64 240, i1 false), !tbaa !29 %inc50 = or i64 %i.1197, 1 %14 = shl i64 %inc50, 8 %scevgep.1 = getelementptr i8, ptr @doubling, i64 %14 %arrayidx39.1 = getelementptr inbounds [524288 x i64], ptr @dist, i64 0, i64 %inc50 store i64 1072114514, ptr %arrayidx39.1, align 8, !tbaa !29 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(240) %scevgep.1, i8 -1, i64 240, i1 false), !tbaa !29 %inc50.1 = or i64 %i.1197, 2 %15 = shl i64 %inc50.1, 8 %scevgep.2 = getelementptr i8, ptr @doubling, i64 %15 %arrayidx39.2 = getelementptr inbounds [524288 x i64], ptr @dist, i64 0, i64 %inc50.1 store i64 1072114514, ptr %arrayidx39.2, align 16, !tbaa !29 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(240) %scevgep.2, i8 -1, i64 240, i1 false), !tbaa !29 %inc50.2 = or i64 %i.1197, 3 %16 = shl i64 %inc50.2, 8 %scevgep.3 = getelementptr i8, ptr @doubling, i64 %16 %arrayidx39.3 = getelementptr inbounds [524288 x i64], ptr @dist, i64 0, i64 %inc50.2 store i64 1072114514, ptr %arrayidx39.3, align 8, !tbaa !29 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(240) %scevgep.3, i8 -1, i64 240, i1 false), !tbaa !29 %inc50.3 = add nuw i64 %i.1197, 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.end51.loopexit.unr-lcssa, label %for.body38, !llvm.loop !61 for.end51.loopexit.unr-lcssa: ; preds = %for.body38, %for.body38.preheader %i.1197.unr = phi i64 [ 0, %for.body38.preheader ], [ %inc50.3, %for.body38 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end51, label %for.body38.epil for.body38.epil: ; preds = %for.end51.loopexit.unr-lcssa, %for.body38.epil %i.1197.epil = phi i64 [ %inc50.epil, %for.body38.epil ], [ %i.1197.unr, %for.end51.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body38.epil ], [ 0, %for.end51.loopexit.unr-lcssa ] %17 = shl i64 %i.1197.epil, 8 %scevgep.epil = getelementptr i8, ptr @doubling, i64 %17 %arrayidx39.epil = getelementptr inbounds [524288 x i64], ptr @dist, i64 0, i64 %i.1197.epil store i64 1072114514, ptr %arrayidx39.epil, align 8, !tbaa !29 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(240) %scevgep.epil, i8 -1, i64 240, i1 false), !tbaa !29 %inc50.epil = add nuw i64 %i.1197.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.end51, label %for.body38.epil, !llvm.loop !62 for.end51: ; preds = %for.end51.loopexit.unr-lcssa, %for.body38.epil, %makemkj.exit call void @dfs(i64 noundef 1, i64 noundef 0, ptr noundef nonnull %g, ptr noundef nonnull %x) %18 = load i64, ptr %q, align 8, !tbaa !29 %cmp55198 = icmp sgt i64 %18, 0 br i1 %cmp55198, label %for.body56, label %for.end115 for.body56: ; preds = %for.end51, %for.body56 %i.2199 = phi i64 [ %inc114, %for.body56 ], [ 0, %for.end51 ] %call57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %h, ptr noundef nonnull %w, ptr noundef nonnull %a, ptr noundef nonnull %b) %19 = load i64, ptr %a, align 8, !tbaa !29 %20 = load i64, ptr %b, align 8, !tbaa !29 %call58 = call i64 @query(i64 noundef %19, i64 noundef %20) %mul59 = mul nsw i64 %i.2199, 3 %arrayidx60 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %mul59 store i64 %19, ptr %arrayidx60, align 8, !tbaa !40 %fi64 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %mul59, i32 1 store i64 1, ptr %fi64, align 8, !tbaa !47 %21 = load i64, ptr %h, align 8, !tbaa !29 %cl67 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %mul59, i32 2 store i64 %21, ptr %cl67, align 8, !tbaa !56 %22 = load i64, ptr %w, align 8, !tbaa !29 %kr70 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %mul59, i32 3 store i64 %22, ptr %kr70, align 8, !tbaa !57 %id = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %mul59, i32 4 store i64 %i.2199, ptr %id, align 8, !tbaa !55 %add74 = add nuw nsw i64 %mul59, 1 %arrayidx75 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %add74 store i64 %20, ptr %arrayidx75, align 8, !tbaa !40 %fi80 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %add74, i32 1 store i64 1, ptr %fi80, align 8, !tbaa !47 %cl84 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %add74, i32 2 store i64 %21, ptr %cl84, align 8, !tbaa !56 %kr88 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %add74, i32 3 store i64 %22, ptr %kr88, align 8, !tbaa !57 %id92 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %add74, i32 4 store i64 %i.2199, ptr %id92, align 8, !tbaa !55 %add94 = add nuw nsw i64 %mul59, 2 %arrayidx95 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %add94 store i64 %call58, ptr %arrayidx95, align 8, !tbaa !40 %fi100 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %add94, i32 1 store i64 -2, ptr %fi100, align 8, !tbaa !47 %cl104 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %add94, i32 2 store i64 %21, ptr %cl104, align 8, !tbaa !56 %kr108 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %add94, i32 3 store i64 %22, ptr %kr108, align 8, !tbaa !57 %id112 = getelementptr inbounds [524288 x %struct.rs], ptr @qg, i64 0, i64 %add94, i32 4 store i64 %i.2199, ptr %id112, align 8, !tbaa !55 %inc114 = add nuw nsw i64 %i.2199, 1 %23 = load i64, ptr %q, align 8, !tbaa !29 %cmp55 = icmp slt i64 %inc114, %23 br i1 %cmp55, label %for.body56, label %for.end115, !llvm.loop !63 for.end115: ; preds = %for.body56, %for.end51 %.lcssa = phi i64 [ %18, %for.end51 ], [ %23, %for.body56 ] %mul116 = mul nsw i64 %.lcssa, 3 call void @qsort(ptr noundef nonnull @qg, i64 noundef %mul116, i64 noundef 40, ptr noundef nonnull @sortfnc) #19 %24 = load i64, ptr %q, align 8, !tbaa !29 %mul117 = mul nsw i64 %24, 3 %25 = load i64, ptr @qg, align 16, !tbaa !40 %cmp36.i169 = icmp sgt i64 %24, 0 br i1 %cmp36.i169, label %for.body.i175, label %makemkj.exit191 for.body.i175: ; preds = %for.end115, %for.inc.i186 %nst.039.i176 = phi i64 [ %nst.1.i188, %for.inc.i186 ], [ %25, %for.end115 ] %ms.038.i177 = phi i64 [ %ms.1.i187, %for.inc.i186 ], [ 0, %for.end115 ] %i.037.i178 = phi i64 [ %inc.i189, %for.inc.i186 ], [ 1, %for.end115 ] %arrayidx1.i179 = getelementptr inbounds %struct.rs, ptr @qg, i64 %i.037.i178 %26 = load i64, ptr %arrayidx1.i179, align 8, !tbaa !40 %arrayidx3.i180 = getelementptr %struct.rs, ptr %arrayidx1.i179, i64 -1 %27 = load i64, ptr %arrayidx3.i180, align 8, !tbaa !40 %cmp5.not.i181 = icmp eq i64 %26, %27 br i1 %cmp5.not.i181, label %for.inc.i186, label %if.then.i182 if.then.i182: ; preds = %for.body.i175 %sub6.i183 = sub nsw i64 %i.037.i178, %ms.038.i177 %arrayidx7.i184 = getelementptr inbounds %struct.mkj, ptr @qx, i64 %nst.039.i176 %kz.i185 = getelementptr inbounds %struct.mkj, ptr @qx, i64 %nst.039.i176, i32 1 store i64 %sub6.i183, ptr %kz.i185, align 8, !tbaa !42 store i64 %ms.038.i177, ptr %arrayidx7.i184, align 16, !tbaa !44 br label %for.inc.i186 for.inc.i186: ; preds = %if.then.i182, %for.body.i175 %ms.1.i187 = phi i64 [ %i.037.i178, %if.then.i182 ], [ %ms.038.i177, %for.body.i175 ] %nst.1.i188 = phi i64 [ %26, %if.then.i182 ], [ %nst.039.i176, %for.body.i175 ] %inc.i189 = add nuw nsw i64 %i.037.i178, 1 %exitcond.not.i190 = icmp eq i64 %inc.i189, %mul117 br i1 %exitcond.not.i190, label %makemkj.exit191, label %for.body.i175, !llvm.loop !45 makemkj.exit191: ; preds = %for.inc.i186, %for.end115 %ms.0.lcssa.i170 = phi i64 [ 0, %for.end115 ], [ %ms.1.i187, %for.inc.i186 ] %nst.0.lcssa.i171 = phi i64 [ %25, %for.end115 ], [ %nst.1.i188, %for.inc.i186 ] %sub12.i172 = sub nsw i64 %mul117, %ms.0.lcssa.i170 %arrayidx13.i173 = getelementptr inbounds %struct.mkj, ptr @qx, i64 %nst.0.lcssa.i171 %kz14.i174 = getelementptr inbounds %struct.mkj, ptr @qx, i64 %nst.0.lcssa.i171, i32 1 store i64 %sub12.i172, ptr %kz14.i174, align 8, !tbaa !42 store i64 %ms.0.lcssa.i170, ptr %arrayidx13.i173, align 16, !tbaa !44 call void @tdfs(i64 noundef 1, i64 noundef -1, ptr noundef nonnull %g, ptr noundef nonnull %x) %28 = load i64, ptr %q, align 8, !tbaa !29 %cmp121201 = icmp sgt i64 %28, 0 br i1 %cmp121201, label %for.body122, label %for.end127 for.body122: ; preds = %makemkj.exit191, %for.body122 %i.3202 = phi i64 [ %inc126, %for.body122 ], [ 0, %makemkj.exit191 ] %arrayidx123 = getelementptr inbounds [524288 x i64], ptr @res, i64 0, i64 %i.3202 %29 = load i64, ptr %arrayidx123, align 8, !tbaa !29 %call124 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %29) %inc126 = add nuw nsw i64 %i.3202, 1 %30 = load i64, ptr %q, align 8, !tbaa !29 %cmp121 = icmp slt i64 %inc126, %30 br i1 %cmp121, label %for.body122, label %for.end127, !llvm.loop !64 for.end127: ; preds = %for.body122, %makemkj.exit191 call void @llvm.lifetime.end.p0(i64 8388608, ptr nonnull %x) #19 call void @llvm.lifetime.end.p0(i64 20971520, ptr nonnull %g) #19 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #19 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %w) #19 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #19 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #19 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #19 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #19 ret i32 0 } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #15 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #16 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #17 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #16 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 = { 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 #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind "no-trapping-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 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 #11 = { 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 #12 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #13 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #14 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #15 = { 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 #16 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #17 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #18 = { nounwind willreturn memory(read) } attributes #19 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"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, !6} !8 = distinct !{!8, !6, !9, !10} !9 = !{!"llvm.loop.isvectorized", i32 1} !10 = !{!"llvm.loop.unroll.runtime.disable"} !11 = distinct !{!11, !6, !10, !9} !12 = distinct !{!12, !6, !9, !10} !13 = distinct !{!13, !6, !10, !9} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6} !18 = distinct !{!18, !6} !19 = distinct !{!19, !20} !20 = !{!"llvm.loop.unroll.disable"} !21 = distinct !{!21, !6} !22 = distinct !{!22, !20} !23 = distinct !{!23, !6} !24 = distinct !{!24, !6} !25 = !{!26, !26, i64 0} !26 = !{!"int", !27, i64 0} !27 = !{!"omnipotent char", !28, i64 0} !28 = !{!"Simple C/C++ TBAA"} !29 = !{!30, !30, i64 0} !30 = !{!"long long", !27, i64 0} !31 = !{!32, !32, i64 0} !32 = !{!"double", !27, i64 0} !33 = distinct !{!33, !6, !9, !10} !34 = distinct !{!34, !6, !10, !9} !35 = distinct !{!35, !6} !36 = distinct !{!36, !6} !37 = distinct !{!37, !6} !38 = !{!39, !26, i64 0} !39 = !{!"", !26, i64 0, !26, i64 4} !40 = !{!41, !30, i64 0} !41 = !{!"", !30, i64 0, !30, i64 8, !30, i64 16, !30, i64 24, !30, i64 32} !42 = !{!43, !30, i64 8} !43 = !{!"", !30, i64 0, !30, i64 8} !44 = !{!43, !30, i64 0} !45 = distinct !{!45, !6} !46 = distinct !{!46, !6} !47 = !{!41, !30, i64 8} !48 = distinct !{!48, !6} !49 = distinct !{!49, !6} !50 = distinct !{!50, !6} !51 = !{!52, !52, i64 0} !52 = !{!"_Bool", !27, i64 0} !53 = !{i8 0, i8 2} !54 = !{} !55 = !{!41, !30, i64 32} !56 = !{!41, !30, i64 16} !57 = !{!41, !30, i64 24} !58 = distinct !{!58, !6} !59 = distinct !{!59, !6} !60 = distinct !{!60, !6} !61 = distinct !{!61, !6} !62 = distinct !{!62, !20} !63 = distinct !{!63, !6} !64 = distinct !{!64, !6}
#include<stdio.h> int a[1010],m,n,i,b,c; int main(){ scanf("%d%d",&n,&m); while(n!=0 && m!=0){ for(i=1;i<=n;i++)a[i]=1; b=i=n; while(b>1){ c=0; while(c<m){ i++;if(i>n)i=1; c+=a[i]; } a[i]=0;b--; } for(i=1;i<=n;i++)if(a[i]==1)printf("%d\n",i); scanf("%d%d",&n,&m); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264467/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264467/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @n = dso_local global i32 0, align 4 @m = dso_local global i32 0, align 4 @i = dso_local local_unnamed_addr global i32 0, align 4 @a = dso_local local_unnamed_addr global [1010 x i32] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global i32 0, align 4 @c = dso_local local_unnamed_addr global i32 0, align 4 @.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: %call = tail 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 %cmp52 = icmp ne i32 %0, 0 %1 = load i32, ptr @m, align 4 %cmp153 = icmp ne i32 %1, 0 %2 = select i1 %cmp52, i1 %cmp153, i1 false br i1 %2, label %for.cond.preheader, label %while.end29 for.cond.preheader: ; preds = %entry, %for.end27 %3 = phi i32 [ %20, %for.end27 ], [ %1, %entry ] %4 = phi i32 [ %19, %for.end27 ], [ %0, %entry ] %cmp2.not35 = icmp slt i32 %4, 1 br i1 %cmp2.not35, label %for.cond16.preheader.thread, label %for.body.preheader for.cond16.preheader.thread: ; preds = %for.cond.preheader store i32 %4, ptr @b, align 4, !tbaa !5 store i32 1, ptr @i, align 4, !tbaa !5 br label %for.end27 for.body.preheader: ; preds = %for.cond.preheader %5 = add nuw i32 %4, 1 %wide.trip.count = zext i32 %5 to i64 %6 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %4, 8 br i1 %min.iters.check, label %for.body.preheader58, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %6, -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 ] %offset.idx = or i64 %index, 1 %7 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %offset.idx store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %7, align 4, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %8, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %6, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader58 for.body.preheader58: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader58, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader58 ] %arrayidx = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block %cmp445 = icmp sgt i32 %4, 1 br i1 %cmp445, label %while.cond6.preheader.lr.ph, label %for.cond16.preheader while.cond6.preheader.lr.ph: ; preds = %for.end %cmp738 = icmp sgt i32 %3, 0 br i1 %cmp738, label %while.cond6.preheader.us.preheader, label %while.cond6.preheader.lr.ph.split while.cond6.preheader.us.preheader: ; preds = %while.cond6.preheader.lr.ph %10 = and i32 %4, 1 %lcmp.mod.not.not = icmp eq i32 %10, 0 br i1 %lcmp.mod.not.not, label %while.body8.us.prol, label %while.cond6.preheader.us.prol.loopexit while.body8.us.prol: ; preds = %while.cond6.preheader.us.preheader, %while.body8.us.prol %storemerge3440.us.prol = phi i32 [ %add.us.prol, %while.body8.us.prol ], [ 0, %while.cond6.preheader.us.preheader ] %spec.store.select3739.us.prol = phi i32 [ %spec.store.select.us.prol, %while.body8.us.prol ], [ %4, %while.cond6.preheader.us.preheader ] %inc9.us.prol = add nsw i32 %spec.store.select3739.us.prol, 1 %cmp10.not.us.prol = icmp slt i32 %spec.store.select3739.us.prol, %4 %spec.store.select.us.prol = select i1 %cmp10.not.us.prol, i32 %inc9.us.prol, i32 1 %idxprom11.us.prol = sext i32 %spec.store.select.us.prol to i64 %arrayidx12.us.prol = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %idxprom11.us.prol %11 = load i32, ptr %arrayidx12.us.prol, align 4, !tbaa !5 %add.us.prol = add nsw i32 %11, %storemerge3440.us.prol %cmp7.us.prol = icmp slt i32 %add.us.prol, %3 br i1 %cmp7.us.prol, label %while.body8.us.prol, label %while.cond6.while.end_crit_edge.us.prol, !llvm.loop !14 while.cond6.while.end_crit_edge.us.prol: ; preds = %while.body8.us.prol store i32 0, ptr %arrayidx12.us.prol, align 4, !tbaa !5 %dec.us.prol = add nsw i32 %4, -1 br label %while.cond6.preheader.us.prol.loopexit while.cond6.preheader.us.prol.loopexit: ; preds = %while.cond6.while.end_crit_edge.us.prol, %while.cond6.preheader.us.preheader %storemerge3247.us.unr = phi i32 [ %4, %while.cond6.preheader.us.preheader ], [ %dec.us.prol, %while.cond6.while.end_crit_edge.us.prol ] %spec.store.select.lcssa4446.us.unr = phi i32 [ %4, %while.cond6.preheader.us.preheader ], [ %spec.store.select.us.prol, %while.cond6.while.end_crit_edge.us.prol ] %add.us.lcssa.lcssa.unr = phi i32 [ undef, %while.cond6.preheader.us.preheader ], [ %add.us.prol, %while.cond6.while.end_crit_edge.us.prol ] %12 = icmp eq i32 %4, 2 br i1 %12, label %while.cond3.for.cond16.preheader_crit_edge, label %while.cond6.preheader.us while.cond6.preheader.us: ; preds = %while.cond6.preheader.us.prol.loopexit, %while.cond6.while.end_crit_edge.us.1 %storemerge3247.us = phi i32 [ %dec.us.1, %while.cond6.while.end_crit_edge.us.1 ], [ %storemerge3247.us.unr, %while.cond6.preheader.us.prol.loopexit ] %spec.store.select.lcssa4446.us = phi i32 [ %spec.store.select.us.1, %while.cond6.while.end_crit_edge.us.1 ], [ %spec.store.select.lcssa4446.us.unr, %while.cond6.preheader.us.prol.loopexit ] br label %while.body8.us while.body8.us: ; preds = %while.cond6.preheader.us, %while.body8.us %storemerge3440.us = phi i32 [ 0, %while.cond6.preheader.us ], [ %add.us, %while.body8.us ] %spec.store.select3739.us = phi i32 [ %spec.store.select.lcssa4446.us, %while.cond6.preheader.us ], [ %spec.store.select.us, %while.body8.us ] %inc9.us = add nsw i32 %spec.store.select3739.us, 1 %cmp10.not.us = icmp slt i32 %spec.store.select3739.us, %4 %spec.store.select.us = select i1 %cmp10.not.us, i32 %inc9.us, i32 1 %idxprom11.us = sext i32 %spec.store.select.us to i64 %arrayidx12.us = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %idxprom11.us %13 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %add.us = add nsw i32 %13, %storemerge3440.us %cmp7.us = icmp slt i32 %add.us, %3 br i1 %cmp7.us, label %while.body8.us, label %while.cond6.while.end_crit_edge.us, !llvm.loop !14 while.cond6.while.end_crit_edge.us: ; preds = %while.body8.us store i32 0, ptr %arrayidx12.us, align 4, !tbaa !5 br label %while.body8.us.1 while.body8.us.1: ; preds = %while.body8.us.1, %while.cond6.while.end_crit_edge.us %storemerge3440.us.1 = phi i32 [ 0, %while.cond6.while.end_crit_edge.us ], [ %add.us.1, %while.body8.us.1 ] %spec.store.select3739.us.1 = phi i32 [ %spec.store.select.us, %while.cond6.while.end_crit_edge.us ], [ %spec.store.select.us.1, %while.body8.us.1 ] %inc9.us.1 = add nsw i32 %spec.store.select3739.us.1, 1 %cmp10.not.us.1 = icmp slt i32 %spec.store.select3739.us.1, %4 %spec.store.select.us.1 = select i1 %cmp10.not.us.1, i32 %inc9.us.1, i32 1 %idxprom11.us.1 = sext i32 %spec.store.select.us.1 to i64 %arrayidx12.us.1 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %idxprom11.us.1 %14 = load i32, ptr %arrayidx12.us.1, align 4, !tbaa !5 %add.us.1 = add nsw i32 %14, %storemerge3440.us.1 %cmp7.us.1 = icmp slt i32 %add.us.1, %3 br i1 %cmp7.us.1, label %while.body8.us.1, label %while.cond6.while.end_crit_edge.us.1, !llvm.loop !14 while.cond6.while.end_crit_edge.us.1: ; preds = %while.body8.us.1 store i32 0, ptr %arrayidx12.us.1, align 4, !tbaa !5 %dec.us.1 = add nsw i32 %storemerge3247.us, -2 %cmp4.us.1 = icmp sgt i32 %storemerge3247.us, 3 br i1 %cmp4.us.1, label %while.cond6.preheader.us, label %while.cond3.for.cond16.preheader_crit_edge, !llvm.loop !15 while.cond6.preheader.lr.ph.split: ; preds = %while.cond6.preheader.lr.ph %idxprom13 = zext i32 %4 to i64 %arrayidx14 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %idxprom13 store i32 0, ptr %arrayidx14, align 4, !tbaa !5 br label %while.cond3.for.cond16.preheader_crit_edge while.cond3.for.cond16.preheader_crit_edge: ; preds = %while.cond6.preheader.us.prol.loopexit, %while.cond6.while.end_crit_edge.us.1, %while.cond6.preheader.lr.ph.split %.us-phi = phi i32 [ 0, %while.cond6.preheader.lr.ph.split ], [ %add.us.lcssa.lcssa.unr, %while.cond6.preheader.us.prol.loopexit ], [ %add.us.1, %while.cond6.while.end_crit_edge.us.1 ] store i32 %.us-phi, ptr @c, align 4, !tbaa !5 br label %for.cond16.preheader for.cond16.preheader: ; preds = %while.cond3.for.cond16.preheader_crit_edge, %for.end %storemerge32.lcssa = phi i32 [ 1, %while.cond3.for.cond16.preheader_crit_edge ], [ %4, %for.end ] store i32 %storemerge32.lcssa, ptr @b, align 4, !tbaa !5 store i32 1, ptr @i, align 4, !tbaa !5 br i1 %cmp2.not35, label %for.end27, label %for.body18 for.body18: ; preds = %for.cond16.preheader, %for.inc25 %15 = phi i32 [ %17, %for.inc25 ], [ %4, %for.cond16.preheader ] %storemerge3351 = phi i32 [ %inc26, %for.inc25 ], [ 1, %for.cond16.preheader ] %idxprom19 = sext i32 %storemerge3351 to i64 %arrayidx20 = getelementptr inbounds [1010 x i32], ptr @a, i64 0, i64 %idxprom19 %16 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21 = icmp eq i32 %16, 1 br i1 %cmp21, label %if.then22, label %for.inc25 if.then22: ; preds = %for.body18 %call23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %storemerge3351) %.pre = load i32, ptr @i, align 4, !tbaa !5 %.pre55 = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc25 for.inc25: ; preds = %for.body18, %if.then22 %17 = phi i32 [ %15, %for.body18 ], [ %.pre55, %if.then22 ] %18 = phi i32 [ %storemerge3351, %for.body18 ], [ %.pre, %if.then22 ] %inc26 = add nsw i32 %18, 1 store i32 %inc26, ptr @i, align 4, !tbaa !5 %cmp17.not.not = icmp slt i32 %18, %17 br i1 %cmp17.not.not, label %for.body18, label %for.end27, !llvm.loop !16 for.end27: ; preds = %for.inc25, %for.cond16.preheader.thread, %for.cond16.preheader %call28 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m) %19 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp ne i32 %19, 0 %20 = load i32, ptr @m, align 4 %cmp1 = icmp ne i32 %20, 0 %21 = select i1 %cmp, i1 %cmp1, i1 false br i1 %21, label %for.cond.preheader, label %while.end29, !llvm.loop !17 while.end29: ; preds = %for.end27, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
/* AOJ 0085 * * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0085 * */ #include <stdio.h> #define DEBUG 0 int next[1001]; int main(){ int m, n; int count; int i; int p, prev; while(scanf("%d %d", &n, &m)==2){ if(m==0 && n==0){ break; } for(i=1;i<n;i++){ next[i]=i+1; } next[n] = 1; count = n; prev = 1; p = 1; while(count > 1){ for(i=0;i<m-1;i++){ prev = p; p = next[p]; } if(DEBUG) printf("removing %d\n", p); next[prev] = next[p]; p = next[p]; count--; } printf("%d\n", p); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264524/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264524/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @next = dso_local local_unnamed_addr global [1001 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %cmp47 = icmp eq i32 %call46, 2 br i1 %cmp47, label %while.body, label %while.end24 while.body: ; preds = %entry, %while.end %0 = load i32, ptr %m, align 4, !tbaa !5 %cmp1 = icmp eq i32 %0, 0 %1 = load i32, ptr %n, align 4 %cmp2 = icmp eq i32 %1, 0 %or.cond = select i1 %cmp1, i1 %cmp2, i1 false br i1 %or.cond, label %while.end24, label %for.cond.preheader for.cond.preheader: ; preds = %while.body %cmp335 = icmp sgt i32 %1, 1 br i1 %cmp335, label %for.body.preheader, label %for.end.thread for.end.thread: ; preds = %for.cond.preheader %idxprom453 = sext i32 %1 to i64 %arrayidx554 = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %idxprom453 store i32 1, ptr %arrayidx554, align 4, !tbaa !5 br label %while.end for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %1 to i64 %2 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %1, 9 br i1 %min.iters.check, label %for.body.preheader63, 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 i64> [ <i64 1, i64 2, i64 3, i64 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %offset.idx = or i64 %index, 1 %3 = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %offset.idx %4 = trunc <4 x i64> %vec.ind to <4 x i32> %5 = add <4 x i32> %4, <i32 1, i32 1, i32 1, i32 1> %6 = trunc <4 x i64> %vec.ind to <4 x i32> %7 = add <4 x i32> %6, <i32 5, i32 5, i32 5, i32 5> store <4 x i32> %5, ptr %3, align 4, !tbaa !5 %8 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> %7, ptr %8, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8> %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %2, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader63 for.body.preheader63: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader63, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader63 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %indvars.iv %10 = trunc i64 %indvars.iv.next to i32 store i32 %10, ptr %arrayidx, align 4, !tbaa !5 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block %idxprom4 = sext i32 %1 to i64 %arrayidx5 = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %idxprom4 store i32 1, ptr %arrayidx5, align 4, !tbaa !5 br i1 %cmp335, label %for.cond9.preheader.lr.ph, label %while.end for.cond9.preheader.lr.ph: ; preds = %for.end %cmp1037 = icmp sgt i32 %0, 1 br i1 %cmp1037, label %for.cond9.preheader.us.preheader, label %for.cond9.preheader for.cond9.preheader.us.preheader: ; preds = %for.cond9.preheader.lr.ph %11 = add i32 %0, -2 %12 = add i32 %0, -1 %xtraiter = and i32 %12, 3 %13 = icmp ult i32 %11, 3 %unroll_iter = and i32 %12, -4 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br label %for.cond9.preheader.us for.cond9.preheader.us: ; preds = %for.cond9.preheader.us.preheader, %for.cond9.for.end16_crit_edge.us %p.043.us = phi i32 [ %20, %for.cond9.for.end16_crit_edge.us ], [ 1, %for.cond9.preheader.us.preheader ] %count.042.us = phi i32 [ %dec.us, %for.cond9.for.end16_crit_edge.us ], [ %1, %for.cond9.preheader.us.preheader ] br i1 %13, label %for.cond9.for.end16_crit_edge.us.unr-lcssa, label %for.body11.us for.body11.us: ; preds = %for.cond9.preheader.us, %for.body11.us %p.139.us = phi i32 [ %17, %for.body11.us ], [ %p.043.us, %for.cond9.preheader.us ] %niter = phi i32 [ %niter.next.3, %for.body11.us ], [ 0, %for.cond9.preheader.us ] %idxprom12.us = sext i32 %p.139.us to i64 %arrayidx13.us = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %idxprom12.us %14 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %idxprom12.us.1 = sext i32 %14 to i64 %arrayidx13.us.1 = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %idxprom12.us.1 %15 = load i32, ptr %arrayidx13.us.1, align 4, !tbaa !5 %idxprom12.us.2 = sext i32 %15 to i64 %arrayidx13.us.2 = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %idxprom12.us.2 %16 = load i32, ptr %arrayidx13.us.2, align 4, !tbaa !5 %idxprom12.us.3 = sext i32 %16 to i64 %arrayidx13.us.3 = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %idxprom12.us.3 %17 = load i32, ptr %arrayidx13.us.3, align 4, !tbaa !5 %niter.next.3 = add i32 %niter, 4 %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond9.for.end16_crit_edge.us.unr-lcssa, label %for.body11.us, !llvm.loop !14 for.cond9.for.end16_crit_edge.us.unr-lcssa: ; preds = %for.body11.us, %for.cond9.preheader.us %arrayidx13.us.lcssa.ph = phi ptr [ undef, %for.cond9.preheader.us ], [ %arrayidx13.us.3, %for.body11.us ] %.lcssa64.ph = phi i32 [ undef, %for.cond9.preheader.us ], [ %17, %for.body11.us ] %p.139.us.unr = phi i32 [ %p.043.us, %for.cond9.preheader.us ], [ %17, %for.body11.us ] br i1 %lcmp.mod.not, label %for.cond9.for.end16_crit_edge.us, label %for.body11.us.epil for.body11.us.epil: ; preds = %for.cond9.for.end16_crit_edge.us.unr-lcssa, %for.body11.us.epil %p.139.us.epil = phi i32 [ %18, %for.body11.us.epil ], [ %p.139.us.unr, %for.cond9.for.end16_crit_edge.us.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body11.us.epil ], [ 0, %for.cond9.for.end16_crit_edge.us.unr-lcssa ] %idxprom12.us.epil = sext i32 %p.139.us.epil to i64 %arrayidx13.us.epil = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %idxprom12.us.epil %18 = load i32, ptr %arrayidx13.us.epil, align 4, !tbaa !5 %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond9.for.end16_crit_edge.us, label %for.body11.us.epil, !llvm.loop !15 for.cond9.for.end16_crit_edge.us: ; preds = %for.body11.us.epil, %for.cond9.for.end16_crit_edge.us.unr-lcssa %arrayidx13.us.lcssa = phi ptr [ %arrayidx13.us.lcssa.ph, %for.cond9.for.end16_crit_edge.us.unr-lcssa ], [ %arrayidx13.us.epil, %for.body11.us.epil ] %.lcssa64 = phi i32 [ %.lcssa64.ph, %for.cond9.for.end16_crit_edge.us.unr-lcssa ], [ %18, %for.body11.us.epil ] %idxprom17.us = sext i32 %.lcssa64 to i64 %arrayidx18.us = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %idxprom17.us %19 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5 store i32 %19, ptr %arrayidx13.us.lcssa, align 4, !tbaa !5 %20 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5 %dec.us = add nsw i32 %count.042.us, -1 %cmp7.us = icmp sgt i32 %count.042.us, 2 br i1 %cmp7.us, label %for.cond9.preheader.us, label %while.end, !llvm.loop !17 for.cond9.preheader: ; preds = %for.cond9.preheader.lr.ph, %for.cond9.preheader %p.043 = phi i32 [ %22, %for.cond9.preheader ], [ 1, %for.cond9.preheader.lr.ph ] %count.042 = phi i32 [ %dec, %for.cond9.preheader ], [ %1, %for.cond9.preheader.lr.ph ] %idxprom17 = sext i32 %p.043 to i64 %arrayidx18 = getelementptr inbounds [1001 x i32], ptr @next, i64 0, i64 %idxprom17 %21 = load i32, ptr %arrayidx18, align 4, !tbaa !5 store i32 %21, ptr getelementptr inbounds ([1001 x i32], ptr @next, i64 0, i64 1), align 4, !tbaa !5 %22 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %dec = add nsw i32 %count.042, -1 %cmp7 = icmp ugt i32 %count.042, 2 br i1 %cmp7, label %for.cond9.preheader, label %while.end, !llvm.loop !17 while.end: ; preds = %for.cond9.preheader, %for.cond9.for.end16_crit_edge.us, %for.end.thread, %for.end %p.0.lcssa = phi i32 [ 1, %for.end ], [ 1, %for.end.thread ], [ %20, %for.cond9.for.end16_crit_edge.us ], [ %22, %for.cond9.preheader ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %cmp = icmp eq i32 %call, 2 br i1 %cmp, label %while.body, label %while.end24, !llvm.loop !18 while.end24: ; preds = %while.end, %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !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, !16} !16 = !{!"llvm.loop.unroll.disable"} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
//Dijkstra ABC035-D #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int max(int a,int b){if(a>b){return a;}return b;} int min(int a,int b){if(a<b){return a;}return b;} int zt(int a,int b){return max(a,b)-min(a,b);} int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} //Heap and Priority_queue typedef struct{ long long node; long long cost; }data; data heap[1048576]; long long hsize=0; void resheap(){ long long i; heap[0].node=-1; heap[0].cost=-llinf; for(i=1;i<1048576;i++){ heap[i].node=-1; heap[i].cost=llinf; } } int swjud(data high,data low){ if(high.cost > low.cost){return 1;} return -1; } void pqpush(data x){ long long a,b; data m; hsize++; heap[hsize]=x; a=hsize; while(1){ b=a/2; if(swjud(heap[b],heap[a]) == 1){ m=heap[a];heap[a]=heap[b];heap[b]=m; } else{break;} a=b; } } data pqpop(){ long long a,b,c; data m,sw; m=heap[1]; heap[1]=heap[hsize]; heap[hsize].node=-1; heap[hsize].cost=llinf; hsize--; a=1; while(1){ b=a*2;c=a*2+1; if(swjud(heap[a],heap[b])==-1 && swjud(heap[a],heap[c])==-1){break;} if(swjud(heap[b],heap[c])==-1){ sw=heap[a];heap[a]=heap[b];heap[b]=sw; a=b; } else{ sw=heap[a];heap[a]=heap[c];heap[c]=sw; a=c; } } return m; } typedef struct{ long long xz; long long yz; long long node; }zhd; int xsortfnc(const void *a,const void *b){ if(((zhd*)a)->xz == ((zhd*)b)->xz){return 0;} if(((zhd*)a)->xz < ((zhd*)b)->xz){return -1;} return 1; } int ysortfnc(const void *a,const void *b){ if(((zhd*)a)->yz == ((zhd*)b)->yz){return 0;} if(((zhd*)a)->yz < ((zhd*)b)->yz){return -1;} return 1; } int main(void){ resheap(); zhd xs[131072],ys[131072]; long long i,j,n,x[131072],y[131072],fl[131072]={0},r=0; data hen[131072][4],fd; scanf("%lld",&n); for(i=0;i<n;i++){ scanf("%lld%lld",&x[i],&y[i]); for(j=0;j<4;j++){ hen[i][j].node=-1; hen[i][j].cost=llinf; } xs[i].node=i;xs[i].xz=x[i];xs[i].yz=y[i]; ys[i].node=i;ys[i].xz=x[i];ys[i].yz=y[i]; } qsort(xs,n,sizeof(zhd),xsortfnc); qsort(ys,n,sizeof(zhd),ysortfnc); for(i=0;i<n;i++){ if(i!=0){ hen[xs[i].node][0].node=xs[i-1].node; hen[xs[i].node][0].cost=xs[i].xz-xs[i-1].xz; hen[ys[i].node][2].node=ys[i-1].node; hen[ys[i].node][2].cost=ys[i].yz-ys[i-1].yz; } if(i!=n-1){ hen[xs[i].node][1].node=xs[i+1].node; hen[xs[i].node][1].cost=xs[i+1].xz-xs[i].xz; hen[ys[i].node][3].node=ys[i+1].node; hen[ys[i].node][3].cost=ys[i+1].yz-ys[i].yz; } } fd.node=0;fd.cost=0; pqpush(fd); while(hsize){ fd=pqpop(); if(fd.node==-1){continue;} if(fl[fd.node]==1){continue;} fl[fd.node]=1; r+=fd.cost; for(i=0;i<4;i++){ pqpush(hen[fd.node][i]); } } printf("%lld\n",r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264568/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264568/source.c" target datalayout = "e-m:e-p270: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.data = type { i64, i64 } %struct.zhd = type { i64, i64, i64 } @hsize = dso_local local_unnamed_addr global i64 0, align 8 @heap = dso_local local_unnamed_addr global [1048576 x %struct.data] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local 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: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i32 %a, %b %sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true) ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %mul = shl nsw i32 %rem, 1 %cmp.not = icmp sge i32 %mul, %b %div1 = sdiv i32 %a, %b %add = zext i1 %cmp.not to i32 %retval.0 = add nsw i32 %div1, %add ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %cmp = icmp ne i32 %rem, 0 %div = sdiv i32 %a, %b %add = zext i1 %cmp to i32 %retval.0 = add nsw i32 %div, %add ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i32 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i32 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i32 %a.addr.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i32 %b, 0 br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i32 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5 gcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i32 %a, %a.addr.0.lcssa.i %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i32 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i32 %a, 1 %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, 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 i32 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i32 %add, %i.07 %mul = mul nsw i32 %r.08, %sub %div = sdiv i32 %mul, %i.07 %inc = add nuw i32 %i.07, 1 %sub.1 = sub i32 %add, %inc %mul.1 = mul nsw i32 %div, %sub.1 %div.1 = sdiv i32 %mul.1, %inc %inc.1 = add nuw i32 %i.07, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i32 %add, %i.07.unr %mul.epil = mul nsw i32 %r.08.unr, %sub.epil %div.epil = sdiv i32 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i32 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %a, 8 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %a, -8 %ind.end = or i32 %n.vec, 1 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.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %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> %0 = mul <4 x i32> %vec.phi, %vec.ind %1 = mul <4 x i32> %vec.phi7, %step.add %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8 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, %a br i1 %cmp.n, label %for.end, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader9, %for.body %r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ] %i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ] %mul = mul nsw i32 %r.06, %i.05 %inc = add nuw i32 %i.05, 1 %exitcond.not = icmp eq i32 %i.05, %a br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i32 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %b, 8 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %b, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, 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 !12 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, %b br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ] %i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ] %mul = mul nsw i32 %r.05, %a %inc = add nuw i32 %i.04, 1 %exitcond.not = icmp eq i32 %i.04, %b br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i64 %a, %b %sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true) ret i64 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %mul = shl nsw i64 %rem, 1 %cmp.not = icmp sge i64 %mul, %b %div1 = sdiv i64 %a, %b %add = zext i1 %cmp.not to i64 %retval.0 = add nsw i64 %div1, %add ret i64 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %cmp = icmp ne i64 %rem, 0 %div = sdiv i64 %a, %b %add = zext i1 %cmp to i64 %retval.0 = add nsw i64 %div, %add ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i64 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i64 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i64 %a.addr.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i64 %b, 0 br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i64 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !14 llgcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i64 %a, %a.addr.0.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i64 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i64 %a, 1 %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, 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 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i64 %add, %i.07 %mul = mul nsw i64 %r.08, %sub %div = sdiv i64 %mul, %i.07 %inc = add nuw i64 %i.07, 1 %sub.1 = sub i64 %add, %inc %mul.1 = mul nsw i64 %div, %sub.1 %div.1 = sdiv i64 %mul.1, %inc %inc.1 = add nuw i64 %i.07, 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 !15 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.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 %sub.epil = sub i64 %add, %i.07.unr %mul.epil = mul nsw i64 %r.08.unr, %sub.epil %div.epil = sdiv i64 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i64 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %a, 7 %0 = icmp ult i64 %a, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %a, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.06, %i.05 %inc = add nuw nsw i64 %i.05, 1 %mul.1 = mul nsw i64 %mul, %inc %inc.1 = add nuw nsw i64 %i.05, 2 %mul.2 = mul nsw i64 %mul.1, %inc.1 %inc.2 = add nuw nsw i64 %i.05, 3 %mul.3 = mul nsw i64 %mul.2, %inc.2 %inc.3 = add nuw nsw i64 %i.05, 4 %mul.4 = mul nsw i64 %mul.3, %inc.3 %inc.4 = add nuw nsw i64 %i.05, 5 %mul.5 = mul nsw i64 %mul.4, %inc.4 %inc.5 = add nuw nsw i64 %i.05, 6 %mul.6 = mul nsw i64 %mul.5, %inc.5 %inc.6 = add nuw i64 %i.05, 7 %mul.7 = mul nsw i64 %mul.6, %inc.6 %inc.7 = add nuw i64 %i.05, 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 !16 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.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 %r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ] %i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.06.epil, %i.05.epil %inc.epil = add nuw i64 %i.05.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 !17 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i64 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.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 ] %mul = mul nsw i64 %r.05, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !19 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.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 %r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.05.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !20 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp ogt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp olt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp.i = fcmp ogt double %a, %b %a.b.i = select i1 %cmp.i, double %a, double %b %cmp.i4 = fcmp olt double %a, %b %a.b.i5 = select i1 %cmp.i4, double %a, double %b %sub = fsub double %a.b.i, %a.b.i5 ret double %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !21 %1 = load i32, ptr %b, align 4, !tbaa !21 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext 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 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !21 %1 = load i32, ptr %b, align 4, !tbaa !21 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext 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 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !25 %1 = load i64, ptr %b, align 8, !tbaa !25 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext 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 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !25 %1 = load i64, ptr %b, align 8, !tbaa !25 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext 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 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !27 %1 = load double, ptr %b, align 8, !tbaa !27 %cmp = fcmp ogt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext 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 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !27 %1 = load double, ptr %b, align 8, !tbaa !27 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @resheap() local_unnamed_addr #5 { entry: store i64 -1, ptr @heap, align 16, !tbaa !29 store i64 -4154118101919364364, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 0, i32 1), align 8, !tbaa !31 br label %for.body for.body: ; preds = %for.body, %entry %i.05 = phi i64 [ 1, %entry ], [ %inc.2, %for.body ] %arrayidx = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %i.05 store i64 -1, ptr %arrayidx, align 16, !tbaa !29 %cost = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %i.05, i32 1 store i64 4154118101919364364, ptr %cost, align 8, !tbaa !31 %inc = add nuw nsw i64 %i.05, 1 %arrayidx.1 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc store i64 -1, ptr %arrayidx.1, align 16, !tbaa !29 %cost.1 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc, i32 1 store i64 4154118101919364364, ptr %cost.1, align 8, !tbaa !31 %inc.1 = add nuw nsw i64 %i.05, 2 %arrayidx.2 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc.1 store i64 -1, ptr %arrayidx.2, align 16, !tbaa !29 %cost.2 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc.1, i32 1 store i64 4154118101919364364, ptr %cost.2, align 8, !tbaa !31 %inc.2 = add nuw nsw i64 %i.05, 3 %exitcond.not.2 = icmp eq i64 %inc.2, 1048576 br i1 %exitcond.not.2, label %for.end, label %for.body, !llvm.loop !32 for.end: ; preds = %for.body ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @swjud(i64 %high.coerce0, i64 %high.coerce1, i64 %low.coerce0, i64 %low.coerce1) local_unnamed_addr #1 { entry: %cmp = icmp sgt i64 %high.coerce1, %low.coerce1 %. = select i1 %cmp, i32 1, i32 -1 ret i32 %. } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @pqpush(i64 %x.coerce0, i64 %x.coerce1) local_unnamed_addr #6 { entry: %m = alloca %struct.data, align 8 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %m) %0 = load i64, ptr @hsize, align 8, !tbaa !25 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @hsize, align 8, !tbaa !25 %arrayidx = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc store i64 %x.coerce0, ptr %arrayidx, align 16, !tbaa.struct !33 %x.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8 store i64 %x.coerce1, ptr %x.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !34 %div13 = sdiv i64 %inc, 2 %arrayidx114 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div13 %1 = getelementptr inbounds { i64, i64 }, ptr %arrayidx114, i64 0, i32 1 %2 = load i64, ptr %1, align 8 %cmp.i16 = icmp sgt i64 %2, %x.coerce1 br i1 %cmp.i16, label %if.then, label %while.end if.then: ; preds = %entry, %if.then %arrayidx219 = phi ptr [ %arrayidx2, %if.then ], [ %arrayidx, %entry ] %arrayidx118 = phi ptr [ %arrayidx1, %if.then ], [ %arrayidx114, %entry ] %div17 = phi i64 [ %div, %if.then ], [ %div13, %entry ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %m, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219, i64 16, i1 false), !tbaa.struct !33 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118, ptr noundef nonnull align 8 dereferenceable(16) %m, i64 16, i1 false), !tbaa.struct !33 %div = sdiv i64 %div17, 2 %arrayidx1 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div %arrayidx2 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div17 %3 = getelementptr inbounds { i64, i64 }, ptr %arrayidx1, i64 0, i32 1 %4 = load i64, ptr %3, align 8 %5 = getelementptr inbounds { i64, i64 }, ptr %arrayidx2, i64 0, i32 1 %6 = load i64, ptr %5, align 8 %cmp.i = icmp sgt i64 %4, %6 br i1 %cmp.i, label %if.then, label %while.end while.end: ; preds = %if.then, %entry call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %m) ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local { i64, i64 } @pqpop() local_unnamed_addr #6 { entry: %sw = alloca %struct.data, align 8 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %sw) %retval.sroa.0.0.copyload = load i64, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 1), align 16, !tbaa.struct !33 %retval.sroa.2.0.copyload = load i64, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 1, i32 1), align 8, !tbaa.struct !34 %0 = load i64, ptr @hsize, align 8, !tbaa !25 %arrayidx = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %0 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 1), ptr noundef nonnull align 16 dereferenceable(16) %arrayidx, i64 16, i1 false), !tbaa.struct !33 store i64 -1, ptr %arrayidx, align 16, !tbaa !29 %cost = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %0, i32 1 store i64 4154118101919364364, ptr %cost, align 8, !tbaa !31 %dec = add nsw i64 %0, -1 store i64 %dec, ptr @hsize, align 8, !tbaa !25 %1 = load i64, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 1, i32 1), align 8 %2 = load i64, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 2, i32 1), align 8 %cmp.i.not44 = icmp sgt i64 %1, %2 %.pre45 = load i64, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 3, i32 1), align 8 %cmp.i39.not46 = icmp sgt i64 %1, %.pre45 %or.cond47 = select i1 %cmp.i.not44, i1 true, i1 %cmp.i39.not46 br i1 %or.cond47, label %if.end, label %while.end if.end: ; preds = %entry, %if.end %.pre52 = phi i64 [ %.pre, %if.end ], [ %.pre45, %entry ] %3 = phi i64 [ %7, %if.end ], [ %2, %entry ] %arrayidx551 = phi ptr [ %arrayidx5, %if.end ], [ getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 2), %entry ] %arrayidx450 = phi ptr [ %arrayidx4, %if.end ], [ getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 1), %entry ] %add49 = phi i64 [ %add, %if.end ], [ 3, %entry ] %mul48 = phi i64 [ %mul, %if.end ], [ 2, %entry ] %cmp.i41.not = icmp sgt i64 %3, %.pre52 %arrayidx11 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %add49 %arrayidx11.sink43 = select i1 %cmp.i41.not, ptr %arrayidx11, ptr %arrayidx551 %a.1 = select i1 %cmp.i41.not, i64 %add49, i64 %mul48 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %sw, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx450, i64 16, i1 false) tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx450, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx11.sink43, i64 16, i1 false) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx11.sink43, ptr noundef nonnull align 8 dereferenceable(16) %sw, i64 16, i1 false) %mul = shl nsw i64 %a.1, 1 %add = or i64 %mul, 1 %arrayidx4 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %a.1 %arrayidx5 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %mul %4 = getelementptr inbounds { i64, i64 }, ptr %arrayidx4, i64 0, i32 1 %5 = load i64, ptr %4, align 8 %6 = getelementptr inbounds { i64, i64 }, ptr %arrayidx5, i64 0, i32 1 %7 = load i64, ptr %6, align 8 %cmp.i.not = icmp sgt i64 %5, %7 %.phi.trans.insert = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %add, i32 1 %.pre = load i64, ptr %.phi.trans.insert, align 8 %cmp.i39.not = icmp sgt i64 %5, %.pre %or.cond = select i1 %cmp.i.not, i1 true, i1 %cmp.i39.not br i1 %or.cond, label %if.end, label %while.end while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %sw) %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %retval.sroa.0.0.copyload, 0 %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.sroa.2.0.copyload, 1 ret { i64, i64 } %.fca.1.insert } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @xsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !35 %1 = load i64, ptr %b, align 8, !tbaa !35 %cmp = icmp eq i64 %0, %1 %cmp4 = icmp slt i64 %0, %1 %. = select i1 %cmp4, i32 -1, i32 1 %retval.0 = select i1 %cmp, i32 0, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ysortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #4 { entry: %yz = getelementptr inbounds %struct.zhd, ptr %a, i64 0, i32 1 %0 = load i64, ptr %yz, align 8, !tbaa !37 %yz1 = getelementptr inbounds %struct.zhd, ptr %b, i64 0, i32 1 %1 = load i64, ptr %yz1, align 8, !tbaa !37 %cmp = icmp eq i64 %0, %1 %cmp4 = icmp slt i64 %0, %1 %. = select i1 %cmp4, i32 -1, i32 1 %retval.0 = select i1 %cmp, i32 0, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #8 { entry: %m.i197 = alloca %struct.data, align 8 %sw.i = alloca %struct.data, align 8 %m.i = alloca %struct.data, align 8 %xs = alloca [131072 x %struct.zhd], align 16 %ys = alloca [131072 x %struct.zhd], align 16 %n = alloca i64, align 8 %x = alloca [131072 x i64], align 16 %y = alloca [131072 x i64], align 16 %fl = alloca [131072 x i64], align 16 %hen = alloca [131072 x [4 x %struct.data]], align 16 store i64 -1, ptr @heap, align 16, !tbaa !29 store i64 -4154118101919364364, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 0, i32 1), align 8, !tbaa !31 br label %for.body.i for.body.i: ; preds = %for.body.i, %entry %i.05.i = phi i64 [ 1, %entry ], [ %inc.i.2, %for.body.i ] %arrayidx.i = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %i.05.i store i64 -1, ptr %arrayidx.i, align 16, !tbaa !29 %cost.i = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %i.05.i, i32 1 store i64 4154118101919364364, ptr %cost.i, align 8, !tbaa !31 %inc.i = add nuw nsw i64 %i.05.i, 1 %arrayidx.i.1 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc.i store i64 -1, ptr %arrayidx.i.1, align 16, !tbaa !29 %cost.i.1 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc.i, i32 1 store i64 4154118101919364364, ptr %cost.i.1, align 8, !tbaa !31 %inc.i.1 = add nuw nsw i64 %i.05.i, 2 %arrayidx.i.2 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc.i.1 store i64 -1, ptr %arrayidx.i.2, align 16, !tbaa !29 %cost.i.2 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc.i.1, i32 1 store i64 4154118101919364364, ptr %cost.i.2, align 8, !tbaa !31 %inc.i.2 = add nuw nsw i64 %i.05.i, 3 %exitcond.not.i.2 = icmp eq i64 %inc.i.2, 1048576 br i1 %exitcond.not.i.2, label %resheap.exit, label %for.body.i, !llvm.loop !32 resheap.exit: ; preds = %for.body.i call void @llvm.lifetime.start.p0(i64 3145728, ptr nonnull %xs) #13 call void @llvm.lifetime.start.p0(i64 3145728, ptr nonnull %ys) #13 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #13 call void @llvm.lifetime.start.p0(i64 1048576, ptr nonnull %x) #13 call void @llvm.lifetime.start.p0(i64 1048576, ptr nonnull %y) #13 call void @llvm.lifetime.start.p0(i64 1048576, ptr nonnull %fl) #13 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1048576) %fl, i8 0, i64 1048576, i1 false) call void @llvm.lifetime.start.p0(i64 8388608, ptr nonnull %hen) #13 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !25 %cmp214 = icmp sgt i64 %0, 0 br i1 %cmp214, label %for.body, label %for.end26 for.body: ; preds = %resheap.exit, %for.body %i.0215 = phi i64 [ %inc25, %for.body ], [ 0, %resheap.exit ] %arrayidx = getelementptr inbounds [131072 x i64], ptr %x, i64 0, i64 %i.0215 %arrayidx1 = getelementptr inbounds [131072 x i64], ptr %y, i64 0, i64 %i.0215 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx1) %arrayidx7 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %i.0215, i64 0 store i64 -1, ptr %arrayidx7, align 16, !tbaa !29 %cost = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %i.0215, i64 0, i32 1 store i64 4154118101919364364, ptr %cost, align 8, !tbaa !31 %arrayidx7.1 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %i.0215, i64 1 store i64 -1, ptr %arrayidx7.1, align 16, !tbaa !29 %cost.1 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %i.0215, i64 1, i32 1 store i64 4154118101919364364, ptr %cost.1, align 8, !tbaa !31 %arrayidx7.2 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %i.0215, i64 2 store i64 -1, ptr %arrayidx7.2, align 16, !tbaa !29 %cost.2 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %i.0215, i64 2, i32 1 store i64 4154118101919364364, ptr %cost.2, align 8, !tbaa !31 %arrayidx7.3 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %i.0215, i64 3 store i64 -1, ptr %arrayidx7.3, align 16, !tbaa !29 %cost.3 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %i.0215, i64 3, i32 1 store i64 4154118101919364364, ptr %cost.3, align 8, !tbaa !31 %arrayidx10 = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %i.0215 %node11 = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %i.0215, i32 2 store i64 %i.0215, ptr %node11, align 8, !tbaa !38 %1 = load i64, ptr %arrayidx, align 8, !tbaa !25 store i64 %1, ptr %arrayidx10, align 8, !tbaa !35 %2 = load i64, ptr %arrayidx1, align 8, !tbaa !25 %yz = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %i.0215, i32 1 store i64 %2, ptr %yz, align 8, !tbaa !37 %arrayidx16 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %i.0215 %node17 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %i.0215, i32 2 store i64 %i.0215, ptr %node17, align 8, !tbaa !38 store i64 %1, ptr %arrayidx16, align 8, !tbaa !35 %yz23 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %i.0215, i32 1 store i64 %2, ptr %yz23, align 8, !tbaa !37 %inc25 = add nuw nsw i64 %i.0215, 1 %3 = load i64, ptr %n, align 8, !tbaa !25 %cmp = icmp slt i64 %inc25, %3 br i1 %cmp, label %for.body, label %for.end26, !llvm.loop !39 for.end26: ; preds = %for.body, %resheap.exit %.lcssa = phi i64 [ %0, %resheap.exit ], [ %3, %for.body ] call void @qsort(ptr noundef nonnull %xs, i64 noundef %.lcssa, i64 noundef 24, ptr noundef nonnull @xsortfnc) #13 %4 = load i64, ptr %n, align 8, !tbaa !25 call void @qsort(ptr noundef nonnull %ys, i64 noundef %4, i64 noundef 24, ptr noundef nonnull @ysortfnc) #13 %5 = load i64, ptr %n, align 8, !tbaa !25 %cmp29216 = icmp sgt i64 %5, 0 br i1 %cmp29216, label %if.end.peel, label %for.end112 if.end.peel: ; preds = %for.end26 %sub69 = add nsw i64 %5, -1 %cmp70.not.peel = icmp eq i64 %sub69, 0 br i1 %cmp70.not.peel, label %for.end112, label %for.body30.peel.next for.body30.peel.next: ; preds = %if.end.peel %arrayidx72.peel = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 1 %node73.peel = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 1, i32 2 %6 = load i64, ptr %node73.peel, align 8, !tbaa !38 %node75.peel = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 0, i32 2 %7 = load i64, ptr %node75.peel, align 16, !tbaa !38 %arrayidx77.peel = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %7, i64 1 store i64 %6, ptr %arrayidx77.peel, align 16, !tbaa !29 %8 = load i64, ptr %arrayidx72.peel, align 8, !tbaa !35 %9 = load i64, ptr %xs, align 16, !tbaa !35 %sub84.peel = sub nsw i64 %8, %9 %cost89.peel = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %7, i64 1, i32 1 store i64 %sub84.peel, ptr %cost89.peel, align 8, !tbaa !31 %node92.peel = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 1, i32 2 %10 = load i64, ptr %node92.peel, align 8, !tbaa !38 %node94.peel = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 0, i32 2 %11 = load i64, ptr %node94.peel, align 16, !tbaa !38 %arrayidx96.peel = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %11, i64 3 store i64 %10, ptr %arrayidx96.peel, align 16, !tbaa !29 %yz100.peel = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 1, i32 1 %12 = load i64, ptr %yz100.peel, align 16, !tbaa !37 %yz102.peel = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 0, i32 1 %13 = load i64, ptr %yz102.peel, align 8, !tbaa !37 %sub103.peel = sub nsw i64 %12, %13 %cost108.peel = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %11, i64 3, i32 1 store i64 %sub103.peel, ptr %cost108.peel, align 8, !tbaa !31 br label %if.end if.end: ; preds = %for.body30.peel.next, %for.inc110 %i.1217 = phi i64 [ 1, %for.body30.peel.next ], [ %.pre, %for.inc110 ] %sub = add nsw i64 %i.1217, -1 %arrayidx32 = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %sub %node33 = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %sub, i32 2 %14 = load i64, ptr %node33, align 8, !tbaa !38 %arrayidx34 = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %i.1217 %node35 = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %i.1217, i32 2 %15 = load i64, ptr %node35, align 8, !tbaa !38 %arrayidx36 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %15 store i64 %14, ptr %arrayidx36, align 16, !tbaa !29 %16 = load i64, ptr %arrayidx34, align 8, !tbaa !35 %17 = load i64, ptr %arrayidx32, align 8, !tbaa !35 %sub44 = sub nsw i64 %16, %17 %cost49 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %15, i64 0, i32 1 store i64 %sub44, ptr %cost49, align 8, !tbaa !31 %node52 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %sub, i32 2 %18 = load i64, ptr %node52, align 8, !tbaa !38 %node54 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %i.1217, i32 2 %19 = load i64, ptr %node54, align 8, !tbaa !38 %arrayidx56 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %19, i64 2 store i64 %18, ptr %arrayidx56, align 16, !tbaa !29 %yz59 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %i.1217, i32 1 %20 = load i64, ptr %yz59, align 8, !tbaa !37 %yz62 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %sub, i32 1 %21 = load i64, ptr %yz62, align 8, !tbaa !37 %sub63 = sub nsw i64 %20, %21 %cost68 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %19, i64 2, i32 1 store i64 %sub63, ptr %cost68, align 8, !tbaa !31 %cmp70.not = icmp eq i64 %i.1217, %sub69 %.pre = add nuw nsw i64 %i.1217, 1 br i1 %cmp70.not, label %for.inc110, label %if.then71 if.then71: ; preds = %if.end %arrayidx72 = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %.pre %node73 = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %.pre, i32 2 %22 = load i64, ptr %node73, align 8, !tbaa !38 %arrayidx74 = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %i.1217 %node75 = getelementptr inbounds [131072 x %struct.zhd], ptr %xs, i64 0, i64 %i.1217, i32 2 %23 = load i64, ptr %node75, align 8, !tbaa !38 %arrayidx77 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %23, i64 1 store i64 %22, ptr %arrayidx77, align 16, !tbaa !29 %24 = load i64, ptr %arrayidx72, align 8, !tbaa !35 %25 = load i64, ptr %arrayidx74, align 8, !tbaa !35 %sub84 = sub nsw i64 %24, %25 %cost89 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %23, i64 1, i32 1 store i64 %sub84, ptr %cost89, align 8, !tbaa !31 %node92 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %.pre, i32 2 %26 = load i64, ptr %node92, align 8, !tbaa !38 %node94 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %i.1217, i32 2 %27 = load i64, ptr %node94, align 8, !tbaa !38 %arrayidx96 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %27, i64 3 store i64 %26, ptr %arrayidx96, align 16, !tbaa !29 %yz100 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %.pre, i32 1 %28 = load i64, ptr %yz100, align 8, !tbaa !37 %yz102 = getelementptr inbounds [131072 x %struct.zhd], ptr %ys, i64 0, i64 %i.1217, i32 1 %29 = load i64, ptr %yz102, align 8, !tbaa !37 %sub103 = sub nsw i64 %28, %29 %cost108 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %27, i64 3, i32 1 store i64 %sub103, ptr %cost108, align 8, !tbaa !31 br label %for.inc110 for.inc110: ; preds = %if.end, %if.then71 %exitcond.not = icmp eq i64 %.pre, %5 br i1 %exitcond.not, label %for.end112, label %if.end, !llvm.loop !40 for.end112: ; preds = %for.inc110, %if.end.peel, %for.end26 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %m.i) %30 = load i64, ptr @hsize, align 8, !tbaa !25 %inc.i193 = add nsw i64 %30, 1 store i64 %inc.i193, ptr @hsize, align 8, !tbaa !25 %arrayidx.i194 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc.i193 %div13.i = sdiv i64 %inc.i193, 2 %arrayidx114.i = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div13.i %31 = getelementptr inbounds { i64, i64 }, ptr %arrayidx114.i, i64 0, i32 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i194, i8 0, i64 16, i1 false) %32 = load i64, ptr %31, align 8 %cmp.i16.i = icmp sgt i64 %32, 0 br i1 %cmp.i16.i, label %if.then.i, label %pqpush.exit if.then.i: ; preds = %for.end112, %if.then.i %arrayidx219.i = phi ptr [ %arrayidx2.i, %if.then.i ], [ %arrayidx.i194, %for.end112 ] %arrayidx118.i = phi ptr [ %arrayidx1.i, %if.then.i ], [ %arrayidx114.i, %for.end112 ] %div17.i = phi i64 [ %div.i, %if.then.i ], [ %div13.i, %for.end112 ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %m.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219.i, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118.i, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118.i, ptr noundef nonnull align 8 dereferenceable(16) %m.i, i64 16, i1 false), !tbaa.struct !33 %div.i = sdiv i64 %div17.i, 2 %arrayidx1.i = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div.i %arrayidx2.i = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div17.i %33 = getelementptr inbounds { i64, i64 }, ptr %arrayidx1.i, i64 0, i32 1 %34 = load i64, ptr %33, align 8 %35 = getelementptr inbounds { i64, i64 }, ptr %arrayidx2.i, i64 0, i32 1 %36 = load i64, ptr %35, align 8 %cmp.i.i = icmp sgt i64 %34, %36 br i1 %cmp.i.i, label %if.then.i, label %pqpush.exit pqpush.exit: ; preds = %if.then.i, %for.end112 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %m.i) %tobool.not229240 = icmp eq i64 %inc.i193, 0 br i1 %tobool.not229240, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %pqpush.exit, %pqpush.exit212.3 %r.0.ph242 = phi i64 [ %add128, %pqpush.exit212.3 ], [ 0, %pqpush.exit ] %inc.i198235.lcssa239241 = phi i64 [ %inc.i198.3, %pqpush.exit212.3 ], [ %inc.i193, %pqpush.exit ] br label %while.body while.body: ; preds = %while.body.lr.ph, %while.cond.backedge %dec.i228230 = phi i64 [ %inc.i198235.lcssa239241, %while.body.lr.ph ], [ %dec.i, %while.cond.backedge ] call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %sw.i) %retval.sroa.0.0.copyload.i = load i64, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 1), align 16, !tbaa.struct !33 %retval.sroa.2.0.copyload.i = load i64, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 1, i32 1), align 8, !tbaa.struct !34 %arrayidx.i195 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %dec.i228230 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 1), ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i195, i64 16, i1 false), !tbaa.struct !33 store i64 -1, ptr %arrayidx.i195, align 16, !tbaa !29 %cost.i196 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %dec.i228230, i32 1 store i64 4154118101919364364, ptr %cost.i196, align 8, !tbaa !31 %dec.i = add nsw i64 %dec.i228230, -1 %37 = load i64, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 1, i32 1), align 8 %38 = load i64, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 2, i32 1), align 8 %cmp.i.not.i218 = icmp sgt i64 %37, %38 %.pre.i219 = load i64, ptr getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 3, i32 1), align 8 %cmp.i39.not.i220 = icmp sgt i64 %37, %.pre.i219 %or.cond.i221 = select i1 %cmp.i.not.i218, i1 true, i1 %cmp.i39.not.i220 br i1 %or.cond.i221, label %if.end.i, label %pqpop.exit if.end.i: ; preds = %while.body, %if.end.i %.pre.i226 = phi i64 [ %.pre.i, %if.end.i ], [ %.pre.i219, %while.body ] %39 = phi i64 [ %43, %if.end.i ], [ %38, %while.body ] %arrayidx5.i225 = phi ptr [ %arrayidx5.i, %if.end.i ], [ getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 2), %while.body ] %arrayidx4.i224 = phi ptr [ %arrayidx4.i, %if.end.i ], [ getelementptr inbounds ([1048576 x %struct.data], ptr @heap, i64 0, i64 1), %while.body ] %add.i223 = phi i64 [ %add.i, %if.end.i ], [ 3, %while.body ] %mul.i222 = phi i64 [ %mul.i, %if.end.i ], [ 2, %while.body ] %cmp.i41.not.i = icmp sgt i64 %39, %.pre.i226 %arrayidx11.i = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %add.i223 %arrayidx11.sink43.i = select i1 %cmp.i41.not.i, ptr %arrayidx11.i, ptr %arrayidx5.i225 %a.1.i = select i1 %cmp.i41.not.i, i64 %add.i223, i64 %mul.i222 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %sw.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx4.i224, i64 16, i1 false) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx4.i224, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx11.sink43.i, i64 16, i1 false) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx11.sink43.i, ptr noundef nonnull align 8 dereferenceable(16) %sw.i, i64 16, i1 false) %mul.i = shl nsw i64 %a.1.i, 1 %add.i = or i64 %mul.i, 1 %arrayidx4.i = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %a.1.i %arrayidx5.i = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %mul.i %40 = getelementptr inbounds { i64, i64 }, ptr %arrayidx4.i, i64 0, i32 1 %41 = load i64, ptr %40, align 8 %42 = getelementptr inbounds { i64, i64 }, ptr %arrayidx5.i, i64 0, i32 1 %43 = load i64, ptr %42, align 8 %cmp.i.not.i = icmp sgt i64 %41, %43 %.phi.trans.insert.i = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %add.i, i32 1 %.pre.i = load i64, ptr %.phi.trans.insert.i, align 8 %cmp.i39.not.i = icmp sgt i64 %41, %.pre.i %or.cond.i = select i1 %cmp.i.not.i, i1 true, i1 %cmp.i39.not.i br i1 %or.cond.i, label %if.end.i, label %pqpop.exit pqpop.exit: ; preds = %if.end.i, %while.body call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %sw.i) %cmp117 = icmp eq i64 %retval.sroa.0.0.copyload.i, -1 br i1 %cmp117, label %while.cond.backedge, label %if.end119 while.cond.backedge: ; preds = %pqpop.exit, %if.end119 %tobool.not = icmp eq i64 %dec.i, 0 br i1 %tobool.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !42 if.end119: ; preds = %pqpop.exit %arrayidx121 = getelementptr inbounds [131072 x i64], ptr %fl, i64 0, i64 %retval.sroa.0.0.copyload.i %44 = load i64, ptr %arrayidx121, align 8, !tbaa !25 %cmp122 = icmp eq i64 %44, 1 br i1 %cmp122, label %while.cond.backedge, label %if.end124 if.end124: ; preds = %if.end119 %arrayidx121.le = getelementptr inbounds [131072 x i64], ptr %fl, i64 0, i64 %retval.sroa.0.0.copyload.i store i64 %dec.i, ptr @hsize, align 8, !tbaa !25 store i64 1, ptr %arrayidx121.le, align 8, !tbaa !25 %arrayidx134 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %retval.sroa.0.0.copyload.i, i64 0 %45 = load i64, ptr %arrayidx134, align 16 %46 = getelementptr inbounds { i64, i64 }, ptr %arrayidx134, i64 0, i32 1 %47 = load i64, ptr %46, align 8 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %m.i197) store i64 %45, ptr %arrayidx.i195, align 16, !tbaa.struct !33 %x.sroa.2.0.arrayidx.sroa_idx.i200 = getelementptr inbounds i8, ptr %arrayidx.i195, i64 8 store i64 %47, ptr %x.sroa.2.0.arrayidx.sroa_idx.i200, align 8, !tbaa.struct !34 %div13.i201 = sdiv i64 %dec.i228230, 2 %arrayidx114.i202 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div13.i201 %48 = getelementptr inbounds { i64, i64 }, ptr %arrayidx114.i202, i64 0, i32 1 %49 = load i64, ptr %48, align 8 %cmp.i16.i203 = icmp sgt i64 %49, %47 br i1 %cmp.i16.i203, label %if.then.i204, label %pqpush.exit212 if.then.i204: ; preds = %if.end124, %if.then.i204 %arrayidx219.i205 = phi ptr [ %arrayidx2.i210, %if.then.i204 ], [ %arrayidx.i195, %if.end124 ] %arrayidx118.i206 = phi ptr [ %arrayidx1.i209, %if.then.i204 ], [ %arrayidx114.i202, %if.end124 ] %div17.i207 = phi i64 [ %div.i208, %if.then.i204 ], [ %div13.i201, %if.end124 ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %m.i197, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219.i205, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219.i205, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118.i206, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118.i206, ptr noundef nonnull align 8 dereferenceable(16) %m.i197, i64 16, i1 false), !tbaa.struct !33 %div.i208 = sdiv i64 %div17.i207, 2 %arrayidx1.i209 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div.i208 %arrayidx2.i210 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div17.i207 %50 = getelementptr inbounds { i64, i64 }, ptr %arrayidx1.i209, i64 0, i32 1 %51 = load i64, ptr %50, align 8 %52 = getelementptr inbounds { i64, i64 }, ptr %arrayidx2.i210, i64 0, i32 1 %53 = load i64, ptr %52, align 8 %cmp.i.i211 = icmp sgt i64 %51, %53 br i1 %cmp.i.i211, label %if.then.i204, label %pqpush.exit212 pqpush.exit212: ; preds = %if.then.i204, %if.end124 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %m.i197) %arrayidx134.1 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %retval.sroa.0.0.copyload.i, i64 1 %54 = load i64, ptr %arrayidx134.1, align 16 %55 = getelementptr inbounds { i64, i64 }, ptr %arrayidx134.1, i64 0, i32 1 %56 = load i64, ptr %55, align 8 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %m.i197) %inc.i198.1 = add nsw i64 %dec.i228230, 1 %arrayidx.i199.1 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc.i198.1 store i64 %54, ptr %arrayidx.i199.1, align 16, !tbaa.struct !33 %x.sroa.2.0.arrayidx.sroa_idx.i200.1 = getelementptr inbounds i8, ptr %arrayidx.i199.1, i64 8 store i64 %56, ptr %x.sroa.2.0.arrayidx.sroa_idx.i200.1, align 8, !tbaa.struct !34 %div13.i201.1 = sdiv i64 %inc.i198.1, 2 %arrayidx114.i202.1 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div13.i201.1 %57 = getelementptr inbounds { i64, i64 }, ptr %arrayidx114.i202.1, i64 0, i32 1 %58 = load i64, ptr %57, align 8 %cmp.i16.i203.1 = icmp sgt i64 %58, %56 br i1 %cmp.i16.i203.1, label %if.then.i204.1, label %pqpush.exit212.1 if.then.i204.1: ; preds = %pqpush.exit212, %if.then.i204.1 %arrayidx219.i205.1 = phi ptr [ %arrayidx2.i210.1, %if.then.i204.1 ], [ %arrayidx.i199.1, %pqpush.exit212 ] %arrayidx118.i206.1 = phi ptr [ %arrayidx1.i209.1, %if.then.i204.1 ], [ %arrayidx114.i202.1, %pqpush.exit212 ] %div17.i207.1 = phi i64 [ %div.i208.1, %if.then.i204.1 ], [ %div13.i201.1, %pqpush.exit212 ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %m.i197, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219.i205.1, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219.i205.1, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118.i206.1, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118.i206.1, ptr noundef nonnull align 8 dereferenceable(16) %m.i197, i64 16, i1 false), !tbaa.struct !33 %div.i208.1 = sdiv i64 %div17.i207.1, 2 %arrayidx1.i209.1 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div.i208.1 %arrayidx2.i210.1 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div17.i207.1 %59 = getelementptr inbounds { i64, i64 }, ptr %arrayidx1.i209.1, i64 0, i32 1 %60 = load i64, ptr %59, align 8 %61 = getelementptr inbounds { i64, i64 }, ptr %arrayidx2.i210.1, i64 0, i32 1 %62 = load i64, ptr %61, align 8 %cmp.i.i211.1 = icmp sgt i64 %60, %62 br i1 %cmp.i.i211.1, label %if.then.i204.1, label %pqpush.exit212.1 pqpush.exit212.1: ; preds = %if.then.i204.1, %pqpush.exit212 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %m.i197) %arrayidx134.2 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %retval.sroa.0.0.copyload.i, i64 2 %63 = load i64, ptr %arrayidx134.2, align 16 %64 = getelementptr inbounds { i64, i64 }, ptr %arrayidx134.2, i64 0, i32 1 %65 = load i64, ptr %64, align 8 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %m.i197) %inc.i198.2 = add nsw i64 %dec.i228230, 2 %arrayidx.i199.2 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc.i198.2 store i64 %63, ptr %arrayidx.i199.2, align 16, !tbaa.struct !33 %x.sroa.2.0.arrayidx.sroa_idx.i200.2 = getelementptr inbounds i8, ptr %arrayidx.i199.2, i64 8 store i64 %65, ptr %x.sroa.2.0.arrayidx.sroa_idx.i200.2, align 8, !tbaa.struct !34 %div13.i201.2 = sdiv i64 %inc.i198.2, 2 %arrayidx114.i202.2 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div13.i201.2 %66 = getelementptr inbounds { i64, i64 }, ptr %arrayidx114.i202.2, i64 0, i32 1 %67 = load i64, ptr %66, align 8 %cmp.i16.i203.2 = icmp sgt i64 %67, %65 br i1 %cmp.i16.i203.2, label %if.then.i204.2, label %pqpush.exit212.2 if.then.i204.2: ; preds = %pqpush.exit212.1, %if.then.i204.2 %arrayidx219.i205.2 = phi ptr [ %arrayidx2.i210.2, %if.then.i204.2 ], [ %arrayidx.i199.2, %pqpush.exit212.1 ] %arrayidx118.i206.2 = phi ptr [ %arrayidx1.i209.2, %if.then.i204.2 ], [ %arrayidx114.i202.2, %pqpush.exit212.1 ] %div17.i207.2 = phi i64 [ %div.i208.2, %if.then.i204.2 ], [ %div13.i201.2, %pqpush.exit212.1 ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %m.i197, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219.i205.2, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219.i205.2, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118.i206.2, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118.i206.2, ptr noundef nonnull align 8 dereferenceable(16) %m.i197, i64 16, i1 false), !tbaa.struct !33 %div.i208.2 = sdiv i64 %div17.i207.2, 2 %arrayidx1.i209.2 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div.i208.2 %arrayidx2.i210.2 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div17.i207.2 %68 = getelementptr inbounds { i64, i64 }, ptr %arrayidx1.i209.2, i64 0, i32 1 %69 = load i64, ptr %68, align 8 %70 = getelementptr inbounds { i64, i64 }, ptr %arrayidx2.i210.2, i64 0, i32 1 %71 = load i64, ptr %70, align 8 %cmp.i.i211.2 = icmp sgt i64 %69, %71 br i1 %cmp.i.i211.2, label %if.then.i204.2, label %pqpush.exit212.2 pqpush.exit212.2: ; preds = %if.then.i204.2, %pqpush.exit212.1 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %m.i197) %arrayidx134.3 = getelementptr inbounds [131072 x [4 x %struct.data]], ptr %hen, i64 0, i64 %retval.sroa.0.0.copyload.i, i64 3 %72 = load i64, ptr %arrayidx134.3, align 16 %73 = getelementptr inbounds { i64, i64 }, ptr %arrayidx134.3, i64 0, i32 1 %74 = load i64, ptr %73, align 8 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %m.i197) %inc.i198.3 = add nsw i64 %dec.i228230, 3 %arrayidx.i199.3 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %inc.i198.3 store i64 %72, ptr %arrayidx.i199.3, align 16, !tbaa.struct !33 %x.sroa.2.0.arrayidx.sroa_idx.i200.3 = getelementptr inbounds i8, ptr %arrayidx.i199.3, i64 8 store i64 %74, ptr %x.sroa.2.0.arrayidx.sroa_idx.i200.3, align 8, !tbaa.struct !34 %div13.i201.3 = sdiv i64 %inc.i198.3, 2 %arrayidx114.i202.3 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div13.i201.3 %75 = getelementptr inbounds { i64, i64 }, ptr %arrayidx114.i202.3, i64 0, i32 1 %76 = load i64, ptr %75, align 8 %cmp.i16.i203.3 = icmp sgt i64 %76, %74 br i1 %cmp.i16.i203.3, label %if.then.i204.3, label %pqpush.exit212.3 if.then.i204.3: ; preds = %pqpush.exit212.2, %if.then.i204.3 %arrayidx219.i205.3 = phi ptr [ %arrayidx2.i210.3, %if.then.i204.3 ], [ %arrayidx.i199.3, %pqpush.exit212.2 ] %arrayidx118.i206.3 = phi ptr [ %arrayidx1.i209.3, %if.then.i204.3 ], [ %arrayidx114.i202.3, %pqpush.exit212.2 ] %div17.i207.3 = phi i64 [ %div.i208.3, %if.then.i204.3 ], [ %div13.i201.3, %pqpush.exit212.2 ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %m.i197, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219.i205.3, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx219.i205.3, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118.i206.3, i64 16, i1 false), !tbaa.struct !33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx118.i206.3, ptr noundef nonnull align 8 dereferenceable(16) %m.i197, i64 16, i1 false), !tbaa.struct !33 %div.i208.3 = sdiv i64 %div17.i207.3, 2 %arrayidx1.i209.3 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div.i208.3 %arrayidx2.i210.3 = getelementptr inbounds [1048576 x %struct.data], ptr @heap, i64 0, i64 %div17.i207.3 %77 = getelementptr inbounds { i64, i64 }, ptr %arrayidx1.i209.3, i64 0, i32 1 %78 = load i64, ptr %77, align 8 %79 = getelementptr inbounds { i64, i64 }, ptr %arrayidx2.i210.3, i64 0, i32 1 %80 = load i64, ptr %79, align 8 %cmp.i.i211.3 = icmp sgt i64 %78, %80 br i1 %cmp.i.i211.3, label %if.then.i204.3, label %pqpush.exit212.3 pqpush.exit212.3: ; preds = %if.then.i204.3, %pqpush.exit212.2 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %m.i197) %add128 = add nsw i64 %retval.sroa.2.0.copyload.i, %r.0.ph242 store i64 %inc.i198.3, ptr @hsize, align 8, !tbaa !25 %tobool.not229 = icmp eq i64 %inc.i198.3, 0 br i1 %tobool.not229, label %while.end, label %while.body.lr.ph while.cond.while.end_crit_edge: ; preds = %while.cond.backedge store i64 0, ptr @hsize, align 8, !tbaa !25 br label %while.end while.end: ; preds = %pqpush.exit212.3, %pqpush.exit, %while.cond.while.end_crit_edge %r.0.ph.lcssa = phi i64 [ %r.0.ph242, %while.cond.while.end_crit_edge ], [ 0, %pqpush.exit ], [ %add128, %pqpush.exit212.3 ] %call138 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %r.0.ph.lcssa) call void @llvm.lifetime.end.p0(i64 8388608, ptr nonnull %hen) #13 call void @llvm.lifetime.end.p0(i64 1048576, ptr nonnull %fl) #13 call void @llvm.lifetime.end.p0(i64 1048576, ptr nonnull %y) #13 call void @llvm.lifetime.end.p0(i64 1048576, ptr nonnull %x) #13 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #13 call void @llvm.lifetime.end.p0(i64 3145728, ptr nonnull %ys) #13 call void @llvm.lifetime.end.p0(i64 3145728, ptr nonnull %xs) #13 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #11 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #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 = { 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 #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree norecurse nosync nounwind memory(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 #6 = { 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #8 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #13 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"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, !6} !8 = distinct !{!8, !6, !9, !10} !9 = !{!"llvm.loop.isvectorized", i32 1} !10 = !{!"llvm.loop.unroll.runtime.disable"} !11 = distinct !{!11, !6, !10, !9} !12 = distinct !{!12, !6, !9, !10} !13 = distinct !{!13, !6, !10, !9} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.unroll.disable"} !19 = distinct !{!19, !6} !20 = distinct !{!20, !18} !21 = !{!22, !22, i64 0} !22 = !{!"int", !23, i64 0} !23 = !{!"omnipotent char", !24, i64 0} !24 = !{!"Simple C/C++ TBAA"} !25 = !{!26, !26, i64 0} !26 = !{!"long long", !23, i64 0} !27 = !{!28, !28, i64 0} !28 = !{!"double", !23, i64 0} !29 = !{!30, !26, i64 0} !30 = !{!"", !26, i64 0, !26, i64 8} !31 = !{!30, !26, i64 8} !32 = distinct !{!32, !6} !33 = !{i64 0, i64 8, !25, i64 8, i64 8, !25} !34 = !{i64 0, i64 8, !25} !35 = !{!36, !26, i64 0} !36 = !{!"", !26, i64 0, !26, i64 8, !26, i64 16} !37 = !{!36, !26, i64 8} !38 = !{!36, !26, i64 16} !39 = distinct !{!39, !6} !40 = distinct !{!40, !6, !41} !41 = !{!"llvm.loop.peeled.count", i32 1} !42 = distinct !{!42, !6}
#include<stdio.h> #include<stdlib.h> int cmp(const void *a,const void *b) { return *(int *)a-*(int *)b; } int main() { int n,c,k,t[100005],i,sum=0,ans=0; long long int x=0; scanf("%d%d%d",&n,&c,&k); for(i=0;i<n;i++) scanf("%d",&t[i]); qsort(t,n,sizeof(t[0]),cmp); x=t[0]+k; ans++; for(i=0;i<n;i++) { if(x>=t[i]&&sum<c)sum++; else{ ans++; x=t[i]+k; sum=1; } } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264610/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264610/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #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 %c = alloca i32, align 4 %k = alloca i32, align 4 %t = alloca [100005 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %c, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp35 = icmp sgt i32 %0, 0 br i1 %cmp35, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100005 x i32], ptr %t, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry.for.end_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ] call void @qsort(ptr noundef nonnull %t, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #5 %3 = load i32, ptr %k, align 4, !tbaa !5 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp637 = icmp sgt i32 %4, 0 br i1 %cmp637, label %for.body8.lr.ph, label %for.end24 for.body8.lr.ph: ; preds = %for.end %5 = load i32, ptr %t, align 16, !tbaa !5 %add = add nsw i32 %3, %5 %conv3 = sext i32 %add to i64 %6 = load i32, ptr %c, align 4 %wide.trip.count = zext i32 %4 to i64 %xtraiter = and i64 %wide.trip.count, 1 %7 = icmp eq i32 %4, 1 br i1 %7, label %for.end24.loopexit.unr-lcssa, label %for.body8.lr.ph.new for.body8.lr.ph.new: ; preds = %for.body8.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body8 for.body8: ; preds = %for.body8, %for.body8.lr.ph.new %indvars.iv45 = phi i64 [ 0, %for.body8.lr.ph.new ], [ %indvars.iv.next46.1, %for.body8 ] %x.041 = phi i64 [ %conv3, %for.body8.lr.ph.new ], [ %x.1.1, %for.body8 ] %ans.040 = phi i32 [ 1, %for.body8.lr.ph.new ], [ %ans.1.1, %for.body8 ] %sum.039 = phi i32 [ 0, %for.body8.lr.ph.new ], [ %sum.1.1, %for.body8 ] %niter = phi i64 [ 0, %for.body8.lr.ph.new ], [ %niter.next.1, %for.body8 ] %arrayidx10 = getelementptr inbounds [100005 x i32], ptr %t, i64 0, i64 %indvars.iv45 %8 = load i32, ptr %arrayidx10, align 8, !tbaa !5 %conv11 = sext i32 %8 to i64 %cmp12.not = icmp slt i64 %x.041, %conv11 %cmp14 = icmp sge i32 %sum.039, %6 %or.cond.not = select i1 %cmp12.not, i1 true, i1 %cmp14 %inc16 = add nsw i32 %sum.039, 1 %add20 = add nsw i32 %8, %3 %conv21 = sext i32 %add20 to i64 %sum.1 = select i1 %or.cond.not, i32 1, i32 %inc16 %inc17 = zext i1 %or.cond.not to i32 %ans.1 = add nuw nsw i32 %ans.040, %inc17 %x.1 = select i1 %or.cond.not, i64 %conv21, i64 %x.041 %indvars.iv.next46 = or i64 %indvars.iv45, 1 %arrayidx10.1 = getelementptr inbounds [100005 x i32], ptr %t, i64 0, i64 %indvars.iv.next46 %9 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %conv11.1 = sext i32 %9 to i64 %cmp12.not.1 = icmp slt i64 %x.1, %conv11.1 %cmp14.1 = icmp sge i32 %sum.1, %6 %or.cond.not.1 = select i1 %cmp12.not.1, i1 true, i1 %cmp14.1 %inc16.1 = add nsw i32 %sum.1, 1 %add20.1 = add nsw i32 %9, %3 %conv21.1 = sext i32 %add20.1 to i64 %sum.1.1 = select i1 %or.cond.not.1, i32 1, i32 %inc16.1 %inc17.1 = zext i1 %or.cond.not.1 to i32 %ans.1.1 = add nuw nsw i32 %ans.1, %inc17.1 %x.1.1 = select i1 %or.cond.not.1, i64 %conv21.1, i64 %x.1 %indvars.iv.next46.1 = add nuw nsw i64 %indvars.iv45, 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.body8, !llvm.loop !11 for.end24.loopexit.unr-lcssa: ; preds = %for.body8, %for.body8.lr.ph %ans.1.lcssa.ph = phi i32 [ undef, %for.body8.lr.ph ], [ %ans.1.1, %for.body8 ] %indvars.iv45.unr = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next46.1, %for.body8 ] %x.041.unr = phi i64 [ %conv3, %for.body8.lr.ph ], [ %x.1.1, %for.body8 ] %ans.040.unr = phi i32 [ 1, %for.body8.lr.ph ], [ %ans.1.1, %for.body8 ] %sum.039.unr = phi i32 [ 0, %for.body8.lr.ph ], [ %sum.1.1, %for.body8 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end24, label %for.body8.epil for.body8.epil: ; preds = %for.end24.loopexit.unr-lcssa %arrayidx10.epil = getelementptr inbounds [100005 x i32], ptr %t, i64 0, i64 %indvars.iv45.unr %10 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5 %conv11.epil = sext i32 %10 to i64 %cmp12.not.epil = icmp slt i64 %x.041.unr, %conv11.epil %cmp14.epil = icmp sge i32 %sum.039.unr, %6 %or.cond.not.epil = select i1 %cmp12.not.epil, i1 true, i1 %cmp14.epil %inc17.epil = zext i1 %or.cond.not.epil to i32 %ans.1.epil = add nuw nsw i32 %ans.040.unr, %inc17.epil br label %for.end24 for.end24: ; preds = %for.body8.epil, %for.end24.loopexit.unr-lcssa, %for.end %ans.0.lcssa = phi i32 [ 1, %for.end ], [ %ans.1.lcssa.ph, %for.end24.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body8.epil ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #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 declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> //#include <math.h> int a[50]; int main(){ int n,p; int i,j,k,l,m; int b; int ans; while(1){ scanf("%d %d",&n,&p); if(n==0&&p==0)break; b=1; while(b){ for(i=0; i<n; i++){ if(p>0){ p-=1; a[i]+=1; } else{ for(j=0; j<n; j++){ if(j!=i&&a[j]!=0)break; if(j==n-1){ b=0; ans=i; break; } } p+=a[i]; a[i]=0; } if(!b)break; } } printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264654/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264654/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local local_unnamed_addr global [50 x i32] zeroinitializer, align 16 @.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 %p = 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 %p) #3 %call72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp73 = icmp eq i32 %0, 0 %1 = load i32, ptr %p, align 4 %cmp174 = icmp eq i32 %1, 0 %or.cond75 = select i1 %cmp73, i1 %cmp174, i1 false br i1 %or.cond75, label %while.end34, label %while.cond2.preheader while.cond2.preheader: ; preds = %entry, %while.end %p.promoted66 = phi i32 [ %10, %while.end ], [ %1, %entry ] %2 = phi i32 [ %9, %while.end ], [ %0, %entry ] %cmp462 = icmp sgt i32 %2, 0 br i1 %cmp462, label %for.cond.preheader.us.preheader, label %for.cond.preheader for.cond.preheader.us.preheader: ; preds = %while.cond2.preheader %sub17 = add nsw i32 %2, -1 %3 = zext i32 %sub17 to i64 %wide.trip.count = zext i32 %2 to i64 br label %for.body.us.us for.body.us.us: ; preds = %for.inc30.us.us, %for.cond.preheader.us.preheader %indvars.iv80 = phi i64 [ 0, %for.cond.preheader.us.preheader ], [ %spec.select, %for.inc30.us.us ] %add23556063.us.us = phi i32 [ %p.promoted66, %for.cond.preheader.us.preheader ], [ %add235561.us.us, %for.inc30.us.us ] %cmp5.us.us = icmp sgt i32 %add23556063.us.us, 0 br i1 %cmp5.us.us, label %if.end26.thread.us.us, label %for.body9.us.us for.body9.us.us: ; preds = %for.body.us.us, %if.end16.us.us %indvars.iv = phi i64 [ %indvars.iv.next, %if.end16.us.us ], [ 0, %for.body.us.us ] %cmp10.not.us.us = icmp eq i64 %indvars.iv, %indvars.iv80 br i1 %cmp10.not.us.us, label %if.end16.us.us, label %land.lhs.true11.us.us land.lhs.true11.us.us: ; preds = %for.body9.us.us %arrayidx13.us.us = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx13.us.us, align 4, !tbaa !5 %cmp14.not.us.us = icmp eq i32 %4, 0 br i1 %cmp14.not.us.us, label %if.end16.us.us, label %if.end26.thread50.us.us if.end26.thread50.us.us: ; preds = %land.lhs.true11.us.us %arrayidx2254.us.us = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %indvars.iv80 %5 = load i32, ptr %arrayidx2254.us.us, align 4, !tbaa !5 %add2355.us.us = add nsw i32 %5, %add23556063.us.us store i32 %add2355.us.us, ptr %p, align 4, !tbaa !5 store i32 0, ptr %arrayidx2254.us.us, align 4, !tbaa !5 br label %for.inc30.us.us if.end16.us.us: ; preds = %land.lhs.true11.us.us, %for.body9.us.us %cmp18.us.us = icmp eq i64 %indvars.iv, %3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br i1 %cmp18.us.us, label %while.end, label %for.body9.us.us if.end26.thread.us.us: ; preds = %for.body.us.us %sub.us.us = add nsw i32 %add23556063.us.us, -1 store i32 %sub.us.us, ptr %p, align 4, !tbaa !5 %arrayidx.us.us = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %indvars.iv80 %6 = load i32, ptr %arrayidx.us.us, align 4, !tbaa !5 %add.us.us = add nsw i32 %6, 1 store i32 %add.us.us, ptr %arrayidx.us.us, align 4, !tbaa !5 br label %for.inc30.us.us for.inc30.us.us: ; preds = %if.end26.thread.us.us, %if.end26.thread50.us.us %add235561.us.us = phi i32 [ %add2355.us.us, %if.end26.thread50.us.us ], [ %sub.us.us, %if.end26.thread.us.us ] %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %exitcond.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count %spec.select = select i1 %exitcond.not, i64 0, i64 %indvars.iv.next81 br label %for.body.us.us, !llvm.loop !9 for.cond.preheader: ; preds = %while.cond2.preheader, %for.cond.preheader br label %for.cond.preheader while.end: ; preds = %if.end16.us.us %7 = trunc i64 %indvars.iv80 to i32 %idxprom21.us = and i64 %indvars.iv80, 4294967295 %arrayidx22.us = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %idxprom21.us %8 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5 %add23.us = add nsw i32 %8, %add23556063.us.us store i32 %add23.us, ptr %p, align 4, !tbaa !5 store i32 0, ptr %arrayidx22.us, align 4, !tbaa !5 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p) %9 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %9, 0 %10 = load i32, ptr %p, align 4 %cmp1 = icmp eq i32 %10, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end34, label %while.cond2.preheader while.end34: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> int main(void){ int ans,person[50],p,N,i,pp; while(1){ scanf("%d %d",&N,&pp); if(N == 0 && pp == 0) break; p= pp; for(i = 0;i < N;i++){ person[i] = 0; } ans = 0; while(1){ if(p == 0){ if(person[ans] == pp){ break; }else{ p = person[ans]; person[ans] = 0; } }else{ //printf("%d ",ans); person[ans]++; p--; } ans = (ans + 1)%N; } printf("%d\n",ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264698/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264698/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %person = alloca [50 x i32], align 16 %N = alloca i32, align 4 %pp = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %person) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %pp) #4 %call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %pp) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp34 = icmp eq i32 %0, 0 %1 = load i32, ptr %pp, align 4 %cmp135 = icmp eq i32 %1, 0 %or.cond36 = select i1 %cmp34, i1 %cmp135, i1 false br i1 %or.cond36, label %while.end22, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %while.end %2 = phi i32 [ %8, %while.end ], [ %1, %entry ] %3 = phi i32 [ %7, %while.end ], [ %0, %entry ] %cmp231 = icmp sgt i32 %3, 0 br i1 %cmp231, label %for.body.preheader, label %while.cond3.preheader for.body.preheader: ; preds = %for.cond.preheader %4 = zext i32 %3 to i64 %5 = shl nuw nsw i64 %4, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %person, i8 0, i64 %5, i1 false), !tbaa !5 br label %while.cond3.preheader while.cond3.preheader: ; preds = %for.body.preheader, %for.cond.preheader br label %while.cond3 while.cond3: ; preds = %while.cond3.preheader, %if.end20 %ans.0 = phi i32 [ %rem, %if.end20 ], [ 0, %while.cond3.preheader ] %p.0 = phi i32 [ %p.1, %if.end20 ], [ %2, %while.cond3.preheader ] %cmp5 = icmp eq i32 %p.0, 0 %idxprom7 = sext i32 %ans.0 to i64 %arrayidx8 = getelementptr inbounds [50 x i32], ptr %person, i64 0, i64 %idxprom7 %6 = load i32, ptr %arrayidx8, align 4, !tbaa !5 br i1 %cmp5, label %if.then6, label %if.else16 if.then6: ; preds = %while.cond3 %cmp9 = icmp eq i32 %6, %2 br i1 %cmp9, label %while.end, label %if.else if.else: ; preds = %if.then6 store i32 0, ptr %arrayidx8, align 4, !tbaa !5 br label %if.end20 if.else16: ; preds = %while.cond3 %inc19 = add nsw i32 %6, 1 store i32 %inc19, ptr %arrayidx8, align 4, !tbaa !5 %dec = add nsw i32 %p.0, -1 br label %if.end20 if.end20: ; preds = %if.else16, %if.else %p.1 = phi i32 [ %6, %if.else ], [ %dec, %if.else16 ] %add = add nsw i32 %ans.0, 1 %rem = srem i32 %add, %3 br label %while.cond3 while.end: ; preds = %if.then6 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %pp) %7 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp eq i32 %7, 0 %8 = load i32, ptr %pp, align 4 %cmp1 = icmp eq i32 %8, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end22, label %for.cond.preheader while.end22: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %pp) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %person) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <stdlib.h> void copy(char *from,char *to,int n){ int i; for(i=0;i<6;i++){ if(i<n){ to[i] = from[i]; }else{ to[i] ='\0'; } } } int check(char *a,char *b){ int i; for(i=0;i<5;i++){ if(a[i]<b[i]){ return -1; }else if(a[i] >b[i]){ return 1; } } return 0; } int int_sort( const void *a,const void *b){ return strcmp((char *) a, (char *)b); } int main(void){ char s[5001]; int K; int i,j; scanf("%s",s); scanf("%d",&K); char kouho[25000][6]; int index=0; //長さ5以下のsubstringをkouho[]に詰めていく。 for(i=0;s[i]!='\0';i++){//まず先頭のs[i]を決める。 for(j=1;s[i+j-1]!='\0';j++){//s[i],s[i]s[i+1],s[i]s[i+1]s[i+2]...とs[i]を基準として5文字までsubstringを作っている。 if(j>5){//長さ5以上のsubstringは必要ないので処理を終える。 break; }else{ copy(&s[i],kouho[index],j); index++; } } } qsort(kouho,index,sizeof(kouho[0]),int_sort);//kouhoをソートしている int ex[25000]; for(i=0;i<25000;i++){ ex[i]=1; } for(i=0;i<index;i++){ if(check(kouho[i],kouho[i+1])==0){ ex[i+1]=-1; } } int count=0,flag=0; i=0; while(flag < K){ if(ex[i] > 0){ count = i; flag++; } i++; } printf("%s",kouho[count]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264834/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264834/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @copy(ptr nocapture noundef readonly %from, ptr nocapture noundef writeonly %to, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp1 = icmp sgt i32 %n, 0 br i1 %cmp1, label %for.inc, label %for.inc.thread for.inc.thread: ; preds = %entry store i8 0, ptr %to, align 1 br label %for.inc.1.thread for.inc: ; preds = %entry %0 = load i8, ptr %from, align 1, !tbaa !5 store i8 %0, ptr %to, align 1 %cmp1.1.not = icmp eq i32 %n, 1 br i1 %cmp1.1.not, label %for.inc.1.thread, label %for.inc.1 for.inc.1.thread: ; preds = %for.inc, %for.inc.thread %1 = getelementptr inbounds i8, ptr %to, i64 1 store i8 0, ptr %1, align 1 br label %for.inc.2.thread for.inc.1: ; preds = %for.inc %arrayidx.1 = getelementptr inbounds i8, ptr %from, i64 1 %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %3 = getelementptr inbounds i8, ptr %to, i64 1 store i8 %2, ptr %3, align 1 %cmp1.2 = icmp ugt i32 %n, 2 br i1 %cmp1.2, label %for.inc.2, label %for.inc.2.thread for.inc.2.thread: ; preds = %for.inc.1, %for.inc.1.thread %4 = getelementptr inbounds i8, ptr %to, i64 2 store i8 0, ptr %4, align 1 br label %for.inc.3.thread for.inc.2: ; preds = %for.inc.1 %arrayidx.2 = getelementptr inbounds i8, ptr %from, i64 2 %5 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %6 = getelementptr inbounds i8, ptr %to, i64 2 store i8 %5, ptr %6, align 1 %cmp1.3.not = icmp eq i32 %n, 3 br i1 %cmp1.3.not, label %for.inc.3.thread, label %for.inc.3 for.inc.3.thread: ; preds = %for.inc.2, %for.inc.2.thread %7 = getelementptr inbounds i8, ptr %to, i64 3 store i8 0, ptr %7, align 1 br label %for.inc.4.thread for.inc.3: ; preds = %for.inc.2 %arrayidx.3 = getelementptr inbounds i8, ptr %from, i64 3 %8 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %9 = getelementptr inbounds i8, ptr %to, i64 3 store i8 %8, ptr %9, align 1 %cmp1.4 = icmp ugt i32 %n, 4 br i1 %cmp1.4, label %for.inc.4, label %for.inc.4.thread for.inc.4.thread: ; preds = %for.inc.3, %for.inc.3.thread %10 = getelementptr inbounds i8, ptr %to, i64 4 store i8 0, ptr %10, align 1 br label %for.inc.5 for.inc.4: ; preds = %for.inc.3 %arrayidx.4 = getelementptr inbounds i8, ptr %from, i64 4 %11 = load i8, ptr %arrayidx.4, align 1, !tbaa !5 %12 = getelementptr inbounds i8, ptr %to, i64 4 store i8 %11, ptr %12, align 1 %cmp1.5.not = icmp eq i32 %n, 5 br i1 %cmp1.5.not, label %for.inc.5, label %if.then.5 if.then.5: ; preds = %for.inc.4 %arrayidx.5 = getelementptr inbounds i8, ptr %from, i64 5 %13 = load i8, ptr %arrayidx.5, align 1, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %for.inc.4, %for.inc.4.thread, %if.then.5 %.sink18 = phi i8 [ %13, %if.then.5 ], [ 0, %for.inc.4.thread ], [ 0, %for.inc.4 ] %14 = getelementptr inbounds i8, ptr %to, i64 5 store i8 %.sink18, ptr %14, align 1 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @check(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 { entry: %0 = load i8, ptr %a, align 1, !tbaa !5 %1 = load i8, ptr %b, align 1, !tbaa !5 %cmp4 = icmp slt i8 %0, %1 br i1 %cmp4, label %cleanup, label %if.else for.cond: ; preds = %if.else %arrayidx.1 = getelementptr inbounds i8, ptr %a, i64 1 %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %arrayidx2.1 = getelementptr inbounds i8, ptr %b, i64 1 %3 = load i8, ptr %arrayidx2.1, align 1, !tbaa !5 %cmp4.1 = icmp slt i8 %2, %3 br i1 %cmp4.1, label %cleanup, label %if.else.1 if.else.1: ; preds = %for.cond %cmp12.1 = icmp sgt i8 %2, %3 br i1 %cmp12.1, label %cleanup, label %for.cond.1 for.cond.1: ; preds = %if.else.1 %arrayidx.2 = getelementptr inbounds i8, ptr %a, i64 2 %4 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %arrayidx2.2 = getelementptr inbounds i8, ptr %b, i64 2 %5 = load i8, ptr %arrayidx2.2, align 1, !tbaa !5 %cmp4.2 = icmp slt i8 %4, %5 br i1 %cmp4.2, label %cleanup, label %if.else.2 if.else.2: ; preds = %for.cond.1 %cmp12.2 = icmp sgt i8 %4, %5 br i1 %cmp12.2, label %cleanup, label %for.cond.2 for.cond.2: ; preds = %if.else.2 %arrayidx.3 = getelementptr inbounds i8, ptr %a, i64 3 %6 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %arrayidx2.3 = getelementptr inbounds i8, ptr %b, i64 3 %7 = load i8, ptr %arrayidx2.3, align 1, !tbaa !5 %cmp4.3 = icmp slt i8 %6, %7 br i1 %cmp4.3, label %cleanup, label %if.else.3 if.else.3: ; preds = %for.cond.2 %cmp12.3 = icmp sgt i8 %6, %7 br i1 %cmp12.3, label %cleanup, label %for.cond.3 for.cond.3: ; preds = %if.else.3 %arrayidx.4 = getelementptr inbounds i8, ptr %a, i64 4 %8 = load i8, ptr %arrayidx.4, align 1, !tbaa !5 %arrayidx2.4 = getelementptr inbounds i8, ptr %b, i64 4 %9 = load i8, ptr %arrayidx2.4, align 1, !tbaa !5 %cmp4.4 = icmp slt i8 %8, %9 br i1 %cmp4.4, label %cleanup, label %if.else.4 if.else.4: ; preds = %for.cond.3 %cmp12.4 = icmp sgt i8 %8, %9 %spec.select = zext i1 %cmp12.4 to i32 br label %cleanup if.else: ; preds = %entry %cmp12 = icmp sgt i8 %0, %1 br i1 %cmp12, label %cleanup, label %for.cond cleanup: ; preds = %if.else.4, %for.cond.3, %if.else.3, %for.cond.2, %if.else.2, %for.cond.1, %if.else.1, %for.cond, %if.else, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.else ], [ -1, %for.cond ], [ 1, %if.else.1 ], [ -1, %for.cond.1 ], [ 1, %if.else.2 ], [ -1, %for.cond.2 ], [ 1, %if.else.3 ], [ -1, %for.cond.3 ], [ %spec.select, %if.else.4 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @int_sort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #3 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #9 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #5 { entry: %s = alloca [5001 x i8], align 16 %K = alloca i32, align 4 %kouho = alloca [25000 x [6 x i8]], align 16 %ex = alloca [25000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 5001, ptr nonnull %s) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %K) call void @llvm.lifetime.start.p0(i64 150000, ptr nonnull %kouho) #10 %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not109 = icmp eq i8 %0, 0 br i1 %cmp.not109, label %for.end20, label %copy.exit.peel copy.exit.peel: ; preds = %entry, %for.inc18 %indvars.iv175 = phi i64 [ %4, %for.inc18 ], [ 0, %entry ] %1 = phi i8 [ %.pre188, %for.inc18 ], [ %0, %entry ] %arrayidx112 = phi ptr [ %arrayidx, %for.inc18 ], [ %s, %entry ] %index.0111 = phi i64 [ %inc.lcssa.wide, %for.inc18 ], [ 0, %entry ] %arrayidx.1.i = getelementptr inbounds i8, ptr %arrayidx112, i64 1 %arrayidx.2.i = getelementptr inbounds i8, ptr %arrayidx112, i64 2 %arrayidx.3.i = getelementptr inbounds i8, ptr %arrayidx112, i64 3 %arrayidx.4.i = getelementptr inbounds i8, ptr %arrayidx112, i64 4 %sext = shl i64 %index.0111, 32 %2 = ashr exact i64 %sext, 32 %arrayidx15.peel = getelementptr inbounds [25000 x [6 x i8]], ptr %kouho, i64 0, i64 %2 store i8 %1, ptr %arrayidx15.peel, align 2 %3 = getelementptr inbounds i8, ptr %arrayidx15.peel, i64 1 %indvars.iv.next.peel = add nsw i64 %2, 1 %4 = add nuw nsw i64 %indvars.iv175, 1 %sext189 = shl i64 %4, 32 %idxprom4.peel = ashr exact i64 %sext189, 32 %arrayidx5.peel = getelementptr inbounds [5001 x i8], ptr %s, i64 0, i64 %idxprom4.peel call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %3, i8 0, i64 5, i1 false) %5 = load i8, ptr %arrayidx5.peel, align 1, !tbaa !5 %cmp7.peel = icmp eq i8 %5, 0 br i1 %cmp7.peel, label %for.inc18, label %copy.exit.peel143 copy.exit.peel143: ; preds = %copy.exit.peel %arrayidx15.peel130 = getelementptr inbounds [25000 x [6 x i8]], ptr %kouho, i64 0, i64 %indvars.iv.next.peel store i8 %1, ptr %arrayidx15.peel130, align 2 %6 = load i8, ptr %arrayidx.1.i, align 1, !tbaa !5 %7 = getelementptr inbounds i8, ptr %arrayidx15.peel130, i64 1 store i8 %6, ptr %7, align 1 %8 = getelementptr inbounds i8, ptr %arrayidx15.peel130, i64 2 %indvars.iv.next.peel144 = add nsw i64 %2, 2 %9 = shl i64 %indvars.iv175, 32 %sext190 = add i64 %9, 8589934592 %idxprom4.peel146 = ashr exact i64 %sext190, 32 %arrayidx5.peel147 = getelementptr inbounds [5001 x i8], ptr %s, i64 0, i64 %idxprom4.peel146 store i32 0, ptr %8, align 2 %10 = load i8, ptr %arrayidx5.peel147, align 1, !tbaa !5 %cmp7.peel148 = icmp eq i8 %10, 0 br i1 %cmp7.peel148, label %for.inc18, label %copy.exit.peel166 copy.exit.peel166: ; preds = %copy.exit.peel143 %arrayidx15.peel153 = getelementptr inbounds [25000 x [6 x i8]], ptr %kouho, i64 0, i64 %indvars.iv.next.peel144 store i8 %1, ptr %arrayidx15.peel153, align 2 %11 = load i8, ptr %arrayidx.1.i, align 1, !tbaa !5 %12 = getelementptr inbounds i8, ptr %arrayidx15.peel153, i64 1 store i8 %11, ptr %12, align 1 %13 = load i8, ptr %arrayidx.2.i, align 1, !tbaa !5 %14 = getelementptr inbounds i8, ptr %arrayidx15.peel153, i64 2 store i8 %13, ptr %14, align 2 %15 = getelementptr inbounds i8, ptr %arrayidx15.peel153, i64 3 store i8 0, ptr %15, align 1 %16 = getelementptr inbounds i8, ptr %arrayidx15.peel153, i64 4 store i8 0, ptr %16, align 2 %17 = getelementptr inbounds i8, ptr %arrayidx15.peel153, i64 5 store i8 0, ptr %17, align 1 %indvars.iv.next.peel167 = add nsw i64 %2, 3 %18 = shl i64 %indvars.iv175, 32 %sext191 = add i64 %18, 12884901888 %idxprom4.peel169 = ashr exact i64 %sext191, 32 %arrayidx5.peel170 = getelementptr inbounds [5001 x i8], ptr %s, i64 0, i64 %idxprom4.peel169 %19 = load i8, ptr %arrayidx5.peel170, align 1, !tbaa !5 %cmp7.peel171 = icmp eq i8 %19, 0 br i1 %cmp7.peel171, label %for.inc18, label %if.else.peel.next151 if.else.peel.next151: ; preds = %copy.exit.peel166 %20 = load i8, ptr %arrayidx.1.i, align 1, !tbaa !5 %21 = load i8, ptr %arrayidx.2.i, align 1, !tbaa !5 %22 = load i8, ptr %arrayidx.3.i, align 1, !tbaa !5 %arrayidx15 = getelementptr inbounds [25000 x [6 x i8]], ptr %kouho, i64 0, i64 %indvars.iv.next.peel167 store i8 %1, ptr %arrayidx15, align 2 %23 = getelementptr inbounds i8, ptr %arrayidx15, i64 1 store i8 %20, ptr %23, align 1 %24 = getelementptr inbounds i8, ptr %arrayidx15, i64 2 store i8 %21, ptr %24, align 2 %25 = getelementptr inbounds i8, ptr %arrayidx15, i64 3 store i8 %22, ptr %25, align 1 %26 = getelementptr inbounds i8, ptr %arrayidx15, i64 4 store i8 0, ptr %26, align 2 %27 = getelementptr inbounds i8, ptr %arrayidx15, i64 5 store i8 0, ptr %27, align 1 %indvars.iv.next = add nsw i64 %2, 4 %28 = shl i64 %indvars.iv175, 32 %sext192 = add i64 %28, 17179869184 %idxprom4 = ashr exact i64 %sext192, 32 %arrayidx5 = getelementptr inbounds [5001 x i8], ptr %s, i64 0, i64 %idxprom4 %29 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %cmp7 = icmp eq i8 %29, 0 br i1 %cmp7, label %for.inc18, label %for.inc.3.i.1, !llvm.loop !8 for.inc.3.i.1: ; preds = %if.else.peel.next151 %arrayidx15.1 = getelementptr inbounds [25000 x [6 x i8]], ptr %kouho, i64 0, i64 %indvars.iv.next store i8 %1, ptr %arrayidx15.1, align 2 %30 = getelementptr inbounds i8, ptr %arrayidx15.1, i64 1 store i8 %20, ptr %30, align 1 %31 = getelementptr inbounds i8, ptr %arrayidx15.1, i64 2 store i8 %21, ptr %31, align 2 %32 = getelementptr inbounds i8, ptr %arrayidx15.1, i64 3 store i8 %22, ptr %32, align 1 %33 = load i8, ptr %arrayidx.4.i, align 1, !tbaa !5 %34 = getelementptr inbounds i8, ptr %arrayidx15.1, i64 4 store i8 %33, ptr %34, align 2 %35 = getelementptr inbounds i8, ptr %arrayidx15.1, i64 5 store i8 0, ptr %35, align 1 %indvars.iv.next.1 = add nsw i64 %2, 5 br label %for.inc18 for.inc18: ; preds = %if.else.peel.next151, %for.inc.3.i.1, %copy.exit.peel, %copy.exit.peel143, %copy.exit.peel166 %inc.lcssa.wide = phi i64 [ %indvars.iv.next.peel, %copy.exit.peel ], [ %indvars.iv.next.peel144, %copy.exit.peel143 ], [ %indvars.iv.next.peel167, %copy.exit.peel166 ], [ %indvars.iv.next, %if.else.peel.next151 ], [ %indvars.iv.next.1, %for.inc.3.i.1 ] %arrayidx.phi.trans.insert = getelementptr inbounds [5001 x i8], ptr %s, i64 0, i64 %4 %.pre188 = load i8, ptr %arrayidx.phi.trans.insert, align 1, !tbaa !5 %arrayidx = getelementptr inbounds [5001 x i8], ptr %s, i64 0, i64 %4 %cmp.not = icmp eq i8 %.pre188, 0 br i1 %cmp.not, label %for.end20.loopexit, label %copy.exit.peel, !llvm.loop !11 for.end20.loopexit: ; preds = %for.inc18 %36 = trunc i64 %inc.lcssa.wide to i32 br label %for.end20 for.end20: ; preds = %for.end20.loopexit, %entry %index.0.lcssa = phi i32 [ 0, %entry ], [ %36, %for.end20.loopexit ] %conv22 = sext i32 %index.0.lcssa to i64 call void @qsort(ptr noundef nonnull %kouho, i64 noundef %conv22, i64 noundef 6, ptr noundef nonnull @int_sort) #10 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %ex) #10 br label %vector.body vector.body: ; preds = %vector.body, %for.end20 %index = phi i64 [ 0, %for.end20 ], [ %index.next.4, %vector.body ] %37 = getelementptr inbounds [25000 x i32], ptr %ex, i64 0, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %37, align 16, !tbaa !12 %38 = getelementptr inbounds i32, ptr %37, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %38, align 16, !tbaa !12 %index.next = add nuw nsw i64 %index, 8 %39 = getelementptr inbounds [25000 x i32], ptr %ex, i64 0, i64 %index.next store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %39, align 16, !tbaa !12 %40 = getelementptr inbounds i32, ptr %39, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %40, align 16, !tbaa !12 %index.next.1 = add nuw nsw i64 %index, 16 %41 = getelementptr inbounds [25000 x i32], ptr %ex, i64 0, i64 %index.next.1 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %41, align 16, !tbaa !12 %42 = getelementptr inbounds i32, ptr %41, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %42, align 16, !tbaa !12 %index.next.2 = add nuw nsw i64 %index, 24 %43 = getelementptr inbounds [25000 x i32], ptr %ex, i64 0, i64 %index.next.2 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %43, align 16, !tbaa !12 %44 = getelementptr inbounds i32, ptr %43, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %44, align 16, !tbaa !12 %index.next.3 = add nuw nsw i64 %index, 32 %45 = getelementptr inbounds [25000 x i32], ptr %ex, i64 0, i64 %index.next.3 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %45, align 16, !tbaa !12 %46 = getelementptr inbounds i32, ptr %45, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %46, align 16, !tbaa !12 %index.next.4 = add nuw nsw i64 %index, 40 %47 = icmp eq i64 %index.next.4, 25000 br i1 %47, label %for.cond32.preheader, label %vector.body, !llvm.loop !14 for.cond32.preheader: ; preds = %vector.body %cmp33115 = icmp sgt i32 %index.0.lcssa, 0 br i1 %cmp33115, label %for.body35.preheader, label %while.cond.preheader for.body35.preheader: ; preds = %for.cond32.preheader %wide.trip.count = zext i32 %index.0.lcssa to i64 %.pre187 = load i8, ptr %kouho, align 16, !tbaa !5 br label %for.body35 while.cond.preheader: ; preds = %for.inc51, %for.cond32.preheader %48 = load i32, ptr %K, align 4, !tbaa !12 %cmp54117 = icmp sgt i32 %48, 0 br i1 %cmp54117, label %while.body, label %while.end for.body35: ; preds = %for.body35.preheader, %for.inc51 %49 = phi i8 [ %.pre187, %for.body35.preheader ], [ %50, %for.inc51 ] %indvars.iv180 = phi i64 [ 0, %for.body35.preheader ], [ %indvars.iv.next181, %for.inc51 ] %arrayidx37 = getelementptr inbounds [25000 x [6 x i8]], ptr %kouho, i64 0, i64 %indvars.iv180 %indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1 %arrayidx41 = getelementptr inbounds [25000 x [6 x i8]], ptr %kouho, i64 0, i64 %indvars.iv.next181 %50 = load i8, ptr %arrayidx41, align 2, !tbaa !5 %or.cond99.not = icmp eq i8 %49, %50 br i1 %or.cond99.not, label %for.cond.i, label %for.inc51 for.cond.i: ; preds = %for.body35 %arrayidx.1.i90 = getelementptr inbounds i8, ptr %arrayidx37, i64 1 %51 = load i8, ptr %arrayidx.1.i90, align 1, !tbaa !5 %arrayidx2.1.i = getelementptr inbounds i8, ptr %arrayidx41, i64 1 %52 = load i8, ptr %arrayidx2.1.i, align 1, !tbaa !5 %or.cond96.not = icmp eq i8 %51, %52 br i1 %or.cond96.not, label %for.cond.1.i, label %for.inc51 for.cond.1.i: ; preds = %for.cond.i %arrayidx.2.i91 = getelementptr inbounds i8, ptr %arrayidx37, i64 2 %53 = load i8, ptr %arrayidx.2.i91, align 2, !tbaa !5 %arrayidx2.2.i = getelementptr inbounds i8, ptr %arrayidx41, i64 2 %54 = load i8, ptr %arrayidx2.2.i, align 2, !tbaa !5 %or.cond97.not = icmp eq i8 %53, %54 br i1 %or.cond97.not, label %for.cond.2.i, label %for.inc51 for.cond.2.i: ; preds = %for.cond.1.i %arrayidx.3.i92 = getelementptr inbounds i8, ptr %arrayidx37, i64 3 %55 = load i8, ptr %arrayidx.3.i92, align 1, !tbaa !5 %arrayidx2.3.i = getelementptr inbounds i8, ptr %arrayidx41, i64 3 %56 = load i8, ptr %arrayidx2.3.i, align 1, !tbaa !5 %or.cond98.not = icmp eq i8 %55, %56 br i1 %or.cond98.not, label %for.cond.3.i, label %for.inc51 for.cond.3.i: ; preds = %for.cond.2.i %arrayidx.4.i93 = getelementptr inbounds i8, ptr %arrayidx37, i64 4 %57 = load i8, ptr %arrayidx.4.i93, align 2, !tbaa !5 %arrayidx2.4.i = getelementptr inbounds i8, ptr %arrayidx41, i64 4 %58 = load i8, ptr %arrayidx2.4.i, align 2, !tbaa !5 %or.cond100.not = icmp eq i8 %57, %58 br i1 %or.cond100.not, label %if.then46, label %for.inc51 if.then46: ; preds = %for.cond.3.i %arrayidx49 = getelementptr inbounds [25000 x i32], ptr %ex, i64 0, i64 %indvars.iv.next181 store i32 -1, ptr %arrayidx49, align 4, !tbaa !12 br label %for.inc51 for.inc51: ; preds = %for.cond.3.i, %for.cond.2.i, %for.cond.1.i, %for.cond.i, %for.body35, %if.then46 %exitcond183.not = icmp eq i64 %indvars.iv.next181, %wide.trip.count br i1 %exitcond183.not, label %while.cond.preheader, label %for.body35, !llvm.loop !17 while.body: ; preds = %while.cond.preheader, %while.body %indvars.iv184 = phi i64 [ %indvars.iv.next185, %while.body ], [ 0, %while.cond.preheader ] %flag.0120 = phi i32 [ %spec.select89, %while.body ], [ 0, %while.cond.preheader ] %count.0119 = phi i32 [ %spec.select, %while.body ], [ 0, %while.cond.preheader ] %arrayidx57 = getelementptr inbounds [25000 x i32], ptr %ex, i64 0, i64 %indvars.iv184 %59 = load i32, ptr %arrayidx57, align 4, !tbaa !12 %cmp58 = icmp sgt i32 %59, 0 %60 = trunc i64 %indvars.iv184 to i32 %spec.select = select i1 %cmp58, i32 %60, i32 %count.0119 %inc61 = zext i1 %cmp58 to i32 %spec.select89 = add nuw nsw i32 %flag.0120, %inc61 %indvars.iv.next185 = add nuw i64 %indvars.iv184, 1 %cmp54 = icmp slt i32 %spec.select89, %48 br i1 %cmp54, label %while.body, label %while.end.loopexit, !llvm.loop !18 while.end.loopexit: ; preds = %while.body %61 = sext i32 %spec.select to i64 br label %while.end while.end: ; preds = %while.end.loopexit, %while.cond.preheader %count.0.lcssa = phi i64 [ 0, %while.cond.preheader ], [ %61, %while.end.loopexit ] %arrayidx65 = getelementptr inbounds [25000 x [6 x i8]], ptr %kouho, i64 0, i64 %count.0.lcssa %call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %arrayidx65) call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %ex) #10 call void @llvm.lifetime.end.p0(i64 150000, ptr nonnull %kouho) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #10 call void @llvm.lifetime.end.p0(i64 5001, ptr nonnull %s) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; 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 norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree "no-trapping-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 willreturn memory(read) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.peeled.count", i32 3} !11 = distinct !{!11, !9} !12 = !{!13, !13, i64 0} !13 = !{!"int", !6, i64 0} !14 = distinct !{!14, !9, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !9} !18 = distinct !{!18, !9}
#include <stdio.h> int main(){ int A,B; scanf("%d %d",&A,&B); if( (A*B)%2==1 ){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264878/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264878/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = and i32 %mul, -2147483647 %cmp = icmp eq i32 %2, 1 %str.3.str = select i1 %cmp, 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 (){ // DECLARAÇÕES int x,y; // INSTRUÇÕES scanf ("%d %d",&x,&y); if ((x*y)%2 != 0) printf ("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264920/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264920/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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: %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, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = and i32 %mul, 1 %cmp.not = icmp eq i32 %2, 0 %str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) 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: 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); c=a*b; if (c%2!=0) printf("Yes",a*b*c); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264964/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264964/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = and i32 %mul, 1 %cmp.not = icmp eq i32 %2, 0 br i1 %cmp.not, label %if.else, label %if.then if.then: ; preds = %entry %mul2 = mul nsw i32 %mul, %mul %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul2) br label %if.end if.else: ; preds = %entry %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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*B)%2 == 0) { printf("No\n"); } else { printf("Yes\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265006/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265006/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %1 = load i32, ptr %B, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = and i32 %mul, 1 %cmp = icmp eq i32 %2, 0 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) 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<string.h> #include<stdlib.h> #include<math.h> int main(){ int i,a; scanf("%d",&a); for(i=0;i<a;i++){ int n; scanf("%d",&n); printf("%d\n",n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26505/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26505/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %0, 0 br i1 %cmp4, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.05 = phi i32 [ %inc, %for.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 %inc = add nuw nsw i32 %i.05, 1 %2 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int a, b; scanf("%d%d", &a, &b); if (a % 2 == 0 || b % 2 == 0)printf("No"); else printf("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265093/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265093/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"No\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 %2 = load i32, ptr %b, align 4 %3 = and i32 %2, 1 %cmp2 = icmp eq i32 %3, 0 %4 = select i1 %cmp, i1 true, i1 %cmp2 %.str.2.sink = select i1 %4, ptr @.str.1, ptr @.str.2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) 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%2 && b%2){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265136/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265136/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = and i32 %0, 1 %tobool.not = icmp eq i32 %1, 0 br i1 %tobool.not, label %if.else, label %land.lhs.true land.lhs.true: ; preds = %entry %2 = load i32, ptr %b, align 4, !tbaa !5 %3 = and i32 %2, 1 %tobool2.not = icmp eq i32 %3, 0 br i1 %tobool2.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.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 %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){ // Your code here! int a,b; scanf("%d %d",&a,&b); if(a%2==1&&b%2==1){ printf("Yes"); } else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265187/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265187/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = and i32 %0, -2147483647 %cmp = icmp eq i32 %1, 1 br i1 %cmp, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %entry %2 = load i32, ptr %b, align 4, !tbaa !5 %3 = and i32 %2, -2147483647 %cmp2 = icmp eq i32 %3, 1 br i1 %cmp2, 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.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) 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==2||B==2) printf("No"); else printf("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265237/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265237/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"No\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() 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 eq i32 %0, 2 %1 = load i32, ptr %B, align 4 %cmp1 = icmp eq i32 %1, 2 %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(void){ int x,y,s,f,i,j,a,b; for(;;){ scanf("%d %d %d",&x,&y,&s); if(x==0&&y==0&&s==0)break; int max=0; for(i=1;i<=s/2;i++){ for(j=i;j<=s;j++){ a=i*(100+x)/100; b=j*(100+x)/100; f = i*(100+y)/100 + j*(100+y)/100; if(a+b==s&&max<f) max=f; } } printf("%d\n",max); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265280/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265280/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %x = alloca i32, align 4 %y = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 %call49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %s) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp50 = icmp eq i32 %0, 0 %1 = load i32, ptr %y, align 4 %cmp151 = icmp eq i32 %1, 0 %or.cond52 = select i1 %cmp50, i1 %cmp151, i1 false %2 = load i32, ptr %s, align 4 %cmp353 = icmp eq i32 %2, 0 %or.cond3154 = select i1 %or.cond52, i1 %cmp353, i1 false br i1 %or.cond3154, label %for.end30, label %for.cond4.preheader for.cond4.preheader: ; preds = %entry, %for.end28 %3 = phi i32 [ %8, %for.end28 ], [ %2, %entry ] %4 = phi i32 [ %7, %for.end28 ], [ %1, %entry ] %5 = phi i32 [ %6, %for.end28 ], [ %0, %entry ] %cmp5.not45 = icmp slt i32 %3, 2 br i1 %cmp5.not45, label %for.end28, label %for.cond6.preheader.lr.ph for.cond6.preheader.lr.ph: ; preds = %for.cond4.preheader %div5657 = lshr i32 %3, 1 %add = add nsw i32 %5, 100 %add13 = add nsw i32 %4, 100 br label %for.cond6.preheader for.cond6.preheader: ; preds = %for.cond6.preheader.lr.ph, %for.inc26 %max.047 = phi i32 [ 0, %for.cond6.preheader.lr.ph ], [ %max.1.lcssa, %for.inc26 ] %i.046 = phi i32 [ 1, %for.cond6.preheader.lr.ph ], [ %inc27, %for.inc26 ] %cmp7.not42 = icmp sgt i32 %i.046, %3 br i1 %cmp7.not42, label %for.inc26, label %for.body8.lr.ph for.body8.lr.ph: ; preds = %for.cond6.preheader %mul = mul nsw i32 %i.046, %add %div9 = sdiv i32 %mul, 100 %mul14 = mul nsw i32 %i.046, %add13 %div15 = sdiv i32 %mul14, 100 br label %for.body8 for.body8: ; preds = %for.body8.lr.ph, %for.body8 %max.144 = phi i32 [ %max.047, %for.body8.lr.ph ], [ %max.2, %for.body8 ] %j.043 = phi i32 [ %i.046, %for.body8.lr.ph ], [ %inc, %for.body8 ] %mul11 = mul nsw i32 %j.043, %add %div12 = sdiv i32 %mul11, 100 %mul17 = mul nsw i32 %j.043, %add13 %div18 = sdiv i32 %mul17, 100 %add19 = add nsw i32 %div18, %div15 %add20 = add nsw i32 %div12, %div9 %cmp21 = icmp eq i32 %add20, %3 %cmp23 = icmp slt i32 %max.144, %add19 %or.cond41 = select i1 %cmp21, i1 %cmp23, i1 false %max.2 = select i1 %or.cond41, i32 %add19, i32 %max.144 %inc = add nuw i32 %j.043, 1 %exitcond.not = icmp eq i32 %j.043, %3 br i1 %exitcond.not, label %for.inc26, label %for.body8, !llvm.loop !9 for.inc26: ; preds = %for.body8, %for.cond6.preheader %max.1.lcssa = phi i32 [ %max.047, %for.cond6.preheader ], [ %max.2, %for.body8 ] %inc27 = add nuw nsw i32 %i.046, 1 %exitcond55.not = icmp eq i32 %i.046, %div5657 br i1 %exitcond55.not, label %for.end28, label %for.cond6.preheader, !llvm.loop !11 for.end28: ; preds = %for.inc26, %for.cond4.preheader %max.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ %max.1.lcssa, %for.inc26 ] %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %s) %6 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp eq i32 %6, 0 %7 = load i32, ptr %y, align 4 %cmp1 = icmp eq i32 %7, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %8 = load i32, ptr %s, align 4 %cmp3 = icmp eq i32 %8, 0 %or.cond31 = select i1 %or.cond, i1 %cmp3, i1 false br i1 %or.cond31, label %for.end30, label %for.cond4.preheader for.end30: ; preds = %for.end28, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#define _USE_MATH_DEFINES #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <ctype.h> #include <limits.h> #define EPS 1e-10 #define sq(n) ((n)*(n)) #define rep(i,n) for(i=0;i<n;i++) #define rev(i,n) for(i=n-1;i>=0;i--) #define sort(a,n) qsort(a,n,sizeof(TYPE),cmp) #define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r); #define chsort(s,n) qsort(s,n,sizeof(char),cmp) #define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r); #define TYPE int #define MEMSET(a) memset(a,0,sizeof(a)) long long mod=(long long)1e09+7; int inf=1<<29; long long llinf=1ll<<60; int in(void){ int i;scanf("%d",&i); return i; } long long llin(void){ long long i;scanf("%lld",&i); return i; } double din(void){ double i;scanf("%lf",&i); return i; } void chin(char s[]){ scanf("%s",s); } void print(int a){ printf("%d\n",a); } void llprint(long long a){ printf("%lld\n",a); } void dprint(double a){ printf("%.10f\n",a); } void print2(int a,int b){ printf("%d %d\n",a,b); } long long max(long long a,long long b){ return a>b?a:b; } long long min(long long a,long long b){ return a<b?a:b; } int cmp(const void *a,const void *b){ return *(TYPE *)a-*(TYPE *)b; } int cmp_r(const void *a,const void *b){ return *(TYPE *)b-*(TYPE *)a; } int char_cmp(const void *a,const void *b){ return strcmp((char *)a,(char *)b); } int char_cmp_r(const void *a,const void *b){ return strcmp((char *)b,(char *)a); } void swap(int *a,int *b){ int t=*a; *a=*b; *b=t; } long long gcd(long long x,long long y){ return x%y?gcd(y,x%y):y; } long long lcm(long long x,long long y){ return x/gcd(x,y)*y; } // write codes below this // when you use 'sort', // make sure TYPE macro is correct int main(void){ int x,y,s,i,j,m; while(1){ x=in(); y=in(); s=in(); if(!x)break; m=0; for(i=1;i<s;i++){ for(j=1;j<s;j++){ if(i*(100+x)/100+j*(100+x)/100==s) m=max(m,i*(100+y)/100+j*(100+y)/100); } } print(m); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265323/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265323/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @mod = dso_local local_unnamed_addr global i64 1000000007, align 8 @inf = dso_local local_unnamed_addr global i32 536870912, align 4 @llinf = dso_local local_unnamed_addr global i64 1152921504606846976, align 8 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1 @.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @in() local_unnamed_addr #0 { entry: %i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %0 = load i32, ptr %i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #10 ret i32 %0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i64 @llin() local_unnamed_addr #0 { entry: %i = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i) %0 = load i64, ptr %i, align 8, !tbaa !9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #10 ret i64 %0 } ; Function Attrs: nofree nounwind uwtable define dso_local double @din() local_unnamed_addr #0 { entry: %i = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i) %0 = load double, ptr %i, align 8, !tbaa !11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #10 ret double %0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @chin(ptr noundef %s) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %s) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %a) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @llprint(i64 noundef %a) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %a) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @dprint(double noundef %a) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %a) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %a, i32 noundef %b) ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @char_cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #11 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @char_cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #11 ret i32 %call } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #7 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #8 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse ] %y.tr = phi i64 [ %y, %entry ], [ %rem, %tailrecurse ] %rem = srem i64 %x.tr, %y.tr %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %cond.end, label %tailrecurse cond.end: ; preds = %tailrecurse ret i64 %y.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %x, i64 noundef %y) local_unnamed_addr #8 { entry: br label %tailrecurse.i tailrecurse.i: ; preds = %tailrecurse.i, %entry %x.tr.i = phi i64 [ %x, %entry ], [ %y.tr.i, %tailrecurse.i ] %y.tr.i = phi i64 [ %y, %entry ], [ %rem.i, %tailrecurse.i ] %rem.i = srem i64 %x.tr.i, %y.tr.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %tailrecurse.i gcd.exit: ; preds = %tailrecurse.i %div = sdiv i64 %x, %y.tr.i %mul = mul nsw i64 %div, %y ret i64 %mul } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %i.i40 = alloca i32, align 4 %i.i38 = alloca i32, align 4 %i.i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #10 %call.i50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i) %0 = load i32, ptr %i.i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i38) #10 %call.i3951 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i38) %1 = load i32, ptr %i.i38, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i38) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i40) #10 %call.i4152 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i40) %2 = load i32, ptr %i.i40, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i40) #10 %tobool.not53 = icmp eq i32 %0, 0 br i1 %tobool.not53, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end25 %3 = phi i32 [ %9, %for.end25 ], [ %2, %entry ] %4 = phi i32 [ %8, %for.end25 ], [ %1, %entry ] %5 = phi i32 [ %7, %for.end25 ], [ %0, %entry ] %cmp46 = icmp sgt i32 %3, 1 br i1 %cmp46, label %for.cond3.preheader.lr.ph, label %for.end25 for.cond3.preheader.lr.ph: ; preds = %for.cond.preheader %add = add nsw i32 %5, 100 %add12 = add nsw i32 %4, 100 br label %for.cond3.preheader.us for.cond3.preheader.us: ; preds = %for.cond3.for.inc23_crit_edge.us, %for.cond3.preheader.lr.ph %m.048.us = phi i32 [ 0, %for.cond3.preheader.lr.ph ], [ %m.2.us, %for.cond3.for.inc23_crit_edge.us ] %i.047.us = phi i32 [ 1, %for.cond3.preheader.lr.ph ], [ %inc24.us, %for.cond3.for.inc23_crit_edge.us ] %mul.us = mul nsw i32 %i.047.us, %add %div.us = sdiv i32 %mul.us, 100 %mul13.us = mul nsw i32 %i.047.us, %add12 %div14.us = sdiv i32 %mul13.us, 100 br label %for.body5.us for.body5.us: ; preds = %for.cond3.preheader.us, %for.inc.us %m.145.us = phi i32 [ %m.048.us, %for.cond3.preheader.us ], [ %m.2.us, %for.inc.us ] %j.044.us = phi i32 [ 1, %for.cond3.preheader.us ], [ %inc.us, %for.inc.us ] %mul7.us = mul nsw i32 %j.044.us, %add %div8.us = sdiv i32 %mul7.us, 100 %add9.us = add nsw i32 %div8.us, %div.us %cmp10.us = icmp eq i32 %add9.us, %3 br i1 %cmp10.us, label %if.then11.us, label %for.inc.us if.then11.us: ; preds = %for.body5.us %mul16.us = mul nsw i32 %j.044.us, %add12 %div17.us = sdiv i32 %mul16.us, 100 %add18.us = add nsw i32 %div17.us, %div14.us %6 = call i32 @llvm.smax.i32(i32 %m.145.us, i32 %add18.us) br label %for.inc.us for.inc.us: ; preds = %if.then11.us, %for.body5.us %m.2.us = phi i32 [ %6, %if.then11.us ], [ %m.145.us, %for.body5.us ] %inc.us = add nuw nsw i32 %j.044.us, 1 %exitcond.not = icmp eq i32 %inc.us, %3 br i1 %exitcond.not, label %for.cond3.for.inc23_crit_edge.us, label %for.body5.us, !llvm.loop !13 for.cond3.for.inc23_crit_edge.us: ; preds = %for.inc.us %inc24.us = add nuw nsw i32 %i.047.us, 1 %exitcond54.not = icmp eq i32 %inc24.us, %3 br i1 %exitcond54.not, label %for.end25, label %for.cond3.preheader.us, !llvm.loop !15 for.end25: ; preds = %for.cond3.for.inc23_crit_edge.us, %for.cond.preheader %m.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %m.2.us, %for.cond3.for.inc23_crit_edge.us ] %call.i42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %m.0.lcssa) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #10 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i) %7 = load i32, ptr %i.i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i38) #10 %call.i39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i38) %8 = load i32, ptr %i.i38, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i38) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i40) #10 %call.i41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i40) %9 = load i32, ptr %i.i40, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i40) #10 %tobool.not = icmp eq i32 %7, 0 br i1 %tobool.not, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end25, %entry ret i32 0 } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #7 = { 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 #8 = { 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind } attributes #11 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = !{!12, !12, i64 0} !12 = !{!"double", !7, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14}
#include<stdio.h> int main() { int n,a; scanf("%d %d",&n,&a); int i,j,k; int x[55]; for(i=0;i<n;i++) scanf("%d",&x[i]); long long int dp[55][3003]; for(i=0;i<55;i++) for(j=0;j<3003;j++) dp[i][j]=0; for(i=0;i<n;i++) { for(j=54;j>0;j--) for(k=0;k<3003;k++) if(dp[j][k]>0) dp[j+1][k+x[i]]+=dp[j][k]; dp[1][x[i]]++; } long long int ans=0; for(i=1;i<=n;i++) ans+=dp[i][i*a]; printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265381/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265381/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %x = alloca [55 x i32], align 16 %dp = alloca [55 x [3003 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a) call void @llvm.lifetime.start.p0(i64 220, ptr nonnull %x) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp95 = icmp sgt i32 %0, 0 br i1 %cmp95, label %for.body, label %for.end.thread for.end.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 1321320, ptr nonnull %dp) #4 br label %for.end68 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [55 x i32], ptr %x, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body call void @llvm.lifetime.start.p0(i64 1321320, ptr nonnull %dp) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1321320) %dp, i8 0, i64 1321320, i1 false), !tbaa !11 %cmp19101 = icmp sgt i32 %1, 0 br i1 %cmp19101, label %for.cond21.preheader.preheader, label %for.end68 for.cond21.preheader.preheader: ; preds = %for.end %wide.trip.count = zext i32 %1 to i64 br label %for.cond21.preheader for.cond21.preheader: ; preds = %for.cond21.preheader.preheader, %for.end48 %indvars.iv120 = phi i64 [ 0, %for.cond21.preheader.preheader ], [ %indvars.iv.next121, %for.end48 ] %arrayidx39 = getelementptr inbounds [55 x i32], ptr %x, i64 0, i64 %indvars.iv120 br label %for.cond24.preheader for.cond58.preheader: ; preds = %for.end48 %cmp59.not103 = icmp slt i32 %1, 1 br i1 %cmp59.not103, label %for.end68, label %for.body60.lr.ph for.body60.lr.ph: ; preds = %for.cond58.preheader %3 = load i32, ptr %a, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %5 = add nuw i32 %1, 1 %wide.trip.count128 = zext i32 %5 to i64 %6 = add nsw i64 %wide.trip.count128, -1 %7 = add nsw i64 %wide.trip.count128, -2 %xtraiter = and i64 %6, 3 %8 = icmp ult i64 %7, 3 br i1 %8, label %for.end68.loopexit.unr-lcssa, label %for.body60.lr.ph.new for.body60.lr.ph.new: ; preds = %for.body60.lr.ph %unroll_iter = and i64 %6, -4 br label %for.body60 for.cond24.preheader: ; preds = %for.cond21.preheader, %for.inc47 %indvars.iv116 = phi i64 [ 54, %for.cond21.preheader ], [ %indvars.iv.next117, %for.inc47 ] %9 = add nuw nsw i64 %indvars.iv116, 1 br label %for.body26 for.body26: ; preds = %for.cond24.preheader, %for.inc44 %indvars.iv113 = phi i64 [ 0, %for.cond24.preheader ], [ %indvars.iv.next114, %for.inc44 ] %arrayidx30 = getelementptr inbounds [55 x [3003 x i64]], ptr %dp, i64 0, i64 %indvars.iv116, i64 %indvars.iv113 %10 = load i64, ptr %arrayidx30, align 8, !tbaa !11 %cmp31 = icmp sgt i64 %10, 0 br i1 %cmp31, label %if.then, label %for.inc44 if.then: ; preds = %for.body26 %11 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %12 = trunc i64 %indvars.iv113 to i32 %add40 = add nsw i32 %11, %12 %idxprom41 = sext i32 %add40 to i64 %arrayidx42 = getelementptr inbounds [55 x [3003 x i64]], ptr %dp, i64 0, i64 %9, i64 %idxprom41 %13 = load i64, ptr %arrayidx42, align 8, !tbaa !11 %add43 = add nsw i64 %13, %10 store i64 %add43, ptr %arrayidx42, align 8, !tbaa !11 br label %for.inc44 for.inc44: ; preds = %for.body26, %if.then %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %exitcond.not = icmp eq i64 %indvars.iv.next114, 3003 br i1 %exitcond.not, label %for.inc47, label %for.body26, !llvm.loop !13 for.inc47: ; preds = %for.inc44 %indvars.iv.next117 = add nsw i64 %indvars.iv116, -1 %cmp22 = icmp ugt i64 %indvars.iv116, 1 br i1 %cmp22, label %for.cond24.preheader, label %for.end48, !llvm.loop !14 for.end48: ; preds = %for.inc47 %14 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %idxprom52 = sext i32 %14 to i64 %arrayidx53 = getelementptr inbounds [55 x [3003 x i64]], ptr %dp, i64 0, i64 1, i64 %idxprom52 %15 = load i64, ptr %arrayidx53, align 8, !tbaa !11 %inc54 = add nsw i64 %15, 1 store i64 %inc54, ptr %arrayidx53, align 8, !tbaa !11 %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1 %exitcond123.not = icmp eq i64 %indvars.iv.next121, %wide.trip.count br i1 %exitcond123.not, label %for.cond58.preheader, label %for.cond21.preheader, !llvm.loop !15 for.body60: ; preds = %for.body60, %for.body60.lr.ph.new %indvars.iv124 = phi i64 [ 1, %for.body60.lr.ph.new ], [ %indvars.iv.next125.3, %for.body60 ] %ans.0105 = phi i64 [ 0, %for.body60.lr.ph.new ], [ %add65.3, %for.body60 ] %niter = phi i64 [ 0, %for.body60.lr.ph.new ], [ %niter.next.3, %for.body60 ] %16 = mul nsw i64 %indvars.iv124, %4 %arrayidx64 = getelementptr inbounds [55 x [3003 x i64]], ptr %dp, i64 0, i64 %indvars.iv124, i64 %16 %17 = load i64, ptr %arrayidx64, align 8, !tbaa !11 %add65 = add nsw i64 %17, %ans.0105 %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1 %18 = mul nsw i64 %indvars.iv.next125, %4 %arrayidx64.1 = getelementptr inbounds [55 x [3003 x i64]], ptr %dp, i64 0, i64 %indvars.iv.next125, i64 %18 %19 = load i64, ptr %arrayidx64.1, align 8, !tbaa !11 %add65.1 = add nsw i64 %19, %add65 %indvars.iv.next125.1 = add nuw nsw i64 %indvars.iv124, 2 %20 = mul nsw i64 %indvars.iv.next125.1, %4 %arrayidx64.2 = getelementptr inbounds [55 x [3003 x i64]], ptr %dp, i64 0, i64 %indvars.iv.next125.1, i64 %20 %21 = load i64, ptr %arrayidx64.2, align 8, !tbaa !11 %add65.2 = add nsw i64 %21, %add65.1 %indvars.iv.next125.2 = add nuw nsw i64 %indvars.iv124, 3 %22 = mul nsw i64 %indvars.iv.next125.2, %4 %arrayidx64.3 = getelementptr inbounds [55 x [3003 x i64]], ptr %dp, i64 0, i64 %indvars.iv.next125.2, i64 %22 %23 = load i64, ptr %arrayidx64.3, align 8, !tbaa !11 %add65.3 = add nsw i64 %23, %add65.2 %indvars.iv.next125.3 = add nuw nsw i64 %indvars.iv124, 4 %niter.next.3 = add nuw i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.end68.loopexit.unr-lcssa, label %for.body60, !llvm.loop !16 for.end68.loopexit.unr-lcssa: ; preds = %for.body60, %for.body60.lr.ph %add65.lcssa.ph = phi i64 [ undef, %for.body60.lr.ph ], [ %add65.3, %for.body60 ] %indvars.iv124.unr = phi i64 [ 1, %for.body60.lr.ph ], [ %indvars.iv.next125.3, %for.body60 ] %ans.0105.unr = phi i64 [ 0, %for.body60.lr.ph ], [ %add65.3, %for.body60 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end68, label %for.body60.epil for.body60.epil: ; preds = %for.end68.loopexit.unr-lcssa, %for.body60.epil %indvars.iv124.epil = phi i64 [ %indvars.iv.next125.epil, %for.body60.epil ], [ %indvars.iv124.unr, %for.end68.loopexit.unr-lcssa ] %ans.0105.epil = phi i64 [ %add65.epil, %for.body60.epil ], [ %ans.0105.unr, %for.end68.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body60.epil ], [ 0, %for.end68.loopexit.unr-lcssa ] %24 = mul nsw i64 %indvars.iv124.epil, %4 %arrayidx64.epil = getelementptr inbounds [55 x [3003 x i64]], ptr %dp, i64 0, i64 %indvars.iv124.epil, i64 %24 %25 = load i64, ptr %arrayidx64.epil, align 8, !tbaa !11 %add65.epil = add nsw i64 %25, %ans.0105.epil %indvars.iv.next125.epil = add nuw nsw i64 %indvars.iv124.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.end68, label %for.body60.epil, !llvm.loop !17 for.end68: ; preds = %for.end68.loopexit.unr-lcssa, %for.body60.epil, %for.end, %for.end.thread, %for.cond58.preheader %ans.0.lcssa = phi i64 [ 0, %for.cond58.preheader ], [ 0, %for.end.thread ], [ 0, %for.end ], [ %add65.lcssa.ph, %for.end68.loopexit.unr-lcssa ], [ %add65.epil, %for.body60.epil ] %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 1321320, ptr nonnull %dp) #4 call void @llvm.lifetime.end.p0(i64 220, ptr nonnull %x) #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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"long long", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> #include <string.h> int main(void){ int i,a[26]={0}; char s[100001]; scanf("%s",s); for(i=0;i<strlen(s);i++){ if(a[s[i]-'a']==0) a[s[i]-'a']=1; } for(i=0;i<26;i++){ if(a[i]==0){ printf("%c\n",'a'+i); return 0; } } printf("None\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265424/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265424/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 @str = private unnamed_addr constant [5 x i8] c"None\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [26 x i32], align 16 %s = alloca [100001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %a) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %a, i8 0, i64 104, i1 false) call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #7 %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 %cmp40.not = icmp eq i64 %call2, 0 br i1 %cmp40.not, label %if.then23, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call2, 1 %0 = icmp eq i64 %call2, 1 br i1 %0, label %for.cond15.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %call2, -2 br label %for.body for.cond15.preheader.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.cond15.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond15.preheader.unr-lcssa %arrayidx.epil = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv.unr %1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 %conv4.epil = sext i8 %1 to i64 %sub.epil = add nsw i64 %conv4.epil, -97 %arrayidx6.epil = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %sub.epil %2 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !8 %spec.store.select.epil = call i32 @llvm.umax.i32(i32 %2, i32 1) store i32 %spec.store.select.epil, ptr %arrayidx6.epil, align 4 br label %for.cond15.preheader for.cond15.preheader: ; preds = %for.cond15.preheader.unr-lcssa, %for.body.epil %.pre = load i32, ptr %a, align 16, !tbaa !8 %3 = icmp eq i32 %.pre, 0 br i1 %3, label %if.then23, label %for.inc26 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 [100001 x i8], ptr %s, i64 0, i64 %indvars.iv %4 = load i8, ptr %arrayidx, align 2, !tbaa !5 %conv4 = sext i8 %4 to i64 %sub = add nsw i64 %conv4, -97 %arrayidx6 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %sub %5 = load i32, ptr %arrayidx6, align 4, !tbaa !8 %spec.store.select = call i32 @llvm.umax.i32(i32 %5, i32 1) store i32 %spec.store.select, ptr %arrayidx6, align 4 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv.next %6 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %conv4.1 = sext i8 %6 to i64 %sub.1 = add nsw i64 %conv4.1, -97 %arrayidx6.1 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %sub.1 %7 = load i32, ptr %arrayidx6.1, align 4, !tbaa !8 %spec.store.select.1 = call i32 @llvm.umax.i32(i32 %7, i32 1) store i32 %spec.store.select.1, ptr %arrayidx6.1, align 4 %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.cond15.preheader.unr-lcssa, label %for.body, !llvm.loop !10 if.then23: ; preds = %entry, %for.inc26.24, %for.inc26.23, %for.inc26.22, %for.inc26.21, %for.inc26.20, %for.inc26.19, %for.inc26.18, %for.inc26.17, %for.inc26.16, %for.inc26.15, %for.inc26.14, %for.inc26.13, %for.inc26.12, %for.inc26.11, %for.inc26.10, %for.inc26.9, %for.inc26.8, %for.inc26.7, %for.inc26.6, %for.inc26.5, %for.inc26.4, %for.inc26.3, %for.inc26.2, %for.inc26.1, %for.inc26, %for.cond15.preheader %i.143.lcssa.wide = phi i32 [ 97, %for.cond15.preheader ], [ 98, %for.inc26 ], [ 99, %for.inc26.1 ], [ 100, %for.inc26.2 ], [ 101, %for.inc26.3 ], [ 102, %for.inc26.4 ], [ 103, %for.inc26.5 ], [ 104, %for.inc26.6 ], [ 105, %for.inc26.7 ], [ 106, %for.inc26.8 ], [ 107, %for.inc26.9 ], [ 108, %for.inc26.10 ], [ 109, %for.inc26.11 ], [ 110, %for.inc26.12 ], [ 111, %for.inc26.13 ], [ 112, %for.inc26.14 ], [ 113, %for.inc26.15 ], [ 114, %for.inc26.16 ], [ 115, %for.inc26.17 ], [ 116, %for.inc26.18 ], [ 117, %for.inc26.19 ], [ 118, %for.inc26.20 ], [ 119, %for.inc26.21 ], [ 120, %for.inc26.22 ], [ 121, %for.inc26.23 ], [ 122, %for.inc26.24 ], [ 97, %entry ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.143.lcssa.wide) br label %cleanup for.inc26: ; preds = %for.cond15.preheader %arrayidx20.1 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 1 %8 = load i32, ptr %arrayidx20.1, align 4, !tbaa !8 %cmp21.1 = icmp eq i32 %8, 0 br i1 %cmp21.1, label %if.then23, label %for.inc26.1 for.inc26.1: ; preds = %for.inc26 %arrayidx20.2 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 2 %9 = load i32, ptr %arrayidx20.2, align 8, !tbaa !8 %cmp21.2 = icmp eq i32 %9, 0 br i1 %cmp21.2, label %if.then23, label %for.inc26.2 for.inc26.2: ; preds = %for.inc26.1 %arrayidx20.3 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 3 %10 = load i32, ptr %arrayidx20.3, align 4, !tbaa !8 %cmp21.3 = icmp eq i32 %10, 0 br i1 %cmp21.3, label %if.then23, label %for.inc26.3 for.inc26.3: ; preds = %for.inc26.2 %arrayidx20.4 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 4 %11 = load i32, ptr %arrayidx20.4, align 16, !tbaa !8 %cmp21.4 = icmp eq i32 %11, 0 br i1 %cmp21.4, label %if.then23, label %for.inc26.4 for.inc26.4: ; preds = %for.inc26.3 %arrayidx20.5 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 5 %12 = load i32, ptr %arrayidx20.5, align 4, !tbaa !8 %cmp21.5 = icmp eq i32 %12, 0 br i1 %cmp21.5, label %if.then23, label %for.inc26.5 for.inc26.5: ; preds = %for.inc26.4 %arrayidx20.6 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 6 %13 = load i32, ptr %arrayidx20.6, align 8, !tbaa !8 %cmp21.6 = icmp eq i32 %13, 0 br i1 %cmp21.6, label %if.then23, label %for.inc26.6 for.inc26.6: ; preds = %for.inc26.5 %arrayidx20.7 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 7 %14 = load i32, ptr %arrayidx20.7, align 4, !tbaa !8 %cmp21.7 = icmp eq i32 %14, 0 br i1 %cmp21.7, label %if.then23, label %for.inc26.7 for.inc26.7: ; preds = %for.inc26.6 %arrayidx20.8 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 8 %15 = load i32, ptr %arrayidx20.8, align 16, !tbaa !8 %cmp21.8 = icmp eq i32 %15, 0 br i1 %cmp21.8, label %if.then23, label %for.inc26.8 for.inc26.8: ; preds = %for.inc26.7 %arrayidx20.9 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 9 %16 = load i32, ptr %arrayidx20.9, align 4, !tbaa !8 %cmp21.9 = icmp eq i32 %16, 0 br i1 %cmp21.9, label %if.then23, label %for.inc26.9 for.inc26.9: ; preds = %for.inc26.8 %arrayidx20.10 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 10 %17 = load i32, ptr %arrayidx20.10, align 8, !tbaa !8 %cmp21.10 = icmp eq i32 %17, 0 br i1 %cmp21.10, label %if.then23, label %for.inc26.10 for.inc26.10: ; preds = %for.inc26.9 %arrayidx20.11 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 11 %18 = load i32, ptr %arrayidx20.11, align 4, !tbaa !8 %cmp21.11 = icmp eq i32 %18, 0 br i1 %cmp21.11, label %if.then23, label %for.inc26.11 for.inc26.11: ; preds = %for.inc26.10 %arrayidx20.12 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 12 %19 = load i32, ptr %arrayidx20.12, align 16, !tbaa !8 %cmp21.12 = icmp eq i32 %19, 0 br i1 %cmp21.12, label %if.then23, label %for.inc26.12 for.inc26.12: ; preds = %for.inc26.11 %arrayidx20.13 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 13 %20 = load i32, ptr %arrayidx20.13, align 4, !tbaa !8 %cmp21.13 = icmp eq i32 %20, 0 br i1 %cmp21.13, label %if.then23, label %for.inc26.13 for.inc26.13: ; preds = %for.inc26.12 %arrayidx20.14 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 14 %21 = load i32, ptr %arrayidx20.14, align 8, !tbaa !8 %cmp21.14 = icmp eq i32 %21, 0 br i1 %cmp21.14, label %if.then23, label %for.inc26.14 for.inc26.14: ; preds = %for.inc26.13 %arrayidx20.15 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 15 %22 = load i32, ptr %arrayidx20.15, align 4, !tbaa !8 %cmp21.15 = icmp eq i32 %22, 0 br i1 %cmp21.15, label %if.then23, label %for.inc26.15 for.inc26.15: ; preds = %for.inc26.14 %arrayidx20.16 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 16 %23 = load i32, ptr %arrayidx20.16, align 16, !tbaa !8 %cmp21.16 = icmp eq i32 %23, 0 br i1 %cmp21.16, label %if.then23, label %for.inc26.16 for.inc26.16: ; preds = %for.inc26.15 %arrayidx20.17 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 17 %24 = load i32, ptr %arrayidx20.17, align 4, !tbaa !8 %cmp21.17 = icmp eq i32 %24, 0 br i1 %cmp21.17, label %if.then23, label %for.inc26.17 for.inc26.17: ; preds = %for.inc26.16 %arrayidx20.18 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 18 %25 = load i32, ptr %arrayidx20.18, align 8, !tbaa !8 %cmp21.18 = icmp eq i32 %25, 0 br i1 %cmp21.18, label %if.then23, label %for.inc26.18 for.inc26.18: ; preds = %for.inc26.17 %arrayidx20.19 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 19 %26 = load i32, ptr %arrayidx20.19, align 4, !tbaa !8 %cmp21.19 = icmp eq i32 %26, 0 br i1 %cmp21.19, label %if.then23, label %for.inc26.19 for.inc26.19: ; preds = %for.inc26.18 %arrayidx20.20 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 20 %27 = load i32, ptr %arrayidx20.20, align 16, !tbaa !8 %cmp21.20 = icmp eq i32 %27, 0 br i1 %cmp21.20, label %if.then23, label %for.inc26.20 for.inc26.20: ; preds = %for.inc26.19 %arrayidx20.21 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 21 %28 = load i32, ptr %arrayidx20.21, align 4, !tbaa !8 %cmp21.21 = icmp eq i32 %28, 0 br i1 %cmp21.21, label %if.then23, label %for.inc26.21 for.inc26.21: ; preds = %for.inc26.20 %arrayidx20.22 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 22 %29 = load i32, ptr %arrayidx20.22, align 8, !tbaa !8 %cmp21.22 = icmp eq i32 %29, 0 br i1 %cmp21.22, label %if.then23, label %for.inc26.22 for.inc26.22: ; preds = %for.inc26.21 %arrayidx20.23 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 23 %30 = load i32, ptr %arrayidx20.23, align 4, !tbaa !8 %cmp21.23 = icmp eq i32 %30, 0 br i1 %cmp21.23, label %if.then23, label %for.inc26.23 for.inc26.23: ; preds = %for.inc26.22 %arrayidx20.24 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 24 %31 = load i32, ptr %arrayidx20.24, align 16, !tbaa !8 %cmp21.24 = icmp eq i32 %31, 0 br i1 %cmp21.24, label %if.then23, label %for.inc26.24 for.inc26.24: ; preds = %for.inc26.23 %arrayidx20.25 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 25 %32 = load i32, ptr %arrayidx20.25, align 4, !tbaa !8 %cmp21.25 = icmp eq i32 %32, 0 br i1 %cmp21.25, label %if.then23, label %for.inc26.25 for.inc26.25: ; preds = %for.inc26.24 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup cleanup: ; preds = %for.inc26.25, %if.then23 call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #7 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %a) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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.umax.i32(i32, i32) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
# include <stdio.h> # include <string.h> int main(){ char str[100005]; scanf("%s", str); int mau = 0; char lista[26] = {'a', 'b', 'c', 'd','e','f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n','o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; for (int i = 0; i < 26; ++i){ int dif = 0; for (int j = 0; j <strlen(str); ++j){ if (lista[i] != str[j]) dif += 1; } if (dif == strlen(str)){ printf("%c\n", lista[i]); mau += 1; break; } } if (mau == 0) printf("None\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265468/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265468/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @__const.main.lista = private unnamed_addr constant [26 x i8] c"abcdefghijklmnopqrstuvwxyz", align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 @str = private unnamed_addr constant [5 x i8] c"None\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [100005 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100005, ptr nonnull %str) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #7 %cmp447.not = icmp eq i64 %call3, 0 br i1 %cmp447.not, label %cleanup.thread, label %for.cond1.preheader.us.preheader for.cond1.preheader.us.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %call3, 8 %n.vec = and i64 %call3, -8 %cmp.n = icmp eq i64 %call3, %n.vec br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.inc26.us %indvars.iv60 = phi i64 [ %indvars.iv.next61, %for.inc26.us ], [ 0, %for.cond1.preheader.us.preheader ] %arrayidx.us = getelementptr inbounds [26 x i8], ptr @__const.main.lista, i64 0, i64 %indvars.iv60 %0 = load i8, ptr %arrayidx.us, align 1, !tbaa !5 br i1 %min.iters.check, label %for.body7.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond1.preheader.us %broadcast.splatinsert = insertelement <4 x i8> poison, i8 %0, i64 0 %broadcast.splat = shufflevector <4 x i8> %broadcast.splatinsert, <4 x i8> 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> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %vec.phi66 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %1 = getelementptr inbounds [100005 x i8], ptr %str, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load67 = load <4 x i8>, ptr %2, align 4, !tbaa !5 %3 = icmp ne <4 x i8> %broadcast.splat, %wide.load %4 = icmp ne <4 x i8> %broadcast.splat, %wide.load67 %5 = zext <4 x i1> %3 to <4 x i32> %6 = zext <4 x i1> %4 to <4 x i32> %7 = add <4 x i32> %vec.phi, %5 %8 = add <4 x i32> %vec.phi66, %6 %index.next = add nuw i64 %index, 8 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %8, %7 %10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond1.for.cond.cleanup6_crit_edge.us, label %for.body7.us.preheader for.body7.us.preheader: ; preds = %for.cond1.preheader.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond1.preheader.us ], [ %n.vec, %middle.block ] %dif.048.us.ph = phi i32 [ 0, %for.cond1.preheader.us ], [ %10, %middle.block ] br label %for.body7.us for.inc26.us: ; preds = %for.cond1.for.cond.cleanup6_crit_edge.us %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %exitcond63 = icmp eq i64 %indvars.iv.next61, 26 br i1 %exitcond63, label %if.then32, label %for.cond1.preheader.us, !llvm.loop !12 for.body7.us: ; preds = %for.body7.us.preheader, %for.body7.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body7.us ], [ %indvars.iv.ph, %for.body7.us.preheader ] %dif.048.us = phi i32 [ %spec.select.us, %for.body7.us ], [ %dif.048.us.ph, %for.body7.us.preheader ] %arrayidx10.us = getelementptr inbounds [100005 x i8], ptr %str, i64 0, i64 %indvars.iv %11 = load i8, ptr %arrayidx10.us, align 1, !tbaa !5 %cmp12.not.us = icmp ne i8 %0, %11 %add.us = zext i1 %cmp12.not.us to i32 %spec.select.us = add nuw nsw i32 %dif.048.us, %add.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call3 br i1 %exitcond.not, label %for.cond1.for.cond.cleanup6_crit_edge.us, label %for.body7.us, !llvm.loop !13 for.cond1.for.cond.cleanup6_crit_edge.us: ; preds = %for.body7.us, %middle.block %spec.select.us.lcssa = phi i32 [ %10, %middle.block ], [ %spec.select.us, %for.body7.us ] %conv14.us = zext i32 %spec.select.us.lcssa to i64 %cmp17.not.us = icmp eq i64 %call3, %conv14.us br i1 %cmp17.not.us, label %cleanup.thread.loopexit, label %for.inc26.us cleanup.thread.loopexit: ; preds = %for.cond1.for.cond.cleanup6_crit_edge.us %12 = and i64 %indvars.iv60, 4294967295 br label %cleanup.thread cleanup.thread: ; preds = %entry, %cleanup.thread.loopexit %.us-phi = phi i64 [ %12, %cleanup.thread.loopexit ], [ 0, %entry ] %arrayidx21 = getelementptr inbounds [26 x i8], ptr @__const.main.lista, i64 0, i64 %.us-phi %13 = load i8, ptr %arrayidx21, align 1, !tbaa !5 %conv22 = sext i8 %13 to i32 %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv22) br label %if.end34 if.then32: ; preds = %for.inc26.us %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end34 if.end34: ; preds = %cleanup.thread, %if.then32 call void @llvm.lifetime.end.p0(i64 100005, ptr nonnull %str) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; 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} !13 = distinct !{!13, !9, !11, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char S[100010]; scanf("%s", S); int i, j, k; char ans = 'a'; int flag[26]; for (i = 0; i < 26; i++) { flag[i] = 0; } k = 0; for (i = 'a'; i <= 'z'; i++) { for (j = 0; S[j] != '\0'; j++) { if (i == S[j]) { flag[k] = 1; } } k++; } for (i = 0; i < 26; i++) { if (flag[i] != 1) { printf("%c\n", 'a' + i); break; } } if (i == 26) { printf("None\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265510/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265510/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 @str = private unnamed_addr constant [5 x i8] c"None\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [100010 x i8], align 16 %flag = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 100010, ptr nonnull %S) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %flag) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %flag, i8 0, i64 104, i1 false), !tbaa !5 %0 = load i8, ptr %S, align 16, !tbaa !9 %cmp7.not59 = icmp eq i8 %0, 0 br i1 %cmp7.not59, label %for.end37.thread, label %for.cond4.preheader for.cond4.preheader: ; preds = %entry, %for.cond4.for.end19_crit_edge.1 %indvars.iv67 = phi i64 [ %indvars.iv.next68.1, %for.cond4.for.end19_crit_edge.1 ], [ 0, %entry ] %i.162 = phi i32 [ %inc22.1, %for.cond4.for.end19_crit_edge.1 ], [ 97, %entry ] %arrayidx16 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %indvars.iv67 br label %for.body9 for.cond24.preheader: ; preds = %for.cond4.for.end19_crit_edge.1 %.pre = load i32, ptr %flag, align 16, !tbaa !5 %1 = icmp eq i32 %.pre, 1 br i1 %1, label %for.inc35, label %for.end37.thread for.body9: ; preds = %for.cond4.preheader, %for.inc17 %indvars.iv = phi i64 [ 0, %for.cond4.preheader ], [ %indvars.iv.next, %for.inc17 ] %2 = phi i8 [ %0, %for.cond4.preheader ], [ %3, %for.inc17 ] %conv = sext i8 %2 to i32 %cmp13 = icmp eq i32 %i.162, %conv br i1 %cmp13, label %if.then, label %for.inc17 if.then: ; preds = %for.body9 store i32 1, ptr %arrayidx16, align 8, !tbaa !5 br label %for.inc17 for.inc17: ; preds = %for.body9, %if.then %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx6 = getelementptr inbounds [100010 x i8], ptr %S, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx6, align 1, !tbaa !9 %cmp7.not = icmp eq i8 %3, 0 br i1 %cmp7.not, label %for.cond4.for.end19_crit_edge, label %for.body9, !llvm.loop !10 for.cond4.for.end19_crit_edge: ; preds = %for.inc17 %indvars.iv.next68 = or i64 %indvars.iv67, 1 %inc22 = add nuw nsw i32 %i.162, 1 %arrayidx16.1 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %indvars.iv.next68 br label %for.body9.1 for.body9.1: ; preds = %for.inc17.1, %for.cond4.for.end19_crit_edge %indvars.iv.1 = phi i64 [ 0, %for.cond4.for.end19_crit_edge ], [ %indvars.iv.next.1, %for.inc17.1 ] %4 = phi i8 [ %0, %for.cond4.for.end19_crit_edge ], [ %5, %for.inc17.1 ] %conv.1 = sext i8 %4 to i32 %cmp13.1 = icmp eq i32 %inc22, %conv.1 br i1 %cmp13.1, label %if.then.1, label %for.inc17.1 if.then.1: ; preds = %for.body9.1 store i32 1, ptr %arrayidx16.1, align 4, !tbaa !5 br label %for.inc17.1 for.inc17.1: ; preds = %if.then.1, %for.body9.1 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1 %arrayidx6.1 = getelementptr inbounds [100010 x i8], ptr %S, i64 0, i64 %indvars.iv.next.1 %5 = load i8, ptr %arrayidx6.1, align 1, !tbaa !9 %cmp7.not.1 = icmp eq i8 %5, 0 br i1 %cmp7.not.1, label %for.cond4.for.end19_crit_edge.1, label %for.body9.1, !llvm.loop !10 for.cond4.for.end19_crit_edge.1: ; preds = %for.inc17.1 %indvars.iv.next68.1 = add nuw nsw i64 %indvars.iv67, 2 %inc22.1 = add nuw nsw i32 %i.162, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next68.1, 26 br i1 %exitcond.not.1, label %for.cond24.preheader, label %for.cond4.preheader, !llvm.loop !12 for.end37.thread: ; preds = %entry, %for.inc35.24, %for.inc35.23, %for.inc35.22, %for.inc35.21, %for.inc35.20, %for.inc35.19, %for.inc35.18, %for.inc35.17, %for.inc35.16, %for.inc35.15, %for.inc35.14, %for.inc35.13, %for.inc35.12, %for.inc35.11, %for.inc35.10, %for.inc35.9, %for.inc35.8, %for.inc35.7, %for.inc35.6, %for.inc35.5, %for.inc35.4, %for.inc35.3, %for.inc35.2, %for.inc35.1, %for.inc35, %for.cond24.preheader %i.263.lcssa.wide = phi i32 [ 97, %for.cond24.preheader ], [ 98, %for.inc35 ], [ 99, %for.inc35.1 ], [ 100, %for.inc35.2 ], [ 101, %for.inc35.3 ], [ 102, %for.inc35.4 ], [ 103, %for.inc35.5 ], [ 104, %for.inc35.6 ], [ 105, %for.inc35.7 ], [ 106, %for.inc35.8 ], [ 107, %for.inc35.9 ], [ 108, %for.inc35.10 ], [ 109, %for.inc35.11 ], [ 110, %for.inc35.12 ], [ 111, %for.inc35.13 ], [ 112, %for.inc35.14 ], [ 113, %for.inc35.15 ], [ 114, %for.inc35.16 ], [ 115, %for.inc35.17 ], [ 116, %for.inc35.18 ], [ 117, %for.inc35.19 ], [ 118, %for.inc35.20 ], [ 119, %for.inc35.21 ], [ 120, %for.inc35.22 ], [ 121, %for.inc35.23 ], [ 122, %for.inc35.24 ], [ 97, %entry ] %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.263.lcssa.wide) br label %if.end42 for.inc35: ; preds = %for.cond24.preheader %arrayidx29.1 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 1 %6 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5 %cmp30.not.1 = icmp eq i32 %6, 1 br i1 %cmp30.not.1, label %for.inc35.1, label %for.end37.thread for.inc35.1: ; preds = %for.inc35 %arrayidx29.2 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 2 %7 = load i32, ptr %arrayidx29.2, align 8, !tbaa !5 %cmp30.not.2 = icmp eq i32 %7, 1 br i1 %cmp30.not.2, label %for.inc35.2, label %for.end37.thread for.inc35.2: ; preds = %for.inc35.1 %arrayidx29.3 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 3 %8 = load i32, ptr %arrayidx29.3, align 4, !tbaa !5 %cmp30.not.3 = icmp eq i32 %8, 1 br i1 %cmp30.not.3, label %for.inc35.3, label %for.end37.thread for.inc35.3: ; preds = %for.inc35.2 %arrayidx29.4 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 4 %9 = load i32, ptr %arrayidx29.4, align 16, !tbaa !5 %cmp30.not.4 = icmp eq i32 %9, 1 br i1 %cmp30.not.4, label %for.inc35.4, label %for.end37.thread for.inc35.4: ; preds = %for.inc35.3 %arrayidx29.5 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 5 %10 = load i32, ptr %arrayidx29.5, align 4, !tbaa !5 %cmp30.not.5 = icmp eq i32 %10, 1 br i1 %cmp30.not.5, label %for.inc35.5, label %for.end37.thread for.inc35.5: ; preds = %for.inc35.4 %arrayidx29.6 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 6 %11 = load i32, ptr %arrayidx29.6, align 8, !tbaa !5 %cmp30.not.6 = icmp eq i32 %11, 1 br i1 %cmp30.not.6, label %for.inc35.6, label %for.end37.thread for.inc35.6: ; preds = %for.inc35.5 %arrayidx29.7 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 7 %12 = load i32, ptr %arrayidx29.7, align 4, !tbaa !5 %cmp30.not.7 = icmp eq i32 %12, 1 br i1 %cmp30.not.7, label %for.inc35.7, label %for.end37.thread for.inc35.7: ; preds = %for.inc35.6 %arrayidx29.8 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 8 %13 = load i32, ptr %arrayidx29.8, align 16, !tbaa !5 %cmp30.not.8 = icmp eq i32 %13, 1 br i1 %cmp30.not.8, label %for.inc35.8, label %for.end37.thread for.inc35.8: ; preds = %for.inc35.7 %arrayidx29.9 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 9 %14 = load i32, ptr %arrayidx29.9, align 4, !tbaa !5 %cmp30.not.9 = icmp eq i32 %14, 1 br i1 %cmp30.not.9, label %for.inc35.9, label %for.end37.thread for.inc35.9: ; preds = %for.inc35.8 %arrayidx29.10 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 10 %15 = load i32, ptr %arrayidx29.10, align 8, !tbaa !5 %cmp30.not.10 = icmp eq i32 %15, 1 br i1 %cmp30.not.10, label %for.inc35.10, label %for.end37.thread for.inc35.10: ; preds = %for.inc35.9 %arrayidx29.11 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 11 %16 = load i32, ptr %arrayidx29.11, align 4, !tbaa !5 %cmp30.not.11 = icmp eq i32 %16, 1 br i1 %cmp30.not.11, label %for.inc35.11, label %for.end37.thread for.inc35.11: ; preds = %for.inc35.10 %arrayidx29.12 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 12 %17 = load i32, ptr %arrayidx29.12, align 16, !tbaa !5 %cmp30.not.12 = icmp eq i32 %17, 1 br i1 %cmp30.not.12, label %for.inc35.12, label %for.end37.thread for.inc35.12: ; preds = %for.inc35.11 %arrayidx29.13 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 13 %18 = load i32, ptr %arrayidx29.13, align 4, !tbaa !5 %cmp30.not.13 = icmp eq i32 %18, 1 br i1 %cmp30.not.13, label %for.inc35.13, label %for.end37.thread for.inc35.13: ; preds = %for.inc35.12 %arrayidx29.14 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 14 %19 = load i32, ptr %arrayidx29.14, align 8, !tbaa !5 %cmp30.not.14 = icmp eq i32 %19, 1 br i1 %cmp30.not.14, label %for.inc35.14, label %for.end37.thread for.inc35.14: ; preds = %for.inc35.13 %arrayidx29.15 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 15 %20 = load i32, ptr %arrayidx29.15, align 4, !tbaa !5 %cmp30.not.15 = icmp eq i32 %20, 1 br i1 %cmp30.not.15, label %for.inc35.15, label %for.end37.thread for.inc35.15: ; preds = %for.inc35.14 %arrayidx29.16 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 16 %21 = load i32, ptr %arrayidx29.16, align 16, !tbaa !5 %cmp30.not.16 = icmp eq i32 %21, 1 br i1 %cmp30.not.16, label %for.inc35.16, label %for.end37.thread for.inc35.16: ; preds = %for.inc35.15 %arrayidx29.17 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 17 %22 = load i32, ptr %arrayidx29.17, align 4, !tbaa !5 %cmp30.not.17 = icmp eq i32 %22, 1 br i1 %cmp30.not.17, label %for.inc35.17, label %for.end37.thread for.inc35.17: ; preds = %for.inc35.16 %arrayidx29.18 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 18 %23 = load i32, ptr %arrayidx29.18, align 8, !tbaa !5 %cmp30.not.18 = icmp eq i32 %23, 1 br i1 %cmp30.not.18, label %for.inc35.18, label %for.end37.thread for.inc35.18: ; preds = %for.inc35.17 %arrayidx29.19 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 19 %24 = load i32, ptr %arrayidx29.19, align 4, !tbaa !5 %cmp30.not.19 = icmp eq i32 %24, 1 br i1 %cmp30.not.19, label %for.inc35.19, label %for.end37.thread for.inc35.19: ; preds = %for.inc35.18 %arrayidx29.20 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 20 %25 = load i32, ptr %arrayidx29.20, align 16, !tbaa !5 %cmp30.not.20 = icmp eq i32 %25, 1 br i1 %cmp30.not.20, label %for.inc35.20, label %for.end37.thread for.inc35.20: ; preds = %for.inc35.19 %arrayidx29.21 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 21 %26 = load i32, ptr %arrayidx29.21, align 4, !tbaa !5 %cmp30.not.21 = icmp eq i32 %26, 1 br i1 %cmp30.not.21, label %for.inc35.21, label %for.end37.thread for.inc35.21: ; preds = %for.inc35.20 %arrayidx29.22 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 22 %27 = load i32, ptr %arrayidx29.22, align 8, !tbaa !5 %cmp30.not.22 = icmp eq i32 %27, 1 br i1 %cmp30.not.22, label %for.inc35.22, label %for.end37.thread for.inc35.22: ; preds = %for.inc35.21 %arrayidx29.23 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 23 %28 = load i32, ptr %arrayidx29.23, align 4, !tbaa !5 %cmp30.not.23 = icmp eq i32 %28, 1 br i1 %cmp30.not.23, label %for.inc35.23, label %for.end37.thread for.inc35.23: ; preds = %for.inc35.22 %arrayidx29.24 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 24 %29 = load i32, ptr %arrayidx29.24, align 16, !tbaa !5 %cmp30.not.24 = icmp eq i32 %29, 1 br i1 %cmp30.not.24, label %for.inc35.24, label %for.end37.thread for.inc35.24: ; preds = %for.inc35.23 %arrayidx29.25 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 25 %30 = load i32, ptr %arrayidx29.25, align 4, !tbaa !5 %cmp30.not.25 = icmp eq i32 %30, 1 br i1 %cmp30.not.25, label %if.then40, label %for.end37.thread if.then40: ; preds = %for.inc35.24 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end42 if.end42: ; preds = %for.end37.thread, %if.then40 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %flag) #5 call void @llvm.lifetime.end.p0(i64 100010, 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: 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 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include <stdio.h> int main(int argc, char **argv) { char s[100001]; scanf("%s", s); int alpha[26] = {}; for (int i = 0; s[i] != '\0'; ++i) { alpha[s[i] - 'a']++; } for (int i = 0; i < 26; ++i) { if (alpha[i] == 0) { printf("%c\n", 'a' + i); goto end; } } puts("None"); end: return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265554/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265554/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"None\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %s = alloca [100001 x i8], align 16 %alpha = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %alpha) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %alpha, i8 0, i64 104, i1 false) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not33 = icmp eq i8 %0, 0 br i1 %cmp.not33, label %cleanup, label %for.body for.cond9.preheader: ; preds = %for.body %.pre = load i32, ptr %alpha, align 16, !tbaa !8 %1 = icmp eq i32 %.pre, 0 br i1 %1, label %cleanup, label %for.inc19 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %2 = phi i8 [ %4, %for.body ], [ %0, %entry ] %conv = sext i8 %2 to i64 %sub = add nsw i64 %conv, -97 %arrayidx6 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 %sub %3 = load i32, ptr %arrayidx6, align 4, !tbaa !8 %inc = add nsw i32 %3, 1 store i32 %inc, ptr %arrayidx6, align 4, !tbaa !8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %4, 0 br i1 %cmp.not, label %for.cond9.preheader, label %for.body, !llvm.loop !10 for.inc19: ; preds = %for.cond9.preheader %arrayidx15.1 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 1 %5 = load i32, ptr %arrayidx15.1, align 4, !tbaa !8 %cmp16.1 = icmp eq i32 %5, 0 br i1 %cmp16.1, label %cleanup, label %for.inc19.1 for.inc19.1: ; preds = %for.inc19 %arrayidx15.2 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 2 %6 = load i32, ptr %arrayidx15.2, align 8, !tbaa !8 %cmp16.2 = icmp eq i32 %6, 0 br i1 %cmp16.2, label %cleanup, label %for.inc19.2 for.inc19.2: ; preds = %for.inc19.1 %arrayidx15.3 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 3 %7 = load i32, ptr %arrayidx15.3, align 4, !tbaa !8 %cmp16.3 = icmp eq i32 %7, 0 br i1 %cmp16.3, label %cleanup, label %for.inc19.3 for.inc19.3: ; preds = %for.inc19.2 %arrayidx15.4 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 4 %8 = load i32, ptr %arrayidx15.4, align 16, !tbaa !8 %cmp16.4 = icmp eq i32 %8, 0 br i1 %cmp16.4, label %cleanup, label %for.inc19.4 for.inc19.4: ; preds = %for.inc19.3 %arrayidx15.5 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 5 %9 = load i32, ptr %arrayidx15.5, align 4, !tbaa !8 %cmp16.5 = icmp eq i32 %9, 0 br i1 %cmp16.5, label %cleanup, label %for.inc19.5 for.inc19.5: ; preds = %for.inc19.4 %arrayidx15.6 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 6 %10 = load i32, ptr %arrayidx15.6, align 8, !tbaa !8 %cmp16.6 = icmp eq i32 %10, 0 br i1 %cmp16.6, label %cleanup, label %for.inc19.6 for.inc19.6: ; preds = %for.inc19.5 %arrayidx15.7 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 7 %11 = load i32, ptr %arrayidx15.7, align 4, !tbaa !8 %cmp16.7 = icmp eq i32 %11, 0 br i1 %cmp16.7, label %cleanup, label %for.inc19.7 for.inc19.7: ; preds = %for.inc19.6 %arrayidx15.8 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 8 %12 = load i32, ptr %arrayidx15.8, align 16, !tbaa !8 %cmp16.8 = icmp eq i32 %12, 0 br i1 %cmp16.8, label %cleanup, label %for.inc19.8 for.inc19.8: ; preds = %for.inc19.7 %arrayidx15.9 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 9 %13 = load i32, ptr %arrayidx15.9, align 4, !tbaa !8 %cmp16.9 = icmp eq i32 %13, 0 br i1 %cmp16.9, label %cleanup, label %for.inc19.9 for.inc19.9: ; preds = %for.inc19.8 %arrayidx15.10 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 10 %14 = load i32, ptr %arrayidx15.10, align 8, !tbaa !8 %cmp16.10 = icmp eq i32 %14, 0 br i1 %cmp16.10, label %cleanup, label %for.inc19.10 for.inc19.10: ; preds = %for.inc19.9 %arrayidx15.11 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 11 %15 = load i32, ptr %arrayidx15.11, align 4, !tbaa !8 %cmp16.11 = icmp eq i32 %15, 0 br i1 %cmp16.11, label %cleanup, label %for.inc19.11 for.inc19.11: ; preds = %for.inc19.10 %arrayidx15.12 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 12 %16 = load i32, ptr %arrayidx15.12, align 16, !tbaa !8 %cmp16.12 = icmp eq i32 %16, 0 br i1 %cmp16.12, label %cleanup, label %for.inc19.12 for.inc19.12: ; preds = %for.inc19.11 %arrayidx15.13 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 13 %17 = load i32, ptr %arrayidx15.13, align 4, !tbaa !8 %cmp16.13 = icmp eq i32 %17, 0 br i1 %cmp16.13, label %cleanup, label %for.inc19.13 for.inc19.13: ; preds = %for.inc19.12 %arrayidx15.14 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 14 %18 = load i32, ptr %arrayidx15.14, align 8, !tbaa !8 %cmp16.14 = icmp eq i32 %18, 0 br i1 %cmp16.14, label %cleanup, label %for.inc19.14 for.inc19.14: ; preds = %for.inc19.13 %arrayidx15.15 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 15 %19 = load i32, ptr %arrayidx15.15, align 4, !tbaa !8 %cmp16.15 = icmp eq i32 %19, 0 br i1 %cmp16.15, label %cleanup, label %for.inc19.15 for.inc19.15: ; preds = %for.inc19.14 %arrayidx15.16 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 16 %20 = load i32, ptr %arrayidx15.16, align 16, !tbaa !8 %cmp16.16 = icmp eq i32 %20, 0 br i1 %cmp16.16, label %cleanup, label %for.inc19.16 for.inc19.16: ; preds = %for.inc19.15 %arrayidx15.17 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 17 %21 = load i32, ptr %arrayidx15.17, align 4, !tbaa !8 %cmp16.17 = icmp eq i32 %21, 0 br i1 %cmp16.17, label %cleanup, label %for.inc19.17 for.inc19.17: ; preds = %for.inc19.16 %arrayidx15.18 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 18 %22 = load i32, ptr %arrayidx15.18, align 8, !tbaa !8 %cmp16.18 = icmp eq i32 %22, 0 br i1 %cmp16.18, label %cleanup, label %for.inc19.18 for.inc19.18: ; preds = %for.inc19.17 %arrayidx15.19 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 19 %23 = load i32, ptr %arrayidx15.19, align 4, !tbaa !8 %cmp16.19 = icmp eq i32 %23, 0 br i1 %cmp16.19, label %cleanup, label %for.inc19.19 for.inc19.19: ; preds = %for.inc19.18 %arrayidx15.20 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 20 %24 = load i32, ptr %arrayidx15.20, align 16, !tbaa !8 %cmp16.20 = icmp eq i32 %24, 0 br i1 %cmp16.20, label %cleanup, label %for.inc19.20 for.inc19.20: ; preds = %for.inc19.19 %arrayidx15.21 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 21 %25 = load i32, ptr %arrayidx15.21, align 4, !tbaa !8 %cmp16.21 = icmp eq i32 %25, 0 br i1 %cmp16.21, label %cleanup, label %for.inc19.21 for.inc19.21: ; preds = %for.inc19.20 %arrayidx15.22 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 22 %26 = load i32, ptr %arrayidx15.22, align 8, !tbaa !8 %cmp16.22 = icmp eq i32 %26, 0 br i1 %cmp16.22, label %cleanup, label %for.inc19.22 for.inc19.22: ; preds = %for.inc19.21 %arrayidx15.23 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 23 %27 = load i32, ptr %arrayidx15.23, align 4, !tbaa !8 %cmp16.23 = icmp eq i32 %27, 0 br i1 %cmp16.23, label %cleanup, label %for.inc19.23 for.inc19.23: ; preds = %for.inc19.22 %arrayidx15.24 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 24 %28 = load i32, ptr %arrayidx15.24, align 16, !tbaa !8 %cmp16.24 = icmp eq i32 %28, 0 br i1 %cmp16.24, label %cleanup, label %for.inc19.24 for.inc19.24: ; preds = %for.inc19.23 %arrayidx15.25 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 25 %29 = load i32, ptr %arrayidx15.25, align 4, !tbaa !8 %cmp16.25 = icmp eq i32 %29, 0 br i1 %cmp16.25, label %cleanup, label %for.inc19.25 for.inc19.25: ; preds = %for.inc19.24 %call22 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %cleanup23 cleanup: ; preds = %entry, %for.inc19.24, %for.inc19.23, %for.inc19.22, %for.inc19.21, %for.inc19.20, %for.inc19.19, %for.inc19.18, %for.inc19.17, %for.inc19.16, %for.inc19.15, %for.inc19.14, %for.inc19.13, %for.inc19.12, %for.inc19.11, %for.inc19.10, %for.inc19.9, %for.inc19.8, %for.inc19.7, %for.inc19.6, %for.inc19.5, %for.inc19.4, %for.inc19.3, %for.inc19.2, %for.inc19.1, %for.inc19, %for.cond9.preheader %i8.035.lcssa.wide = phi i32 [ 97, %for.cond9.preheader ], [ 98, %for.inc19 ], [ 99, %for.inc19.1 ], [ 100, %for.inc19.2 ], [ 101, %for.inc19.3 ], [ 102, %for.inc19.4 ], [ 103, %for.inc19.5 ], [ 104, %for.inc19.6 ], [ 105, %for.inc19.7 ], [ 106, %for.inc19.8 ], [ 107, %for.inc19.9 ], [ 108, %for.inc19.10 ], [ 109, %for.inc19.11 ], [ 110, %for.inc19.12 ], [ 111, %for.inc19.13 ], [ 112, %for.inc19.14 ], [ 113, %for.inc19.15 ], [ 114, %for.inc19.16 ], [ 115, %for.inc19.17 ], [ 116, %for.inc19.18 ], [ 117, %for.inc19.19 ], [ 118, %for.inc19.20 ], [ 119, %for.inc19.21 ], [ 120, %for.inc19.22 ], [ 121, %for.inc19.23 ], [ 122, %for.inc19.24 ], [ 97, %entry ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i8.035.lcssa.wide) br label %cleanup23 cleanup23: ; preds = %cleanup, %for.inc19.25 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %alpha) #4 call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int n,x,y,h,w,s,s1,s2,a,i; int m[]={600,800,1000,1200,1400,1600,0}; while(1){ scanf("%d",&n); if(n==0)break; a=0; for(i=0;i<n;i++){ scanf("%d %d %d %d",&x,&y,&h,&w); if (x+y+h>160)s1=6; else if(x+y+h>140)s1=5; else if(x+y+h>120)s1=4; else if(x+y+h>100)s1=3; else if(x+y+h> 80)s1=2; else if(x+y+h> 60)s1=1; else s1=0; if (w>25)s2=6; else if(w>20)s2=5; else if(w>15)s2=4; else if(w>10)s2=3; else if(w>5 )s2=2; else if(w>2 )s2=1; else s2=0; if(s1>s2)s=s1; else s=s2; a+=m[s]; } printf("%d\n",a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265611/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265611/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @__const.main.m = private unnamed_addr constant [7 x i32] [i32 600, i32 800, i32 1000, i32 1200, i32 1400, i32 1600, i32 0], align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 %h = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call75 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp76 = icmp eq i32 %0, 0 br i1 %cmp76, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %8, %for.end ], [ %0, %entry ] %cmp172 = icmp sgt i32 %1, 0 br i1 %cmp172, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %if.end60 %i.074 = phi i32 [ %inc, %if.end60 ], [ 0, %for.cond.preheader ] %a.073 = phi i32 [ %add65, %if.end60 ], [ 0, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %h, ptr noundef nonnull %w) %2 = load i32, ptr %x, align 4, !tbaa !5 %3 = load i32, ptr %y, align 4, !tbaa !5 %add = add nsw i32 %3, %2 %4 = load i32, ptr %h, align 4, !tbaa !5 %add3 = add nsw i32 %add, %4 %cmp4 = icmp sgt i32 %add3, 160 br i1 %cmp4, label %if.end36, label %if.else if.else: ; preds = %for.body %cmp8 = icmp sgt i32 %add3, 140 br i1 %cmp8, label %if.end36, label %if.else10 if.else10: ; preds = %if.else %cmp13 = icmp sgt i32 %add3, 120 br i1 %cmp13, label %if.end36, label %if.else15 if.else15: ; preds = %if.else10 %cmp18 = icmp sgt i32 %add3, 100 br i1 %cmp18, label %if.end36, label %if.else20 if.else20: ; preds = %if.else15 %cmp23 = icmp sgt i32 %add3, 80 br i1 %cmp23, label %if.end36, label %if.else25 if.else25: ; preds = %if.else20 %cmp28 = icmp sgt i32 %add3, 60 %. = zext i1 %cmp28 to i32 br label %if.end36 if.end36: ; preds = %if.else25, %if.else20, %if.else15, %if.else10, %if.else, %for.body %s1.0 = phi i32 [ 6, %for.body ], [ 5, %if.else ], [ 4, %if.else10 ], [ 3, %if.else15 ], [ 2, %if.else20 ], [ %., %if.else25 ] %5 = load i32, ptr %w, align 4, !tbaa !5 %cmp37 = icmp sgt i32 %5, 25 br i1 %cmp37, label %if.end60, label %if.else39 if.else39: ; preds = %if.end36 %cmp40 = icmp sgt i32 %5, 20 br i1 %cmp40, label %if.end60, label %if.else42 if.else42: ; preds = %if.else39 %cmp43 = icmp sgt i32 %5, 15 br i1 %cmp43, label %if.end60, label %if.else45 if.else45: ; preds = %if.else42 %cmp46 = icmp sgt i32 %5, 10 br i1 %cmp46, label %if.end60, label %if.else48 if.else48: ; preds = %if.else45 %cmp49 = icmp sgt i32 %5, 5 br i1 %cmp49, label %if.end60, label %if.else51 if.else51: ; preds = %if.else48 %cmp52 = icmp sgt i32 %5, 2 %.71 = zext i1 %cmp52 to i32 br label %if.end60 if.end60: ; preds = %if.else51, %if.else48, %if.else45, %if.else42, %if.else39, %if.end36 %s2.0 = phi i32 [ 6, %if.end36 ], [ 5, %if.else39 ], [ 4, %if.else42 ], [ 3, %if.else45 ], [ 2, %if.else48 ], [ %.71, %if.else51 ] %s1.0.s2.0 = call i32 @llvm.umax.i32(i32 %s1.0, i32 %s2.0) %idxprom = zext i32 %s1.0.s2.0 to i64 %arrayidx = getelementptr inbounds [7 x i32], ptr @__const.main.m, i64 0, i64 %idxprom %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add65 = add nsw i32 %6, %a.073 %inc = add nuw nsw i32 %i.074, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp1 = icmp slt i32 %inc, %7 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %if.end60, %for.cond.preheader %a.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add65, %if.end60 ] %call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %a.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %8, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 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 %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.umax.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> #define MAX(x,y) ((x>y)?x:y) int main(){ int i,j,n,m,x,y,z,w,ans,f; while(1){ scanf("%d",&n); if(n==0)break; ans=0; while(n--){ scanf("%d%d%d%d",&x,&y,&z,&w); x=x+y+z; if(x>160 || w>25)continue; if(x<=60)f=0; else if(x<=80)f=1; else if(x<=100)f=2; else if(x<=120)f=3; else if(x<=140)f=4; else if(x<=160)f=5; if(w<=2)f=MAX(f,0); else if(w<=5)f=MAX(f,1); else if(w<=10)f=MAX(f,2); else if(w<=15)f=MAX(f,3); else if(w<=20)f=MAX(f,4); else if(w<=25)f=MAX(f,5); ans+=(f+3)*200; } printf("%d\n",ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265662/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265662/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 %z = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3 %call101 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp102 = icmp eq i32 %0, 0 br i1 %cmp102, label %while.end83, label %while.cond1.preheader while.cond1.preheader: ; preds = %entry, %while.end %1 = phi i32 [ %7, %while.end ], [ %0, %entry ] %dec98 = add nsw i32 %1, -1 store i32 %dec98, ptr %n, align 4, !tbaa !5 br label %while.body2 while.cond1thread-pre-split: ; preds = %if.end79, %while.body2 %ans.0.ph = phi i32 [ %add81, %if.end79 ], [ %ans.099, %while.body2 ] %.pr = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %.pr, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %.pr, 0 br i1 %tobool.not, label %while.end, label %while.body2 while.body2: ; preds = %while.cond1.preheader, %while.cond1thread-pre-split %ans.099 = phi i32 [ 0, %while.cond1.preheader ], [ %ans.0.ph, %while.cond1thread-pre-split ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z, ptr noundef nonnull %w) %2 = load i32, ptr %x, align 4, !tbaa !5 %3 = load i32, ptr %y, align 4, !tbaa !5 %add = add nsw i32 %3, %2 %4 = load i32, ptr %z, align 4, !tbaa !5 %add4 = add nsw i32 %add, %4 store i32 %add4, ptr %x, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %add4, 160 %5 = load i32, ptr %w, align 4 %cmp6 = icmp sgt i32 %5, 25 %or.cond = select i1 %cmp5, i1 true, i1 %cmp6 br i1 %or.cond, label %while.cond1thread-pre-split, label %if.end8, !llvm.loop !9 if.end8: ; preds = %while.body2 %cmp9 = icmp sgt i32 %add4, 60 br i1 %cmp9, label %if.else, label %if.end30 if.else: ; preds = %if.end8 %cmp11 = icmp ult i32 %add4, 81 br i1 %cmp11, label %if.end30, label %if.else13 if.else13: ; preds = %if.else %cmp14 = icmp ult i32 %add4, 101 br i1 %cmp14, label %if.end30, label %if.else16 if.else16: ; preds = %if.else13 %cmp17 = icmp ult i32 %add4, 121 br i1 %cmp17, label %if.end30, label %if.else19 if.else19: ; preds = %if.else16 %cmp20 = icmp ult i32 %add4, 141 br i1 %cmp20, label %if.end30, label %if.then24 if.then24: ; preds = %if.else19 br label %if.end30 if.end30: ; preds = %if.else19, %if.else16, %if.else13, %if.else, %if.end8, %if.then24 %cmp61 = phi i32 [ 5, %if.then24 ], [ 4, %if.end8 ], [ 4, %if.else ], [ 4, %if.else13 ], [ 4, %if.else16 ], [ 4, %if.else19 ] %cmp53 = phi i32 [ 5, %if.then24 ], [ 3, %if.end8 ], [ 3, %if.else ], [ 3, %if.else13 ], [ 3, %if.else16 ], [ 4, %if.else19 ] %cmp45 = phi i32 [ 5, %if.then24 ], [ 2, %if.end8 ], [ 2, %if.else ], [ 2, %if.else13 ], [ 3, %if.else16 ], [ 4, %if.else19 ] %cmp37 = phi i32 [ 5, %if.then24 ], [ 1, %if.end8 ], [ 1, %if.else ], [ 2, %if.else13 ], [ 3, %if.else16 ], [ 4, %if.else19 ] %f.2 = phi i32 [ 5, %if.then24 ], [ 0, %if.end8 ], [ 1, %if.else ], [ 2, %if.else13 ], [ 3, %if.else16 ], [ 4, %if.else19 ] %cmp31 = icmp slt i32 %5, 3 br i1 %cmp31, label %if.end79, label %if.else34 if.else34: ; preds = %if.end30 %cmp35 = icmp ult i32 %5, 6 br i1 %cmp35, label %if.end79, label %if.else42 if.else42: ; preds = %if.else34 %cmp43 = icmp ult i32 %5, 11 br i1 %cmp43, label %if.end79, label %if.else50 if.else50: ; preds = %if.else42 %cmp51 = icmp ult i32 %5, 16 br i1 %cmp51, label %if.end79, label %if.else58 if.else58: ; preds = %if.else50 %cmp59 = icmp ult i32 %5, 21 %spec.select97 = select i1 %cmp59, i32 %cmp61, i32 5 br label %if.end79 if.end79: ; preds = %if.else58, %if.else50, %if.else42, %if.else34, %if.end30 %f.3 = phi i32 [ %f.2, %if.end30 ], [ %cmp37, %if.else34 ], [ %cmp45, %if.else42 ], [ %cmp53, %if.else50 ], [ %spec.select97, %if.else58 ] %6 = mul nuw nsw i32 %f.3, 200 %mul = add i32 %ans.099, 600 %add81 = add i32 %mul, %6 br label %while.cond1thread-pre-split, !llvm.loop !9 while.end: ; preds = %while.cond1thread-pre-split %call82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.ph) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %7, 0 br i1 %cmp, label %while.end83, label %while.cond1.preheader while.end83: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <math.h> #define N 100 int main(void){ int n, i, x[N], y[N]; double d, d1 = 0.0, d2 = 0.0, d3 = 0.0, dn = 0.0; scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%d", &x[i]); } for(i = 0; i < n; i++){ scanf("%d", &y[i]); } for(i = 0; i < n; i++){ d = fabs(x[i] - y[i]); d1 += d; d2 += d * d; d3 += d * d * d; if(i == 0){ dn = d; } else{ if(dn < d){ dn = d; } } } d2 = sqrt(d2); d3 = cbrt(d3); printf("%f\n", d1); printf("%f\n", d2); printf("%f\n", d3); printf("%f\n", dn); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265727/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265727/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca [100 x i32], align 16 %y = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %x) #7 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %y) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp58 = icmp sgt i32 %0, 0 br i1 %cmp58, label %for.body, label %for.end27 for.cond2.preheader: ; preds = %for.body %cmp360 = icmp sgt i32 %1, 0 br i1 %cmp360, label %for.body4, label %for.end27 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %x, 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.cond11.preheader: ; preds = %for.body4 %cmp1262 = icmp sgt i32 %10, 0 br i1 %cmp1262, label %for.inc25.peel, label %for.end27 for.inc25.peel: ; preds = %for.cond11.preheader %wide.trip.count = zext i32 %10 to i64 %3 = load i32, ptr %x, align 16, !tbaa !5 %4 = load i32, ptr %y, align 16, !tbaa !5 %sub.peel = sub nsw i32 %3, %4 %conv.peel = sitofp i32 %sub.peel to double %5 = call double @llvm.fabs.f64(double %conv.peel) %mul.peel = fmul double %conv.peel, %conv.peel %6 = insertelement <2 x double> poison, double %conv.peel, i64 0 %7 = insertelement <2 x double> %6, double %mul.peel, i64 1 %8 = insertelement <2 x double> %7, double %5, i64 1 %9 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> %8, <2 x double> zeroinitializer) %exitcond.peel.not = icmp eq i32 %10, 1 br i1 %exitcond.peel.not, label %for.end27, label %if.else for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv76 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6) %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp3 = icmp slt i64 %indvars.iv.next77, %11 br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !11 if.else: ; preds = %for.inc25.peel, %if.else %indvars.iv79 = phi i64 [ %indvars.iv.next80, %if.else ], [ 1, %for.inc25.peel ] %dn.067 = phi double [ %dn.1, %if.else ], [ %5, %for.inc25.peel ] %d1.064 = phi double [ %add, %if.else ], [ %5, %for.inc25.peel ] %12 = phi <2 x double> [ %19, %if.else ], [ %9, %for.inc25.peel ] %arrayidx15 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv79 %13 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %arrayidx17 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv79 %14 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %sub = sub nsw i32 %13, %14 %conv = sitofp i32 %sub to double %15 = call double @llvm.fabs.f64(double %conv) %add = fadd double %d1.064, %15 %mul = fmul double %conv, %conv %16 = insertelement <2 x double> poison, double %conv, i64 0 %17 = insertelement <2 x double> %16, double %mul, i64 1 %18 = insertelement <2 x double> %17, double %15, i64 1 %19 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %17, <2 x double> %18, <2 x double> %12) %cmp21 = fcmp olt double %dn.067, %15 %dn.1 = select i1 %cmp21, double %15, double %dn.067 %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %exitcond.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count br i1 %exitcond.not, label %for.end27, label %if.else, !llvm.loop !12 for.end27: ; preds = %if.else, %entry, %for.cond2.preheader, %for.inc25.peel, %for.cond11.preheader %d1.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ %5, %for.inc25.peel ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add, %if.else ] %dn.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ %5, %for.inc25.peel ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %dn.1, %if.else ] %20 = phi <2 x double> [ zeroinitializer, %for.cond11.preheader ], [ %9, %for.inc25.peel ], [ zeroinitializer, %for.cond2.preheader ], [ zeroinitializer, %entry ], [ %19, %if.else ] %21 = extractelement <2 x double> %20, i64 0 %call28 = call double @sqrt(double noundef %21) #7 %22 = extractelement <2 x double> %20, i64 1 %call29 = call double @cbrt(double noundef %22) #8 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %d1.0.lcssa) %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call28) %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call29) %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %dn.0.lcssa) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %y) #7 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %x) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare double @cbrt(double noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } attributes #8 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> double get_normal_distance(int p, int n, int *x, int *y){ int i,j; double dist,dist_p,dist_p_sum; double unit, result, result_next, result_next_p; // Calc Total dist_p_sum = 0; for(i=0; i<n; i++){ dist = x[i] - y[i]; if( dist < 0 ){ dist *= (-1); } dist_p = dist; for(j=2;j<=p;j++){ dist_p *= dist; } dist_p_sum += dist_p; } // Calc Result result = 0.0; for(i=31;i>=-31;i--){ // Get Unit unit = 1.0; if( i > 0 ){ for(j=1;j<=i;j++){ unit *= 2.0; } } else if( i < 0 ){ for(j=-1;j>=i;j--){ unit /= 2.0; } } // Try & Add result_next = result; result_next += unit; result_next_p = 1.0; for(j=1;j<=p;j++){ result_next_p *= result_next; } if( result_next_p <= dist_p_sum ){ result = result_next; } } return result; } double get_infinity_distance(int n, int *x, int *y){ int result = 0; int i,val; for(i=0; i<n; i++){ val = x[i] - y[i]; if( val < 0 ){ val *= (-1); } if( val > result ){ result = val; } } return (double)result; } int main(int argc, char** argv){ int i,j; int n,xy[2][100]; // Input scanf("%d",&n); for(i=0;i<=1;i++){ for(j=0;j<n;j++){ scanf("%d",xy[i]+j); } } // Output for(i=1;i<=3;i++){ printf("%f\n",get_normal_distance(i, n, xy[0], xy[1])); } printf("%f\n",get_infinity_distance(n, xy[0], xy[1])); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265778/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265778/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local double @get_normal_distance(i32 noundef %p, i32 noundef %n, ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) local_unnamed_addr #0 { entry: %cmp87 = icmp sgt i32 %n, 0 br i1 %cmp87, label %for.body.lr.ph, label %for.cond13.preheader for.body.lr.ph: ; preds = %entry %cmp6.not84 = icmp slt i32 %p, 2 %wide.trip.count114 = zext i32 %n to i64 br i1 %cmp6.not84, label %for.body.us.preheader, label %for.body.preheader for.body.preheader: ; preds = %for.body.lr.ph %0 = add i32 %p, -1 %1 = add i32 %p, -2 %xtraiter = and i32 %0, 7 %2 = icmp ult i32 %1, 7 %unroll_iter = and i32 %0, -8 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br label %for.body for.body.us.preheader: ; preds = %for.body.lr.ph %xtraiter136 = and i64 %wide.trip.count114, 1 %3 = icmp eq i32 %n, 1 br i1 %3, label %for.cond13.preheader.loopexit.unr-lcssa, label %for.body.us.preheader.new for.body.us.preheader.new: ; preds = %for.body.us.preheader %unroll_iter140 = and i64 %wide.trip.count114, 4294967294 br label %for.body.us for.body.us: ; preds = %for.body.us, %for.body.us.preheader.new %indvars.iv111 = phi i64 [ 0, %for.body.us.preheader.new ], [ %indvars.iv.next112.1, %for.body.us ] %dist_p_sum.089.us = phi double [ 0.000000e+00, %for.body.us.preheader.new ], [ %add.us.1, %for.body.us ] %niter141 = phi i64 [ 0, %for.body.us.preheader.new ], [ %niter141.next.1, %for.body.us ] %arrayidx.us = getelementptr inbounds i32, ptr %x, i64 %indvars.iv111 %4 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 %arrayidx2.us = getelementptr inbounds i32, ptr %y, i64 %indvars.iv111 %5 = load i32, ptr %arrayidx2.us, align 4, !tbaa !5 %sub.us = sub nsw i32 %4, %5 %conv.us = sitofp i32 %sub.us to double %cmp3.us = icmp slt i32 %sub.us, 0 %mul.us = fneg double %conv.us %dist.0.us = select i1 %cmp3.us, double %mul.us, double %conv.us %add.us = fadd double %dist_p_sum.089.us, %dist.0.us %indvars.iv.next112 = or i64 %indvars.iv111, 1 %arrayidx.us.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next112 %6 = load i32, ptr %arrayidx.us.1, align 4, !tbaa !5 %arrayidx2.us.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next112 %7 = load i32, ptr %arrayidx2.us.1, align 4, !tbaa !5 %sub.us.1 = sub nsw i32 %6, %7 %conv.us.1 = sitofp i32 %sub.us.1 to double %cmp3.us.1 = icmp slt i32 %sub.us.1, 0 %mul.us.1 = fneg double %conv.us.1 %dist.0.us.1 = select i1 %cmp3.us.1, double %mul.us.1, double %conv.us.1 %add.us.1 = fadd double %add.us, %dist.0.us.1 %indvars.iv.next112.1 = add nuw nsw i64 %indvars.iv111, 2 %niter141.next.1 = add i64 %niter141, 2 %niter141.ncmp.1 = icmp eq i64 %niter141.next.1, %unroll_iter140 br i1 %niter141.ncmp.1, label %for.cond13.preheader.loopexit.unr-lcssa, label %for.body.us, !llvm.loop !9 for.cond13.preheader.loopexit.unr-lcssa: ; preds = %for.body.us, %for.body.us.preheader %add.us.lcssa.ph = phi double [ undef, %for.body.us.preheader ], [ %add.us.1, %for.body.us ] %indvars.iv111.unr = phi i64 [ 0, %for.body.us.preheader ], [ %indvars.iv.next112.1, %for.body.us ] %dist_p_sum.089.us.unr = phi double [ 0.000000e+00, %for.body.us.preheader ], [ %add.us.1, %for.body.us ] %lcmp.mod138.not = icmp eq i64 %xtraiter136, 0 br i1 %lcmp.mod138.not, label %for.cond13.preheader, label %for.body.us.epil for.body.us.epil: ; preds = %for.cond13.preheader.loopexit.unr-lcssa %arrayidx.us.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv111.unr %8 = load i32, ptr %arrayidx.us.epil, align 4, !tbaa !5 %arrayidx2.us.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv111.unr %9 = load i32, ptr %arrayidx2.us.epil, align 4, !tbaa !5 %sub.us.epil = sub nsw i32 %8, %9 %conv.us.epil = sitofp i32 %sub.us.epil to double %cmp3.us.epil = icmp slt i32 %sub.us.epil, 0 %mul.us.epil = fneg double %conv.us.epil %dist.0.us.epil = select i1 %cmp3.us.epil, double %mul.us.epil, double %conv.us.epil %add.us.epil = fadd double %dist_p_sum.089.us.unr, %dist.0.us.epil br label %for.cond13.preheader for.cond13.preheader: ; preds = %for.cond5.for.end_crit_edge, %for.body.us.epil, %for.cond13.preheader.loopexit.unr-lcssa, %entry %dist_p_sum.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.us.lcssa.ph, %for.cond13.preheader.loopexit.unr-lcssa ], [ %add.us.epil, %for.body.us.epil ], [ %add, %for.cond5.for.end_crit_edge ] %dist_p_sum.0.lcssa.fr = freeze double %dist_p_sum.0.lcssa %cmp41.not95 = icmp slt i32 %p, 1 br i1 %cmp41.not95, label %for.cond13.preheader.split.us, label %for.body16.preheader for.body16.preheader: ; preds = %for.cond13.preheader %xtraiter154 = and i32 %p, 7 %10 = icmp ult i32 %p, 8 %unroll_iter158 = and i32 %p, -8 %lcmp.mod156.not = icmp eq i32 %xtraiter154, 0 br label %for.body16 for.cond13.preheader.split.us: ; preds = %for.cond13.preheader %cmp48.us = fcmp ult double %dist_p_sum.0.lcssa.fr, 1.000000e+00 br i1 %cmp48.us, label %for.end54, label %for.body16.us for.body16.us: ; preds = %for.cond13.preheader.split.us, %if.end38.us %indvar160 = phi i32 [ %indvar.next161, %if.end38.us ], [ 0, %for.cond13.preheader.split.us ] %result.0100.us = phi double [ %add39.us, %if.end38.us ], [ 0.000000e+00, %for.cond13.preheader.split.us ] %i.199.us = phi i32 [ %dec53.us, %if.end38.us ], [ 31, %for.cond13.preheader.split.us ] %11 = add i32 %indvar160, -31 %12 = add i32 %indvar160, -32 %cmp17.us = icmp sgt i32 %i.199.us, 0 br i1 %cmp17.us, label %for.body23.us.preheader, label %if.else.us for.body23.us.preheader: ; preds = %for.body16.us %xtraiter168 = and i32 %i.199.us, 7 %13 = add i32 %indvar160, -24 %14 = icmp ult i32 %13, 7 br i1 %14, label %if.end38.us.loopexit.unr-lcssa, label %for.body23.us.preheader.new for.body23.us.preheader.new: ; preds = %for.body23.us.preheader %unroll_iter172 = and i32 %i.199.us, -8 br label %for.body23.us if.else.us: ; preds = %for.body16.us %cmp28.us = icmp slt i32 %i.199.us, 0 br i1 %cmp28.us, label %for.body34.us.preheader, label %if.end38.us for.body34.us.preheader: ; preds = %if.else.us %xtraiter162 = and i32 %11, 7 %15 = icmp ult i32 %12, 7 br i1 %15, label %if.end38.us.loopexit131.unr-lcssa, label %for.body34.us.preheader.new for.body34.us.preheader.new: ; preds = %for.body34.us.preheader %unroll_iter166 = and i32 %11, -8 br label %for.body34.us for.body34.us: ; preds = %for.body34.us, %for.body34.us.preheader.new %unit.192.us = phi double [ 1.000000e+00, %for.body34.us.preheader.new ], [ %div.us.7, %for.body34.us ] %niter167 = phi i32 [ 0, %for.body34.us.preheader.new ], [ %niter167.next.7, %for.body34.us ] %div.us = fmul double %unit.192.us, 5.000000e-01 %div.us.1 = fmul double %div.us, 5.000000e-01 %div.us.2 = fmul double %div.us.1, 5.000000e-01 %div.us.3 = fmul double %div.us.2, 5.000000e-01 %div.us.4 = fmul double %div.us.3, 5.000000e-01 %div.us.5 = fmul double %div.us.4, 5.000000e-01 %div.us.6 = fmul double %div.us.5, 5.000000e-01 %div.us.7 = fmul double %div.us.6, 5.000000e-01 %niter167.next.7 = add i32 %niter167, 8 %niter167.ncmp.7.not = icmp eq i32 %niter167.next.7, %unroll_iter166 br i1 %niter167.ncmp.7.not, label %if.end38.us.loopexit131.unr-lcssa, label %for.body34.us, !llvm.loop !11 for.body23.us: ; preds = %for.body23.us, %for.body23.us.preheader.new %unit.094.us = phi double [ 1.000000e+00, %for.body23.us.preheader.new ], [ %mul24.us.7, %for.body23.us ] %niter173 = phi i32 [ 0, %for.body23.us.preheader.new ], [ %niter173.next.7, %for.body23.us ] %mul24.us = fmul double %unit.094.us, 2.000000e+00 %mul24.us.1 = fmul double %mul24.us, 2.000000e+00 %mul24.us.2 = fmul double %mul24.us.1, 2.000000e+00 %mul24.us.3 = fmul double %mul24.us.2, 2.000000e+00 %mul24.us.4 = fmul double %mul24.us.3, 2.000000e+00 %mul24.us.5 = fmul double %mul24.us.4, 2.000000e+00 %mul24.us.6 = fmul double %mul24.us.5, 2.000000e+00 %mul24.us.7 = fmul double %mul24.us.6, 2.000000e+00 %niter173.next.7 = add i32 %niter173, 8 %niter173.ncmp.7 = icmp eq i32 %niter173.next.7, %unroll_iter172 br i1 %niter173.ncmp.7, label %if.end38.us.loopexit.unr-lcssa, label %for.body23.us, !llvm.loop !12 if.end38.us.loopexit.unr-lcssa: ; preds = %for.body23.us, %for.body23.us.preheader %mul24.us.lcssa.ph = phi double [ undef, %for.body23.us.preheader ], [ %mul24.us.7, %for.body23.us ] %unit.094.us.unr = phi double [ 1.000000e+00, %for.body23.us.preheader ], [ %mul24.us.7, %for.body23.us ] %lcmp.mod170.not = icmp eq i32 %xtraiter168, 0 br i1 %lcmp.mod170.not, label %if.end38.us, label %for.body23.us.epil for.body23.us.epil: ; preds = %if.end38.us.loopexit.unr-lcssa, %for.body23.us.epil %unit.094.us.epil = phi double [ %mul24.us.epil, %for.body23.us.epil ], [ %unit.094.us.unr, %if.end38.us.loopexit.unr-lcssa ] %epil.iter169 = phi i32 [ %epil.iter169.next, %for.body23.us.epil ], [ 0, %if.end38.us.loopexit.unr-lcssa ] %mul24.us.epil = fmul double %unit.094.us.epil, 2.000000e+00 %epil.iter169.next = add i32 %epil.iter169, 1 %epil.iter169.cmp.not = icmp eq i32 %epil.iter169.next, %xtraiter168 br i1 %epil.iter169.cmp.not, label %if.end38.us, label %for.body23.us.epil, !llvm.loop !13 if.end38.us.loopexit131.unr-lcssa: ; preds = %for.body34.us, %for.body34.us.preheader %div.us.lcssa.ph = phi double [ undef, %for.body34.us.preheader ], [ %div.us.7, %for.body34.us ] %unit.192.us.unr = phi double [ 1.000000e+00, %for.body34.us.preheader ], [ %div.us.7, %for.body34.us ] %lcmp.mod164.not = icmp eq i32 %xtraiter162, 0 br i1 %lcmp.mod164.not, label %if.end38.us, label %for.body34.us.epil for.body34.us.epil: ; preds = %if.end38.us.loopexit131.unr-lcssa, %for.body34.us.epil %unit.192.us.epil = phi double [ %div.us.epil, %for.body34.us.epil ], [ %unit.192.us.unr, %if.end38.us.loopexit131.unr-lcssa ] %epil.iter163 = phi i32 [ %epil.iter163.next, %for.body34.us.epil ], [ 0, %if.end38.us.loopexit131.unr-lcssa ] %div.us.epil = fmul double %unit.192.us.epil, 5.000000e-01 %epil.iter163.next = add i32 %epil.iter163, 1 %epil.iter163.cmp.not = icmp eq i32 %epil.iter163.next, %xtraiter162 br i1 %epil.iter163.cmp.not, label %if.end38.us, label %for.body34.us.epil, !llvm.loop !15 if.end38.us: ; preds = %if.end38.us.loopexit131.unr-lcssa, %for.body34.us.epil, %if.end38.us.loopexit.unr-lcssa, %for.body23.us.epil, %if.else.us %unit.2.us = phi double [ 1.000000e+00, %if.else.us ], [ %mul24.us.lcssa.ph, %if.end38.us.loopexit.unr-lcssa ], [ %mul24.us.epil, %for.body23.us.epil ], [ %div.us.lcssa.ph, %if.end38.us.loopexit131.unr-lcssa ], [ %div.us.epil, %for.body34.us.epil ] %add39.us = fadd double %result.0100.us, %unit.2.us %dec53.us = add nsw i32 %i.199.us, -1 %cmp14.us = icmp sgt i32 %i.199.us, -31 %indvar.next161 = add i32 %indvar160, 1 br i1 %cmp14.us, label %for.body16.us, label %for.end54, !llvm.loop !16 for.body: ; preds = %for.body.preheader, %for.cond5.for.end_crit_edge %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond5.for.end_crit_edge ], [ 0, %for.body.preheader ] %dist_p_sum.089 = phi double [ %add, %for.cond5.for.end_crit_edge ], [ 0.000000e+00, %for.body.preheader ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %16 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %17 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %16, %17 %conv = sitofp i32 %sub to double %cmp3 = icmp slt i32 %sub, 0 %mul = fneg double %conv %dist.0 = select i1 %cmp3, double %mul, double %conv br i1 %2, label %for.cond5.for.end_crit_edge.unr-lcssa, label %for.body8 for.body8: ; preds = %for.body, %for.body8 %dist_p.086 = phi double [ %mul9.7, %for.body8 ], [ %dist.0, %for.body ] %niter = phi i32 [ %niter.next.7, %for.body8 ], [ 0, %for.body ] %mul9 = fmul double %dist.0, %dist_p.086 %mul9.1 = fmul double %dist.0, %mul9 %mul9.2 = fmul double %dist.0, %mul9.1 %mul9.3 = fmul double %dist.0, %mul9.2 %mul9.4 = fmul double %dist.0, %mul9.3 %mul9.5 = fmul double %dist.0, %mul9.4 %mul9.6 = fmul double %dist.0, %mul9.5 %mul9.7 = fmul double %dist.0, %mul9.6 %niter.next.7 = add i32 %niter, 8 %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond5.for.end_crit_edge.unr-lcssa, label %for.body8, !llvm.loop !17 for.cond5.for.end_crit_edge.unr-lcssa: ; preds = %for.body8, %for.body %mul9.lcssa.ph = phi double [ undef, %for.body ], [ %mul9.7, %for.body8 ] %dist_p.086.unr = phi double [ %dist.0, %for.body ], [ %mul9.7, %for.body8 ] br i1 %lcmp.mod.not, label %for.cond5.for.end_crit_edge, label %for.body8.epil for.body8.epil: ; preds = %for.cond5.for.end_crit_edge.unr-lcssa, %for.body8.epil %dist_p.086.epil = phi double [ %mul9.epil, %for.body8.epil ], [ %dist_p.086.unr, %for.cond5.for.end_crit_edge.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body8.epil ], [ 0, %for.cond5.for.end_crit_edge.unr-lcssa ] %mul9.epil = fmul double %dist.0, %dist_p.086.epil %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond5.for.end_crit_edge, label %for.body8.epil, !llvm.loop !18 for.cond5.for.end_crit_edge: ; preds = %for.body8.epil, %for.cond5.for.end_crit_edge.unr-lcssa %mul9.lcssa = phi double [ %mul9.lcssa.ph, %for.cond5.for.end_crit_edge.unr-lcssa ], [ %mul9.epil, %for.body8.epil ] %add = fadd double %dist_p_sum.089, %mul9.lcssa %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond110.not = icmp eq i64 %indvars.iv.next, %wide.trip.count114 br i1 %exitcond110.not, label %for.cond13.preheader, label %for.body, !llvm.loop !9 for.body16: ; preds = %for.body16.preheader, %for.cond40.for.end47_crit_edge %indvar = phi i32 [ 0, %for.body16.preheader ], [ %indvar.next, %for.cond40.for.end47_crit_edge ] %result.0100 = phi double [ 0.000000e+00, %for.body16.preheader ], [ %result.1, %for.cond40.for.end47_crit_edge ] %i.199 = phi i32 [ 31, %for.body16.preheader ], [ %dec53, %for.cond40.for.end47_crit_edge ] %18 = add i32 %indvar, -31 %19 = add i32 %indvar, -32 %cmp17 = icmp sgt i32 %i.199, 0 br i1 %cmp17, label %for.body23.preheader, label %if.else for.body23.preheader: ; preds = %for.body16 %xtraiter148 = and i32 %i.199, 7 %20 = add i32 %indvar, -24 %21 = icmp ult i32 %20, 7 br i1 %21, label %if.end38.loopexit.unr-lcssa, label %for.body23.preheader.new for.body23.preheader.new: ; preds = %for.body23.preheader %unroll_iter152 = and i32 %i.199, -8 br label %for.body23 for.body23: ; preds = %for.body23, %for.body23.preheader.new %unit.094 = phi double [ 1.000000e+00, %for.body23.preheader.new ], [ %mul24.7, %for.body23 ] %niter153 = phi i32 [ 0, %for.body23.preheader.new ], [ %niter153.next.7, %for.body23 ] %mul24 = fmul double %unit.094, 2.000000e+00 %mul24.1 = fmul double %mul24, 2.000000e+00 %mul24.2 = fmul double %mul24.1, 2.000000e+00 %mul24.3 = fmul double %mul24.2, 2.000000e+00 %mul24.4 = fmul double %mul24.3, 2.000000e+00 %mul24.5 = fmul double %mul24.4, 2.000000e+00 %mul24.6 = fmul double %mul24.5, 2.000000e+00 %mul24.7 = fmul double %mul24.6, 2.000000e+00 %niter153.next.7 = add i32 %niter153, 8 %niter153.ncmp.7 = icmp eq i32 %niter153.next.7, %unroll_iter152 br i1 %niter153.ncmp.7, label %if.end38.loopexit.unr-lcssa, label %for.body23, !llvm.loop !12 if.else: ; preds = %for.body16 %cmp28 = icmp slt i32 %i.199, 0 br i1 %cmp28, label %for.body34.preheader, label %if.end38 for.body34.preheader: ; preds = %if.else %xtraiter142 = and i32 %18, 7 %22 = icmp ult i32 %19, 7 br i1 %22, label %if.end38.loopexit132.unr-lcssa, label %for.body34.preheader.new for.body34.preheader.new: ; preds = %for.body34.preheader %unroll_iter146 = and i32 %18, -8 br label %for.body34 for.body34: ; preds = %for.body34, %for.body34.preheader.new %unit.192 = phi double [ 1.000000e+00, %for.body34.preheader.new ], [ %div.7, %for.body34 ] %niter147 = phi i32 [ 0, %for.body34.preheader.new ], [ %niter147.next.7, %for.body34 ] %div = fmul double %unit.192, 5.000000e-01 %div.1 = fmul double %div, 5.000000e-01 %div.2 = fmul double %div.1, 5.000000e-01 %div.3 = fmul double %div.2, 5.000000e-01 %div.4 = fmul double %div.3, 5.000000e-01 %div.5 = fmul double %div.4, 5.000000e-01 %div.6 = fmul double %div.5, 5.000000e-01 %div.7 = fmul double %div.6, 5.000000e-01 %niter147.next.7 = add i32 %niter147, 8 %niter147.ncmp.7.not = icmp eq i32 %niter147.next.7, %unroll_iter146 br i1 %niter147.ncmp.7.not, label %if.end38.loopexit132.unr-lcssa, label %for.body34, !llvm.loop !11 if.end38.loopexit.unr-lcssa: ; preds = %for.body23, %for.body23.preheader %mul24.lcssa.ph = phi double [ undef, %for.body23.preheader ], [ %mul24.7, %for.body23 ] %unit.094.unr = phi double [ 1.000000e+00, %for.body23.preheader ], [ %mul24.7, %for.body23 ] %lcmp.mod150.not = icmp eq i32 %xtraiter148, 0 br i1 %lcmp.mod150.not, label %if.end38, label %for.body23.epil for.body23.epil: ; preds = %if.end38.loopexit.unr-lcssa, %for.body23.epil %unit.094.epil = phi double [ %mul24.epil, %for.body23.epil ], [ %unit.094.unr, %if.end38.loopexit.unr-lcssa ] %epil.iter149 = phi i32 [ %epil.iter149.next, %for.body23.epil ], [ 0, %if.end38.loopexit.unr-lcssa ] %mul24.epil = fmul double %unit.094.epil, 2.000000e+00 %epil.iter149.next = add i32 %epil.iter149, 1 %epil.iter149.cmp.not = icmp eq i32 %epil.iter149.next, %xtraiter148 br i1 %epil.iter149.cmp.not, label %if.end38, label %for.body23.epil, !llvm.loop !19 if.end38.loopexit132.unr-lcssa: ; preds = %for.body34, %for.body34.preheader %div.lcssa.ph = phi double [ undef, %for.body34.preheader ], [ %div.7, %for.body34 ] %unit.192.unr = phi double [ 1.000000e+00, %for.body34.preheader ], [ %div.7, %for.body34 ] %lcmp.mod144.not = icmp eq i32 %xtraiter142, 0 br i1 %lcmp.mod144.not, label %if.end38, label %for.body34.epil for.body34.epil: ; preds = %if.end38.loopexit132.unr-lcssa, %for.body34.epil %unit.192.epil = phi double [ %div.epil, %for.body34.epil ], [ %unit.192.unr, %if.end38.loopexit132.unr-lcssa ] %epil.iter143 = phi i32 [ %epil.iter143.next, %for.body34.epil ], [ 0, %if.end38.loopexit132.unr-lcssa ] %div.epil = fmul double %unit.192.epil, 5.000000e-01 %epil.iter143.next = add i32 %epil.iter143, 1 %epil.iter143.cmp.not = icmp eq i32 %epil.iter143.next, %xtraiter142 br i1 %epil.iter143.cmp.not, label %if.end38, label %for.body34.epil, !llvm.loop !20 if.end38: ; preds = %if.end38.loopexit132.unr-lcssa, %for.body34.epil, %if.end38.loopexit.unr-lcssa, %for.body23.epil, %if.else %unit.2 = phi double [ 1.000000e+00, %if.else ], [ %mul24.lcssa.ph, %if.end38.loopexit.unr-lcssa ], [ %mul24.epil, %for.body23.epil ], [ %div.lcssa.ph, %if.end38.loopexit132.unr-lcssa ], [ %div.epil, %for.body34.epil ] %add39 = fadd double %result.0100, %unit.2 br i1 %10, label %for.cond40.for.end47_crit_edge.unr-lcssa, label %for.body43 for.body43: ; preds = %if.end38, %for.body43 %result_next_p.097 = phi double [ %mul44.7, %for.body43 ], [ 1.000000e+00, %if.end38 ] %niter159 = phi i32 [ %niter159.next.7, %for.body43 ], [ 0, %if.end38 ] %mul44 = fmul double %add39, %result_next_p.097 %mul44.1 = fmul double %add39, %mul44 %mul44.2 = fmul double %add39, %mul44.1 %mul44.3 = fmul double %add39, %mul44.2 %mul44.4 = fmul double %add39, %mul44.3 %mul44.5 = fmul double %add39, %mul44.4 %mul44.6 = fmul double %add39, %mul44.5 %mul44.7 = fmul double %add39, %mul44.6 %niter159.next.7 = add i32 %niter159, 8 %niter159.ncmp.7 = icmp eq i32 %niter159.next.7, %unroll_iter158 br i1 %niter159.ncmp.7, label %for.cond40.for.end47_crit_edge.unr-lcssa, label %for.body43, !llvm.loop !21 for.cond40.for.end47_crit_edge.unr-lcssa: ; preds = %for.body43, %if.end38 %mul44.lcssa.ph = phi double [ undef, %if.end38 ], [ %mul44.7, %for.body43 ] %result_next_p.097.unr = phi double [ 1.000000e+00, %if.end38 ], [ %mul44.7, %for.body43 ] br i1 %lcmp.mod156.not, label %for.cond40.for.end47_crit_edge, label %for.body43.epil for.body43.epil: ; preds = %for.cond40.for.end47_crit_edge.unr-lcssa, %for.body43.epil %result_next_p.097.epil = phi double [ %mul44.epil, %for.body43.epil ], [ %result_next_p.097.unr, %for.cond40.for.end47_crit_edge.unr-lcssa ] %epil.iter155 = phi i32 [ %epil.iter155.next, %for.body43.epil ], [ 0, %for.cond40.for.end47_crit_edge.unr-lcssa ] %mul44.epil = fmul double %add39, %result_next_p.097.epil %epil.iter155.next = add i32 %epil.iter155, 1 %epil.iter155.cmp.not = icmp eq i32 %epil.iter155.next, %xtraiter154 br i1 %epil.iter155.cmp.not, label %for.cond40.for.end47_crit_edge, label %for.body43.epil, !llvm.loop !22 for.cond40.for.end47_crit_edge: ; preds = %for.body43.epil, %for.cond40.for.end47_crit_edge.unr-lcssa %mul44.lcssa = phi double [ %mul44.lcssa.ph, %for.cond40.for.end47_crit_edge.unr-lcssa ], [ %mul44.epil, %for.body43.epil ] %cmp48 = fcmp ugt double %mul44.lcssa, %dist_p_sum.0.lcssa.fr %result.1 = select i1 %cmp48, double %result.0100, double %add39 %dec53 = add nsw i32 %i.199, -1 %cmp14 = icmp sgt i32 %i.199, -31 %indvar.next = add i32 %indvar, 1 br i1 %cmp14, label %for.body16, label %for.end54, !llvm.loop !16 for.end54: ; preds = %for.cond40.for.end47_crit_edge, %if.end38.us, %for.cond13.preheader.split.us %.us-phi101 = phi double [ 0.000000e+00, %for.cond13.preheader.split.us ], [ %add39.us, %if.end38.us ], [ %result.1, %for.cond40.for.end47_crit_edge ] ret double %.us-phi101 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local double @get_infinity_distance(i32 noundef %n, ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) local_unnamed_addr #2 { entry: %cmp14 = icmp sgt i32 %n, 0 br i1 %cmp14, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader22, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %vec.phi18 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %0 = getelementptr inbounds i32, ptr %x, i64 %index %wide.load = load <4 x i32>, ptr %0, align 4, !tbaa !5 %1 = getelementptr inbounds i32, ptr %0, i64 4 %wide.load19 = load <4 x i32>, ptr %1, align 4, !tbaa !5 %2 = getelementptr inbounds i32, ptr %y, i64 %index %wide.load20 = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 %wide.load21 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = sub nsw <4 x i32> %wide.load, %wide.load20 %5 = sub nsw <4 x i32> %wide.load19, %wide.load21 %6 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %4, i1 true) %7 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %5, i1 true) %8 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %6, <4 x i32> %vec.phi) %9 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %7, <4 x i32> %vec.phi18) %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !23 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %8, <4 x i32> %9) %11 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end.loopexit, label %for.body.preheader22 for.body.preheader22: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %result.015.ph = phi i32 [ 0, %for.body.preheader ], [ %11, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader22, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader22 ] %result.015 = phi i32 [ %result.1, %for.body ], [ %result.015.ph, %for.body.preheader22 ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %12 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %13 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %12, %13 %spec.select = tail call i32 @llvm.abs.i32(i32 %sub, i1 true) %result.1 = tail call i32 @llvm.smax.i32(i32 %spec.select, i32 %result.015) %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.loopexit, label %for.body, !llvm.loop !26 for.end.loopexit: ; preds = %for.body, %middle.block %result.1.lcssa = phi i32 [ %11, %middle.block ], [ %result.1, %for.body ] %14 = sitofp i32 %result.1.lcssa to double br label %for.end for.end: ; preds = %for.end.loopexit, %entry %result.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %14, %for.end.loopexit ] ret double %result.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %xy = alloca [2 x [100 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %xy) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = icmp sgt i32 %0, 0 br i1 %1, label %for.body3, label %for.cond8.preheader for.cond8.preheader: ; preds = %for.body3.1, %for.inc5, %entry %2 = phi i32 [ %0, %entry ], [ %6, %for.inc5 ], [ %8, %for.body3.1 ] %arrayidx13 = getelementptr inbounds [2 x [100 x i32]], ptr %xy, i64 0, i64 1 %call15 = call double @get_normal_distance(i32 noundef 1, i32 noundef %2, ptr noundef nonnull %xy, ptr noundef nonnull %arrayidx13) %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call15) %3 = load i32, ptr %n, align 4, !tbaa !5 %call15.1 = call double @get_normal_distance(i32 noundef 2, i32 noundef %3, ptr noundef nonnull %xy, ptr noundef nonnull %arrayidx13) %call16.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call15.1) %4 = load i32, ptr %n, align 4, !tbaa !5 %call15.2 = call double @get_normal_distance(i32 noundef 3, i32 noundef %4, ptr noundef nonnull %xy, ptr noundef nonnull %arrayidx13) %call16.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call15.2) %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp14.i = icmp sgt i32 %5, 0 br i1 %cmp14.i, label %for.body.preheader.i, label %get_infinity_distance.exit for.body3: ; preds = %entry, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %xy, i64 %indvars.iv %call4 = 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, !tbaa !5 %7 = sext i32 %6 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp2, label %for.body3, label %for.inc5, !llvm.loop !27 for.inc5: ; preds = %for.body3 %cmp233.1 = icmp sgt i32 %6, 0 br i1 %cmp233.1, label %for.body3.lr.ph.1, label %for.cond8.preheader for.body3.lr.ph.1: ; preds = %for.inc5 %arrayidx.1 = getelementptr inbounds [2 x [100 x i32]], ptr %xy, i64 0, i64 1 br label %for.body3.1 for.body3.1: ; preds = %for.body3.1, %for.body3.lr.ph.1 %indvars.iv.1 = phi i64 [ 0, %for.body3.lr.ph.1 ], [ %indvars.iv.next.1, %for.body3.1 ] %add.ptr.1 = getelementptr inbounds i32, ptr %arrayidx.1, i64 %indvars.iv.1 %call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.1) %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2.1 = icmp slt i64 %indvars.iv.next.1, %9 br i1 %cmp2.1, label %for.body3.1, label %for.cond8.preheader, !llvm.loop !27 for.body.preheader.i: ; preds = %for.cond8.preheader %wide.trip.count.i = zext i32 %5 to i64 %min.iters.check = icmp ult i32 %5, 8 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, 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 ], [ %18, %vector.body ] %vec.phi44 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ] %10 = getelementptr inbounds i32, ptr %xy, i64 %index %wide.load = load <4 x i32>, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 %wide.load45 = load <4 x i32>, ptr %11, align 16, !tbaa !5 %12 = getelementptr inbounds i32, ptr %arrayidx13, i64 %index %wide.load46 = load <4 x i32>, ptr %12, align 16, !tbaa !5 %13 = getelementptr inbounds i32, ptr %12, i64 4 %wide.load47 = load <4 x i32>, ptr %13, align 16, !tbaa !5 %14 = sub nsw <4 x i32> %wide.load, %wide.load46 %15 = sub nsw <4 x i32> %wide.load45, %wide.load47 %16 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %14, i1 true) %17 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %15, i1 true) %18 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %16, <4 x i32> %vec.phi) %19 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %17, <4 x i32> %vec.phi44) %index.next = add nuw i64 %index, 8 %20 = icmp eq i64 %index.next, %n.vec br i1 %20, label %middle.block, label %vector.body, !llvm.loop !28 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %18, <4 x i32> %19) %21 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i br i1 %cmp.n, label %for.end.loopexit.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 ] %result.015.i.ph = phi i32 [ 0, %for.body.preheader.i ], [ %21, %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 ] %result.015.i = phi i32 [ %result.1.i, %for.body.i ], [ %result.015.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds i32, ptr %xy, i64 %indvars.iv.i %22 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %arrayidx2.i = getelementptr inbounds i32, ptr %arrayidx13, i64 %indvars.iv.i %23 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %sub.i = sub nsw i32 %22, %23 %spec.select.i = call i32 @llvm.abs.i32(i32 %sub.i, i1 true) %result.1.i = call i32 @llvm.smax.i32(i32 %spec.select.i, i32 %result.015.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 %for.end.loopexit.i, label %for.body.i, !llvm.loop !29 for.end.loopexit.i: ; preds = %for.body.i, %middle.block %result.1.i.lcssa = phi i32 [ %21, %middle.block ], [ %result.1.i, %for.body.i ] %24 = sitofp i32 %result.1.i.lcssa to double br label %get_infinity_distance.exit get_infinity_distance.exit: ; preds = %for.cond8.preheader, %for.end.loopexit.i %result.0.lcssa.i = phi double [ 0.000000e+00, %for.cond8.preheader ], [ %24, %for.end.loopexit.i ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %result.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %xy) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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.abs.i32(i32, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #5 attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !14} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !14} !19 = distinct !{!19, !14} !20 = distinct !{!20, !14} !21 = distinct !{!21, !10} !22 = distinct !{!22, !14} !23 = distinct !{!23, !10, !24, !25} !24 = !{!"llvm.loop.isvectorized", i32 1} !25 = !{!"llvm.loop.unroll.runtime.disable"} !26 = distinct !{!26, !10, !25, !24} !27 = distinct !{!27, !10} !28 = distinct !{!28, !10, !24, !25} !29 = distinct !{!29, !10, !25, !24}
#define _CRT_SECURE_NO_WARNINGS #define debug #include <stdio.h> #include <inttypes.h> #include <stdlib.h> #include <string.h> #include <math.h> typedef uint64_t uint64; typedef uint32_t uint32; typedef uint8_t uint8; typedef int64_t int64; typedef int32_t int32; typedef int8_t int8; #define finc(i,a,b) for(uint32 i=(a);i<=(b);i++) #define fdec(i,a,b) for(uint32 i=(b)+1;i-->(a);) #define in(i,bits) scanf("%"PRId##bits"",&i) #define uin(i,bits) scanf("%"PRIu##bits"",&i) #define out(i,bits,c) printf("%"PRId##bits"%c",i,c) #define uout(i,bits,c) printf("%"PRIu##bits"%c",i,c) #define end '\n' uint32 arr[100 + 1]; int main(void) { uint32 test; uin(test, 32); while (test--) { uint32 n, m; uin(n, 32); uin(m, 32); finc(i, 1, n) uin(arr[i], 32); uint32 sum = 0; finc(i, 1, n) sum += arr[i]; if (sum == m) printf("YES"); else printf("NO"); putchar(end); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26585/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26585/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%u\00", align 1 @arr = dso_local global [101 x i32] zeroinitializer, align 16 @.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 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %test = alloca i32, align 4 %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %test) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %test) %0 = load i32, ptr %test, align 4, !tbaa !5 %dec29 = add i32 %0, -1 store i32 %dec29, ptr %test, align 4, !tbaa !5 %tobool.not30 = icmp eq i32 %0, 0 br i1 %tobool.not30, label %while.end, label %while.body while.body: ; preds = %entry, %for.cond.cleanup7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not23 = icmp eq i32 %1, 0 br i1 %cmp.not23, label %for.cond.cleanup7, label %for.body for.cond5.preheader: ; preds = %for.body %cmp6.not25 = icmp eq i32 %10, 0 br i1 %cmp6.not25, label %for.cond.cleanup7, label %for.body8.preheader for.body8.preheader: ; preds = %for.cond5.preheader %2 = add nuw i32 %10, 1 %wide.trip.count = zext i32 %2 to i64 %3 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %10, 8 br i1 %min.iters.check, label %for.body8.preheader37, label %vector.ph vector.ph: ; preds = %for.body8.preheader %n.vec = and i64 %3, -8 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi35 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %offset.idx = or i64 %index, 1 %4 = getelementptr inbounds [101 x i32], ptr @arr, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load36 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = add <4 x i32> %wide.load, %vec.phi %7 = add <4 x i32> %wide.load36, %vec.phi35 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %3, %n.vec br i1 %cmp.n, label %for.cond.cleanup7, label %for.body8.preheader37 for.body8.preheader37: ; preds = %for.body8.preheader, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body8.preheader ], [ %ind.end, %middle.block ] %sum.026.ph = phi i32 [ 0, %for.body8.preheader ], [ %9, %middle.block ] br label %for.body8 for.body: ; preds = %while.body, %for.body %i.024 = phi i32 [ %inc, %for.body ], [ 1, %while.body ] %idxprom = zext i32 %i.024 to i64 %arrayidx = getelementptr inbounds [101 x i32], ptr @arr, i64 0, i64 %idxprom %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %inc = add i32 %i.024, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not = icmp ugt i32 %inc, %10 br i1 %cmp.not, label %for.cond5.preheader, label %for.body, !llvm.loop !13 for.cond.cleanup7: ; preds = %for.body8, %middle.block, %while.body, %for.cond5.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %while.body ], [ %9, %middle.block ], [ %add, %for.body8 ] %11 = load i32, ptr %m, align 4, !tbaa !5 %cmp14 = icmp eq i32 %sum.0.lcssa, %11 %.str.1..str.2 = select i1 %cmp14, ptr @.str.1, ptr @.str.2 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) %12 = load ptr, ptr @stdout, align 8, !tbaa !14 %call.i = call i32 @putc(i32 noundef 10, ptr noundef %12) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 %13 = load i32, ptr %test, align 4, !tbaa !5 %dec = add i32 %13, -1 store i32 %dec, ptr %test, align 4, !tbaa !5 %tobool.not = icmp eq i32 %13, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !16 for.body8: ; preds = %for.body8.preheader37, %for.body8 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body8 ], [ %indvars.iv.ph, %for.body8.preheader37 ] %sum.026 = phi i32 [ %add, %for.body8 ], [ %sum.026.ph, %for.body8.preheader37 ] %arrayidx10 = getelementptr inbounds [101 x i32], ptr @arr, i64 0, i64 %indvars.iv %14 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %add = add i32 %14, %sum.026 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond, label %for.cond.cleanup7, label %for.body8, !llvm.loop !17 while.end: ; preds = %for.cond.cleanup7, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %test) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; 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 = !{!15, !15, i64 0} !15 = !{!"any pointer", !7, i64 0} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !12, !11}
#include <stdio.h> #include <math.h> int main() { double A[100]; double d, p1, p2, p3, max; int n, i; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%lf", &A[i]); p1 = 0.0; p2 = 0.0; p3 = 0.0; max = 0.0; for (i = 0; i < n; i++) { scanf("%lf", &d); d -= A[i]; if (d < 0) d *= -1; p1 += d; p2 += d * d; p3 += d * d * d; if (d > max) max = d; } p2 = sqrt(p2); p3 = pow(p3, 1.0 / 3.0); printf("%.5lf\n", p1); printf("%.5lf\n", p2); printf("%.5lf\n", p3); printf("%.5lf\n", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265907/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265907/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%.5lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca [100 x double], align 16 %d = alloca double, align 8 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %A) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp35 = icmp sgt i32 %0, 0 br i1 %cmp35, label %for.body, label %for.end17 for.cond2.preheader: ; preds = %for.body %1 = icmp sgt i32 %2, 0 br i1 %1, label %for.body4, label %for.end17 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x double], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv48 = phi i64 [ %indvars.iv.next49, %for.body4 ], [ 0, %for.cond2.preheader ] %max.041 = phi double [ %max.1, %for.body4 ], [ 0.000000e+00, %for.cond2.preheader ] %p1.038 = phi double [ %add, %for.body4 ], [ 0.000000e+00, %for.cond2.preheader ] %4 = phi <2 x double> [ %10, %for.body4 ], [ zeroinitializer, %for.cond2.preheader ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %d) %arrayidx7 = getelementptr inbounds [100 x double], ptr %A, i64 0, i64 %indvars.iv48 %5 = load double, ptr %arrayidx7, align 8, !tbaa !11 %6 = load double, ptr %d, align 8, !tbaa !11 %sub = fsub double %6, %5 %cmp8 = fcmp olt double %sub, 0.000000e+00 %mul = fneg double %sub %storemerge = select i1 %cmp8, double %mul, double %sub store double %storemerge, ptr %d, align 8, !tbaa !11 %add = fadd double %p1.038, %storemerge %mul10 = fmul double %storemerge, %storemerge %7 = insertelement <2 x double> poison, double %storemerge, i64 0 %8 = insertelement <2 x double> %7, double %mul10, i64 1 %9 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer %10 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %8, <2 x double> %9, <2 x double> %4) %cmp12 = fcmp ogt double %storemerge, %max.041 %max.1 = select i1 %cmp12, double %storemerge, double %max.041 %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1 %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp3 = icmp slt i64 %indvars.iv.next49, %12 br i1 %cmp3, label %for.body4, label %for.end17, !llvm.loop !13 for.end17: ; preds = %for.body4, %entry, %for.cond2.preheader %p1.0.lcssa = phi double [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add, %for.body4 ] %max.0.lcssa = phi double [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %max.1, %for.body4 ] %13 = phi <2 x double> [ zeroinitializer, %for.cond2.preheader ], [ zeroinitializer, %entry ], [ %10, %for.body4 ] %14 = extractelement <2 x double> %13, i64 0 %call18 = call double @sqrt(double noundef %14) #5 %15 = extractelement <2 x double> %13, i64 1 %call19 = call double @pow(double noundef %15, double noundef 0x3FD5555555555555) #5 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %p1.0.lcssa) %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %call18) %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %call19) %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %A) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress 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 <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x 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 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 = { 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 = !{!12, !12, i64 0} !12 = !{!"double", !7, i64 0} !13 = distinct !{!13, !10}
#include <stdio.h> #include <math.h> int main() { int input_n; int vector_x[100], vector_y[100]; double xy_fabs = 0; double d_xy_p1 = 0, d_xy_p2 = 0, d_xy_p3 = 0, d_xy_pinf = 0; int counter_i; scanf("%d", &input_n); for(counter_i = 0 ; counter_i < input_n ; counter_i++) scanf("%d", &vector_x[counter_i]); for(counter_i = 0 ; counter_i < input_n ; counter_i++) { scanf("%d", &vector_y[counter_i]); xy_fabs = fabs(vector_x[counter_i] - vector_y[counter_i]); d_xy_p1 = d_xy_p1 + xy_fabs; d_xy_p2 = d_xy_p2 + pow(xy_fabs, 2.0); d_xy_p3 = d_xy_p3 + pow(xy_fabs, 3.0); if(d_xy_pinf < xy_fabs) d_xy_pinf = xy_fabs; } d_xy_p2 = sqrt(d_xy_p2); d_xy_p3 = pow(d_xy_p3, 1.0/3.0); printf("%lf\n", d_xy_p1); printf("%lf\n", d_xy_p2); printf("%lf\n", d_xy_p3); printf("%lf\n", d_xy_pinf); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265958/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265958/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %input_n = alloca i32, align 4 %vector_x = alloca [100 x i32], align 16 %vector_y = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input_n) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %vector_x) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %vector_y) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input_n) %0 = load i32, ptr %input_n, align 4, !tbaa !5 %cmp44 = icmp sgt i32 %0, 0 br i1 %cmp44, label %for.body, label %for.end20 for.cond2.preheader: ; preds = %for.body %1 = icmp sgt i32 %2, 0 br i1 %1, label %for.body4, label %for.end20 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %vector_x, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %input_n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body4 ], [ 0, %for.cond2.preheader ] %d_xy_pinf.050 = phi double [ %d_xy_pinf.1, %for.body4 ], [ 0.000000e+00, %for.cond2.preheader ] %d_xy_p3.049 = phi double [ %add15, %for.body4 ], [ 0.000000e+00, %for.cond2.preheader ] %d_xy_p2.048 = phi double [ %add13, %for.body4 ], [ 0.000000e+00, %for.cond2.preheader ] %d_xy_p1.047 = phi double [ %add, %for.body4 ], [ 0.000000e+00, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [100 x i32], ptr %vector_y, i64 0, i64 %indvars.iv56 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6) %arrayidx9 = getelementptr inbounds [100 x i32], ptr %vector_x, i64 0, i64 %indvars.iv56 %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %5 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %sub = sub nsw i32 %4, %5 %conv = sitofp i32 %sub to double %6 = call double @llvm.fabs.f64(double %conv) %add = fadd double %d_xy_p1.047, %6 %square = fmul double %conv, %conv %add13 = fadd double %d_xy_p2.048, %square %call14 = call double @pow(double noundef %6, double noundef 3.000000e+00) #5 %add15 = fadd double %d_xy_p3.049, %call14 %cmp16 = fcmp olt double %d_xy_pinf.050, %6 %d_xy_pinf.1 = select i1 %cmp16, double %6, double %d_xy_pinf.050 %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1 %7 = load i32, ptr %input_n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp3 = icmp slt i64 %indvars.iv.next57, %8 br i1 %cmp3, label %for.body4, label %for.end20, !llvm.loop !11 for.end20: ; preds = %for.body4, %entry, %for.cond2.preheader %d_xy_p1.0.lcssa = phi double [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add, %for.body4 ] %d_xy_p2.0.lcssa = phi double [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add13, %for.body4 ] %d_xy_p3.0.lcssa = phi double [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add15, %for.body4 ] %d_xy_pinf.0.lcssa = phi double [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %d_xy_pinf.1, %for.body4 ] %call21 = call double @sqrt(double noundef %d_xy_p2.0.lcssa) #5 %call22 = call double @pow(double noundef %d_xy_p3.0.lcssa, double noundef 0x3FD5555555555555) #5 %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %d_xy_p1.0.lcssa) %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call21) %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call22) %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %d_xy_pinf.0.lcssa) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %vector_y) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %vector_x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input_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.fabs.f64(double) #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <math.h> #define N 101 double Minkowski_p1(int, int *, int *); double Minkowski_p2(int, int *, int *); double Minkowski_p3(int, int *, int *); double Minkowski_pinf(int, int *, int *); int main() { int i, n, x[N], y[N]; double p1, p2, p3, pinf; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &x[i]); } for (i = 0; i < n; i++) { scanf("%d", &y[i]); } p1 = Minkowski_p1(n, x, y); p2 = Minkowski_p2(n, x, y); p3 = Minkowski_p3(n, x, y); pinf = Minkowski_pinf(n, x, y); printf("%f\n%f\n%f\n%f\n", p1, p2, p3, pinf); return 0; } double Minkowski_p1(int n, int *x, int *y) { int i; double ans = 0; for (i = 0; i < n; i++) { ans += fabs(x[i] - y[i]); } return ans; } double Minkowski_p2(int n, int *x, int *y) { int i; double ans = 0; for (i = 0; i < n; i++) { ans += (x[i] - y[i]) * (x[i] - y[i]); } return sqrt(ans); } double Minkowski_p3(int n, int *x, int *y) { int i; double ans = 0; for (i = 0; i < n; i++) { ans += (x[i] - y[i]) * (x[i] - y[i]) * fabs(x[i] - y[i]); } return pow(ans, (double)1/3); } double Minkowski_pinf(int n, int *x, int *y) { int i; double max = -1; for (i = 0; i < n; i++) { if (fabs(x[i] - y[i]) > max) { max = fabs(x[i] - y[i]); } } return max; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266021/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266021/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%f\0A%f\0A%f\0A%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca [101 x i32], align 16 %y = alloca [101 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %x) #7 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %y) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp67 = icmp sgt i32 %0, 0 br i1 %cmp67, label %for.body, label %Minkowski_p2.exit for.cond2.preheader: ; preds = %for.body %cmp369 = icmp sgt i32 %1, 0 br i1 %cmp369, label %for.body4, label %Minkowski_p2.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x i32], ptr %x, 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.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv74 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6) %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1 %.pr = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %.pr to i64 %cmp3 = icmp slt i64 %indvars.iv.next75, %3 br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !11 for.end10: ; preds = %for.body4 %cmp7.i = icmp sgt i32 %.pr, 0 br i1 %cmp7.i, label %for.body.preheader.i, label %Minkowski_p2.exit for.body.preheader.i: ; preds = %for.end10 %wide.trip.count.i = zext i32 %.pr to i64 %4 = add nsw i64 %wide.trip.count.i, -1 %xtraiter = and i64 %wide.trip.count.i, 1 %5 = icmp eq i64 %4, 0 br i1 %5, label %for.body.i31.preheader.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = and i64 %wide.trip.count.i, 4294967294 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.body.i ] %ans.09.i = phi double [ 0.000000e+00, %for.body.preheader.i.new ], [ %add.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ] %arrayidx.i = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.i %6 = load i32, ptr %arrayidx.i, align 8, !tbaa !5 %arrayidx2.i = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.i %7 = load i32, ptr %arrayidx2.i, align 8, !tbaa !5 %sub.i = sub nsw i32 %6, %7 %conv.i = sitofp i32 %sub.i to double %8 = call double @llvm.fabs.f64(double %conv.i) %add.i = fadd double %ans.09.i, %8 %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next.i %9 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5 %arrayidx2.i.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next.i %10 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5 %sub.i.1 = sub nsw i32 %9, %10 %conv.i.1 = sitofp i32 %sub.i.1 to double %11 = call double @llvm.fabs.f64(double %conv.i.1) %add.i.1 = fadd double %add.i, %11 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.body.i31.preheader.unr-lcssa, label %for.body.i, !llvm.loop !12 for.body.i31.preheader.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i %add.i.lcssa.ph = phi double [ undef, %for.body.preheader.i ], [ %add.i.1, %for.body.i ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.body.i ] %ans.09.i.unr = phi double [ 0.000000e+00, %for.body.preheader.i ], [ %add.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.i31.preheader, label %for.body.i.epil for.body.i.epil: ; preds = %for.body.i31.preheader.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.i.unr %12 = load i32, ptr %arrayidx.i.epil, align 4, !tbaa !5 %arrayidx2.i.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.i.unr %13 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5 %sub.i.epil = sub nsw i32 %12, %13 %conv.i.epil = sitofp i32 %sub.i.epil to double %14 = call double @llvm.fabs.f64(double %conv.i.epil) %add.i.epil = fadd double %ans.09.i.unr, %14 br label %for.body.i31.preheader for.body.i31.preheader: ; preds = %for.body.i31.preheader.unr-lcssa, %for.body.i.epil %add.i.lcssa = phi double [ %add.i.lcssa.ph, %for.body.i31.preheader.unr-lcssa ], [ %add.i.epil, %for.body.i.epil ] %xtraiter85 = and i64 %wide.trip.count.i, 1 %15 = icmp eq i64 %4, 0 br i1 %15, label %Minkowski_p2.exit.loopexit.unr-lcssa, label %for.body.i31.preheader.new for.body.i31.preheader.new: ; preds = %for.body.i31.preheader %unroll_iter88 = and i64 %wide.trip.count.i, 4294967294 br label %for.body.i31 for.body.i31: ; preds = %for.body.i31, %for.body.i31.preheader.new %indvars.iv.i32 = phi i64 [ 0, %for.body.i31.preheader.new ], [ %indvars.iv.next.i38.1, %for.body.i31 ] %ans.018.i = phi double [ 0.000000e+00, %for.body.i31.preheader.new ], [ %add.i37.1, %for.body.i31 ] %niter89 = phi i64 [ 0, %for.body.i31.preheader.new ], [ %niter89.next.1, %for.body.i31 ] %arrayidx.i33 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.i32 %16 = load i32, ptr %arrayidx.i33, align 8, !tbaa !5 %arrayidx2.i34 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.i32 %17 = load i32, ptr %arrayidx2.i34, align 8, !tbaa !5 %sub.i35 = sub nsw i32 %16, %17 %mul.i = mul nsw i32 %sub.i35, %sub.i35 %conv.i36 = sitofp i32 %mul.i to double %add.i37 = fadd double %ans.018.i, %conv.i36 %indvars.iv.next.i38 = or i64 %indvars.iv.i32, 1 %arrayidx.i33.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next.i38 %18 = load i32, ptr %arrayidx.i33.1, align 4, !tbaa !5 %arrayidx2.i34.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next.i38 %19 = load i32, ptr %arrayidx2.i34.1, align 4, !tbaa !5 %sub.i35.1 = sub nsw i32 %18, %19 %mul.i.1 = mul nsw i32 %sub.i35.1, %sub.i35.1 %conv.i36.1 = sitofp i32 %mul.i.1 to double %add.i37.1 = fadd double %add.i37, %conv.i36.1 %indvars.iv.next.i38.1 = add nuw nsw i64 %indvars.iv.i32, 2 %niter89.next.1 = add i64 %niter89, 2 %niter89.ncmp.1 = icmp eq i64 %niter89.next.1, %unroll_iter88 br i1 %niter89.ncmp.1, label %Minkowski_p2.exit.loopexit.unr-lcssa, label %for.body.i31, !llvm.loop !13 Minkowski_p2.exit.loopexit.unr-lcssa: ; preds = %for.body.i31, %for.body.i31.preheader %add.i37.lcssa.ph = phi double [ undef, %for.body.i31.preheader ], [ %add.i37.1, %for.body.i31 ] %indvars.iv.i32.unr = phi i64 [ 0, %for.body.i31.preheader ], [ %indvars.iv.next.i38.1, %for.body.i31 ] %ans.018.i.unr = phi double [ 0.000000e+00, %for.body.i31.preheader ], [ %add.i37.1, %for.body.i31 ] %lcmp.mod86.not = icmp eq i64 %xtraiter85, 0 br i1 %lcmp.mod86.not, label %Minkowski_p2.exit, label %for.body.i31.epil for.body.i31.epil: ; preds = %Minkowski_p2.exit.loopexit.unr-lcssa %arrayidx.i33.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.i32.unr %20 = load i32, ptr %arrayidx.i33.epil, align 4, !tbaa !5 %arrayidx2.i34.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.i32.unr %21 = load i32, ptr %arrayidx2.i34.epil, align 4, !tbaa !5 %sub.i35.epil = sub nsw i32 %20, %21 %mul.i.epil = mul nsw i32 %sub.i35.epil, %sub.i35.epil %conv.i36.epil = sitofp i32 %mul.i.epil to double %add.i37.epil = fadd double %ans.018.i.unr, %conv.i36.epil br label %Minkowski_p2.exit Minkowski_p2.exit: ; preds = %for.body.i31.epil, %Minkowski_p2.exit.loopexit.unr-lcssa, %entry, %for.cond2.preheader, %for.end10 %ans.0.lcssa.i64 = phi double [ 0.000000e+00, %for.end10 ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add.i.lcssa, %Minkowski_p2.exit.loopexit.unr-lcssa ], [ %add.i.lcssa, %for.body.i31.epil ] %ans.0.lcssa.i28 = phi double [ 0.000000e+00, %for.end10 ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add.i37.lcssa.ph, %Minkowski_p2.exit.loopexit.unr-lcssa ], [ %add.i37.epil, %for.body.i31.epil ] %call.i = call double @sqrt(double noundef %ans.0.lcssa.i28) #7 %22 = load i32, ptr %n, align 4, !tbaa !5 %cmp27.i = icmp sgt i32 %22, 0 br i1 %cmp27.i, label %for.body.preheader.i42, label %Minkowski_p3.exit for.body.preheader.i42: ; preds = %Minkowski_p2.exit %wide.trip.count.i43 = zext i32 %22 to i64 %xtraiter90 = and i64 %wide.trip.count.i43, 1 %23 = icmp eq i32 %22, 1 br i1 %23, label %Minkowski_p3.exit.loopexit.unr-lcssa, label %for.body.preheader.i42.new for.body.preheader.i42.new: ; preds = %for.body.preheader.i42 %unroll_iter93 = and i64 %wide.trip.count.i43, 4294967294 br label %for.body.i44 for.body.i44: ; preds = %for.body.i44, %for.body.preheader.i42.new %indvars.iv.i45 = phi i64 [ 0, %for.body.preheader.i42.new ], [ %indvars.iv.next.i51.1, %for.body.i44 ] %ans.029.i = phi double [ 0.000000e+00, %for.body.preheader.i42.new ], [ %31, %for.body.i44 ] %niter94 = phi i64 [ 0, %for.body.preheader.i42.new ], [ %niter94.next.1, %for.body.i44 ] %arrayidx.i46 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.i45 %24 = load i32, ptr %arrayidx.i46, align 8, !tbaa !5 %arrayidx2.i47 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.i45 %25 = load i32, ptr %arrayidx2.i47, align 8, !tbaa !5 %sub.i48 = sub nsw i32 %24, %25 %mul.i49 = mul nsw i32 %sub.i48, %sub.i48 %conv.i50 = sitofp i32 %mul.i49 to double %conv13.i = sitofp i32 %sub.i48 to double %26 = call double @llvm.fabs.f64(double %conv13.i) %27 = call double @llvm.fmuladd.f64(double %conv.i50, double %26, double %ans.029.i) %indvars.iv.next.i51 = or i64 %indvars.iv.i45, 1 %arrayidx.i46.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next.i51 %28 = load i32, ptr %arrayidx.i46.1, align 4, !tbaa !5 %arrayidx2.i47.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next.i51 %29 = load i32, ptr %arrayidx2.i47.1, align 4, !tbaa !5 %sub.i48.1 = sub nsw i32 %28, %29 %mul.i49.1 = mul nsw i32 %sub.i48.1, %sub.i48.1 %conv.i50.1 = sitofp i32 %mul.i49.1 to double %conv13.i.1 = sitofp i32 %sub.i48.1 to double %30 = call double @llvm.fabs.f64(double %conv13.i.1) %31 = call double @llvm.fmuladd.f64(double %conv.i50.1, double %30, double %27) %indvars.iv.next.i51.1 = add nuw nsw i64 %indvars.iv.i45, 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 %Minkowski_p3.exit.loopexit.unr-lcssa, label %for.body.i44, !llvm.loop !14 Minkowski_p3.exit.loopexit.unr-lcssa: ; preds = %for.body.i44, %for.body.preheader.i42 %.lcssa.ph = phi double [ undef, %for.body.preheader.i42 ], [ %31, %for.body.i44 ] %indvars.iv.i45.unr = phi i64 [ 0, %for.body.preheader.i42 ], [ %indvars.iv.next.i51.1, %for.body.i44 ] %ans.029.i.unr = phi double [ 0.000000e+00, %for.body.preheader.i42 ], [ %31, %for.body.i44 ] %lcmp.mod91.not = icmp eq i64 %xtraiter90, 0 br i1 %lcmp.mod91.not, label %Minkowski_p3.exit, label %for.body.i44.epil for.body.i44.epil: ; preds = %Minkowski_p3.exit.loopexit.unr-lcssa %arrayidx.i46.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.i45.unr %32 = load i32, ptr %arrayidx.i46.epil, align 4, !tbaa !5 %arrayidx2.i47.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.i45.unr %33 = load i32, ptr %arrayidx2.i47.epil, align 4, !tbaa !5 %sub.i48.epil = sub nsw i32 %32, %33 %mul.i49.epil = mul nsw i32 %sub.i48.epil, %sub.i48.epil %conv.i50.epil = sitofp i32 %mul.i49.epil to double %conv13.i.epil = sitofp i32 %sub.i48.epil to double %34 = call double @llvm.fabs.f64(double %conv13.i.epil) %35 = call double @llvm.fmuladd.f64(double %conv.i50.epil, double %34, double %ans.029.i.unr) br label %Minkowski_p3.exit Minkowski_p3.exit: ; preds = %for.body.i44.epil, %Minkowski_p3.exit.loopexit.unr-lcssa, %Minkowski_p2.exit %ans.0.lcssa.i40 = phi double [ 0.000000e+00, %Minkowski_p2.exit ], [ %.lcssa.ph, %Minkowski_p3.exit.loopexit.unr-lcssa ], [ %35, %for.body.i44.epil ] %call.i41 = call double @pow(double noundef %ans.0.lcssa.i40, double noundef 0x3FD5555555555555) #7 %36 = load i32, ptr %n, align 4, !tbaa !5 %cmp19.i = icmp sgt i32 %36, 0 br i1 %cmp19.i, label %for.body.preheader.i53, label %Minkowski_pinf.exit for.body.preheader.i53: ; preds = %Minkowski_p3.exit %wide.trip.count.i54 = zext i32 %36 to i64 %xtraiter95 = and i64 %wide.trip.count.i54, 1 %37 = icmp eq i32 %36, 1 br i1 %37, label %Minkowski_pinf.exit.loopexit.unr-lcssa, label %for.body.preheader.i53.new for.body.preheader.i53.new: ; preds = %for.body.preheader.i53 %unroll_iter98 = and i64 %wide.trip.count.i54, 4294967294 br label %for.body.i55 for.body.i55: ; preds = %for.body.i55, %for.body.preheader.i53.new %indvars.iv.i56 = phi i64 [ 0, %for.body.preheader.i53.new ], [ %indvars.iv.next.i61.1, %for.body.i55 ] %max.021.i = phi double [ -1.000000e+00, %for.body.preheader.i53.new ], [ %max.1.i.1, %for.body.i55 ] %niter99 = phi i64 [ 0, %for.body.preheader.i53.new ], [ %niter99.next.1, %for.body.i55 ] %arrayidx.i57 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.i56 %38 = load i32, ptr %arrayidx.i57, align 8, !tbaa !5 %arrayidx2.i58 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.i56 %39 = load i32, ptr %arrayidx2.i58, align 8, !tbaa !5 %sub.i59 = sub nsw i32 %38, %39 %conv.i60 = sitofp i32 %sub.i59 to double %40 = call double @llvm.fabs.f64(double %conv.i60) %cmp3.i = fcmp ogt double %40, %max.021.i %max.1.i = select i1 %cmp3.i, double %40, double %max.021.i %indvars.iv.next.i61 = or i64 %indvars.iv.i56, 1 %arrayidx.i57.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next.i61 %41 = load i32, ptr %arrayidx.i57.1, align 4, !tbaa !5 %arrayidx2.i58.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next.i61 %42 = load i32, ptr %arrayidx2.i58.1, align 4, !tbaa !5 %sub.i59.1 = sub nsw i32 %41, %42 %conv.i60.1 = sitofp i32 %sub.i59.1 to double %43 = call double @llvm.fabs.f64(double %conv.i60.1) %cmp3.i.1 = fcmp ogt double %43, %max.1.i %max.1.i.1 = select i1 %cmp3.i.1, double %43, double %max.1.i %indvars.iv.next.i61.1 = add nuw nsw i64 %indvars.iv.i56, 2 %niter99.next.1 = add i64 %niter99, 2 %niter99.ncmp.1 = icmp eq i64 %niter99.next.1, %unroll_iter98 br i1 %niter99.ncmp.1, label %Minkowski_pinf.exit.loopexit.unr-lcssa, label %for.body.i55, !llvm.loop !15 Minkowski_pinf.exit.loopexit.unr-lcssa: ; preds = %for.body.i55, %for.body.preheader.i53 %max.1.i.lcssa.ph = phi double [ undef, %for.body.preheader.i53 ], [ %max.1.i.1, %for.body.i55 ] %indvars.iv.i56.unr = phi i64 [ 0, %for.body.preheader.i53 ], [ %indvars.iv.next.i61.1, %for.body.i55 ] %max.021.i.unr = phi double [ -1.000000e+00, %for.body.preheader.i53 ], [ %max.1.i.1, %for.body.i55 ] %lcmp.mod96.not = icmp eq i64 %xtraiter95, 0 br i1 %lcmp.mod96.not, label %Minkowski_pinf.exit, label %for.body.i55.epil for.body.i55.epil: ; preds = %Minkowski_pinf.exit.loopexit.unr-lcssa %arrayidx.i57.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.i56.unr %44 = load i32, ptr %arrayidx.i57.epil, align 4, !tbaa !5 %arrayidx2.i58.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.i56.unr %45 = load i32, ptr %arrayidx2.i58.epil, align 4, !tbaa !5 %sub.i59.epil = sub nsw i32 %44, %45 %conv.i60.epil = sitofp i32 %sub.i59.epil to double %46 = call double @llvm.fabs.f64(double %conv.i60.epil) %cmp3.i.epil = fcmp ogt double %46, %max.021.i.unr %max.1.i.epil = select i1 %cmp3.i.epil, double %46, double %max.021.i.unr br label %Minkowski_pinf.exit Minkowski_pinf.exit: ; preds = %for.body.i55.epil, %Minkowski_pinf.exit.loopexit.unr-lcssa, %Minkowski_p3.exit %max.0.lcssa.i = phi double [ -1.000000e+00, %Minkowski_p3.exit ], [ %max.1.i.lcssa.ph, %Minkowski_pinf.exit.loopexit.unr-lcssa ], [ %max.1.i.epil, %for.body.i55.epil ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %ans.0.lcssa.i64, double noundef %call.i, double noundef %call.i41, double noundef %max.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %y) #7 call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %x) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local double @Minkowski_p1(i32 noundef %n, ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) local_unnamed_addr #3 { entry: %cmp7 = icmp sgt i32 %n, 0 br i1 %cmp7, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %n, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %ans.09 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %add.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %conv = sitofp i32 %sub to double %3 = tail call double @llvm.fabs.f64(double %conv) %add = fadd double %ans.09, %3 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next %5 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %4, %5 %conv.1 = sitofp i32 %sub.1 to double %6 = tail call double @llvm.fabs.f64(double %conv.1) %add.1 = fadd double %add, %6 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !12 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %add.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %add.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %ans.09.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %add.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.unr %7 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %arrayidx2.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.unr %8 = load i32, ptr %arrayidx2.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %7, %8 %conv.epil = sitofp i32 %sub.epil to double %9 = tail call double @llvm.fabs.f64(double %conv.epil) %add.epil = fadd double %ans.09.unr, %9 br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %ans.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ] ret double %ans.0.lcssa } ; Function Attrs: nofree nounwind memory(write, argmem: readwrite) uwtable define dso_local double @Minkowski_p2(i32 noundef %n, ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) local_unnamed_addr #4 { entry: %cmp16 = icmp sgt i32 %n, 0 br i1 %cmp16, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %n, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %ans.018 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %add.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %mul = mul nsw i32 %sub, %sub %conv = sitofp i32 %mul to double %add = fadd double %ans.018, %conv %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %3, %4 %mul.1 = mul nsw i32 %sub.1, %sub.1 %conv.1 = sitofp i32 %mul.1 to double %add.1 = fadd double %add, %conv.1 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !13 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %add.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %add.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %ans.018.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %add.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.unr %5 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %arrayidx2.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.unr %6 = load i32, ptr %arrayidx2.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %5, %6 %mul.epil = mul nsw i32 %sub.epil, %sub.epil %conv.epil = sitofp i32 %mul.epil to double %add.epil = fadd double %ans.018.unr, %conv.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %ans.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ] %call = tail call double @sqrt(double noundef %ans.0.lcssa) #7 ret double %call } ; Function Attrs: nofree nounwind memory(write, argmem: readwrite) uwtable define dso_local double @Minkowski_p3(i32 noundef %n, ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) local_unnamed_addr #4 { entry: %cmp27 = icmp sgt i32 %n, 0 br i1 %cmp27, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %n, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %ans.029 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %8, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %mul = mul nsw i32 %sub, %sub %conv = sitofp i32 %mul to double %conv13 = sitofp i32 %sub to double %3 = tail call double @llvm.fabs.f64(double %conv13) %4 = tail call double @llvm.fmuladd.f64(double %conv, double %3, double %ans.029) %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %5 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next %6 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %5, %6 %mul.1 = mul nsw i32 %sub.1, %sub.1 %conv.1 = sitofp i32 %mul.1 to double %conv13.1 = sitofp i32 %sub.1 to double %7 = tail call double @llvm.fabs.f64(double %conv13.1) %8 = tail call double @llvm.fmuladd.f64(double %conv.1, double %7, double %4) %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 !14 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %8, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %ans.029.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %8, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.unr %9 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %arrayidx2.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.unr %10 = load i32, ptr %arrayidx2.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %9, %10 %mul.epil = mul nsw i32 %sub.epil, %sub.epil %conv.epil = sitofp i32 %mul.epil to double %conv13.epil = sitofp i32 %sub.epil to double %11 = tail call double @llvm.fabs.f64(double %conv13.epil) %12 = tail call double @llvm.fmuladd.f64(double %conv.epil, double %11, double %ans.029.unr) br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %ans.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %12, %for.body.epil ] %call = tail call double @pow(double noundef %ans.0.lcssa, double noundef 0x3FD5555555555555) #7 ret double %call } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local double @Minkowski_pinf(i32 noundef %n, ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) local_unnamed_addr #3 { entry: %cmp19 = icmp sgt i32 %n, 0 br i1 %cmp19, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %n, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %max.021 = phi double [ -1.000000e+00, %for.body.preheader.new ], [ %max.1.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %conv = sitofp i32 %sub to double %3 = tail call double @llvm.fabs.f64(double %conv) %cmp3 = fcmp ogt double %3, %max.021 %max.1 = select i1 %cmp3, double %3, double %max.021 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next %5 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %4, %5 %conv.1 = sitofp i32 %sub.1 to double %6 = tail call double @llvm.fabs.f64(double %conv.1) %cmp3.1 = fcmp ogt double %6, %max.1 %max.1.1 = select i1 %cmp3.1, double %6, double %max.1 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !15 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %max.1.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %max.1.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %max.021.unr = phi double [ -1.000000e+00, %for.body.preheader ], [ %max.1.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.unr %7 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %arrayidx2.epil = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.unr %8 = load i32, ptr %arrayidx2.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %7, %8 %conv.epil = sitofp i32 %sub.epil to double %9 = tail call double @llvm.fabs.f64(double %conv.epil) %cmp3.epil = fcmp ogt double %9, %max.021.unr %max.1.epil = select i1 %cmp3.epil, double %9, double %max.021.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %max.0.lcssa = phi double [ -1.000000e+00, %entry ], [ %max.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %max.1.epil, %for.body.epil ] ret double %max.0.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #5 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #6 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #5 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind memory(write, argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { 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 #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> #include <math.h> int main(void) { int n,i; double x[100],y[100],s; scanf("%d",&n); for(i=0;i<n;i++)scanf("%lf",&x[i]); for(i=0;i<n;i++)scanf("%lf",&y[i]); s=0; for(i=0;i<n;i++)s+=fabs(x[i]-y[i]); printf("%.6f\n",s); s=0; for(i=0;i<n;i++)s+=pow(fabs(x[i]-y[i]),2); printf("%.6f\n",sqrt(s)); s=0; for(i=0;i<n;i++)s+=pow(fabs(x[i]-y[i]),3); printf("%.6f\n",pow(s,1./3)); s=0; for(i=0;i<n;i++)if(fabs(x[i]-y[i])>s)s=fabs(x[i]-y[i]); printf("%.6f\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266072/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266072/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%.6f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca [100 x double], align 16 %y = alloca [100 x double], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %y) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp100 = icmp sgt i32 %0, 0 br i1 %cmp100, label %for.body, label %for.end20 for.cond2.preheader: ; preds = %for.body %cmp3102 = icmp sgt i32 %1, 0 br i1 %cmp3102, label %for.body4, label %for.end20 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond11.preheader: ; preds = %for.body4 %cmp12104 = icmp sgt i32 %4, 0 br i1 %cmp12104, label %for.body13.preheader, label %for.end20 for.body13.preheader: ; preds = %for.cond11.preheader %wide.trip.count = zext i32 %4 to i64 %xtraiter = and i64 %wide.trip.count, 1 %3 = icmp eq i32 %4, 1 br i1 %3, label %for.end20.loopexit.unr-lcssa, label %for.body13.preheader.new for.body13.preheader.new: ; preds = %for.body13.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body13 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv122 = phi i64 [ %indvars.iv.next123, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv122 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp3 = icmp slt i64 %indvars.iv.next123, %5 br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !11 for.body13: ; preds = %for.body13, %for.body13.preheader.new %indvars.iv125 = phi i64 [ 0, %for.body13.preheader.new ], [ %indvars.iv.next126.1, %for.body13 ] %s.0106 = phi double [ 0.000000e+00, %for.body13.preheader.new ], [ %add.1, %for.body13 ] %niter = phi i64 [ 0, %for.body13.preheader.new ], [ %niter.next.1, %for.body13 ] %arrayidx15 = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv125 %6 = load double, ptr %arrayidx15, align 16, !tbaa !12 %arrayidx17 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv125 %7 = load double, ptr %arrayidx17, align 16, !tbaa !12 %sub = fsub double %6, %7 %8 = call double @llvm.fabs.f64(double %sub) %add = fadd double %s.0106, %8 %indvars.iv.next126 = or i64 %indvars.iv125, 1 %arrayidx15.1 = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv.next126 %9 = load double, ptr %arrayidx15.1, align 8, !tbaa !12 %arrayidx17.1 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv.next126 %10 = load double, ptr %arrayidx17.1, align 8, !tbaa !12 %sub.1 = fsub double %9, %10 %11 = call double @llvm.fabs.f64(double %sub.1) %add.1 = fadd double %add, %11 %indvars.iv.next126.1 = add nuw nsw i64 %indvars.iv125, 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.end20.loopexit.unr-lcssa, label %for.body13, !llvm.loop !14 for.end20.loopexit.unr-lcssa: ; preds = %for.body13, %for.body13.preheader %add.lcssa.ph = phi double [ undef, %for.body13.preheader ], [ %add.1, %for.body13 ] %indvars.iv125.unr = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next126.1, %for.body13 ] %s.0106.unr = phi double [ 0.000000e+00, %for.body13.preheader ], [ %add.1, %for.body13 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end20, label %for.body13.epil for.body13.epil: ; preds = %for.end20.loopexit.unr-lcssa %arrayidx15.epil = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv125.unr %12 = load double, ptr %arrayidx15.epil, align 8, !tbaa !12 %arrayidx17.epil = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv125.unr %13 = load double, ptr %arrayidx17.epil, align 8, !tbaa !12 %sub.epil = fsub double %12, %13 %14 = call double @llvm.fabs.f64(double %sub.epil) %add.epil = fadd double %s.0106.unr, %14 br label %for.end20 for.end20: ; preds = %for.body13.epil, %for.end20.loopexit.unr-lcssa, %entry, %for.cond2.preheader, %for.cond11.preheader %s.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end20.loopexit.unr-lcssa ], [ %add.epil, %for.body13.epil ] %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %s.0.lcssa) %15 = load i32, ptr %n, align 4, !tbaa !5 %cmp23108 = icmp sgt i32 %15, 0 br i1 %cmp23108, label %for.body24.preheader, label %for.end34 for.body24.preheader: ; preds = %for.end20 %wide.trip.count131 = zext i32 %15 to i64 %xtraiter148 = and i64 %wide.trip.count131, 3 %16 = icmp ult i32 %15, 4 br i1 %16, label %for.end34.loopexit.unr-lcssa, label %for.body24.preheader.new for.body24.preheader.new: ; preds = %for.body24.preheader %unroll_iter151 = and i64 %wide.trip.count131, 4294967292 br label %for.body24 for.body24: ; preds = %for.body24, %for.body24.preheader.new %indvars.iv128 = phi i64 [ 0, %for.body24.preheader.new ], [ %indvars.iv.next129.3, %for.body24 ] %s.1110 = phi double [ 0.000000e+00, %for.body24.preheader.new ], [ %add31.3, %for.body24 ] %niter152 = phi i64 [ 0, %for.body24.preheader.new ], [ %niter152.next.3, %for.body24 ] %arrayidx26 = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv128 %17 = load double, ptr %arrayidx26, align 16, !tbaa !12 %arrayidx28 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv128 %18 = load double, ptr %arrayidx28, align 16, !tbaa !12 %sub29 = fsub double %17, %18 %square = fmul double %sub29, %sub29 %add31 = fadd double %s.1110, %square %indvars.iv.next129 = or i64 %indvars.iv128, 1 %arrayidx26.1 = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv.next129 %19 = load double, ptr %arrayidx26.1, align 8, !tbaa !12 %arrayidx28.1 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv.next129 %20 = load double, ptr %arrayidx28.1, align 8, !tbaa !12 %sub29.1 = fsub double %19, %20 %square.1 = fmul double %sub29.1, %sub29.1 %add31.1 = fadd double %add31, %square.1 %indvars.iv.next129.1 = or i64 %indvars.iv128, 2 %arrayidx26.2 = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv.next129.1 %21 = load double, ptr %arrayidx26.2, align 16, !tbaa !12 %arrayidx28.2 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv.next129.1 %22 = load double, ptr %arrayidx28.2, align 16, !tbaa !12 %sub29.2 = fsub double %21, %22 %square.2 = fmul double %sub29.2, %sub29.2 %add31.2 = fadd double %add31.1, %square.2 %indvars.iv.next129.2 = or i64 %indvars.iv128, 3 %arrayidx26.3 = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv.next129.2 %23 = load double, ptr %arrayidx26.3, align 8, !tbaa !12 %arrayidx28.3 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv.next129.2 %24 = load double, ptr %arrayidx28.3, align 8, !tbaa !12 %sub29.3 = fsub double %23, %24 %square.3 = fmul double %sub29.3, %sub29.3 %add31.3 = fadd double %add31.2, %square.3 %indvars.iv.next129.3 = add nuw nsw i64 %indvars.iv128, 4 %niter152.next.3 = add i64 %niter152, 4 %niter152.ncmp.3 = icmp eq i64 %niter152.next.3, %unroll_iter151 br i1 %niter152.ncmp.3, label %for.end34.loopexit.unr-lcssa, label %for.body24, !llvm.loop !15 for.end34.loopexit.unr-lcssa: ; preds = %for.body24, %for.body24.preheader %add31.lcssa.ph = phi double [ undef, %for.body24.preheader ], [ %add31.3, %for.body24 ] %indvars.iv128.unr = phi i64 [ 0, %for.body24.preheader ], [ %indvars.iv.next129.3, %for.body24 ] %s.1110.unr = phi double [ 0.000000e+00, %for.body24.preheader ], [ %add31.3, %for.body24 ] %lcmp.mod149.not = icmp eq i64 %xtraiter148, 0 br i1 %lcmp.mod149.not, label %for.end34, label %for.body24.epil for.body24.epil: ; preds = %for.end34.loopexit.unr-lcssa, %for.body24.epil %indvars.iv128.epil = phi i64 [ %indvars.iv.next129.epil, %for.body24.epil ], [ %indvars.iv128.unr, %for.end34.loopexit.unr-lcssa ] %s.1110.epil = phi double [ %add31.epil, %for.body24.epil ], [ %s.1110.unr, %for.end34.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body24.epil ], [ 0, %for.end34.loopexit.unr-lcssa ] %arrayidx26.epil = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv128.epil %25 = load double, ptr %arrayidx26.epil, align 8, !tbaa !12 %arrayidx28.epil = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv128.epil %26 = load double, ptr %arrayidx28.epil, align 8, !tbaa !12 %sub29.epil = fsub double %25, %26 %square.epil = fmul double %sub29.epil, %sub29.epil %add31.epil = fadd double %s.1110.epil, %square.epil %indvars.iv.next129.epil = add nuw nsw i64 %indvars.iv128.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter148 br i1 %epil.iter.cmp.not, label %for.end34, label %for.body24.epil, !llvm.loop !16 for.end34: ; preds = %for.end34.loopexit.unr-lcssa, %for.body24.epil, %for.end20 %s.1.lcssa = phi double [ 0.000000e+00, %for.end20 ], [ %add31.lcssa.ph, %for.end34.loopexit.unr-lcssa ], [ %add31.epil, %for.body24.epil ] %call35 = call double @sqrt(double noundef %s.1.lcssa) #5 %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %call35) %27 = load i32, ptr %n, align 4, !tbaa !5 %cmp38112 = icmp sgt i32 %27, 0 br i1 %cmp38112, label %for.body39, label %for.end49 for.body39: ; preds = %for.end34, %for.body39 %indvars.iv133 = phi i64 [ %indvars.iv.next134, %for.body39 ], [ 0, %for.end34 ] %s.2114 = phi double [ %add46, %for.body39 ], [ 0.000000e+00, %for.end34 ] %arrayidx41 = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv133 %28 = load double, ptr %arrayidx41, align 8, !tbaa !12 %arrayidx43 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv133 %29 = load double, ptr %arrayidx43, align 8, !tbaa !12 %sub44 = fsub double %28, %29 %30 = call double @llvm.fabs.f64(double %sub44) %call45 = call double @pow(double noundef %30, double noundef 3.000000e+00) #5 %add46 = fadd double %s.2114, %call45 %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %31 = load i32, ptr %n, align 4, !tbaa !5 %32 = sext i32 %31 to i64 %cmp38 = icmp slt i64 %indvars.iv.next134, %32 br i1 %cmp38, label %for.body39, label %for.end49, !llvm.loop !18 for.end49: ; preds = %for.body39, %for.end34 %s.2.lcssa = phi double [ 0.000000e+00, %for.end34 ], [ %add46, %for.body39 ] %call50 = call double @pow(double noundef %s.2.lcssa, double noundef 0x3FD5555555555555) #5 %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %call50) %33 = load i32, ptr %n, align 4, !tbaa !5 %cmp53116 = icmp sgt i32 %33, 0 br i1 %cmp53116, label %for.body54.preheader, label %for.end68 for.body54.preheader: ; preds = %for.end49 %wide.trip.count139 = zext i32 %33 to i64 %xtraiter153 = and i64 %wide.trip.count139, 1 %34 = icmp eq i32 %33, 1 br i1 %34, label %for.end68.loopexit.unr-lcssa, label %for.body54.preheader.new for.body54.preheader.new: ; preds = %for.body54.preheader %unroll_iter157 = and i64 %wide.trip.count139, 4294967294 br label %for.body54 for.body54: ; preds = %for.body54, %for.body54.preheader.new %indvars.iv136 = phi i64 [ 0, %for.body54.preheader.new ], [ %indvars.iv.next137.1, %for.body54 ] %s.3118 = phi double [ 0.000000e+00, %for.body54.preheader.new ], [ %s.4.1, %for.body54 ] %niter158 = phi i64 [ 0, %for.body54.preheader.new ], [ %niter158.next.1, %for.body54 ] %arrayidx56 = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv136 %35 = load double, ptr %arrayidx56, align 16, !tbaa !12 %arrayidx58 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv136 %36 = load double, ptr %arrayidx58, align 16, !tbaa !12 %sub59 = fsub double %35, %36 %37 = call double @llvm.fabs.f64(double %sub59) %cmp60 = fcmp ogt double %37, %s.3118 %s.4 = select i1 %cmp60, double %37, double %s.3118 %indvars.iv.next137 = or i64 %indvars.iv136, 1 %arrayidx56.1 = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv.next137 %38 = load double, ptr %arrayidx56.1, align 8, !tbaa !12 %arrayidx58.1 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv.next137 %39 = load double, ptr %arrayidx58.1, align 8, !tbaa !12 %sub59.1 = fsub double %38, %39 %40 = call double @llvm.fabs.f64(double %sub59.1) %cmp60.1 = fcmp ogt double %40, %s.4 %s.4.1 = select i1 %cmp60.1, double %40, double %s.4 %indvars.iv.next137.1 = add nuw nsw i64 %indvars.iv136, 2 %niter158.next.1 = add i64 %niter158, 2 %niter158.ncmp.1 = icmp eq i64 %niter158.next.1, %unroll_iter157 br i1 %niter158.ncmp.1, label %for.end68.loopexit.unr-lcssa, label %for.body54, !llvm.loop !19 for.end68.loopexit.unr-lcssa: ; preds = %for.body54, %for.body54.preheader %s.4.lcssa.ph = phi double [ undef, %for.body54.preheader ], [ %s.4.1, %for.body54 ] %indvars.iv136.unr = phi i64 [ 0, %for.body54.preheader ], [ %indvars.iv.next137.1, %for.body54 ] %s.3118.unr = phi double [ 0.000000e+00, %for.body54.preheader ], [ %s.4.1, %for.body54 ] %lcmp.mod155.not = icmp eq i64 %xtraiter153, 0 br i1 %lcmp.mod155.not, label %for.end68, label %for.body54.epil for.body54.epil: ; preds = %for.end68.loopexit.unr-lcssa %arrayidx56.epil = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv136.unr %41 = load double, ptr %arrayidx56.epil, align 8, !tbaa !12 %arrayidx58.epil = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv136.unr %42 = load double, ptr %arrayidx58.epil, align 8, !tbaa !12 %sub59.epil = fsub double %41, %42 %43 = call double @llvm.fabs.f64(double %sub59.epil) %cmp60.epil = fcmp ogt double %43, %s.3118.unr %s.4.epil = select i1 %cmp60.epil, double %43, double %s.3118.unr br label %for.end68 for.end68: ; preds = %for.body54.epil, %for.end68.loopexit.unr-lcssa, %for.end49 %s.3.lcssa = phi double [ 0.000000e+00, %for.end49 ], [ %s.4.lcssa.ph, %for.end68.loopexit.unr-lcssa ], [ %s.4.epil, %for.body54.epil ] %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %s.3.lcssa) call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %x) #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.fabs.f64(double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = !{!13, !13, i64 0} !13 = !{!"double", !7, i64 0} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include <stdio.h> #include <math.h> int main() { int i; int n; scanf("%d", &n); int x[n], y[n]; for( i = 0; i < n; ++i ) scanf("%d", &x[i]); for( i = 0; i < n; ++i ) scanf("%d", &y[i]); int p; double D; for( p = 1; p < 4; ++p ){ D = 0; for( i = 0; i < n; ++i ) D += (double)(pow(fabs(x[i] - y[i]), p)); D = (double)pow(D, 1.0/p); printf("%lf\n", D); } D = 0; for( i = 0; i < n; ++i ){ double tmp = (double)(fabs(x[i] - y[i])); D = D < tmp ? tmp : D; } printf("%lf\n", D); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266122/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266122/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %cmp71 = icmp sgt i32 %3, 0 br i1 %cmp71, label %for.body, label %for.end26 for.cond3.preheader: ; preds = %for.body %5 = icmp sgt i32 %6, 0 br i1 %5, label %for.body5, label %for.end26 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond12.preheader: ; preds = %for.body5 %8 = icmp sgt i32 %9, 0 br i1 %8, label %for.body17.lr.ph, label %for.end26 for.body5: ; preds = %for.cond3.preheader, %for.body5 %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx7 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv84 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp4 = icmp slt i64 %indvars.iv.next85, %10 br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !11 for.body17.lr.ph: ; preds = %for.cond12.preheader %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = call i32 @llvm.smax.i32(i32 %11, i32 1) %smax = zext i32 %12 to i64 %xtraiter = and i64 %smax, 1 %13 = icmp slt i32 %11, 2 br i1 %13, label %for.end26.loopexit.unr-lcssa, label %for.body17.lr.ph.new for.body17.lr.ph.new: ; preds = %for.body17.lr.ph %unroll_iter = and i64 %smax, 2147483646 br label %for.body17 for.body36.preheader: ; preds = %for.end26.2 %wide.trip.count = zext i32 %40 to i64 %xtraiter115 = and i64 %wide.trip.count, 1 %14 = icmp eq i32 %40, 1 br i1 %14, label %for.end47.loopexit.unr-lcssa, label %for.body36.preheader.new for.body36.preheader.new: ; preds = %for.body36.preheader %unroll_iter118 = and i64 %wide.trip.count, 4294967294 br label %for.body36 for.body17: ; preds = %for.body17, %for.body17.lr.ph.new %indvars.iv87 = phi i64 [ 0, %for.body17.lr.ph.new ], [ %indvars.iv.next88.1106, %for.body17 ] %D.077 = phi double [ 0.000000e+00, %for.body17.lr.ph.new ], [ %add.1105, %for.body17 ] %niter = phi i64 [ 0, %for.body17.lr.ph.new ], [ %niter.next.1, %for.body17 ] %arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87 %15 = load i32, ptr %arrayidx19, align 8, !tbaa !5 %arrayidx21 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv87 %16 = load i32, ptr %arrayidx21, align 8, !tbaa !5 %sub = sub nsw i32 %15, %16 %conv = sitofp i32 %sub to double %17 = call double @llvm.fabs.f64(double %conv) %add = fadd double %D.077, %17 %indvars.iv.next88 = or i64 %indvars.iv87, 1 %arrayidx19.1101 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next88 %18 = load i32, ptr %arrayidx19.1101, align 4, !tbaa !5 %arrayidx21.1102 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next88 %19 = load i32, ptr %arrayidx21.1102, align 4, !tbaa !5 %sub.1103 = sub nsw i32 %18, %19 %conv.1104 = sitofp i32 %sub.1103 to double %20 = call double @llvm.fabs.f64(double %conv.1104) %add.1105 = fadd double %add, %20 %indvars.iv.next88.1106 = add nuw nsw i64 %indvars.iv87, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1.not, label %for.end26.loopexit.unr-lcssa, label %for.body17, !llvm.loop !12 for.end26.loopexit.unr-lcssa: ; preds = %for.body17, %for.body17.lr.ph %add.lcssa.ph = phi double [ undef, %for.body17.lr.ph ], [ %add.1105, %for.body17 ] %indvars.iv87.unr = phi i64 [ 0, %for.body17.lr.ph ], [ %indvars.iv.next88.1106, %for.body17 ] %D.077.unr = phi double [ 0.000000e+00, %for.body17.lr.ph ], [ %add.1105, %for.body17 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end26, label %for.body17.epil for.body17.epil: ; preds = %for.end26.loopexit.unr-lcssa %arrayidx19.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87.unr %21 = load i32, ptr %arrayidx19.epil, align 4, !tbaa !5 %arrayidx21.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv87.unr %22 = load i32, ptr %arrayidx21.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %21, %22 %conv.epil = sitofp i32 %sub.epil to double %23 = call double @llvm.fabs.f64(double %conv.epil) %add.epil = fadd double %D.077.unr, %23 br label %for.end26 for.end26: ; preds = %for.body17.epil, %for.end26.loopexit.unr-lcssa, %entry, %for.cond3.preheader, %for.cond12.preheader %D.0.lcssa = phi double [ 0.000000e+00, %for.cond12.preheader ], [ 0.000000e+00, %for.cond3.preheader ], [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end26.loopexit.unr-lcssa ], [ %add.epil, %for.body17.epil ] %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %D.0.lcssa) %24 = load i32, ptr %n, align 4, !tbaa !5 %cmp1675.1 = icmp sgt i32 %24, 0 br i1 %cmp1675.1, label %for.body17.lr.ph.1, label %for.end26.1 for.body17.lr.ph.1: ; preds = %for.end26 %25 = load i32, ptr %n, align 4, !tbaa !5 %26 = call i32 @llvm.smax.i32(i32 %25, i32 1) %smax109 = zext i32 %26 to i64 %xtraiter110 = and i64 %smax109, 1 %27 = icmp slt i32 %25, 2 br i1 %27, label %for.end26.1.loopexit.unr-lcssa, label %for.body17.lr.ph.1.new for.body17.lr.ph.1.new: ; preds = %for.body17.lr.ph.1 %unroll_iter113 = and i64 %smax109, 2147483646 br label %for.body17.1 for.body17.1: ; preds = %for.body17.1, %for.body17.lr.ph.1.new %indvars.iv87.1 = phi i64 [ 0, %for.body17.lr.ph.1.new ], [ %indvars.iv.next88.1.1, %for.body17.1 ] %D.077.1 = phi double [ 0.000000e+00, %for.body17.lr.ph.1.new ], [ %add.1.1, %for.body17.1 ] %niter114 = phi i64 [ 0, %for.body17.lr.ph.1.new ], [ %niter114.next.1, %for.body17.1 ] %arrayidx19.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87.1 %28 = load i32, ptr %arrayidx19.1, align 8, !tbaa !5 %arrayidx21.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv87.1 %29 = load i32, ptr %arrayidx21.1, align 8, !tbaa !5 %sub.1 = sub nsw i32 %28, %29 %conv.1 = sitofp i32 %sub.1 to double %square = fmul double %conv.1, %conv.1 %add.1 = fadd double %D.077.1, %square %indvars.iv.next88.1 = or i64 %indvars.iv87.1, 1 %arrayidx19.1.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next88.1 %30 = load i32, ptr %arrayidx19.1.1, align 4, !tbaa !5 %arrayidx21.1.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next88.1 %31 = load i32, ptr %arrayidx21.1.1, align 4, !tbaa !5 %sub.1.1 = sub nsw i32 %30, %31 %conv.1.1 = sitofp i32 %sub.1.1 to double %square.1 = fmul double %conv.1.1, %conv.1.1 %add.1.1 = fadd double %add.1, %square.1 %indvars.iv.next88.1.1 = add nuw nsw i64 %indvars.iv87.1, 2 %niter114.next.1 = add i64 %niter114, 2 %niter114.ncmp.1.not = icmp eq i64 %niter114.next.1, %unroll_iter113 br i1 %niter114.ncmp.1.not, label %for.end26.1.loopexit.unr-lcssa, label %for.body17.1, !llvm.loop !12 for.end26.1.loopexit.unr-lcssa: ; preds = %for.body17.1, %for.body17.lr.ph.1 %add.1.lcssa.ph = phi double [ undef, %for.body17.lr.ph.1 ], [ %add.1.1, %for.body17.1 ] %indvars.iv87.1.unr = phi i64 [ 0, %for.body17.lr.ph.1 ], [ %indvars.iv.next88.1.1, %for.body17.1 ] %D.077.1.unr = phi double [ 0.000000e+00, %for.body17.lr.ph.1 ], [ %add.1.1, %for.body17.1 ] %lcmp.mod111.not = icmp eq i64 %xtraiter110, 0 br i1 %lcmp.mod111.not, label %for.end26.1, label %for.body17.1.epil for.body17.1.epil: ; preds = %for.end26.1.loopexit.unr-lcssa %arrayidx19.1.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87.1.unr %32 = load i32, ptr %arrayidx19.1.epil, align 4, !tbaa !5 %arrayidx21.1.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv87.1.unr %33 = load i32, ptr %arrayidx21.1.epil, align 4, !tbaa !5 %sub.1.epil = sub nsw i32 %32, %33 %conv.1.epil = sitofp i32 %sub.1.epil to double %square.epil = fmul double %conv.1.epil, %conv.1.epil %add.1.epil = fadd double %D.077.1.unr, %square.epil br label %for.end26.1 for.end26.1: ; preds = %for.body17.1.epil, %for.end26.1.loopexit.unr-lcssa, %for.end26 %D.0.lcssa.1 = phi double [ 0.000000e+00, %for.end26 ], [ %add.1.lcssa.ph, %for.end26.1.loopexit.unr-lcssa ], [ %add.1.epil, %for.body17.1.epil ] %call28.1 = call double @pow(double noundef %D.0.lcssa.1, double noundef 5.000000e-01) #7 %call29.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call28.1) %34 = load i32, ptr %n, align 4, !tbaa !5 %cmp1675.2 = icmp sgt i32 %34, 0 br i1 %cmp1675.2, label %for.body17.2, label %for.end26.2 for.body17.2: ; preds = %for.end26.1, %for.body17.2 %indvars.iv87.2 = phi i64 [ %indvars.iv.next88.2, %for.body17.2 ], [ 0, %for.end26.1 ] %D.077.2 = phi double [ %add.2, %for.body17.2 ], [ 0.000000e+00, %for.end26.1 ] %arrayidx19.2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87.2 %35 = load i32, ptr %arrayidx19.2, align 4, !tbaa !5 %arrayidx21.2 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv87.2 %36 = load i32, ptr %arrayidx21.2, align 4, !tbaa !5 %sub.2 = sub nsw i32 %35, %36 %conv.2 = sitofp i32 %sub.2 to double %37 = call double @llvm.fabs.f64(double %conv.2) %call23.2 = call double @pow(double noundef %37, double noundef 3.000000e+00) #7 %add.2 = fadd double %D.077.2, %call23.2 %indvars.iv.next88.2 = add nuw nsw i64 %indvars.iv87.2, 1 %38 = load i32, ptr %n, align 4, !tbaa !5 %39 = sext i32 %38 to i64 %cmp16.2 = icmp slt i64 %indvars.iv.next88.2, %39 br i1 %cmp16.2, label %for.body17.2, label %for.end26.2, !llvm.loop !12 for.end26.2: ; preds = %for.body17.2, %for.end26.1 %D.0.lcssa.2 = phi double [ 0.000000e+00, %for.end26.1 ], [ %add.2, %for.body17.2 ] %call28.2 = call double @pow(double noundef %D.0.lcssa.2, double noundef 0x3FD5555555555555) #7 %call29.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call28.2) %40 = load i32, ptr %n, align 4, !tbaa !5 %cmp3479 = icmp sgt i32 %40, 0 br i1 %cmp3479, label %for.body36.preheader, label %for.end47 for.body36: ; preds = %for.body36, %for.body36.preheader.new %indvars.iv90 = phi i64 [ 0, %for.body36.preheader.new ], [ %indvars.iv.next91.1, %for.body36 ] %D.181 = phi double [ 0.000000e+00, %for.body36.preheader.new ], [ %cond.1, %for.body36 ] %niter119 = phi i64 [ 0, %for.body36.preheader.new ], [ %niter119.next.1, %for.body36 ] %arrayidx38 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv90 %41 = load i32, ptr %arrayidx38, align 8, !tbaa !5 %arrayidx40 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv90 %42 = load i32, ptr %arrayidx40, align 8, !tbaa !5 %sub41 = sub nsw i32 %41, %42 %conv42 = sitofp i32 %sub41 to double %43 = call double @llvm.fabs.f64(double %conv42) %cmp43 = fcmp olt double %D.181, %43 %cond = select i1 %cmp43, double %43, double %D.181 %indvars.iv.next91 = or i64 %indvars.iv90, 1 %arrayidx38.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next91 %44 = load i32, ptr %arrayidx38.1, align 4, !tbaa !5 %arrayidx40.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next91 %45 = load i32, ptr %arrayidx40.1, align 4, !tbaa !5 %sub41.1 = sub nsw i32 %44, %45 %conv42.1 = sitofp i32 %sub41.1 to double %46 = call double @llvm.fabs.f64(double %conv42.1) %cmp43.1 = fcmp olt double %cond, %46 %cond.1 = select i1 %cmp43.1, double %46, double %cond %indvars.iv.next91.1 = add nuw nsw i64 %indvars.iv90, 2 %niter119.next.1 = add i64 %niter119, 2 %niter119.ncmp.1 = icmp eq i64 %niter119.next.1, %unroll_iter118 br i1 %niter119.ncmp.1, label %for.end47.loopexit.unr-lcssa, label %for.body36, !llvm.loop !13 for.end47.loopexit.unr-lcssa: ; preds = %for.body36, %for.body36.preheader %cond.lcssa.ph = phi double [ undef, %for.body36.preheader ], [ %cond.1, %for.body36 ] %indvars.iv90.unr = phi i64 [ 0, %for.body36.preheader ], [ %indvars.iv.next91.1, %for.body36 ] %D.181.unr = phi double [ 0.000000e+00, %for.body36.preheader ], [ %cond.1, %for.body36 ] %lcmp.mod116.not = icmp eq i64 %xtraiter115, 0 br i1 %lcmp.mod116.not, label %for.end47, label %for.body36.epil for.body36.epil: ; preds = %for.end47.loopexit.unr-lcssa %arrayidx38.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv90.unr %47 = load i32, ptr %arrayidx38.epil, align 4, !tbaa !5 %arrayidx40.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv90.unr %48 = load i32, ptr %arrayidx40.epil, align 4, !tbaa !5 %sub41.epil = sub nsw i32 %47, %48 %conv42.epil = sitofp i32 %sub41.epil to double %49 = call double @llvm.fabs.f64(double %conv42.epil) %cmp43.epil = fcmp olt double %D.181.unr, %49 %cond.epil = select i1 %cmp43.epil, double %49, double %D.181.unr br label %for.end47 for.end47: ; preds = %for.body36.epil, %for.end47.loopexit.unr-lcssa, %for.end26.2 %D.1.lcssa = phi double [ 0.000000e+00, %for.end26.2 ], [ %cond.lcssa.ph, %for.end47.loopexit.unr-lcssa ], [ %cond.epil, %for.body36.epil ] %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %D.1.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main() { int a,b=0,c; scanf("%d",&a); while(a != 0){ if(a%10 == 2){ b++; } a = a/10; } printf("%d",b); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266166/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266166/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %.pr = load i32, ptr %a, align 4, !tbaa !5 %cmp.not4 = icmp eq i32 %.pr, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %b.05 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ] %0 = phi i32 [ %div, %while.body ], [ %.pr, %entry ] %rem = srem i32 %0, 10 %cmp1 = icmp eq i32 %rem, 2 %inc = zext i1 %cmp1 to i32 %spec.select = add nuw nsw i32 %b.05, %inc %div = sdiv i32 %0, 10 %.off = add i32 %0, 9 %cmp.not = icmp ult i32 %.off, 19 br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %div, ptr %a, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %b.0.lcssa = phi i32 [ %spec.select, %while.cond.while.end_crit_edge ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %b.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int N,a,b,c,d,count=0; scanf("%d",&N); a=N/1000; b=(N-(a*1000))/100; c=(N-(a*1000)-(b*100))/10; d=N-(a*1000)-(b*100)-(c*10); if(a==2)count+=1; if(b==2)count+=1; if(c==2)count+=1; if(d==2)count+=1; printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266209/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266209/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %.fr = freeze i32 %0 %1 = srem i32 %.fr, 1000 %.lhs.trunc = trunc i32 %1 to i16 %2 = srem i16 %.lhs.trunc, 100 %.lhs.trunc40 = trunc i16 %2 to i8 %3 = srem i8 %.lhs.trunc40, 10 %.off = add i32 %.fr, -2000 %cmp = icmp ult i32 %.off, 1000 %spec.select = zext i1 %cmp to i32 %.off36 = add nsw i32 %1, -200 %cmp13 = icmp ult i32 %.off36, 100 %add15 = select i1 %cmp, i32 2, i32 1 %count.1 = select i1 %cmp13, i32 %add15, i32 %spec.select %narrow = add nsw i16 %2, -20 %cmp17 = icmp ult i16 %narrow, 10 %add19 = zext i1 %cmp17 to i32 %count.2 = add nuw nsw i32 %count.1, %add19 %cmp21 = icmp eq i8 %3, 2 %add23 = zext i1 %cmp21 to i32 %count.3 = add nuw nsw i32 %count.2, %add23 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.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(int argc, char const *argv[]) { int N; scanf("%d", &N); int ans=0; for (size_t i = 0; i < 4; i++) { if (N%10==2) { ans++; } N=N/10; } printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266252/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266252/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) 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) %N.promoted = load i32, ptr %N, align 4, !tbaa !5 %div = sdiv i32 %N.promoted, 10 %div.1 = sdiv i32 %N.promoted, 100 %div.2 = sdiv i32 %N.promoted, 1000 %0 = insertelement <4 x i32> poison, i32 %div, i64 0 %1 = insertelement <4 x i32> %0, i32 %N.promoted, i64 1 %2 = insertelement <4 x i32> %1, i32 %div.1, i64 2 %3 = insertelement <4 x i32> %2, i32 %div.2, i64 3 %4 = srem <4 x i32> %3, <i32 10, i32 10, i32 10, i32 10> %5 = icmp eq <4 x i32> %4, <i32 2, i32 2, i32 2, i32 2> %6 = bitcast <4 x i1> %5 to i4 %7 = call i4 @llvm.ctpop.i4(i4 %6), !range !9 %8 = zext i4 %7 to i32 %div.3 = sdiv i32 %N.promoted, 10000 store i32 %div.3, ptr %N, align 4, !tbaa !5 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i4 @llvm.ctpop.i4(i4) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i4 0, i4 5}
#include<stdio.h> #include<stdlib.h> int main(){ int h,w,i,j,k,a,y[200010],x[200010],d[200010]={}; scanf("%d %d %d",&h,&w,&k); for(i=0;i<h;i++){ for(j=0;j<w;j++){ scanf("%d",&a); y[a]=i; x[a]=j; } } for(i=1;i<=h*w;i++)d[i+k]=d[i]+abs(x[i]-x[i+k])+abs(y[i]-y[i+k]); scanf("%d",&k); while(k--){ scanf("%d %d",&i,&j); printf("%d\n",d[j]-d[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266296/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266296/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 %i = alloca i32, align 4 %j = alloca i32, align 4 %k = alloca i32, align 4 %a = alloca i32, align 4 %y = alloca [200010 x i32], align 16 %x = alloca [200010 x i32], align 16 %d = alloca [200010 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %y) #6 call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %x) #6 call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %d) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800040) %d, i8 0, i64 800040, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w, ptr noundef nonnull %k) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp44 = icmp sgt i32 %0, 0 %.pre54 = load i32, ptr %w, align 4, !tbaa !5 br i1 %cmp44, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre54, 0 br i1 %1, label %for.cond1.preheader, label %for.cond1.preheader.lr.ph.split.us for.cond1.preheader.lr.ph.split.us: ; preds = %for.cond1.preheader.lr.ph store i32 0, ptr %j, align 4, !tbaa !5 br label %for.cond10.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %40, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %inc8, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %4 = phi i32 [ %41, %for.inc7 ], [ %.pre54, %for.cond1.preheader.lr.ph ] store i32 0, ptr %j, align 4, !tbaa !5 %cmp243 = icmp sgt i32 %4, 0 br i1 %cmp243, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %for.cond1.preheader.lr.ph.split.us, %entry %5 = phi i32 [ %.pre54, %entry ], [ %.pre54, %for.cond1.preheader.lr.ph.split.us ], [ %41, %for.inc7 ] %.lcssa = phi i32 [ %0, %entry ], [ %0, %for.cond1.preheader.lr.ph.split.us ], [ %40, %for.inc7 ] %mul = mul nsw i32 %5, %.lcssa %cmp11.not46 = icmp slt i32 %mul, 1 br i1 %cmp11.not46, label %for.end32, label %for.body12.lr.ph for.body12.lr.ph: ; preds = %for.cond10.preheader %6 = load i32, ptr %k, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %8 = add nuw i32 %mul, 1 %wide.trip.count = zext i32 %8 to i64 %9 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %mul, 8 %10 = and i64 %7, 4611686018427387896 %diff.check = icmp eq i64 %10, 0 %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check br i1 %or.cond, label %for.body12.preheader, label %vector.ph vector.ph: ; preds = %for.body12.lr.ph %n.vec = and i64 %9, -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 ] %offset.idx = or i64 %index, 1 %11 = getelementptr inbounds [200010 x i32], ptr %d, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5 %12 = getelementptr inbounds i32, ptr %11, i64 4 %wide.load62 = load <4 x i32>, ptr %12, align 4, !tbaa !5 %13 = getelementptr inbounds [200010 x i32], ptr %x, i64 0, i64 %offset.idx %wide.load63 = load <4 x i32>, ptr %13, align 4, !tbaa !5 %14 = getelementptr inbounds i32, ptr %13, i64 4 %wide.load64 = load <4 x i32>, ptr %14, align 4, !tbaa !5 %15 = add nsw i64 %offset.idx, %7 %16 = getelementptr inbounds [200010 x i32], ptr %x, i64 0, i64 %15 %wide.load65 = load <4 x i32>, ptr %16, align 4, !tbaa !5 %17 = getelementptr inbounds i32, ptr %16, i64 4 %wide.load66 = load <4 x i32>, ptr %17, align 4, !tbaa !5 %18 = sub nsw <4 x i32> %wide.load63, %wide.load65 %19 = sub nsw <4 x i32> %wide.load64, %wide.load66 %20 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %18, i1 true) %21 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %19, i1 true) %22 = add nsw <4 x i32> %20, %wide.load %23 = add nsw <4 x i32> %21, %wide.load62 %24 = getelementptr inbounds [200010 x i32], ptr %y, i64 0, i64 %offset.idx %wide.load67 = load <4 x i32>, ptr %24, align 4, !tbaa !5 %25 = getelementptr inbounds i32, ptr %24, i64 4 %wide.load68 = load <4 x i32>, ptr %25, align 4, !tbaa !5 %26 = getelementptr inbounds [200010 x i32], ptr %y, i64 0, i64 %15 %wide.load69 = load <4 x i32>, ptr %26, align 4, !tbaa !5 %27 = getelementptr inbounds i32, ptr %26, i64 4 %wide.load70 = load <4 x i32>, ptr %27, align 4, !tbaa !5 %28 = sub nsw <4 x i32> %wide.load67, %wide.load69 %29 = sub nsw <4 x i32> %wide.load68, %wide.load70 %30 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %28, i1 true) %31 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %29, i1 true) %32 = add nsw <4 x i32> %22, %30 %33 = add nsw <4 x i32> %23, %31 %34 = getelementptr inbounds [200010 x i32], ptr %d, i64 0, i64 %15 store <4 x i32> %32, ptr %34, align 4, !tbaa !5 %35 = getelementptr inbounds i32, ptr %34, i64 4 store <4 x i32> %33, ptr %35, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %36 = icmp eq i64 %index.next, %n.vec br i1 %36, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %9, %n.vec br i1 %cmp.n, label %for.end32, label %for.body12.preheader for.body12.preheader: ; preds = %for.body12.lr.ph, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body12.lr.ph ], [ %ind.end, %middle.block ] br label %for.body12 for.body3: ; preds = %for.cond1.preheader, %for.body3 %37 = phi i32 [ %inc, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %38 = load i32, ptr %a, align 4, !tbaa !5 %idxprom = sext i32 %38 to i64 %arrayidx = getelementptr inbounds [200010 x i32], ptr %y, i64 0, i64 %idxprom store i32 %3, ptr %arrayidx, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [200010 x i32], ptr %x, i64 0, i64 %idxprom store i32 %37, ptr %arrayidx6, align 4, !tbaa !5 %inc = add nuw nsw i32 %37, 1 store i32 %inc, ptr %j, align 4, !tbaa !5 %39 = load i32, ptr %w, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc, %39 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !13 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %h, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %40 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %41 = phi i32 [ %39, %for.inc7.loopexit ], [ %4, %for.cond1.preheader ] %inc8 = add nuw nsw i32 %3, 1 %cmp = icmp slt i32 %inc8, %40 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !14 for.body12: ; preds = %for.body12.preheader, %for.body12 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body12 ], [ %indvars.iv.ph, %for.body12.preheader ] %arrayidx14 = getelementptr inbounds [200010 x i32], ptr %d, i64 0, i64 %indvars.iv %42 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [200010 x i32], ptr %x, i64 0, i64 %indvars.iv %43 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %44 = add nsw i64 %indvars.iv, %7 %arrayidx18 = getelementptr inbounds [200010 x i32], ptr %x, i64 0, i64 %44 %45 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %sub = sub nsw i32 %43, %45 %46 = call i32 @llvm.abs.i32(i32 %sub, i1 true) %add19 = add nsw i32 %46, %42 %arrayidx21 = getelementptr inbounds [200010 x i32], ptr %y, i64 0, i64 %indvars.iv %47 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %arrayidx24 = getelementptr inbounds [200010 x i32], ptr %y, i64 0, i64 %44 %48 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %sub25 = sub nsw i32 %47, %48 %49 = call i32 @llvm.abs.i32(i32 %sub25, i1 true) %add26 = add nsw i32 %add19, %49 %arrayidx29 = getelementptr inbounds [200010 x i32], ptr %d, i64 0, i64 %44 store i32 %add26, ptr %arrayidx29, 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.end32, label %for.body12, !llvm.loop !16 for.end32: ; preds = %for.body12, %middle.block, %for.cond10.preheader %storemerge41.lcssa = phi i32 [ 1, %for.cond10.preheader ], [ %8, %middle.block ], [ %8, %for.body12 ] store i32 %storemerge41.lcssa, ptr %i, align 4, !tbaa !5 %call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %50 = load i32, ptr %k, align 4, !tbaa !5 %dec49 = add nsw i32 %50, -1 store i32 %dec49, ptr %k, align 4, !tbaa !5 %tobool.not50 = icmp eq i32 %50, 0 br i1 %tobool.not50, label %while.end, label %while.body while.body: ; preds = %for.end32, %while.body %call34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i, ptr noundef nonnull %j) %51 = load i32, ptr %j, align 4, !tbaa !5 %idxprom35 = sext i32 %51 to i64 %arrayidx36 = getelementptr inbounds [200010 x i32], ptr %d, i64 0, i64 %idxprom35 %52 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %53 = load i32, ptr %i, align 4, !tbaa !5 %idxprom37 = sext i32 %53 to i64 %arrayidx38 = getelementptr inbounds [200010 x i32], ptr %d, i64 0, i64 %idxprom37 %54 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %sub39 = sub nsw i32 %52, %54 %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub39) %55 = load i32, ptr %k, align 4, !tbaa !5 %dec = add nsw i32 %55, -1 store i32 %dec, ptr %k, align 4, !tbaa !5 %tobool.not = icmp eq i32 %55, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !17 while.end: ; preds = %while.body, %for.end32 call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %d) #6 call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %x) #6 call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %y) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !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, !15} !15 = !{!"llvm.loop.unswitch.partial.disable"} !16 = distinct !{!16, !10, !11} !17 = distinct !{!17, !10}
#include <stdio.h> #define N 500 int main() { static int cc[N], ss[N], ff[N]; int n, i, x; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d%d%d", &cc[i], &ss[i], &ff[i]); for (x = 0; x < n; x++) { int t; t = 0; for (i = x; i < n - 1; i++) { if (t < ss[i]) t = ss[i]; t = (t + ff[i] - 1) / ff[i] * ff[i] + cc[i]; } printf("%d\n", t); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266353/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266353/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @main.cc = internal global [500 x i32] zeroinitializer, align 16 @main.ss = internal global [500 x i32] zeroinitializer, align 16 @main.ff = internal global [500 x i32] zeroinitializer, align 16 @.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 [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) #4 %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.end33 for.cond6.preheader: ; preds = %for.body %cmp755 = icmp sgt i32 %1, 0 br i1 %cmp755, label %for.cond9.preheader, label %for.end33 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [500 x i32], ptr @main.cc, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [500 x i32], ptr @main.ss, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [500 x i32], ptr @main.ff, i64 0, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9 for.cond9.preheader: ; preds = %for.cond6.preheader, %for.end29 %indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.end29 ], [ 0, %for.cond6.preheader ] %3 = phi i32 [ %8, %for.end29 ], [ %1, %for.cond6.preheader ] %indvars63 = trunc i64 %indvars.iv58 to i32 %sub = add nsw i32 %3, -1 %cmp1052 = icmp sgt i32 %sub, %indvars63 br i1 %cmp1052, label %for.body11.preheader, label %for.end29 for.body11.preheader: ; preds = %for.cond9.preheader %wide.trip.count = zext i32 %sub to i64 br label %for.body11 for.body11: ; preds = %for.body11.preheader, %for.body11 %indvars.iv60 = phi i64 [ %indvars.iv58, %for.body11.preheader ], [ %indvars.iv.next61, %for.body11 ] %t.054 = phi i32 [ 0, %for.body11.preheader ], [ %add26, %for.body11 ] %arrayidx13 = getelementptr inbounds [500 x i32], ptr @main.ss, i64 0, i64 %indvars.iv60 %4 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %t.054, i32 %4) %arrayidx18 = getelementptr inbounds [500 x i32], ptr @main.ff, i64 0, i64 %indvars.iv60 %5 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %add = add nsw i32 %spec.select, %5 %add.fr = freeze i32 %add %sub19 = add i32 %add.fr, -1 %6 = srem i32 %sub19, %5 %arrayidx25 = getelementptr inbounds [500 x i32], ptr @main.cc, i64 0, i64 %indvars.iv60 %7 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %mul = sub i32 %7, %6 %add26 = add i32 %mul, %sub19 %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %exitcond.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count br i1 %exitcond.not, label %for.end29, label %for.body11, !llvm.loop !11 for.end29: ; preds = %for.body11, %for.cond9.preheader %t.0.lcssa = phi i32 [ 0, %for.cond9.preheader ], [ %add26, %for.body11 ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %t.0.lcssa) %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %indvars = trunc i64 %indvars.iv.next59 to i32 %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp7 = icmp sgt i32 %8, %indvars br i1 %cmp7, label %for.cond9.preheader, label %for.end33, !llvm.loop !12 for.end33: ; preds = %for.end29, %entry, %for.cond6.preheader 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} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void) { //code goes long i,n,j; scanf("%ld",&n); long c[n],s[n],f[n],tot=-1; for(j=0;j<(n-1);++j) scanf("%ld %ld %ld",&c[j],&s[j],&f[j]); for(i=0;i<n;++i){ tot=0; for(j=i;j<(n-1);++j){ if(tot<s[j]) tot=s[j]; else if(tot%f[j]) tot=((tot/f[j])+1)*f[j]; tot+=c[j]; } printf("%ld\n",tot); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266397/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266397/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%ld %ld %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 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %vla1 = alloca i64, i64 %2, align 16 %vla2 = alloca i64, i64 %2, align 16 %cmp49 = icmp sgt i64 %2, 1 br i1 %cmp49, label %for.body, label %for.cond6.preheader for.cond6.preheader: ; preds = %for.body, %entry %3 = phi i64 [ %2, %entry ], [ %4, %for.body ] %cmp754 = icmp sgt i64 %3, 0 br i1 %cmp754, label %for.cond9.preheader, label %for.end29 for.body: ; preds = %entry, %for.body %j.050 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %j.050 %arrayidx3 = getelementptr inbounds i64, ptr %vla1, i64 %j.050 %arrayidx4 = getelementptr inbounds i64, ptr %vla2, i64 %j.050 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4) %inc = add nuw nsw i64 %j.050, 1 %4 = load i64, ptr %n, align 8, !tbaa !5 %sub = add nsw i64 %4, -1 %cmp = icmp slt i64 %inc, %sub br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9 for.cond9.preheader: ; preds = %for.cond6.preheader, %for.end25 %5 = phi i64 [ %9, %for.end25 ], [ %3, %for.cond6.preheader ] %i.055 = phi i64 [ %inc28, %for.end25 ], [ 0, %for.cond6.preheader ] %sub10 = add nsw i64 %5, -1 %cmp1151 = icmp slt i64 %i.055, %sub10 br i1 %cmp1151, label %for.body12, label %for.end25 for.body12: ; preds = %for.cond9.preheader, %if.end20 %tot.053 = phi i64 [ %add22, %if.end20 ], [ 0, %for.cond9.preheader ] %j.152 = phi i64 [ %inc24, %if.end20 ], [ %i.055, %for.cond9.preheader ] %arrayidx13 = getelementptr inbounds i64, ptr %vla1, i64 %j.152 %6 = load i64, ptr %arrayidx13, align 8, !tbaa !5 %cmp14 = icmp slt i64 %tot.053, %6 br i1 %cmp14, label %if.end20, label %if.else if.else: ; preds = %for.body12 %arrayidx16 = getelementptr inbounds i64, ptr %vla2, i64 %j.152 %7 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %rem = srem i64 %tot.053, %7 %div = sdiv i64 %tot.053, %7 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %if.end20, label %if.then17 if.then17: ; preds = %if.else %add = add nsw i64 %div, 1 %mul = mul nsw i64 %add, %7 br label %if.end20 if.end20: ; preds = %for.body12, %if.else, %if.then17 %tot.1 = phi i64 [ %mul, %if.then17 ], [ %tot.053, %if.else ], [ %6, %for.body12 ] %arrayidx21 = getelementptr inbounds i64, ptr %vla, i64 %j.152 %8 = load i64, ptr %arrayidx21, align 8, !tbaa !5 %add22 = add nsw i64 %8, %tot.1 %inc24 = add nuw nsw i64 %j.152, 1 %cmp11 = icmp slt i64 %inc24, %sub10 br i1 %cmp11, label %for.body12, label %for.end25, !llvm.loop !11 for.end25: ; preds = %if.end20, %for.cond9.preheader %tot.0.lcssa = phi i64 [ 0, %for.cond9.preheader ], [ %add22, %if.end20 ] %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %tot.0.lcssa) %inc28 = add nuw nsw i64 %i.055, 1 %9 = load i64, ptr %n, align 8, !tbaa !5 %cmp7 = icmp slt i64 %inc28, %9 br i1 %cmp7, label %for.cond9.preheader, label %for.end29, !llvm.loop !12 for.end29: ; preds = %for.end25, %for.cond6.preheader call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !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() { int t,p,m,tot; int a[100010]; scanf("%d",&t); for(int i=1;i<=t;i++) { scanf("%d %d",&m,&p); tot=0; for(int i=1;i<=m;i++) { scanf("%d",&a[i]); tot+=a[i]; } if(tot==p)printf("YES\n"); else printf("NO\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26644/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26644/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %p = alloca i32, align 4 %m = alloca i32, align 4 %a = alloca [100010 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.cond.cleanup5, %entry call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 ret i32 0 for.body: ; preds = %entry, %for.cond.cleanup5 %i.026 = phi i32 [ %inc14, %for.cond.cleanup5 ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %p) %1 = load i32, ptr %m, align 4, !tbaa !5 %cmp4.not22 = icmp slt i32 %1, 1 br i1 %cmp4.not22, label %for.cond.cleanup5, label %for.body6 for.cond.cleanup5: ; preds = %for.body6, %for.body %tot.0.lcssa = phi i32 [ 0, %for.body ], [ %add, %for.body6 ] %2 = load i32, ptr %p, align 4, !tbaa !5 %cmp10 = icmp eq i32 %tot.0.lcssa, %2 %str.4.str = select i1 %cmp10, ptr @str.4, ptr @str %puts21 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) %inc14 = add nuw nsw i32 %i.026, 1 %3 = load i32, ptr %t, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.026, %3 br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !9 for.body6: ; preds = %for.body, %for.body6 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body6 ], [ 1, %for.body ] %tot.023 = phi i32 [ %add, %for.body6 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %4, %tot.023 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %m, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp4.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp4.not.not, label %for.body6, label %for.cond.cleanup5, !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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int r; int c; scanf("%d%d", &r, &c); while(r != 0 && c != 0) { if(r * c % 2 == 0) { printf("yes\n"); } else { printf("no\n"); } scanf("%d%d", &r, &c); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266490/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266490/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = 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: %r = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #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 %r, ptr noundef nonnull %c) %0 = load i32, ptr %r, align 4, !tbaa !5 %cmp8 = icmp ne i32 %0, 0 %1 = load i32, ptr %c, align 4 %cmp19 = icmp ne i32 %1, 0 %2 = select i1 %cmp8, i1 %cmp19, i1 false br i1 %2, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %3 = phi i32 [ %7, %while.body ], [ %1, %entry ] %4 = phi i32 [ %6, %while.body ], [ %0, %entry ] %mul = mul nsw i32 %3, %4 %5 = and i32 %mul, 1 %cmp2 = icmp eq i32 %5, 0 %str.3.str = select i1 %cmp2, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r, ptr noundef nonnull %c) %6 = load i32, ptr %r, align 4, !tbaa !5 %cmp = icmp ne i32 %6, 0 %7 = load i32, ptr %c, align 4 %cmp1 = icmp ne i32 %7, 0 %8 = select i1 %cmp, i1 %cmp1, i1 false br i1 %8, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int N,K,A[2001],i,j; long int a=0,b=0,sum; scanf("%d %d",&N,&K); for(i=0;i<N;i++){ scanf("%d ", &A[i]); } for(i=0;i<N;i++){ for(j=i+1;j<N;j++){ if(A[i] > A[j]){ a++; } } for(j=0;j<i;j++){ if(A[i] > A[j]){ b++; } } } sum = (a+b)*(((long int)K*(K-1)/2)%1000000007)+a*K; printf("%ld\n",sum%1000000007); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266540/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266540/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \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 i32, align 4 %K = alloca i32, align 4 %A = alloca [2001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 call void @llvm.lifetime.start.p0(i64 8004, ptr nonnull %A) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp59 = icmp sgt i32 %0, 0 br i1 %cmp59, label %for.body, label %for.end33 for.cond2.preheader: ; preds = %for.body %cmp369 = icmp sgt i32 %2, 0 br i1 %cmp369, label %for.body4.preheader, label %for.end33 for.body4.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %2 to i64 %wide.trip.count90 = zext i32 %2 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [2001 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %N, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond2.loopexit: ; preds = %for.body19, %middle.block, %for.cond17.preheader %b.1.lcssa = phi i64 [ %b.071, %for.cond17.preheader ], [ %29, %middle.block ], [ %spec.select58, %for.body19 ] %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %exitcond91.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count90 br i1 %exitcond91.not, label %for.end33, label %for.body4, !llvm.loop !11 for.body4: ; preds = %for.body4.preheader, %for.cond2.loopexit %indvars.iv87 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next88, %for.cond2.loopexit ] %indvars.iv77 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next78, %for.cond2.loopexit ] %b.071 = phi i64 [ 0, %for.body4.preheader ], [ %b.1.lcssa, %for.cond2.loopexit ] %a.070 = phi i64 [ 0, %for.body4.preheader ], [ %a.1.lcssa, %for.cond2.loopexit ] %4 = xor i64 %indvars.iv87, -1 %5 = add nsw i64 %4, %wide.trip.count90 %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1 %cmp661 = icmp ult i64 %indvars.iv.next88, %1 br i1 %cmp661, label %for.body7.lr.ph, label %for.cond17.preheader for.body7.lr.ph: ; preds = %for.body4 %arrayidx9 = getelementptr inbounds [2001 x i32], ptr %A, i64 0, i64 %indvars.iv87 %6 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %min.iters.check98 = icmp ult i64 %5, 4 br i1 %min.iters.check98, label %for.body7.preheader, label %vector.ph99 vector.ph99: ; preds = %for.body7.lr.ph %n.vec101 = and i64 %5, -4 %ind.end = add i64 %indvars.iv77, %n.vec101 %7 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %a.070, i64 0 %broadcast.splatinsert110 = insertelement <2 x i32> poison, i32 %6, i64 0 %broadcast.splat111 = shufflevector <2 x i32> %broadcast.splatinsert110, <2 x i32> poison, <2 x i32> zeroinitializer br label %vector.body104 vector.body104: ; preds = %vector.body104, %vector.ph99 %index105 = phi i64 [ 0, %vector.ph99 ], [ %index.next112, %vector.body104 ] %vec.phi106 = phi <2 x i64> [ %7, %vector.ph99 ], [ %14, %vector.body104 ] %vec.phi107 = phi <2 x i64> [ zeroinitializer, %vector.ph99 ], [ %15, %vector.body104 ] %offset.idx = add i64 %indvars.iv77, %index105 %8 = getelementptr inbounds [2001 x i32], ptr %A, i64 0, i64 %offset.idx %wide.load108 = load <2 x i32>, ptr %8, align 4, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 2 %wide.load109 = load <2 x i32>, ptr %9, align 4, !tbaa !5 %10 = icmp sgt <2 x i32> %broadcast.splat111, %wide.load108 %11 = icmp sgt <2 x i32> %broadcast.splat111, %wide.load109 %12 = zext <2 x i1> %10 to <2 x i64> %13 = zext <2 x i1> %11 to <2 x i64> %14 = add <2 x i64> %vec.phi106, %12 %15 = add <2 x i64> %vec.phi107, %13 %index.next112 = add nuw i64 %index105, 4 %16 = icmp eq i64 %index.next112, %n.vec101 br i1 %16, label %middle.block96, label %vector.body104, !llvm.loop !12 middle.block96: ; preds = %vector.body104 %bin.rdx113 = add <2 x i64> %15, %14 %17 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx113) %cmp.n103 = icmp eq i64 %5, %n.vec101 br i1 %cmp.n103, label %for.cond17.preheader, label %for.body7.preheader for.body7.preheader: ; preds = %for.body7.lr.ph, %middle.block96 %indvars.iv79.ph = phi i64 [ %indvars.iv77, %for.body7.lr.ph ], [ %ind.end, %middle.block96 ] %a.163.ph = phi i64 [ %a.070, %for.body7.lr.ph ], [ %17, %middle.block96 ] br label %for.body7 for.cond17.preheader: ; preds = %for.body7, %middle.block96, %for.body4 %a.1.lcssa = phi i64 [ %a.070, %for.body4 ], [ %17, %middle.block96 ], [ %spec.select, %for.body7 ] %cmp1865.not = icmp eq i64 %indvars.iv87, 0 br i1 %cmp1865.not, label %for.cond2.loopexit, label %for.body19.lr.ph for.body19.lr.ph: ; preds = %for.cond17.preheader %arrayidx21 = getelementptr inbounds [2001 x i32], ptr %A, i64 0, i64 %indvars.iv87 %18 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %min.iters.check = icmp ult i64 %indvars.iv87, 4 br i1 %min.iters.check, label %for.body19.preheader, label %vector.ph vector.ph: ; preds = %for.body19.lr.ph %n.vec = and i64 %indvars.iv87, 9223372036854775804 %19 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %b.071, i64 0 %broadcast.splatinsert = insertelement <2 x i32> poison, i32 %18, i64 0 %broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> poison, <2 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 <2 x i64> [ %19, %vector.ph ], [ %26, %vector.body ] %vec.phi94 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %27, %vector.body ] %20 = getelementptr inbounds [2001 x i32], ptr %A, i64 0, i64 %index %wide.load = load <2 x i32>, ptr %20, align 16, !tbaa !5 %21 = getelementptr inbounds i32, ptr %20, i64 2 %wide.load95 = load <2 x i32>, ptr %21, align 8, !tbaa !5 %22 = icmp sgt <2 x i32> %broadcast.splat, %wide.load %23 = icmp sgt <2 x i32> %broadcast.splat, %wide.load95 %24 = zext <2 x i1> %22 to <2 x i64> %25 = zext <2 x i1> %23 to <2 x i64> %26 = add <2 x i64> %vec.phi, %24 %27 = add <2 x i64> %vec.phi94, %25 %index.next = add nuw i64 %index, 4 %28 = icmp eq i64 %index.next, %n.vec br i1 %28, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %27, %26 %29 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %indvars.iv87, %n.vec br i1 %cmp.n, label %for.cond2.loopexit, label %for.body19.preheader for.body19.preheader: ; preds = %for.body19.lr.ph, %middle.block %indvars.iv82.ph = phi i64 [ 0, %for.body19.lr.ph ], [ %n.vec, %middle.block ] %b.167.ph = phi i64 [ %b.071, %for.body19.lr.ph ], [ %29, %middle.block ] br label %for.body19 for.body7: ; preds = %for.body7.preheader, %for.body7 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body7 ], [ %indvars.iv79.ph, %for.body7.preheader ] %a.163 = phi i64 [ %spec.select, %for.body7 ], [ %a.163.ph, %for.body7.preheader ] %arrayidx11 = getelementptr inbounds [2001 x i32], ptr %A, i64 0, i64 %indvars.iv79 %30 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %6, %30 %inc13 = zext i1 %cmp12 to i64 %spec.select = add nsw i64 %a.163, %inc13 %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %exitcond.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count90 br i1 %exitcond.not, label %for.cond17.preheader, label %for.body7, !llvm.loop !16 for.body19: ; preds = %for.body19.preheader, %for.body19 %indvars.iv82 = phi i64 [ %indvars.iv.next83, %for.body19 ], [ %indvars.iv82.ph, %for.body19.preheader ] %b.167 = phi i64 [ %spec.select58, %for.body19 ], [ %b.167.ph, %for.body19.preheader ] %arrayidx23 = getelementptr inbounds [2001 x i32], ptr %A, i64 0, i64 %indvars.iv82 %31 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %cmp24 = icmp sgt i32 %18, %31 %inc26 = zext i1 %cmp24 to i64 %spec.select58 = add nsw i64 %b.167, %inc26 %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1 %exitcond86.not = icmp eq i64 %indvars.iv.next83, %indvars.iv87 br i1 %exitcond86.not, label %for.cond2.loopexit, label %for.body19, !llvm.loop !17 for.end33: ; preds = %for.cond2.loopexit, %entry, %for.cond2.preheader %a.0.lcssa = phi i64 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %a.1.lcssa, %for.cond2.loopexit ] %b.0.lcssa = phi i64 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %b.1.lcssa, %for.cond2.loopexit ] %add34 = add nsw i64 %b.0.lcssa, %a.0.lcssa %32 = load i32, ptr %K, align 4, !tbaa !5 %conv = sext i32 %32 to i64 %sub = add nsw i32 %32, -1 %conv35 = sext i32 %sub to i64 %mul = mul nsw i64 %conv35, %conv %div = sdiv i64 %mul, 2 %rem = srem i64 %div, 1000000007 %mul36 = mul nsw i64 %rem, %add34 %mul38 = mul nsw i64 %a.0.lcssa, %conv %add39 = add nsw i64 %mul36, %mul38 %rem40 = srem i64 %add39, 1000000007 %call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %rem40) call void @llvm.lifetime.end.p0(i64 8004, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #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 i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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, !13, !14} !16 = distinct !{!16, !10, !14, !13} !17 = distinct !{!17, !10, !14, !13}
#include<stdio.h> #include<math.h> int main(){ int i, ii; char op[1000]; int a[1000]; int b[1000]; int ans[1000]; for(i=0;i < 1000;i++){ a[i] = 0; } for(i=0;i < 1000;i++){ b[i] = 0; } for(i=0;i < 1000;i++){ op[i] = ' '; } for(i=0;i < 1000;i++){ ans[i] = 0; } i = 0; ii = 0; while(1){ scanf("%d %c %d", &a[i], &op[i], &b[i]); if(op[i] == '?') break; ii++; i++; if(i > 1000) break; } i = 0; while(i <= ii){ if(op[i] == '+'){ ans[i] = a[i] + b[i]; }else if(op[i] == '-'){ ans[i] = a[i] - b[i]; }else if(op[i] == '*'){ ans[i] = a[i] * b[i]; }else if(op[i] == '/'){ ans[i] = a[i] / b[i]; }else{ break; } i++; } for(i=0;i<ii;i++){ printf("%d\n", ans[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266605/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266605/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %op = alloca [1000 x i8], align 16 %a = alloca [1000 x i32], align 16 %b = alloca [1000 x i32], align 16 %ans = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %op) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %ans) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %a, i8 0, i64 4000, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %b, i8 0, i64 4000, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1000) %op, i8 32, i64 1000, i1 false), !tbaa !9 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %ans, i8 0, i64 4000, i1 false), !tbaa !5 br label %while.cond while.cond: ; preds = %entry, %if.end %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %if.end ] %arrayidx26 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv %arrayidx28 = getelementptr inbounds [1000 x i8], ptr %op, i64 0, i64 %indvars.iv %arrayidx30 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx26, ptr noundef nonnull %arrayidx28, ptr noundef nonnull %arrayidx30) %0 = load i8, ptr %arrayidx28, align 1, !tbaa !9 %cmp33 = icmp eq i8 %0, 63 br i1 %cmp33, label %while.end.split.loop.exit175, label %if.end if.end: ; preds = %while.cond %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 1001 br i1 %exitcond, label %while.end, label %while.cond while.end.split.loop.exit175: ; preds = %while.cond %indvars165.le = trunc i64 %indvars.iv to i32 br label %while.end while.end: ; preds = %if.end, %while.end.split.loop.exit175 %ii.1 = phi i32 [ %indvars165.le, %while.end.split.loop.exit175 ], [ 1001, %if.end ] %1 = add nuw nsw i32 %ii.1, 1 %wide.trip.count = zext i32 %1 to i64 br label %while.body44 while.body44: ; preds = %while.end, %if.end99 %indvars.iv166 = phi i64 [ 0, %while.end ], [ %indvars.iv.next167, %if.end99 ] %arrayidx46 = getelementptr inbounds [1000 x i8], ptr %op, i64 0, i64 %indvars.iv166 %2 = load i8, ptr %arrayidx46, align 1, !tbaa !9 switch i8 %2, label %while.end101 [ i8 43, label %if.then50 i8 45, label %if.then62 i8 42, label %if.then75 i8 47, label %if.then88 ] if.then50: ; preds = %while.body44 %arrayidx52 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv166 %3 = load i32, ptr %arrayidx52, align 4, !tbaa !5 %arrayidx54 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv166 %4 = load i32, ptr %arrayidx54, align 4, !tbaa !5 %add = add nsw i32 %4, %3 br label %if.end99 if.then62: ; preds = %while.body44 %arrayidx64 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv166 %5 = load i32, ptr %arrayidx64, align 4, !tbaa !5 %arrayidx66 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv166 %6 = load i32, ptr %arrayidx66, align 4, !tbaa !5 %sub = sub nsw i32 %5, %6 br label %if.end99 if.then75: ; preds = %while.body44 %arrayidx77 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv166 %7 = load i32, ptr %arrayidx77, align 4, !tbaa !5 %arrayidx79 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv166 %8 = load i32, ptr %arrayidx79, align 4, !tbaa !5 %mul = mul nsw i32 %8, %7 br label %if.end99 if.then88: ; preds = %while.body44 %arrayidx90 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv166 %9 = load i32, ptr %arrayidx90, align 4, !tbaa !5 %arrayidx92 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv166 %10 = load i32, ptr %arrayidx92, align 4, !tbaa !5 %div = sdiv i32 %9, %10 br label %if.end99 if.end99: ; preds = %if.then62, %if.then88, %if.then75, %if.then50 %sub.sink = phi i32 [ %sub, %if.then62 ], [ %div, %if.then88 ], [ %mul, %if.then75 ], [ %add, %if.then50 ] %arrayidx68 = getelementptr inbounds [1000 x i32], ptr %ans, i64 0, i64 %indvars.iv166 store i32 %sub.sink, ptr %arrayidx68, align 4, !tbaa !5 %indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1 %exitcond169.not = icmp eq i64 %indvars.iv.next167, %wide.trip.count br i1 %exitcond169.not, label %while.end101, label %while.body44, !llvm.loop !10 while.end101: ; preds = %while.body44, %if.end99 %cmp103157 = icmp sgt i32 %ii.1, 0 br i1 %cmp103157, label %for.body105.preheader, label %for.end111 for.body105.preheader: ; preds = %while.end101 %wide.trip.count173 = zext i32 %ii.1 to i64 br label %for.body105 for.body105: ; preds = %for.body105.preheader, %for.body105 %indvars.iv170 = phi i64 [ 0, %for.body105.preheader ], [ %indvars.iv.next171, %for.body105 ] %arrayidx107 = getelementptr inbounds [1000 x i32], ptr %ans, i64 0, i64 %indvars.iv170 %11 = load i32, ptr %arrayidx107, align 4, !tbaa !5 %call108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11) %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1 %exitcond174.not = icmp eq i64 %indvars.iv.next171, %wide.trip.count173 br i1 %exitcond174.not, label %for.end111, label %for.body105, !llvm.loop !12 for.end111: ; preds = %for.body105, %while.end101 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %ans) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %op) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include <stdio.h> int main(void){ int a,b; char op; while(scanf("%d %s %d",&a,&op,&b)==3){ if(op == '?') break; switch(op){ case '+' :{ printf("%d\n",a+b); break; } case '-' :{ printf("%d\n",a-b); break; } case '*' :{ printf("%d\n",a*b); break;} case '/' :{ printf("%d\n",a/b); break; } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266670/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266670/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %s %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %cmp12 = icmp ne i32 %call11, 3 %0 = load i8, ptr %op, align 1 %cmp113 = icmp eq i8 %0, 63 %or.cond14 = select i1 %cmp12, i1 true, i1 %cmp113 br i1 %or.cond14, label %while.end, label %if.end if.end: ; preds = %entry, %sw.epilog %1 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ] %conv = sext i8 %1 to i32 switch i32 %conv, label %sw.epilog [ i32 43, label %sw.bb i32 45, label %sw.bb5 i32 42, label %sw.bb7 i32 47, label %sw.bb9 ] sw.bb: ; preds = %if.end %2 = load i32, ptr %a, align 4, !tbaa !5 %3 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %3, %2 br label %sw.epilog.sink.split sw.bb5: ; preds = %if.end %4 = load i32, ptr %a, align 4, !tbaa !5 %5 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %4, %5 br label %sw.epilog.sink.split sw.bb7: ; preds = %if.end %6 = load i32, ptr %a, align 4, !tbaa !5 %7 = load i32, ptr %b, align 4, !tbaa !5 %mul = mul nsw i32 %7, %6 br label %sw.epilog.sink.split sw.bb9: ; preds = %if.end %8 = load i32, ptr %a, align 4, !tbaa !5 %9 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %8, %9 br label %sw.epilog.sink.split sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb5, %sw.bb7, %sw.bb9 %div.sink = phi i32 [ %div, %sw.bb9 ], [ %mul, %sw.bb7 ], [ %sub, %sw.bb5 ], [ %add, %sw.bb ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink) br label %sw.epilog sw.epilog: ; preds = %sw.epilog.sink.split, %if.end %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %cmp = icmp ne i32 %call, 3 %10 = load i8, ptr %op, align 1 %cmp1 = icmp eq i8 %10, 63 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 br i1 %or.cond, label %while.end, label %if.end, !llvm.loop !9 while.end: ; preds = %sw.epilog, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int a,b; char op; while(1){scanf("%d %c %d",&a,&op,&b); if(op=='+'){printf("%d\n",a+b); }else if(op=='-'){printf("%d\n",a-b); }else if(op=='*'){printf("%d\n",a*b); }else if(op=='/'){printf("%d\n",a/b); }else if(op=='?'){break;} } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266713/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266713/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i8, ptr %op, align 1, !tbaa !5 switch i8 %0, label %while.cond.backedge [ i8 43, label %if.then i8 45, label %if.then6 i8 42, label %if.then12 i8 47, label %if.then18 i8 63, label %while.end ] if.then: ; preds = %while.cond %1 = load i32, ptr %a, align 4, !tbaa !8 %2 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %2, %1 br label %if.end28.sink.split if.then6: ; preds = %while.cond %3 = load i32, ptr %a, align 4, !tbaa !8 %4 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %3, %4 br label %if.end28.sink.split if.then12: ; preds = %while.cond %5 = load i32, ptr %a, align 4, !tbaa !8 %6 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %6, %5 br label %if.end28.sink.split if.then18: ; preds = %while.cond %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %7, %8 br label %if.end28.sink.split if.end28.sink.split: ; preds = %if.then, %if.then12, %if.then18, %if.then6 %sub.sink = phi i32 [ %sub, %if.then6 ], [ %div, %if.then18 ], [ %mul, %if.then12 ], [ %add, %if.then ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) br label %while.cond.backedge while.cond.backedge: ; preds = %if.end28.sink.split, %while.cond br label %while.cond while.end: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}
#include<stdio.h> int main(){ int a,b,h,i,j,k; char op; while(1){ scanf("%d %c %d",&a,&op,&b); h=a+b; i=a-b; j=a*b; k=a/b; if(op == '?'){ break; } else if(op == '+'){ printf("%d\n",h); } else if(op == '-'){ printf("%d\n",i); } else if(op == '*'){ printf("%d\n",j); } else if(op == '/'){ printf("%d\n",k); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266757/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266757/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i8, ptr %op, align 1, !tbaa !9 switch i8 %2, label %while.cond.backedge [ i8 63, label %while.end i8 43, label %if.then5 i8 45, label %if.then11 i8 42, label %if.then17 i8 47, label %if.then23 ] if.then5: ; preds = %while.cond %add = add nsw i32 %1, %0 br label %if.end28.sink.split if.then11: ; preds = %while.cond %sub = sub nsw i32 %0, %1 br label %if.end28.sink.split if.then17: ; preds = %while.cond %mul = mul nsw i32 %1, %0 br label %if.end28.sink.split if.then23: ; preds = %while.cond %div = sdiv i32 %0, %1 br label %if.end28.sink.split if.end28.sink.split: ; preds = %if.then11, %if.then23, %if.then17, %if.then5 %add.sink = phi i32 [ %add, %if.then5 ], [ %mul, %if.then17 ], [ %div, %if.then23 ], [ %sub, %if.then11 ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink) br label %while.cond.backedge while.cond.backedge: ; preds = %if.end28.sink.split, %while.cond br label %while.cond while.end: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0}
#include <stdio.h> #include <stdlib.h> int main() { int a,b,c; scanf("%d%d%d",&a,&b,&c); if (a+c<=b) printf("%d\n",(a+c)*2); else if (b+c<=a) printf("%d\n",(b+c)*2); else printf("%d\n",(a+b+c)/2*2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26680/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26680/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %c, align 4, !tbaa !5 %add = add i32 %1, %0 %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %add, %2 br i1 %cmp.not, label %if.else, label %if.end14 if.else: ; preds = %entry %add3 = add nsw i32 %2, %1 %cmp4.not = icmp sgt i32 %add3, %0 br i1 %cmp4.not, label %if.else9, label %if.end14 if.else9: ; preds = %if.else %add11 = add i32 %add, %2 %div = sdiv i32 %add11, 2 br label %if.end14 if.end14: ; preds = %if.else, %entry, %if.else9 %add3.sink = phi i32 [ %div, %if.else9 ], [ %add, %entry ], [ %add3, %if.else ] %mul7 = shl nsw i32 %add3.sink, 1 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul7) 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; char op; while(1) { scanf("%d %c %d",&a,&op,&b); if(op == '?') break; if(op == '+') printf("%d\n",a+b); else if(op == '-') printf("%d\n",a-b); else if(op == '*') printf("%d\n",a*b); else if(op == '/') printf("%d\n",a/b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266843/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266843/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i8, ptr %op, align 1, !tbaa !5 switch i8 %0, label %while.cond.backedge [ i8 63, label %while.end i8 43, label %if.then5 i8 45, label %if.then10 i8 42, label %if.then16 i8 47, label %if.then22 ] if.then5: ; preds = %while.cond %1 = load i32, ptr %a, align 4, !tbaa !8 %2 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %2, %1 br label %if.end27.sink.split if.then10: ; preds = %while.cond %3 = load i32, ptr %a, align 4, !tbaa !8 %4 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %3, %4 br label %if.end27.sink.split if.then16: ; preds = %while.cond %5 = load i32, ptr %a, align 4, !tbaa !8 %6 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %6, %5 br label %if.end27.sink.split if.then22: ; preds = %while.cond %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %7, %8 br label %if.end27.sink.split if.end27.sink.split: ; preds = %if.then5, %if.then16, %if.then22, %if.then10 %sub.sink = phi i32 [ %sub, %if.then10 ], [ %div, %if.then22 ], [ %mul, %if.then16 ], [ %add, %if.then5 ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) br label %while.cond.backedge while.cond.backedge: ; preds = %if.end27.sink.split, %while.cond br label %while.cond while.end: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}
#include <stdio.h> int main(){ int a,b,i; char op; for (i=0;;) { scanf("%d %c %d",&a,&op,&b); if (op=='+') { printf("%d\n",a+b); } else if(op=='-'){ printf("%d\n",a-b); } else if(op=='*'){ printf("%d\n",a*b); } else if(op=='/'){ printf("%d\n",a/b); } else break; } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266887/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266887/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 br label %for.cond for.cond: ; preds = %if.end23, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i8, ptr %op, align 1, !tbaa !5 switch i8 %0, label %for.end [ i8 43, label %if.then i8 45, label %if.then6 i8 42, label %if.then12 i8 47, label %if.then18 ] if.then: ; preds = %for.cond %1 = load i32, ptr %a, align 4, !tbaa !8 %2 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %2, %1 br label %if.end23 if.then6: ; preds = %for.cond %3 = load i32, ptr %a, align 4, !tbaa !8 %4 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %3, %4 br label %if.end23 if.then12: ; preds = %for.cond %5 = load i32, ptr %a, align 4, !tbaa !8 %6 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %6, %5 br label %if.end23 if.then18: ; preds = %for.cond %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %7, %8 br label %if.end23 if.end23: ; preds = %if.then6, %if.then18, %if.then12, %if.then %sub.sink = phi i32 [ %sub, %if.then6 ], [ %div, %if.then18 ], [ %mul, %if.then12 ], [ %add, %if.then ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) br label %for.cond for.end: ; preds = %for.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}
#include <stdio.h> int main(void) { int l, r, a; scanf("%d%d%d", &l, &r, &a); if(l > r) { int t = l; l = r; r = t; } if(a + l <= r) { printf("%d\n", 2 * (a + l)); } else { printf("%d\n", 2 * (r + (a + l - r) / 2)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26693/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26693/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %l = alloca i32, align 4 %r = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r, ptr noundef nonnull %a) %0 = load i32, ptr %l, align 4, !tbaa !5 %1 = load i32, ptr %r, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %l, align 4, !tbaa !5 store i32 %0, ptr %r, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %1, %if.then ], [ %0, %entry ] %4 = load i32, ptr %a, align 4, !tbaa !5 %add = add nsw i32 %3, %4 %cmp1.not = icmp sgt i32 %add, %2 br i1 %cmp1.not, label %if.else, label %if.end9 if.else: ; preds = %if.end %sub = sub nsw i32 %add, %2 %div = sdiv i32 %sub, 2 %add6 = add nsw i32 %div, %2 br label %if.end9 if.end9: ; preds = %if.end, %if.else %add6.sink = phi i32 [ %add6, %if.else ], [ %add, %if.end ] %mul7 = shl nsw i32 %add6.sink, 1 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul7) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ char op; int a,b; do{ scanf("%d %[+-*/?] %d",&a,&op,&b); switch(op){ case'+' :printf("%d\n",a+b); break; case'-' :printf("%d\n",a-b); break; case'*' :printf("%d\n",a*b); break; case'/' :printf("%d\n",a/b); break; } }while(op!='?'); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266980/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266980/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 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: %op = alloca i8, align 1 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 br label %do.body do.body: ; preds = %do.cond, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i8, ptr %op, align 1, !tbaa !5 %conv = sext i8 %0 to i32 switch i32 %conv, label %do.cond [ i32 43, label %sw.bb i32 45, label %sw.bb2 i32 42, label %sw.bb4 i32 47, label %sw.bb6 ] sw.bb: ; preds = %do.body %1 = load i32, ptr %a, align 4, !tbaa !8 %2 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %2, %1 br label %do.condthread-pre-split sw.bb2: ; preds = %do.body %3 = load i32, ptr %a, align 4, !tbaa !8 %4 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %3, %4 br label %do.condthread-pre-split sw.bb4: ; preds = %do.body %5 = load i32, ptr %a, align 4, !tbaa !8 %6 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %6, %5 br label %do.condthread-pre-split sw.bb6: ; preds = %do.body %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %7, %8 br label %do.condthread-pre-split do.condthread-pre-split: ; preds = %sw.bb6, %sw.bb4, %sw.bb2, %sw.bb %div.sink = phi i32 [ %div, %sw.bb6 ], [ %mul, %sw.bb4 ], [ %sub, %sw.bb2 ], [ %add, %sw.bb ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink) %.pr = load i8, ptr %op, align 1, !tbaa !5 br label %do.cond do.cond: ; preds = %do.condthread-pre-split, %do.body %9 = phi i8 [ %.pr, %do.condthread-pre-split ], [ %0, %do.body ] %cmp.not = icmp eq i8 %9, 63 br i1 %cmp.not, label %do.end, label %do.body, !llvm.loop !10 do.end: ; preds = %do.cond call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int a,b; char op; while(1){ scanf("%d %c %d",&a,&op,&b); if(op==('+')){ printf("%d\n",a+b); } else if(op==('-')){ printf("%d\n",a-b); } else if(op==('*')){ printf("%d\n",a*b); } else if(op==('/')){ printf("%d\n",a/b); } else if(op==('?')) break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267022/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267022/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i8, ptr %op, align 1, !tbaa !5 switch i8 %0, label %while.cond.backedge [ i8 43, label %if.then i8 45, label %if.then6 i8 42, label %if.then12 i8 47, label %if.then18 i8 63, label %while.end ] if.then: ; preds = %while.cond %1 = load i32, ptr %a, align 4, !tbaa !8 %2 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %2, %1 br label %if.end28.sink.split if.then6: ; preds = %while.cond %3 = load i32, ptr %a, align 4, !tbaa !8 %4 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %3, %4 br label %if.end28.sink.split if.then12: ; preds = %while.cond %5 = load i32, ptr %a, align 4, !tbaa !8 %6 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %6, %5 br label %if.end28.sink.split if.then18: ; preds = %while.cond %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %7, %8 br label %if.end28.sink.split if.end28.sink.split: ; preds = %if.then, %if.then12, %if.then18, %if.then6 %sub.sink = phi i32 [ %sub, %if.then6 ], [ %div, %if.then18 ], [ %mul, %if.then12 ], [ %add, %if.then ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) br label %while.cond.backedge while.cond.backedge: ; preds = %if.end28.sink.split, %while.cond br label %while.cond while.end: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}
#include <stdio.h> int main(void){ int a,b; char op; while(1){ //input scanf("%d %s %d",&a, &op, &b); switch(op){ case '+': printf("%d\n", a+b); break; case '-': printf("%d\n", a-b); break; case '*': printf("%d\n", a*b); break; case '/': printf("%d\n", a/b); break; case '?': return 0; default: break; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267066/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267066/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %s %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i8, ptr %op, align 1, !tbaa !5 %conv = sext i8 %0 to i32 switch i32 %conv, label %while.cond.backedge [ i32 43, label %sw.bb i32 45, label %sw.bb2 i32 42, label %sw.bb4 i32 47, label %sw.bb6 i32 63, label %sw.bb8 ] sw.bb: ; preds = %while.cond %1 = load i32, ptr %a, align 4, !tbaa !8 %2 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %2, %1 br label %sw.epilog.sink.split sw.bb2: ; preds = %while.cond %3 = load i32, ptr %a, align 4, !tbaa !8 %4 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %3, %4 br label %sw.epilog.sink.split sw.bb4: ; preds = %while.cond %5 = load i32, ptr %a, align 4, !tbaa !8 %6 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %6, %5 br label %sw.epilog.sink.split sw.bb6: ; preds = %while.cond %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %7, %8 br label %sw.epilog.sink.split sw.bb8: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb2, %sw.bb4, %sw.bb6 %div.sink = phi i32 [ %div, %sw.bb6 ], [ %mul, %sw.bb4 ], [ %sub, %sw.bb2 ], [ %add, %sw.bb ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink) br label %while.cond.backedge while.cond.backedge: ; preds = %sw.epilog.sink.split, %while.cond br label %while.cond } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}
#include <stdio.h> int main(){ int a, b; char op; while(1){ scanf("%d %c %d", &a, &op, &b); if(op == '?') break; else if(op == '+') printf("%d\n",a+b); else if(op == '-') printf("%d\n",a-b); else if(op == '*') printf("%d\n", a*b); else if(op == '/') printf("%d\n", a/b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267109/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267109/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i8, ptr %op, align 1, !tbaa !5 switch i8 %0, label %while.cond.backedge [ i8 63, label %while.end i8 43, label %if.then5 i8 45, label %if.then11 i8 42, label %if.then17 i8 47, label %if.then23 ] if.then5: ; preds = %while.cond %1 = load i32, ptr %a, align 4, !tbaa !8 %2 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %2, %1 br label %if.end28.sink.split if.then11: ; preds = %while.cond %3 = load i32, ptr %a, align 4, !tbaa !8 %4 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %3, %4 br label %if.end28.sink.split if.then17: ; preds = %while.cond %5 = load i32, ptr %a, align 4, !tbaa !8 %6 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %6, %5 br label %if.end28.sink.split if.then23: ; preds = %while.cond %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %7, %8 br label %if.end28.sink.split if.end28.sink.split: ; preds = %if.then11, %if.then23, %if.then17, %if.then5 %add.sink = phi i32 [ %add, %if.then5 ], [ %mul, %if.then17 ], [ %div, %if.then23 ], [ %sub, %if.then11 ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink) br label %while.cond.backedge while.cond.backedge: ; preds = %if.end28.sink.split, %while.cond br label %while.cond while.end: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}
#include<stdio.h> int main(){ int a,b; int x; char op; while(1){ scanf("%d%*c%c%d",&a,&op,&b); if(op == '?') break; if(op == '+') x=a+b; else if(op == '-') x=a-b; else if(op == '*') x=a*b; else if(op == '/') x=a/b; printf("%d\n",x); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267202/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267202/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%d%*c%c%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 br label %while.cond while.cond: ; preds = %if.end23, %entry %x.0 = phi i32 [ undef, %entry ], [ %x.1, %if.end23 ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i8, ptr %op, align 1, !tbaa !5 switch i8 %0, label %if.end23 [ i8 63, label %while.end i8 43, label %if.then5 i8 45, label %if.then9 i8 42, label %if.then14 i8 47, label %if.then19 ] if.then5: ; preds = %while.cond %1 = load i32, ptr %a, align 4, !tbaa !8 %2 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %2, %1 br label %if.end23 if.then9: ; preds = %while.cond %3 = load i32, ptr %a, align 4, !tbaa !8 %4 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %3, %4 br label %if.end23 if.then14: ; preds = %while.cond %5 = load i32, ptr %a, align 4, !tbaa !8 %6 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %6, %5 br label %if.end23 if.then19: ; preds = %while.cond %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %7, %8 br label %if.end23 if.end23: ; preds = %while.cond, %if.then9, %if.then19, %if.then14, %if.then5 %x.1 = phi i32 [ %add, %if.then5 ], [ %sub, %if.then9 ], [ %mul, %if.then14 ], [ %div, %if.then19 ], [ %x.0, %while.cond ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.1) br label %while.cond while.end: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}
#include <stdio.h> int main(void) { int a,b,r; char o; while(1){ scanf("%d %c %d",&a,&o,&b); if(o=='?') break; if(o=='+') r=a+b; if(o=='-') r=a-b; if(o=='*') r=a*b; if(o=='/') r=a/b; printf("%d\n",r); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267246/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267246/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %o = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %o) #3 br label %while.cond while.cond: ; preds = %if.end21, %entry %r.0 = phi i32 [ undef, %entry ], [ %r.4, %if.end21 ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %o, ptr noundef nonnull %b) %0 = load i8, ptr %o, align 1, !tbaa !5 switch i8 %0, label %while.cond.if.end6_crit_edge [ i8 63, label %while.end i8 43, label %if.then5 ] while.cond.if.end6_crit_edge: ; preds = %while.cond %.pre = load i32, ptr %a, align 4 %.pre23 = load i32, ptr %b, align 4 br label %if.end6 if.then5: ; preds = %while.cond %1 = load i32, ptr %a, align 4 %2 = load i32, ptr %b, align 4 %add = add nsw i32 %2, %1 br label %if.end6 if.end6: ; preds = %while.cond.if.end6_crit_edge, %if.then5 %3 = phi i32 [ %2, %if.then5 ], [ %.pre23, %while.cond.if.end6_crit_edge ] %4 = phi i32 [ %1, %if.then5 ], [ %.pre, %while.cond.if.end6_crit_edge ] %r.1 = phi i32 [ %add, %if.then5 ], [ %r.0, %while.cond.if.end6_crit_edge ] %cmp8 = icmp eq i8 %0, 45 %sub = sub nsw i32 %4, %3 %r.2 = select i1 %cmp8, i32 %sub, i32 %r.1 %cmp13 = icmp eq i8 %0, 42 %mul = mul nsw i32 %3, %4 %r.3 = select i1 %cmp13, i32 %mul, i32 %r.2 %cmp18 = icmp eq i8 %0, 47 br i1 %cmp18, label %if.then20, label %if.end21 if.then20: ; preds = %if.end6 %div = sdiv i32 %4, %3 br label %if.end21 if.end21: ; preds = %if.then20, %if.end6 %r.4 = phi i32 [ %div, %if.then20 ], [ %r.3, %if.end6 ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.4) br label %while.cond while.end: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %o) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> //#include <string.h> //#include <math.h> //#define ll long long int main() { int l, r, a; int i, j, k; scanf("%d %d %d", &l, &r, &a); if(l == 0 && a == 0) { printf("0\n"); return 0; } else if(r == 0 && a == 0) { printf("0\n"); return 0; } else if(l == r) { printf("%d\n", l + r + 2 * (a / 2)); return 0; } while(1) { if(l < r && a != 0) { l++; a--; } else if(r < l && a != 0) { r++; a--; } else if (l == r) { printf("%d\n", l + r + 2 * (a / 2)); break; } else if(a == 0) { if(l < r) k = 2 * l; else if (r < l) k = 2 * r; printf("%d\n", k); break; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26729/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26729/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %l = alloca i32, align 4 %r = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r, ptr noundef nonnull %a) %0 = load i32, ptr %l, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 0 %1 = load i32, ptr %a, align 4 %cmp1 = icmp eq i32 %1, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %puts64 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup if.else: ; preds = %entry %2 = load i32, ptr %r, align 4, !tbaa !5 %cmp3 = icmp eq i32 %2, 0 %or.cond56 = select i1 %cmp3, i1 %cmp1, i1 false br i1 %or.cond56, label %if.then6, label %if.else8 if.then6: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup if.else8: ; preds = %if.else %cmp9 = icmp eq i32 %0, %2 br i1 %cmp9, label %if.then10, label %while.cond.outer.outer if.then10: ; preds = %if.else8 %div = sdiv i32 %1, 2 %mul79 = add i32 %div, %0 %add11 = shl i32 %mul79, 1 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add11) br label %cleanup while.cond: ; preds = %while.cond.outer, %if.else34 br i1 %or.cond57, label %if.then18, label %if.else19 if.then18: ; preds = %while.cond %inc = add nsw i32 %inc72.ph, 1 store i32 %inc, ptr %l, align 4, !tbaa !5 %dec = add nsw i32 %.ph, -1 store i32 %dec, ptr %a, align 4, !tbaa !5 br label %while.cond.outer if.else19: ; preds = %while.cond br i1 %or.cond58, label %if.then23, label %if.else26 if.then23: ; preds = %if.else19 %inc24 = add nsw i32 %inc2474.ph.ph, 1 store i32 %inc24, ptr %r, align 4, !tbaa !5 %dec25 = add nsw i32 %.ph, -1 store i32 %dec25, ptr %a, align 4, !tbaa !5 br label %while.cond.outer.outer while.cond.outer.outer: ; preds = %if.else8, %if.then23 %.ph.ph = phi i32 [ %dec25, %if.then23 ], [ %1, %if.else8 ] %inc2474.ph.ph = phi i32 [ %inc24, %if.then23 ], [ %2, %if.else8 ] %inc72.ph.ph = phi i32 [ %inc72.ph, %if.then23 ], [ %0, %if.else8 ] br label %while.cond.outer while.cond.outer: ; preds = %while.cond.outer.outer, %if.then18 %.ph = phi i32 [ %dec, %if.then18 ], [ %.ph.ph, %while.cond.outer.outer ] %inc72.ph = phi i32 [ %inc, %if.then18 ], [ %inc72.ph.ph, %while.cond.outer.outer ] %cmp15 = icmp slt i32 %inc72.ph, %inc2474.ph.ph %cmp17 = icmp ne i32 %.ph, 0 %or.cond57 = select i1 %cmp15, i1 %cmp17, i1 false %cmp20 = icmp slt i32 %inc2474.ph.ph, %inc72.ph %or.cond58 = select i1 %cmp20, i1 %cmp17, i1 false %cmp27 = icmp eq i32 %inc72.ph, %inc2474.ph.ph %cmp35 = icmp eq i32 %.ph, 0 br label %while.cond if.else26: ; preds = %if.else19 br i1 %cmp27, label %if.then28, label %if.else34 if.then28: ; preds = %if.else26 %div30 = sdiv i32 %.ph, 2 %add2978 = add i32 %inc2474.ph.ph, %div30 %add32 = shl i32 %add2978, 1 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add32) br label %cleanup if.else34: ; preds = %if.else26 br i1 %cmp35, label %if.then36, label %while.cond if.then36: ; preds = %if.else34 %spec.select = call i32 @llvm.smin.i32(i32 %inc72.ph, i32 %inc2474.ph.ph) %k.0 = shl nsw i32 %spec.select, 1 %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %k.0) br label %cleanup cleanup: ; preds = %if.then28, %if.then36, %if.then10, %if.then6, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree 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 <stdlib.h> #define min(X, Y) (((X) < (Y)) ? (X) : (Y)) #define max(X, Y) (((X) > (Y)) ? (X) : (Y)) int main(){ int a,b,c; scanf("%d %d %d",&a,&b,&c); int k = max(a,b); int k1 = min(a,b); if(a == b){ a+= c/2; b+= c/2; printf("%d",a+b); } else{ while(k1<k && c>0){ k1++; c--; } if(k==k1 && c>=2){ k += c/2; k1+= c/2; } printf("%d",min(k,k1)*2); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26734/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26734/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %1 = load i32, ptr %b, align 4 %cond = call i32 @llvm.smax.i32(i32 %0, i32 %1) %cmp6 = icmp eq i32 %0, %1 br i1 %cmp6, label %if.then, label %while.cond.preheader while.cond.preheader: ; preds = %entry %cond5 = call i32 @llvm.smin.i32(i32 %0, i32 %1) %c.promoted = load i32, ptr %c, align 4 %c.promoted.fr = freeze i32 %c.promoted %cmp1139 = icmp slt i32 %cond5, %cond %cmp1240 = icmp sgt i32 %c.promoted.fr, 0 %2 = and i1 %cmp1139, %cmp1240 br i1 %2, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %while.cond.preheader %3 = add nsw i32 %c.promoted.fr, -1 %4 = xor i32 %cond5, -1 %5 = add i32 %cond, %4 %umin = call i32 @llvm.umin.i32(i32 %3, i32 %5) %6 = add i32 %umin, %cond5 %7 = add i32 %6, 1 %8 = sub nsw i32 %3, %umin store i32 %8, ptr %c, align 4, !tbaa !5 br label %while.end if.then: ; preds = %entry %9 = load i32, ptr %c, align 4, !tbaa !5 %div = sdiv i32 %9, 2 %add = add nsw i32 %div, %0 store i32 %add, ptr %a, align 4, !tbaa !5 store i32 %add, ptr %b, align 4, !tbaa !5 br label %if.end26 while.end: ; preds = %while.body.preheader, %while.cond.preheader %k1.0.lcssa = phi i32 [ %7, %while.body.preheader ], [ %cond5, %while.cond.preheader ] %.lcssa = phi i32 [ %8, %while.body.preheader ], [ %c.promoted.fr, %while.cond.preheader ] %cmp13 = icmp eq i32 %cond, %k1.0.lcssa %cmp14 = icmp sgt i32 %.lcssa, 1 %or.cond = and i1 %cmp13, %cmp14 %div1637 = lshr i32 %.lcssa, 1 %add17 = select i1 %or.cond, i32 %div1637, i32 0 %k.0 = add nsw i32 %add17, %cond %k1.1 = add nsw i32 %add17, %k1.0.lcssa %cond24 = call i32 @llvm.smin.i32(i32 %k.0, i32 %k1.1) br label %if.end26 if.end26: ; preds = %while.end, %if.then %cond24.sink = phi i32 [ %cond24, %while.end ], [ %add, %if.then ] %mul = shl nsw i32 %cond24.sink, 1 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #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 ; 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(int argc, char *argv[]){ int a,b; char op; int ans; scanf("%d %c %d", &a, &op, &b); while(op!='?'){ switch(op){ case '+': ans=a+b; break; case '-': ans=a-b; break; case '*': ans=a*b; break; case '/': ans=a/b; break; default: break; } printf("%d\n", ans); scanf("%d %c %d", &a, &op, &b); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267383/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267383/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i8, ptr %op, align 1, !tbaa !5 %cmp.not8 = icmp eq i8 %0, 63 br i1 %cmp.not8, label %while.end, label %while.body while.body: ; preds = %entry, %sw.epilog %1 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ] %ans.09 = phi i32 [ %ans.1, %sw.epilog ], [ undef, %entry ] %conv = sext i8 %1 to i32 switch i32 %conv, label %sw.epilog [ i32 43, label %sw.bb i32 45, label %sw.bb3 i32 42, label %sw.bb4 i32 47, label %sw.bb5 ] sw.bb: ; preds = %while.body %2 = load i32, ptr %a, align 4, !tbaa !8 %3 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %3, %2 br label %sw.epilog sw.bb3: ; preds = %while.body %4 = load i32, ptr %a, align 4, !tbaa !8 %5 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %4, %5 br label %sw.epilog sw.bb4: ; preds = %while.body %6 = load i32, ptr %a, align 4, !tbaa !8 %7 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %7, %6 br label %sw.epilog sw.bb5: ; preds = %while.body %8 = load i32, ptr %a, align 4, !tbaa !8 %9 = load i32, ptr %b, align 4, !tbaa !8 %div = sdiv i32 %8, %9 br label %sw.epilog sw.epilog: ; preds = %while.body, %sw.bb5, %sw.bb4, %sw.bb3, %sw.bb %ans.1 = phi i32 [ %ans.09, %while.body ], [ %div, %sw.bb5 ], [ %mul, %sw.bb4 ], [ %sub, %sw.bb3 ], [ %add, %sw.bb ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1) %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %10 = load i8, ptr %op, align 1, !tbaa !5 %cmp.not = icmp eq i8 %10, 63 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %sw.epilog, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define PI 3.141592653589 int main(void){ int a, b; char op; while(scanf("%d %c %d\n", &a, &op, &b) != EOF) { if (op == '?') break; if (b == 0 && op == '/') break; if (op == '+') printf("%d\n", a + b); if (op == '-') printf("%d\n", a - b); if (op == '*') printf("%d\n", a * b); if (op == '/') printf("%d\n", a / b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267426/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267426/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%d %c %d\0A\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 %call35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %cmp36 = icmp eq i32 %call35, -1 %0 = load i8, ptr %op, align 1 %cmp137 = icmp eq i8 %0, 63 %or.cond3438 = select i1 %cmp36, i1 true, i1 %cmp137 br i1 %or.cond3438, label %while.end, label %if.end if.end: ; preds = %entry, %if.end33 %1 = phi i8 [ %13, %if.end33 ], [ %0, %entry ] %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp3 = icmp eq i32 %2, 0 %cmp6 = icmp eq i8 %1, 47 %or.cond = select i1 %cmp3, i1 %cmp6, i1 false br i1 %or.cond, label %while.end, label %if.end9 if.end9: ; preds = %if.end %cmp11 = icmp eq i8 %1, 43 br i1 %cmp11, label %if.then13, label %if.end15 if.then13: ; preds = %if.end9 %3 = load i32, ptr %a, align 4, !tbaa !5 %add = add nsw i32 %3, %2 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %.pre = load i8, ptr %op, align 1, !tbaa !9 br label %if.end15 if.end15: ; preds = %if.then13, %if.end9 %4 = phi i8 [ %.pre, %if.then13 ], [ %1, %if.end9 ] %cmp17 = icmp eq i8 %4, 45 br i1 %cmp17, label %if.then19, label %if.end21 if.then19: ; preds = %if.end15 %5 = load i32, ptr %a, align 4, !tbaa !5 %6 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %5, %6 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) %.pr = load i8, ptr %op, align 1, !tbaa !9 br label %if.end21 if.end21: ; preds = %if.then19, %if.end15 %7 = phi i8 [ %.pr, %if.then19 ], [ %4, %if.end15 ] %cmp23 = icmp eq i8 %7, 42 br i1 %cmp23, label %if.then25, label %if.end27 if.then25: ; preds = %if.end21 %8 = load i32, ptr %a, align 4, !tbaa !5 %9 = load i32, ptr %b, align 4, !tbaa !5 %mul = mul nsw i32 %9, %8 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) %.pre39 = load i8, ptr %op, align 1, !tbaa !9 br label %if.end27 if.end27: ; preds = %if.then25, %if.end21 %10 = phi i8 [ %.pre39, %if.then25 ], [ %7, %if.end21 ] %cmp29 = icmp eq i8 %10, 47 br i1 %cmp29, label %if.then31, label %if.end33 if.then31: ; preds = %if.end27 %11 = load i32, ptr %a, align 4, !tbaa !5 %12 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %11, %12 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) br label %if.end33 if.end33: ; preds = %if.then31, %if.end27 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %cmp = icmp eq i32 %call, -1 %13 = load i8, ptr %op, align 1 %cmp1 = icmp eq i8 %13, 63 %or.cond34 = select i1 %cmp, i1 true, i1 %cmp1 br i1 %or.cond34, label %while.end, label %if.end, !llvm.loop !10 while.end: ; preds = %if.end33, %if.end, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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> #define MAXN 30000 int N, t; char avail[MAXN]; int main() { int i,k; scanf("%d %d\n", &N, &t); t--; avail[0] = 1; for(i=1; i<N; i++) avail[i] = 0; for(i=0; i<N; i++){ scanf("%d", &k); if(avail[i]) avail[i+k] = 1; } if(avail[t]) printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26747/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26747/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 @N = dso_local global i32 0, align 4 @t = dso_local global i32 0, align 4 @avail = dso_local local_unnamed_addr global [30000 x i8] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N, ptr noundef nonnull @t) %0 = load i32, ptr @t, align 4, !tbaa !5 %dec = add nsw i32 %0, -1 store i32 %dec, ptr @t, align 4, !tbaa !5 store i8 1, ptr @avail, align 16, !tbaa !9 %1 = load i32, ptr @N, align 4, !tbaa !5 %cmp26 = icmp sgt i32 %1, 1 br i1 %cmp26, label %for.cond1.preheader.thread, label %for.cond1.preheader for.cond1.preheader.thread: ; preds = %entry %2 = add nsw i32 %1, -1 %3 = zext i32 %2 to i64 tail call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds ([30000 x i8], ptr @avail, i64 0, i64 1), i8 0, i64 %3, i1 false), !tbaa !9 br label %for.body3.preheader for.cond1.preheader: ; preds = %entry %cmp228 = icmp eq i32 %1, 1 br i1 %cmp228, label %for.body3.preheader, label %for.end11 for.body3.preheader: ; preds = %for.cond1.preheader.thread, %for.cond1.preheader br label %for.body3 for.body3: ; preds = %for.body3.preheader, %for.inc9 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc9 ], [ 0, %for.body3.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %arrayidx6 = getelementptr inbounds [30000 x i8], ptr @avail, i64 0, i64 %indvars.iv %4 = load i8, ptr %arrayidx6, align 1, !tbaa !9 %tobool.not = icmp eq i8 %4, 0 br i1 %tobool.not, label %for.inc9, label %if.then if.then: ; preds = %for.body3 %5 = load i32, ptr %k, align 4, !tbaa !5 %6 = trunc i64 %indvars.iv to i32 %add = add nsw i32 %5, %6 %idxprom7 = sext i32 %add to i64 %arrayidx8 = getelementptr inbounds [30000 x i8], ptr @avail, i64 0, i64 %idxprom7 store i8 1, ptr %arrayidx8, align 1, !tbaa !9 br label %for.inc9 for.inc9: ; preds = %for.body3, %if.then %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 %cmp2 = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp2, label %for.body3, label %for.end11.loopexit, !llvm.loop !10 for.end11.loopexit: ; preds = %for.inc9 %.pre = load i32, ptr @t, align 4, !tbaa !5 br label %for.end11 for.end11: ; preds = %for.end11.loopexit, %for.cond1.preheader %9 = phi i32 [ %.pre, %for.end11.loopexit ], [ %dec, %for.cond1.preheader ] %idxprom12 = sext i32 %9 to i64 %arrayidx13 = getelementptr inbounds [30000 x i8], ptr @avail, i64 0, i64 %idxprom12 %10 = load i8, ptr %arrayidx13, align 1, !tbaa !9 %tobool14.not = icmp eq i8 %10, 0 %str.str.4 = select i1 %tobool14.not, ptr @str, ptr @str.4 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int a,b,x; char op; while(1){ scanf("%d %c %d",&a,&op,&b); if(op == '+'){ x=a+b; printf("%d\n",x); } if(op == '-'){ x=a-b; printf("%d\n",x); } if(op == '*'){ x=a*b; printf("%d\n",x); } if(op == '/'){ x=(double)a/(double)b; printf("%d\n",x); } if(op == '?'){ break; } } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267512/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267512/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %c %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %op = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %op) #3 br label %while.cond while.cond: ; preds = %if.end23, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b) %0 = load i8, ptr %op, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 43 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %while.cond %1 = load i32, ptr %a, align 4, !tbaa !8 %2 = load i32, ptr %b, align 4, !tbaa !8 %add = add nsw i32 %2, %1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %.pr = load i8, ptr %op, align 1, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.cond %3 = phi i8 [ %.pr, %if.then ], [ %0, %while.cond ] %cmp4 = icmp eq i8 %3, 45 br i1 %cmp4, label %if.then6, label %if.end8 if.then6: ; preds = %if.end %4 = load i32, ptr %a, align 4, !tbaa !8 %5 = load i32, ptr %b, align 4, !tbaa !8 %sub = sub nsw i32 %4, %5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) %.pre = load i8, ptr %op, align 1, !tbaa !5 br label %if.end8 if.end8: ; preds = %if.then6, %if.end %6 = phi i8 [ %.pre, %if.then6 ], [ %3, %if.end ] %cmp10 = icmp eq i8 %6, 42 br i1 %cmp10, label %if.then12, label %if.end14 if.then12: ; preds = %if.end8 %7 = load i32, ptr %a, align 4, !tbaa !8 %8 = load i32, ptr %b, align 4, !tbaa !8 %mul = mul nsw i32 %8, %7 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) %.pr32 = load i8, ptr %op, align 1, !tbaa !5 br label %if.end14 if.end14: ; preds = %if.then12, %if.end8 %9 = phi i8 [ %.pr32, %if.then12 ], [ %6, %if.end8 ] %cmp16 = icmp eq i8 %9, 47 br i1 %cmp16, label %if.then18, label %if.end23 if.then18: ; preds = %if.end14 %10 = load i32, ptr %a, align 4, !tbaa !8 %conv19 = sitofp i32 %10 to double %11 = load i32, ptr %b, align 4, !tbaa !8 %conv20 = sitofp i32 %11 to double %div = fdiv double %conv19, %conv20 %conv21 = fptosi double %div to i32 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv21) %.pre33 = load i8, ptr %op, align 1, !tbaa !5 br label %if.end23 if.end23: ; preds = %if.then18, %if.end14 %12 = phi i8 [ %.pre33, %if.then18 ], [ %9, %if.end14 ] %cmp25 = icmp eq i8 %12, 63 br i1 %cmp25, label %while.end, label %while.cond while.end: ; preds = %if.end23 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}