Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> int main(void){ int a,b; scanf("%d %d",&a,&b); printf("%d %d %lf\n",a/b,a%b,(double)a/(double)b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122640/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122640/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%d %d %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) 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 x, y; int d, r; double f; scanf("%d", &x); scanf("%d", &y); d=x/y; r=x%y; f=(double)x/y; printf("%d %d %f\n", d, r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122684/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122684/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\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 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv2 = sitofp i32 %1 to double %div3 = fdiv double %conv, %conv2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div3) 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"}
#include <stdio.h> int main(void){ int a,b,d,r; scanf("%d %d",&a,&b); double f; d=a/b; r=a%b; f=1.0*a/b; printf("%d %d %lf",d,r,f); return 0; ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122727/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122727/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %lf\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 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) 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,d,r; double f; scanf("%d %d" ,&a ,&b); printf("%d %d %f\n" ,a / b ,a % b ,(double)a / b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122770/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122770/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <float.h> int main () { int a; int b; int d; int r; double f; scanf("%d %d", &a, &b); d = a / b; r = a % b; f = 1.0 * a / b; printf("%d %d %.5f\n", d, r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122820/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122820/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %.5f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) 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); printf("%d %d %.5f\n",a/b,a%b,(double)a/b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122879/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122879/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %.5f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) 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){ char s[16]={"CODEFESTIVAL2016"}; char t[16]; int count=0; scanf("%s",t); for(int i=0;i<16;i++){ if(s[i]!=t[i]) count++; } printf("%d",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122921/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122921/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca [16 x i8], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load <16 x i8>, ptr %t, align 16, !tbaa !5 %1 = icmp ne <16 x i8> %0, <i8 67, i8 79, i8 68, i8 69, i8 70, i8 69, i8 83, i8 84, i8 73, i8 86, i8 65, i8 76, i8 50, i8 48, i8 49, i8 54> %2 = bitcast <16 x i1> %1 to i16 %3 = call i16 @llvm.ctpop.i16(i16 %2), !range !8 %4 = zext i16 %3 to i32 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %t) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i16 @llvm.ctpop.i16(i16) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{i16 0, i16 17}
#include<stdio.h> #define MAX 100001 #define max2(a,b) a<b?b:a #define max3(a,b,c) max2((max2(a,b)),c) #define max4(a,b,c,d) max3((max2(a,b)),c,d) int main(){ int i,a,b,c,q,w,e,r,t,y; int n; char s[17]; char ss[17]="CODEFESTIVAL2016"; a = 0; scanf("%s",s); for(i = 0; i<16;i++){ if(ss[i]!=s[i])a++; } printf("%d\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122965/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122965/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [17 x i8], align 16 call void @llvm.lifetime.start.p0(i64 17, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load <16 x i8>, ptr %s, align 16, !tbaa !5 %1 = icmp ne <16 x i8> %0, <i8 67, i8 79, i8 68, i8 69, i8 70, i8 69, i8 83, i8 84, i8 73, i8 86, i8 65, i8 76, i8 50, i8 48, i8 49, i8 54> %2 = bitcast <16 x i1> %1 to i16 %3 = call i16 @llvm.ctpop.i16(i16 %2), !range !8 %4 = zext i16 %3 to i32 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) call void @llvm.lifetime.end.p0(i64 17, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i16 @llvm.ctpop.i16(i16) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{i16 0, i16 17}
#include <stdio.h> int main(){ int i,n,fl=0,ng=0; for(i=0;i<4 && ng==0;i++){ scanf("%d",&n); switch(n){ case 1: fl += 1000; break; case 9: fl += 100; break; case 7: fl += 10; break; case 4: fl += 1; break; default: ng = 1; break; } } if(fl == 1111){ printf("YES\n"); } else{ printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123014/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123014/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @switch.table.main = private unnamed_addr constant [9 x i32] [i32 1000, i32 1000, i32 1000, i32 1, i32 1000, i32 1000, i32 10, i32 1000, i32 100], align 4 ; 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 %switch.tableidx = add i32 %0, -1 %1 = icmp ult i32 %switch.tableidx, 9 br i1 %1, label %switch.hole_check, label %for.end switch.hole_check: ; preds = %entry %switch.maskindex = trunc i32 %switch.tableidx to i16 %switch.shifted = lshr i16 329, %switch.maskindex %2 = and i16 %switch.shifted, 1 %switch.lobit.not = icmp eq i16 %2, 0 br i1 %switch.lobit.not, label %for.end, label %switch.lookup switch.lookup: ; preds = %switch.hole_check %3 = sext i32 %switch.tableidx to i64 %switch.gep = getelementptr inbounds [9 x i32], ptr @switch.table.main, i64 0, i64 %3 %switch.load = load i32, ptr %switch.gep, align 4 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %4 = load i32, ptr %n, align 4, !tbaa !5 %switch.tableidx.1 = add i32 %4, -1 %5 = icmp ult i32 %switch.tableidx.1, 9 br i1 %5, label %switch.hole_check.1, label %for.end switch.hole_check.1: ; preds = %switch.lookup %switch.maskindex.1 = trunc i32 %switch.tableidx.1 to i16 %switch.shifted.1 = lshr i16 329, %switch.maskindex.1 %6 = and i16 %switch.shifted.1, 1 %switch.lobit.not.1 = icmp eq i16 %6, 0 br i1 %switch.lobit.not.1, label %for.end, label %switch.lookup.1 switch.lookup.1: ; preds = %switch.hole_check.1 %7 = sext i32 %switch.tableidx.1 to i64 %switch.gep.1 = getelementptr inbounds [9 x i32], ptr @switch.table.main, i64 0, i64 %7 %switch.load.1 = load i32, ptr %switch.gep.1, align 4 %add.1 = add nuw nsw i32 %switch.load, %switch.load.1 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %8 = load i32, ptr %n, align 4, !tbaa !5 %switch.tableidx.2 = add i32 %8, -1 %9 = icmp ult i32 %switch.tableidx.2, 9 br i1 %9, label %switch.hole_check.2, label %for.end switch.hole_check.2: ; preds = %switch.lookup.1 %switch.maskindex.2 = trunc i32 %switch.tableidx.2 to i16 %switch.shifted.2 = lshr i16 329, %switch.maskindex.2 %10 = and i16 %switch.shifted.2, 1 %switch.lobit.not.2 = icmp eq i16 %10, 0 br i1 %switch.lobit.not.2, label %for.end, label %switch.lookup.2 switch.lookup.2: ; preds = %switch.hole_check.2 %11 = sext i32 %switch.tableidx.2 to i64 %switch.gep.2 = getelementptr inbounds [9 x i32], ptr @switch.table.main, i64 0, i64 %11 %switch.load.2 = load i32, ptr %switch.gep.2, align 4 %add.2 = add nuw nsw i32 %add.1, %switch.load.2 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %12 = load i32, ptr %n, align 4, !tbaa !5 %switch.tableidx.3 = add i32 %12, -1 %13 = icmp ult i32 %switch.tableidx.3, 9 br i1 %13, label %switch.hole_check.3, label %for.end switch.hole_check.3: ; preds = %switch.lookup.2 %switch.maskindex.3 = trunc i32 %switch.tableidx.3 to i16 %switch.shifted.3 = lshr i16 329, %switch.maskindex.3 %14 = and i16 %switch.shifted.3, 1 %switch.lobit.not.3 = icmp eq i16 %14, 0 br i1 %switch.lobit.not.3, label %for.end, label %switch.lookup.3 switch.lookup.3: ; preds = %switch.hole_check.3 %15 = sext i32 %switch.tableidx.3 to i64 %switch.gep.3 = getelementptr inbounds [9 x i32], ptr @switch.table.main, i64 0, i64 %15 %switch.load.3 = load i32, ptr %switch.gep.3, align 4 %add.3 = add nuw nsw i32 %add.2, %switch.load.3 br label %for.end for.end: ; preds = %switch.lookup.3, %switch.hole_check.3, %switch.lookup.2, %switch.hole_check.2, %switch.lookup.1, %switch.hole_check.1, %switch.lookup, %switch.hole_check, %entry %fl.123 = phi i32 [ 0, %entry ], [ 0, %switch.hole_check ], [ %switch.load, %switch.lookup ], [ %switch.load, %switch.hole_check.1 ], [ %add.1, %switch.lookup.1 ], [ %add.1, %switch.hole_check.2 ], [ %add.2, %switch.lookup.2 ], [ %add.2, %switch.hole_check.3 ], [ %add.3, %switch.lookup.3 ] %cmp8 = icmp eq i32 %fl.123, 1111 %str.3.str = select i1 %cmp8, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int med3(int x, int y, int z); void quickSort(int a[], int left, int right); void sort(int a[], int size); int A[4]; int main(){ A[0]=getchar(); getchar(); A[1]=getchar(); getchar(); A[2]=getchar(); getchar(); A[3]=getchar(); sort(A, 4); if(A[0]=='1' && A[1]=='4' && A[2]=='7' && A[3]=='9'){ printf("YES\n"); }else{ printf("NO\n"); } return 0; } int med3(int x, int y, int z){ if(x < y){ if (y < z){return y;}else if(z < x){return x;}else{return z;} } else { if (z < y){return y;}else if(x < z){return x;}else{return z;} } } void quickSort(int a[], int left, int right){ if(left >= right){return;} int pivot = med3(a[left], a[left+(right-left)/2], a[right]); int l=left, r=right; while(1){ while (a[l] < pivot){l++;} while (pivot < a[r]){r--;} if(l>=r){break;} int t=a[l]; a[l]=a[r]; a[r]=t; l++; r--; } quickSort(a, left, l-1); quickSort(a, r+1, right); } void sort(int a[], int size){ quickSort(a, 0, size-1); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123058/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123058/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @A = dso_local global [4 x i32] zeroinitializer, align 16 @stdin = external local_unnamed_addr global ptr, align 8 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) store i32 %call.i, ptr @A, align 16, !tbaa !9 %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i17 = tail call i32 @getc(ptr noundef %1) %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i18 = tail call i32 @getc(ptr noundef %2) store i32 %call.i18, ptr getelementptr inbounds ([4 x i32], ptr @A, i64 0, i64 1), align 4, !tbaa !9 %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i19 = tail call i32 @getc(ptr noundef %3) %4 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i20 = tail call i32 @getc(ptr noundef %4) store i32 %call.i20, ptr getelementptr inbounds ([4 x i32], ptr @A, i64 0, i64 2), align 8, !tbaa !9 %5 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i21 = tail call i32 @getc(ptr noundef %5) %6 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i22 = tail call i32 @getc(ptr noundef %6) store i32 %call.i22, ptr getelementptr inbounds ([4 x i32], ptr @A, i64 0, i64 3), align 4, !tbaa !9 tail call void @quickSort(ptr noundef nonnull @A, i32 noundef 0, i32 noundef 3) %7 = load <4 x i32>, ptr @A, align 16 %.fr = freeze <4 x i32> %7 %8 = icmp ne <4 x i32> %.fr, <i32 49, i32 52, i32 55, i32 57> %9 = bitcast <4 x i1> %8 to i4 %10 = icmp eq i4 %9, 0 %str.2.str = select i1 %10, ptr @str.2, ptr @str %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.2.str) ret i32 0 } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @sort(ptr nocapture noundef %a, i32 noundef %size) local_unnamed_addr #1 { entry: %sub = add nsw i32 %size, -1 tail call void @quickSort(ptr noundef %a, i32 noundef 0, i32 noundef %sub) ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @med3(i32 noundef %x, i32 noundef %y, i32 noundef %z) local_unnamed_addr #2 { entry: %cmp = icmp slt i32 %x, %y br i1 %cmp, label %if.then, label %if.else6 if.then: ; preds = %entry %cmp1 = icmp slt i32 %y, %z br i1 %cmp1, label %return, label %if.else if.else: ; preds = %if.then %x.z = tail call i32 @llvm.smax.i32(i32 %z, i32 %x) br label %return if.else6: ; preds = %entry %cmp7 = icmp slt i32 %z, %y br i1 %cmp7, label %return, label %if.else9 if.else9: ; preds = %if.else6 %x.z26 = tail call i32 @llvm.smin.i32(i32 %x, i32 %z) br label %return return: ; preds = %if.else9, %if.else6, %if.else, %if.then %retval.0 = phi i32 [ %y, %if.then ], [ %x.z, %if.else ], [ %y, %if.else6 ], [ %x.z26, %if.else9 ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @quickSort(ptr nocapture noundef %a, i32 noundef %left, i32 noundef %right) local_unnamed_addr #1 { entry: %cmp.not65 = icmp slt i32 %left, %right br i1 %cmp.not65, label %if.end.lr.ph, label %return if.end.lr.ph: ; preds = %entry %idxprom3 = sext i32 %right to i64 %arrayidx4 = getelementptr inbounds i32, ptr %a, i64 %idxprom3 br label %if.end if.end: ; preds = %if.end.lr.ph, %while.end29 %left.tr66 = phi i32 [ %left, %if.end.lr.ph ], [ %add31, %while.end29 ] %idxprom = sext i32 %left.tr66 to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !9 %sub = sub nsw i32 %right, %left.tr66 %div = sdiv i32 %sub, 2 %add = add nsw i32 %div, %left.tr66 %idxprom1 = sext i32 %add to i64 %arrayidx2 = getelementptr inbounds i32, ptr %a, i64 %idxprom1 %1 = load i32, ptr %arrayidx2, align 4, !tbaa !9 %2 = load i32, ptr %arrayidx4, align 4, !tbaa !9 %cmp.i = icmp slt i32 %0, %1 br i1 %cmp.i, label %if.then.i, label %if.else6.i if.then.i: ; preds = %if.end %cmp1.i = icmp slt i32 %1, %2 br i1 %cmp1.i, label %med3.exit, label %if.else.i if.else.i: ; preds = %if.then.i %x.z.i = tail call i32 @llvm.smax.i32(i32 %2, i32 %0) br label %med3.exit if.else6.i: ; preds = %if.end %cmp7.i = icmp slt i32 %2, %1 br i1 %cmp7.i, label %med3.exit, label %if.else9.i if.else9.i: ; preds = %if.else6.i %x.z26.i = tail call i32 @llvm.smin.i32(i32 %0, i32 %2) br label %med3.exit med3.exit: ; preds = %if.then.i, %if.else.i, %if.else6.i, %if.else9.i %retval.0.i = phi i32 [ %1, %if.then.i ], [ %x.z.i, %if.else.i ], [ %1, %if.else6.i ], [ %x.z26.i, %if.else9.i ] br label %while.cond while.cond: ; preds = %if.end18, %med3.exit %r.0 = phi i32 [ %right, %med3.exit ], [ %dec28, %if.end18 ] %l.0 = phi i32 [ %left.tr66, %med3.exit ], [ %inc27, %if.end18 ] %3 = sext i32 %l.0 to i64 br label %while.cond5 while.cond5: ; preds = %while.cond5, %while.cond %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond5 ], [ %3, %while.cond ] %arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %4 = load i32, ptr %arrayidx7, align 4, !tbaa !9 %cmp8 = icmp slt i32 %4, %retval.0.i %indvars.iv.next = add i64 %indvars.iv, 1 br i1 %cmp8, label %while.cond5, label %while.cond10.preheader, !llvm.loop !11 while.cond10.preheader: ; preds = %while.cond5 %arrayidx7.le = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %5 = trunc i64 %indvars.iv to i32 %6 = sext i32 %r.0 to i64 br label %while.cond10 while.cond10: ; preds = %while.cond10, %while.cond10.preheader %indvars.iv69 = phi i64 [ %indvars.iv.next70, %while.cond10 ], [ %6, %while.cond10.preheader ] %arrayidx12 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv69 %7 = load i32, ptr %arrayidx12, align 4, !tbaa !9 %cmp13 = icmp slt i32 %retval.0.i, %7 %indvars.iv.next70 = add i64 %indvars.iv69, -1 br i1 %cmp13, label %while.cond10, label %while.end15, !llvm.loop !13 while.end15: ; preds = %while.cond10 %8 = trunc i64 %indvars.iv69 to i32 %cmp16.not = icmp slt i32 %5, %8 br i1 %cmp16.not, label %if.end18, label %while.end29 if.end18: ; preds = %while.end15 %arrayidx12.le = getelementptr inbounds i32, ptr %a, i64 %indvars.iv69 store i32 %7, ptr %arrayidx7.le, align 4, !tbaa !9 store i32 %4, ptr %arrayidx12.le, align 4, !tbaa !9 %inc27 = add nsw i32 %5, 1 %dec28 = add nsw i32 %8, -1 br label %while.cond while.end29: ; preds = %while.end15 %sub30 = add nsw i32 %5, -1 tail call void @quickSort(ptr noundef nonnull %a, i32 noundef %left.tr66, i32 noundef %sub30) %add31 = add nsw i32 %8, 1 %cmp.not = icmp slt i32 %add31, %right br i1 %cmp.not, label %if.end, label %return return: ; preds = %while.end29, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nosync nounwind memory(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 #2 = { 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 #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
//tree DP //ABC036-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 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;} 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{ int st; int fi; int kr; }rs; typedef struct{ int st; int 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[],int n){ int 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; } int dist[524288],par[524288]; void dfs(int t,int l,int bp,rs g[],mkj x[]){ int i; if(dist[t]<=l){return;} dist[t]=l; par[t]=bp; for(i=x[t].st;i<x[t].st+x[t].kz;i++){ dfs(g[i].fi,l+1,t,g,x); } } int judge(int arr[],int n,int border){ int st,fi,te,p,q; st=0;fi=n-1; while(st<=fi){ p=0;q=n-1; te=(st+fi)/2; if(p==te){p++;} if(q==te){q--;} while(p<=q){ if(arr[p]+arr[q]>border){ st=te+1; break; } p++;q--; if(p==te){p++;} if(q==te){q--;} } if(p>q){fi=te-1;} } return st; } int main(void){ int i,j,n,m,k,a,b,c,h,w,r=0,l,t; int res=0; int st,fi,te; int cnt[524288]={0}; int dp[524288]; int arr[524288],ac; rs g[524288]; mkj x[524288]; sd dat[524288]; scanf("%d",&n); for(i=0;i<(n-1);i++){ scanf("%d%d",&a,&b); cnt[a]++;cnt[b]++; g[2*i].st=a; g[2*i].fi=b; g[2*i].kr=1; g[2*i+1].st=b; g[2*i+1].fi=a; g[2*i+1].kr=1; } qsort(g,2*(n-1),sizeof(g[0]),sortfnc); makemkj(g,x,2*(n-1)); for(i=0;i<=n;i++){ dp[i]=inf; dist[i]=inf; if(cnt[i]%2==1){r++;} } dfs(1,0,-1,g,x); for(i=0;i<n;i++){ dat[i].node=i+1; dat[i].val=dist[i+1]; } qsort(dat,n,sizeof(dat[0]),sdsortfnc); st=1;fi=n-1; while(st<=fi){ te=(st+fi)/2; for(i=0;i<n;i++){ w=dat[i].node; ac=0; for(j=x[w].st;j<x[w].st+x[w].kz;j++){ if(par[w]==g[j].fi){continue;} arr[ac]=dp[g[j].fi]+1; //printf("[%d]",arr[ac]); ac++; } if(cnt[w]%2==1){ arr[ac]=0; //printf("[%d]",arr[ac]); ac++; } if(i==n-1){ arr[ac]=-inf; //printf("[%d]",arr[ac]); ac++; } qsort(arr,ac,sizeof(int),sortfncsj); t=judge(arr,ac,te); //printf("\n<%d %d %d %d>\n",te,w,ac,t); if(i==n-1){ if(t==0){fi=te-1;} else{st=te+1;} break; } if(t==ac){st=te+1;break;} dp[w]=arr[t]; } } printf("%d %d\n",r/2,st); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123100/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123100/source.c" target datalayout = "e-m:e-p270: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.rs = type { i32, i32, i32 } %struct.mkj = type { i32, i32 } %struct.sd = type { i32, i32 } @dist = dso_local local_unnamed_addr global [524288 x i32] zeroinitializer, align 16 @par = dso_local local_unnamed_addr global [524288 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %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(argmem: read) uwtable define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #1 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = 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 #1 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = 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 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #1 { entry: %0 = load i32, ptr %a, align 4, !tbaa !9 %1 = load i32, ptr %b, align 4, !tbaa !9 %cmp = icmp sgt i32 %0, %1 %cmp4 = icmp slt 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) #1 { entry: %0 = load i32, ptr %a, align 4, !tbaa !11 %1 = load i32, ptr %b, align 4, !tbaa !11 %cmp = icmp eq i32 %0, %1 %cmp4 = icmp slt i32 %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, i32 noundef %n) local_unnamed_addr #2 { entry: %0 = load i32, ptr %g, align 4, !tbaa !11 %cmp42 = icmp sgt i32 %n, 1 br i1 %cmp42, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %1 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %1, 1 %2 = icmp eq i32 %n, 2 br i1 %2, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %1, -2 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %3 = phi i32 [ %0, %for.body.preheader.new ], [ %6, %for.inc.1 ] %indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %nst.045 = phi i32 [ %0, %for.body.preheader.new ], [ %nst.1.1, %for.inc.1 ] %ms.044 = phi i32 [ 0, %for.body.preheader.new ], [ %ms.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx1 = getelementptr inbounds %struct.rs, ptr %g, i64 %indvars.iv %4 = load i32, ptr %arrayidx1, align 4, !tbaa !11 %cmp6.not = icmp eq i32 %4, %3 br i1 %cmp6.not, label %for.inc, label %if.then if.then: ; preds = %for.body %5 = trunc i64 %indvars.iv to i32 %sub7 = sub nsw i32 %5, %ms.044 %idxprom8 = sext i32 %nst.045 to i64 %arrayidx9 = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8 %kz = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8, i32 1 store i32 %sub7, ptr %kz, align 4, !tbaa !13 store i32 %ms.044, ptr %arrayidx9, align 4, !tbaa !9 br label %for.inc for.inc: ; preds = %for.body, %if.then %ms.1 = phi i32 [ %5, %if.then ], [ %ms.044, %for.body ] %nst.1 = phi i32 [ %4, %if.then ], [ %nst.045, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx1.1 = getelementptr inbounds %struct.rs, ptr %g, i64 %indvars.iv.next %6 = load i32, ptr %arrayidx1.1, align 4, !tbaa !11 %cmp6.not.1 = icmp eq i32 %6, %4 br i1 %cmp6.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc %7 = trunc i64 %indvars.iv.next to i32 %sub7.1 = sub nsw i32 %7, %ms.1 %idxprom8.1 = sext i32 %nst.1 to i64 %arrayidx9.1 = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8.1 %kz.1 = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8.1, i32 1 store i32 %sub7.1, ptr %kz.1, align 4, !tbaa !13 store i32 %ms.1, ptr %arrayidx9.1, align 4, !tbaa !9 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %ms.1.1 = phi i32 [ %7, %if.then.1 ], [ %ms.1, %for.inc ] %nst.1.1 = phi i32 [ %6, %if.then.1 ], [ %nst.1, %for.inc ] %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.inc.1, %for.body.preheader %ms.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %ms.1.1, %for.inc.1 ] %nst.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %nst.1.1, %for.inc.1 ] %.unr = phi i32 [ %0, %for.body.preheader ], [ %6, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ] %nst.045.unr = phi i32 [ %0, %for.body.preheader ], [ %nst.1.1, %for.inc.1 ] %ms.044.unr = phi i32 [ 0, %for.body.preheader ], [ %ms.1.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx1.epil = getelementptr inbounds %struct.rs, ptr %g, i64 %indvars.iv.unr %8 = load i32, ptr %arrayidx1.epil, align 4, !tbaa !11 %cmp6.not.epil = icmp eq i32 %8, %.unr br i1 %cmp6.not.epil, label %for.end, label %if.then.epil if.then.epil: ; preds = %for.body.epil %9 = trunc i64 %indvars.iv.unr to i32 %sub7.epil = sub nsw i32 %9, %ms.044.unr %idxprom8.epil = sext i32 %nst.045.unr to i64 %arrayidx9.epil = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8.epil %kz.epil = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8.epil, i32 1 store i32 %sub7.epil, ptr %kz.epil, align 4, !tbaa !13 store i32 %ms.044.unr, ptr %arrayidx9.epil, align 4, !tbaa !9 br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %entry %ms.0.lcssa = phi i32 [ 0, %entry ], [ %ms.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %9, %if.then.epil ], [ %ms.044.unr, %for.body.epil ] %nst.0.lcssa = phi i32 [ %0, %entry ], [ %nst.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %8, %if.then.epil ], [ %nst.045.unr, %for.body.epil ] %sub16 = sub nsw i32 %n, %ms.0.lcssa %idxprom17 = sext i32 %nst.0.lcssa to i64 %arrayidx18 = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom17 %kz19 = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom17, i32 1 store i32 %sub16, ptr %kz19, align 4, !tbaa !13 store i32 %ms.0.lcssa, ptr %arrayidx18, align 4, !tbaa !9 ret void } ; 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 nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local void @dfs(i32 noundef %t, i32 noundef %l, i32 noundef %bp, ptr nocapture noundef readonly %g, ptr nocapture noundef readonly %x) local_unnamed_addr #4 { entry: %idxprom = sext i32 %t to i64 %arrayidx = getelementptr inbounds [524288 x i32], ptr @dist, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %l br i1 %cmp.not, label %if.end, label %cleanup if.end: ; preds = %entry store i32 %l, ptr %arrayidx, align 4, !tbaa !5 %arrayidx4 = getelementptr inbounds [524288 x i32], ptr @par, i64 0, i64 %idxprom store i32 %bp, ptr %arrayidx4, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom %kz = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom, i32 1 %1 = load i32, ptr %kz, align 4, !tbaa !13 %cmp1231 = icmp sgt i32 %1, 0 br i1 %cmp1231, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %if.end %2 = load i32, ptr %arrayidx6, align 4, !tbaa !9 %add15 = add nsw i32 %l, 1 %3 = sext i32 %2 to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ %3, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %fi = getelementptr inbounds %struct.rs, ptr %g, i64 %indvars.iv, i32 1 %4 = load i32, ptr %fi, align 4, !tbaa !16 tail call void @dfs(i32 noundef %4, i32 noundef %add15, i32 noundef %t, ptr noundef %g, ptr noundef nonnull %x) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %5 = load i32, ptr %arrayidx6, align 4, !tbaa !9 %6 = load i32, ptr %kz, align 4, !tbaa !13 %add = add nsw i32 %6, %5 %7 = sext i32 %add to i64 %cmp12 = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp12, label %for.body, label %cleanup, !llvm.loop !17 cleanup: ; preds = %for.body, %if.end, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @judge(ptr nocapture noundef readonly %arr, i32 noundef %n, i32 noundef %border) local_unnamed_addr #5 { entry: %sub = add nsw i32 %n, -1 %cmp.not63 = icmp slt i32 %n, 1 br i1 %cmp.not63, label %while.end30, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %dec = add nsw i32 %n, -2 br label %while.body while.body: ; preds = %while.body.lr.ph, %2 %st.065 = phi i32 [ 0, %while.body.lr.ph ], [ %st.171, %2 ] %fi.064 = phi i32 [ %sub, %while.body.lr.ph ], [ %3, %2 ] %add = add nsw i32 %st.065, %fi.064 %div = sdiv i32 %add, 2 %add.off = add i32 %add, 1 %cmp2 = icmp ult i32 %add.off, 3 %spec.select = zext i1 %cmp2 to i32 %cmp3 = icmp eq i32 %sub, %div %q.0 = select i1 %cmp3, i32 %dec, i32 %sub %cmp7.not59 = icmp slt i32 %q.0, %spec.select br i1 %cmp7.not59, label %.loopexit, label %while.body8 while.body8: ; preds = %while.body, %if.end15 %q.161 = phi i32 [ %q.2, %if.end15 ], [ %q.0, %while.body ] %p.160 = phi i32 [ %spec.select55, %if.end15 ], [ %spec.select, %while.body ] %idxprom = sext i32 %p.160 to i64 %arrayidx = getelementptr inbounds i32, ptr %arr, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom9 = sext i32 %q.161 to i64 %arrayidx10 = getelementptr inbounds i32, ptr %arr, i64 %idxprom9 %1 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %add11 = add nsw i32 %1, %0 %cmp12 = icmp sgt i32 %add11, %border br i1 %cmp12, label %while.end, label %if.end15 if.end15: ; preds = %while.body8 %inc16 = add nsw i32 %p.160, 1 %dec17 = add nsw i32 %q.161, -1 %cmp18 = icmp eq i32 %inc16, %div %inc20 = add nsw i32 %p.160, 2 %spec.select55 = select i1 %cmp18, i32 %inc20, i32 %inc16 %cmp22 = icmp eq i32 %dec17, %div %dec24 = add nsw i32 %q.161, -2 %q.2 = select i1 %cmp22, i32 %dec24, i32 %dec17 %cmp7.not = icmp sgt i32 %spec.select55, %q.2 br i1 %cmp7.not, label %.loopexit, label %while.body8, !llvm.loop !18 while.end: ; preds = %while.body8 %add14 = add nsw i32 %div, 1 br label %2 .loopexit: ; preds = %if.end15, %while.body %sub2870 = add nsw i32 %div, -1 br label %2 2: ; preds = %while.end, %.loopexit %st.171 = phi i32 [ %st.065, %.loopexit ], [ %add14, %while.end ] %3 = phi i32 [ %sub2870, %.loopexit ], [ %fi.064, %while.end ] %cmp.not = icmp sgt i32 %st.171, %3 br i1 %cmp.not, label %while.end30, label %while.body, !llvm.loop !19 while.end30: ; preds = %2, %entry %st.0.lcssa = phi i32 [ 0, %entry ], [ %st.171, %2 ] ret i32 %st.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %cnt = alloca [524288 x i32], align 16 %dp = alloca [524288 x i32], align 16 %arr = alloca [524288 x i32], align 16 %g = alloca [524288 x %struct.rs], align 16 %x = alloca [524288 x %struct.mkj], align 16 %dat = alloca [524288 x %struct.sd], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #11 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #11 call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %cnt) #11 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2097152) %cnt, i8 0, i64 2097152, i1 false) call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %dp) #11 call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %arr) #11 call void @llvm.lifetime.start.p0(i64 6291456, ptr nonnull %g) #11 call void @llvm.lifetime.start.p0(i64 4194304, ptr nonnull %x) #11 call void @llvm.lifetime.start.p0(i64 4194304, ptr nonnull %dat) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %sub220 = add nsw i32 %0, -1 %cmp221 = icmp sgt i32 %0, 1 br i1 %cmp221, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %a, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [524288 x i32], ptr %cnt, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 %3 = load i32, ptr %b, align 4, !tbaa !5 %idxprom2 = sext i32 %3 to i64 %arrayidx3 = getelementptr inbounds [524288 x i32], ptr %cnt, i64 0, i64 %idxprom2 %4 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %inc4 = add nsw i32 %4, 1 store i32 %inc4, ptr %arrayidx3, align 4, !tbaa !5 %5 = shl nuw nsw i64 %indvars.iv, 1 %arrayidx6 = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %5 store i32 %1, ptr %arrayidx6, align 8, !tbaa !11 %fi11 = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %5, i32 1 store i32 %3, ptr %fi11, align 4, !tbaa !16 %kr = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %5, i32 2 store i32 1, ptr %kr, align 8, !tbaa !20 %6 = or i64 %5, 1 %arrayidx17 = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %6 store i32 %3, ptr %arrayidx17, align 4, !tbaa !11 %fi23 = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %6, i32 1 store i32 %1, ptr %fi23, align 8, !tbaa !16 %kr28 = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %6, i32 2 store i32 1, ptr %kr28, align 4, !tbaa !20 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %7, -1 %8 = sext i32 %sub to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !21 for.end: ; preds = %for.body, %entry %sub.lcssa = phi i32 [ %sub220, %entry ], [ %sub, %for.body ] %mul31 = shl nsw i32 %sub.lcssa, 1 %conv = sext i32 %mul31 to i64 call void @qsort(ptr noundef nonnull %g, i64 noundef %conv, i64 noundef 12, ptr noundef nonnull @sortfnc) #11 %9 = load i32, ptr %n, align 4, !tbaa !5 %sub34 = shl i32 %9, 1 %mul35 = add i32 %sub34, -2 %10 = load i32, ptr %g, align 16, !tbaa !11 %cmp42.i = icmp sgt i32 %mul35, 1 br i1 %cmp42.i, label %for.body.preheader.i, label %makemkj.exit for.body.preheader.i: ; preds = %for.end %11 = icmp eq i32 %mul35, 2 br i1 %11, label %for.body.i.epil, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %wide.trip.count.i = zext i32 %mul35 to i64 %12 = add nsw i64 %wide.trip.count.i, -4 br label %for.body.i for.body.i: ; preds = %for.inc.i.1, %for.body.preheader.i.new %13 = phi i32 [ %10, %for.body.preheader.i.new ], [ %16, %for.inc.i.1 ] %indvars.iv.i = phi i64 [ 1, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %nst.045.i = phi i32 [ %10, %for.body.preheader.i.new ], [ %nst.1.i.1, %for.inc.i.1 ] %ms.044.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %ms.1.i.1, %for.inc.i.1 ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.inc.i.1 ] %arrayidx1.i = getelementptr inbounds %struct.rs, ptr %g, i64 %indvars.iv.i %14 = load i32, ptr %arrayidx1.i, align 4, !tbaa !11 %cmp6.not.i = icmp eq i32 %14, %13 br i1 %cmp6.not.i, label %for.inc.i, label %if.then.i if.then.i: ; preds = %for.body.i %15 = trunc i64 %indvars.iv.i to i32 %sub7.i = sub nsw i32 %15, %ms.044.i %idxprom8.i = sext i32 %nst.045.i to i64 %arrayidx9.i = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8.i %kz.i = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8.i, i32 1 store i32 %sub7.i, ptr %kz.i, align 4, !tbaa !13 store i32 %ms.044.i, ptr %arrayidx9.i, align 8, !tbaa !9 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body.i %ms.1.i = phi i32 [ %15, %if.then.i ], [ %ms.044.i, %for.body.i ] %nst.1.i = phi i32 [ %14, %if.then.i ], [ %nst.045.i, %for.body.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx1.i.1 = getelementptr inbounds %struct.rs, ptr %g, i64 %indvars.iv.next.i %16 = load i32, ptr %arrayidx1.i.1, align 4, !tbaa !11 %cmp6.not.i.1 = icmp eq i32 %16, %14 br i1 %cmp6.not.i.1, label %for.inc.i.1, label %if.then.i.1 if.then.i.1: ; preds = %for.inc.i %17 = trunc i64 %indvars.iv.next.i to i32 %sub7.i.1 = sub nsw i32 %17, %ms.1.i %idxprom8.i.1 = sext i32 %nst.1.i to i64 %arrayidx9.i.1 = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8.i.1 %kz.i.1 = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8.i.1, i32 1 store i32 %sub7.i.1, ptr %kz.i.1, align 4, !tbaa !13 store i32 %ms.1.i, ptr %arrayidx9.i.1, align 8, !tbaa !9 br label %for.inc.i.1 for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i %ms.1.i.1 = phi i32 [ %17, %if.then.i.1 ], [ %ms.1.i, %for.inc.i ] %nst.1.i.1 = phi i32 [ %16, %if.then.i.1 ], [ %nst.1.i, %for.inc.i ] %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, %12 br i1 %niter.ncmp.1, label %for.body.i.epil, label %for.body.i, !llvm.loop !14 for.body.i.epil: ; preds = %for.inc.i.1, %for.body.preheader.i %.unr = phi i32 [ %10, %for.body.preheader.i ], [ %16, %for.inc.i.1 ] %indvars.iv.i.unr = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %nst.045.i.unr = phi i32 [ %10, %for.body.preheader.i ], [ %nst.1.i.1, %for.inc.i.1 ] %ms.044.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %ms.1.i.1, %for.inc.i.1 ] %arrayidx1.i.epil = getelementptr inbounds %struct.rs, ptr %g, i64 %indvars.iv.i.unr %18 = load i32, ptr %arrayidx1.i.epil, align 4, !tbaa !11 %cmp6.not.i.epil = icmp eq i32 %18, %.unr br i1 %cmp6.not.i.epil, label %makemkj.exit, label %if.then.i.epil if.then.i.epil: ; preds = %for.body.i.epil %19 = trunc i64 %indvars.iv.i.unr to i32 %sub7.i.epil = sub nsw i32 %19, %ms.044.i.unr %idxprom8.i.epil = sext i32 %nst.045.i.unr to i64 %arrayidx9.i.epil = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8.i.epil %kz.i.epil = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom8.i.epil, i32 1 store i32 %sub7.i.epil, ptr %kz.i.epil, align 4, !tbaa !13 store i32 %ms.044.i.unr, ptr %arrayidx9.i.epil, align 8, !tbaa !9 br label %makemkj.exit makemkj.exit: ; preds = %if.then.i.epil, %for.body.i.epil, %for.end %ms.0.lcssa.i = phi i32 [ 0, %for.end ], [ %19, %if.then.i.epil ], [ %ms.044.i.unr, %for.body.i.epil ] %nst.0.lcssa.i = phi i32 [ %10, %for.end ], [ %18, %if.then.i.epil ], [ %nst.045.i.unr, %for.body.i.epil ] %sub16.i = sub nsw i32 %mul35, %ms.0.lcssa.i %idxprom17.i = sext i32 %nst.0.lcssa.i to i64 %arrayidx18.i = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom17.i %kz19.i = getelementptr inbounds %struct.mkj, ptr %x, i64 %idxprom17.i, i32 1 store i32 %sub16.i, ptr %kz19.i, align 4, !tbaa !13 store i32 %ms.0.lcssa.i, ptr %arrayidx18.i, align 8, !tbaa !9 %cmp37.not223 = icmp slt i32 %9, 0 br i1 %cmp37.not223, label %for.end51, label %for.body39.preheader for.body39.preheader: ; preds = %makemkj.exit %20 = add nuw i32 %9, 1 %wide.trip.count = zext i32 %20 to i64 %min.iters.check = icmp ult i32 %9, 7 br i1 %min.iters.check, label %for.body39.preheader286, label %vector.ph vector.ph: ; preds = %for.body39.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 ], [ %33, %vector.body ] %vec.phi266 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %34, %vector.body ] %21 = getelementptr inbounds [524288 x i32], ptr %dp, i64 0, i64 %index store <4 x i32> <i32 1072114514, i32 1072114514, i32 1072114514, i32 1072114514>, ptr %21, align 16, !tbaa !5 %22 = getelementptr inbounds i32, ptr %21, i64 4 store <4 x i32> <i32 1072114514, i32 1072114514, i32 1072114514, i32 1072114514>, ptr %22, align 16, !tbaa !5 %23 = getelementptr inbounds [524288 x i32], ptr @dist, i64 0, i64 %index store <4 x i32> <i32 1072114514, i32 1072114514, i32 1072114514, i32 1072114514>, ptr %23, align 16, !tbaa !5 %24 = getelementptr inbounds i32, ptr %23, i64 4 store <4 x i32> <i32 1072114514, i32 1072114514, i32 1072114514, i32 1072114514>, ptr %24, align 16, !tbaa !5 %25 = getelementptr inbounds [524288 x i32], ptr %cnt, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %25, align 16, !tbaa !5 %26 = getelementptr inbounds i32, ptr %25, i64 4 %wide.load267 = load <4 x i32>, ptr %26, align 16, !tbaa !5 %27 = and <4 x i32> %wide.load, <i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647> %28 = and <4 x i32> %wide.load267, <i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647> %29 = icmp eq <4 x i32> %27, <i32 1, i32 1, i32 1, i32 1> %30 = icmp eq <4 x i32> %28, <i32 1, i32 1, i32 1, i32 1> %31 = zext <4 x i1> %29 to <4 x i32> %32 = zext <4 x i1> %30 to <4 x i32> %33 = add <4 x i32> %vec.phi, %31 %34 = add <4 x i32> %vec.phi266, %32 %index.next = add nuw i64 %index, 8 %35 = icmp eq i64 %index.next, %n.vec br i1 %35, label %middle.block, label %vector.body, !llvm.loop !22 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %34, %33 %36 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end51.loopexit, label %for.body39.preheader286 for.body39.preheader286: ; preds = %for.body39.preheader, %middle.block %indvars.iv244.ph = phi i64 [ 0, %for.body39.preheader ], [ %n.vec, %middle.block ] %r.0224.ph = phi i32 [ 0, %for.body39.preheader ], [ %36, %middle.block ] br label %for.body39 for.body39: ; preds = %for.body39.preheader286, %for.body39 %indvars.iv244 = phi i64 [ %indvars.iv.next245, %for.body39 ], [ %indvars.iv244.ph, %for.body39.preheader286 ] %r.0224 = phi i32 [ %spec.select, %for.body39 ], [ %r.0224.ph, %for.body39.preheader286 ] %arrayidx41 = getelementptr inbounds [524288 x i32], ptr %dp, i64 0, i64 %indvars.iv244 store i32 1072114514, ptr %arrayidx41, align 4, !tbaa !5 %arrayidx43 = getelementptr inbounds [524288 x i32], ptr @dist, i64 0, i64 %indvars.iv244 store i32 1072114514, ptr %arrayidx43, align 4, !tbaa !5 %arrayidx45 = getelementptr inbounds [524288 x i32], ptr %cnt, i64 0, i64 %indvars.iv244 %37 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %38 = and i32 %37, -2147483647 %cmp46 = icmp eq i32 %38, 1 %inc48 = zext i1 %cmp46 to i32 %spec.select = add nuw nsw i32 %r.0224, %inc48 %indvars.iv.next245 = add nuw nsw i64 %indvars.iv244, 1 %exitcond.not = icmp eq i64 %indvars.iv.next245, %wide.trip.count br i1 %exitcond.not, label %for.end51.loopexit, label %for.body39, !llvm.loop !25 for.end51.loopexit: ; preds = %for.body39, %middle.block %spec.select.lcssa = phi i32 [ %36, %middle.block ], [ %spec.select, %for.body39 ] %39 = lshr i32 %spec.select.lcssa, 1 br label %for.end51 for.end51: ; preds = %for.end51.loopexit, %makemkj.exit %r.0.lcssa = phi i32 [ 0, %makemkj.exit ], [ %39, %for.end51.loopexit ] call void @dfs(i32 noundef 1, i32 noundef 0, i32 noundef -1, ptr noundef nonnull %g, ptr noundef nonnull %x) %40 = load i32, ptr %n, align 4, !tbaa !5 %cmp55227 = icmp sgt i32 %40, 0 br i1 %cmp55227, label %for.body57.preheader, label %for.end68 for.body57.preheader: ; preds = %for.end51 %wide.trip.count250 = zext i32 %40 to i64 %min.iters.check270 = icmp ult i32 %40, 4 br i1 %min.iters.check270, label %for.body57.preheader285, label %vector.ph271 vector.ph271: ; preds = %for.body57.preheader %n.vec273 = and i64 %wide.trip.count250, 4294967292 br label %vector.body276 vector.body276: ; preds = %vector.body276, %vector.ph271 %index277 = phi i64 [ 0, %vector.ph271 ], [ %index.next281, %vector.body276 ] %41 = or i64 %index277, 2 %42 = insertelement <2 x i64> poison, i64 %index277, i64 0 %43 = shufflevector <2 x i64> %42, <2 x i64> poison, <2 x i32> zeroinitializer %44 = or <2 x i64> %43, <i64 1, i64 2> %45 = or i64 %index277, 3 %46 = add i64 %index277, 4 %47 = insertelement <2 x i64> poison, i64 %45, i64 0 %48 = insertelement <2 x i64> %47, i64 %46, i64 1 %49 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %index277 %50 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %41 %51 = trunc <2 x i64> %44 to <2 x i32> %52 = trunc <2 x i64> %48 to <2 x i32> %53 = extractelement <2 x i64> %44, i64 0 %54 = getelementptr inbounds [524288 x i32], ptr @dist, i64 0, i64 %53 %wide.load278 = load <2 x i32>, ptr %54, align 4, !tbaa !5 %55 = getelementptr inbounds i32, ptr %54, i64 2 %wide.load279 = load <2 x i32>, ptr %55, align 4, !tbaa !5 %interleaved.vec = shufflevector <2 x i32> %wide.load278, <2 x i32> %51, <4 x i32> <i32 0, i32 2, i32 1, i32 3> store <4 x i32> %interleaved.vec, ptr %49, align 16, !tbaa !5 %interleaved.vec280 = shufflevector <2 x i32> %wide.load279, <2 x i32> %52, <4 x i32> <i32 0, i32 2, i32 1, i32 3> store <4 x i32> %interleaved.vec280, ptr %50, align 16, !tbaa !5 %index.next281 = add nuw i64 %index277, 4 %56 = icmp eq i64 %index.next281, %n.vec273 br i1 %56, label %middle.block268, label %vector.body276, !llvm.loop !26 middle.block268: ; preds = %vector.body276 %cmp.n275 = icmp eq i64 %n.vec273, %wide.trip.count250 br i1 %cmp.n275, label %for.end68, label %for.body57.preheader285 for.body57.preheader285: ; preds = %for.body57.preheader, %middle.block268 %indvars.iv247.ph = phi i64 [ 0, %for.body57.preheader ], [ %n.vec273, %middle.block268 ] br label %for.body57 for.body57: ; preds = %for.body57.preheader285, %for.body57 %indvars.iv247 = phi i64 [ %indvars.iv.next248, %for.body57 ], [ %indvars.iv247.ph, %for.body57.preheader285 ] %indvars.iv.next248 = add nuw nsw i64 %indvars.iv247, 1 %arrayidx60 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv247 %node = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv247, i32 1 %57 = trunc i64 %indvars.iv.next248 to i32 store i32 %57, ptr %node, align 4, !tbaa !13 %arrayidx63 = getelementptr inbounds [524288 x i32], ptr @dist, i64 0, i64 %indvars.iv.next248 %58 = load i32, ptr %arrayidx63, align 4, !tbaa !5 store i32 %58, ptr %arrayidx60, align 8, !tbaa !9 %exitcond251.not = icmp eq i64 %indvars.iv.next248, %wide.trip.count250 br i1 %exitcond251.not, label %for.end68, label %for.body57, !llvm.loop !27 for.end68: ; preds = %for.body57, %middle.block268, %for.end51 %conv70 = sext i32 %40 to i64 call void @qsort(ptr noundef nonnull %dat, i64 noundef %conv70, i64 noundef 8, ptr noundef nonnull @sdsortfnc) #11 %59 = load i32, ptr %n, align 4, !tbaa !5 %cmp72.not236 = icmp slt i32 %59, 2 br i1 %cmp72.not236, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %for.end68 %sub71 = add nsw i32 %59, -1 br label %while.body while.body: ; preds = %while.body.preheader, %for.end160 %60 = phi i32 [ %85, %for.end160 ], [ %59, %while.body.preheader ] %fi.0238 = phi i32 [ %fi.1, %for.end160 ], [ %sub71, %while.body.preheader ] %st.0237 = phi i32 [ %st.1, %for.end160 ], [ 1, %while.body.preheader ] %add74 = add nsw i32 %fi.0238, %st.0237 %div = sdiv i32 %add74, 2 %cmp76234 = icmp sgt i32 %60, 0 br i1 %cmp76234, label %for.body78, label %for.end160 for.body78: ; preds = %while.body, %if.end153 %indvars.iv255 = phi i64 [ %indvars.iv.next256, %if.end153 ], [ 0, %while.body ] %61 = phi i32 [ %82, %if.end153 ], [ %60, %while.body ] %node81 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv255, i32 1 %62 = load i32, ptr %node81, align 4, !tbaa !13 %idxprom82 = sext i32 %62 to i64 %kz = getelementptr inbounds [524288 x %struct.mkj], ptr %x, i64 0, i64 %idxprom82, i32 1 %63 = load i32, ptr %kz, align 4, !tbaa !13 %cmp92230 = icmp sgt i32 %63, 0 br i1 %cmp92230, label %for.body94.lr.ph, label %for.end115 for.body94.lr.ph: ; preds = %for.body78 %arrayidx83 = getelementptr inbounds [524288 x %struct.mkj], ptr %x, i64 0, i64 %idxprom82 %64 = load i32, ptr %arrayidx83, align 8, !tbaa !9 %add91 = add nsw i32 %63, %64 %arrayidx96 = getelementptr inbounds [524288 x i32], ptr @par, i64 0, i64 %idxprom82 %65 = load i32, ptr %arrayidx96, align 4, !tbaa !5 %66 = sext i32 %64 to i64 %67 = sext i32 %add91 to i64 br label %for.body94 for.body94: ; preds = %for.body94.lr.ph, %for.inc113 %indvars.iv252 = phi i64 [ %66, %for.body94.lr.ph ], [ %indvars.iv.next253, %for.inc113 ] %ac.0232 = phi i32 [ 0, %for.body94.lr.ph ], [ %ac.1, %for.inc113 ] %fi99 = getelementptr inbounds [524288 x %struct.rs], ptr %g, i64 0, i64 %indvars.iv252, i32 1 %68 = load i32, ptr %fi99, align 4, !tbaa !16 %cmp100 = icmp eq i32 %65, %68 br i1 %cmp100, label %for.inc113, label %if.end103 if.end103: ; preds = %for.body94 %idxprom107 = sext i32 %68 to i64 %arrayidx108 = getelementptr inbounds [524288 x i32], ptr %dp, i64 0, i64 %idxprom107 %69 = load i32, ptr %arrayidx108, align 4, !tbaa !5 %add109 = add nsw i32 %69, 1 %idxprom110 = sext i32 %ac.0232 to i64 %arrayidx111 = getelementptr inbounds [524288 x i32], ptr %arr, i64 0, i64 %idxprom110 store i32 %add109, ptr %arrayidx111, align 4, !tbaa !5 %inc112 = add nsw i32 %ac.0232, 1 br label %for.inc113 for.inc113: ; preds = %for.body94, %if.end103 %ac.1 = phi i32 [ %ac.0232, %for.body94 ], [ %inc112, %if.end103 ] %indvars.iv.next253 = add nsw i64 %indvars.iv252, 1 %cmp92 = icmp slt i64 %indvars.iv.next253, %67 br i1 %cmp92, label %for.body94, label %for.end115, !llvm.loop !28 for.end115: ; preds = %for.inc113, %for.body78 %ac.0.lcssa = phi i32 [ 0, %for.body78 ], [ %ac.1, %for.inc113 ] %arrayidx117 = getelementptr inbounds [524288 x i32], ptr %cnt, i64 0, i64 %idxprom82 %70 = load i32, ptr %arrayidx117, align 4, !tbaa !5 %71 = and i32 %70, -2147483647 %cmp119 = icmp eq i32 %71, 1 br i1 %cmp119, label %if.then121, label %if.end125 if.then121: ; preds = %for.end115 %idxprom122 = sext i32 %ac.0.lcssa to i64 %arrayidx123 = getelementptr inbounds [524288 x i32], ptr %arr, i64 0, i64 %idxprom122 store i32 0, ptr %arrayidx123, align 4, !tbaa !5 %inc124 = add nsw i32 %ac.0.lcssa, 1 br label %if.end125 if.end125: ; preds = %if.then121, %for.end115 %ac.2 = phi i32 [ %inc124, %if.then121 ], [ %ac.0.lcssa, %for.end115 ] %sub126 = add nsw i32 %61, -1 %72 = zext i32 %sub126 to i64 %cmp127 = icmp eq i64 %indvars.iv255, %72 br i1 %cmp127, label %if.then129, label %if.end133 if.then129: ; preds = %if.end125 %idxprom130 = sext i32 %ac.2 to i64 %arrayidx131 = getelementptr inbounds [524288 x i32], ptr %arr, i64 0, i64 %idxprom130 store i32 -1072114514, ptr %arrayidx131, align 4, !tbaa !5 %inc132 = add nsw i32 %ac.2, 1 br label %if.end133 if.end133: ; preds = %if.then129, %if.end125 %ac.3 = phi i32 [ %inc132, %if.then129 ], [ %ac.2, %if.end125 ] %conv135 = sext i32 %ac.3 to i64 call void @qsort(ptr noundef nonnull %arr, i64 noundef %conv135, i64 noundef 4, ptr noundef nonnull @sortfncsj) #11 %sub.i = add nsw i32 %ac.3, -1 %cmp.not63.i = icmp slt i32 %ac.3, 1 br i1 %cmp.not63.i, label %judge.exit.thread, label %while.body.lr.ph.i while.body.lr.ph.i: ; preds = %if.end133 %dec.i = add nsw i32 %ac.3, -2 br label %while.body.i while.body.i: ; preds = %75, %while.body.lr.ph.i %st.065.i = phi i32 [ 0, %while.body.lr.ph.i ], [ %st.171.i, %75 ] %fi.064.i = phi i32 [ %sub.i, %while.body.lr.ph.i ], [ %76, %75 ] %add.i = add nsw i32 %fi.064.i, %st.065.i %div.i = sdiv i32 %add.i, 2 %add.off.i = add i32 %add.i, 1 %cmp2.i = icmp ult i32 %add.off.i, 3 %spec.select.i = zext i1 %cmp2.i to i32 %cmp3.i = icmp eq i32 %sub.i, %div.i %q.0.i = select i1 %cmp3.i, i32 %dec.i, i32 %sub.i %cmp7.not59.i = icmp slt i32 %q.0.i, %spec.select.i br i1 %cmp7.not59.i, label %.loopexit.i, label %while.body8.i while.body8.i: ; preds = %while.body.i, %if.end15.i %q.161.i = phi i32 [ %q.2.i, %if.end15.i ], [ %q.0.i, %while.body.i ] %p.160.i = phi i32 [ %spec.select55.i, %if.end15.i ], [ %spec.select.i, %while.body.i ] %idxprom.i = sext i32 %p.160.i to i64 %arrayidx.i = getelementptr inbounds i32, ptr %arr, i64 %idxprom.i %73 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %idxprom9.i = sext i32 %q.161.i to i64 %arrayidx10.i = getelementptr inbounds i32, ptr %arr, i64 %idxprom9.i %74 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5 %add11.i = add nsw i32 %74, %73 %cmp12.i = icmp sgt i32 %add11.i, %div br i1 %cmp12.i, label %while.end.i, label %if.end15.i if.end15.i: ; preds = %while.body8.i %inc16.i = add nsw i32 %p.160.i, 1 %dec17.i = add nsw i32 %q.161.i, -1 %cmp18.i = icmp eq i32 %inc16.i, %div.i %inc20.i = add nsw i32 %p.160.i, 2 %spec.select55.i = select i1 %cmp18.i, i32 %inc20.i, i32 %inc16.i %cmp22.i = icmp eq i32 %dec17.i, %div.i %dec24.i = add nsw i32 %q.161.i, -2 %q.2.i = select i1 %cmp22.i, i32 %dec24.i, i32 %dec17.i %cmp7.not.i = icmp sgt i32 %spec.select55.i, %q.2.i br i1 %cmp7.not.i, label %.loopexit.i, label %while.body8.i, !llvm.loop !18 while.end.i: ; preds = %while.body8.i %add14.i = add nsw i32 %div.i, 1 br label %75 .loopexit.i: ; preds = %if.end15.i, %while.body.i %sub2870.i = add nsw i32 %div.i, -1 br label %75 75: ; preds = %.loopexit.i, %while.end.i %st.171.i = phi i32 [ %st.065.i, %.loopexit.i ], [ %add14.i, %while.end.i ] %76 = phi i32 [ %sub2870.i, %.loopexit.i ], [ %fi.064.i, %while.end.i ] %cmp.not.i = icmp sgt i32 %st.171.i, %76 br i1 %cmp.not.i, label %judge.exit, label %while.body.i, !llvm.loop !19 judge.exit: ; preds = %75 %77 = load i32, ptr %n, align 4, !tbaa !5 %sub138 = add nsw i32 %77, -1 %78 = zext i32 %sub138 to i64 %cmp139 = icmp eq i64 %indvars.iv255, %78 br i1 %cmp139, label %if.then141, label %if.end148 judge.exit.thread: ; preds = %if.end133 %79 = load i32, ptr %n, align 4, !tbaa !5 %sub138213 = add nsw i32 %79, -1 %80 = zext i32 %sub138213 to i64 %cmp139214 = icmp eq i64 %indvars.iv255, %80 br i1 %cmp139214, label %if.then144, label %if.end148 if.then141: ; preds = %judge.exit %cmp142 = icmp eq i32 %st.171.i, 0 br i1 %cmp142, label %if.then144, label %if.else if.then144: ; preds = %judge.exit.thread, %if.then141 %81 = phi i32 [ %77, %if.then141 ], [ %79, %judge.exit.thread ] %sub145 = add nsw i32 %div, -1 br label %for.end160 if.else: ; preds = %if.then141 %add146 = add nsw i32 %div, 1 br label %for.end160 if.end148: ; preds = %judge.exit.thread, %judge.exit %82 = phi i32 [ %79, %judge.exit.thread ], [ %77, %judge.exit ] %st.0.lcssa.i215 = phi i32 [ 0, %judge.exit.thread ], [ %st.171.i, %judge.exit ] %cmp149 = icmp eq i32 %st.0.lcssa.i215, %ac.3 br i1 %cmp149, label %if.then151, label %if.end153 if.then151: ; preds = %if.end148 %add152 = add nsw i32 %div, 1 br label %for.end160 if.end153: ; preds = %if.end148 %idxprom154 = sext i32 %st.0.lcssa.i215 to i64 %arrayidx155 = getelementptr inbounds [524288 x i32], ptr %arr, i64 0, i64 %idxprom154 %83 = load i32, ptr %arrayidx155, align 4, !tbaa !5 %arrayidx157 = getelementptr inbounds [524288 x i32], ptr %dp, i64 0, i64 %idxprom82 store i32 %83, ptr %arrayidx157, align 4, !tbaa !5 %indvars.iv.next256 = add nuw nsw i64 %indvars.iv255, 1 %84 = sext i32 %82 to i64 %cmp76 = icmp slt i64 %indvars.iv.next256, %84 br i1 %cmp76, label %for.body78, label %for.end160, !llvm.loop !29 for.end160: ; preds = %if.end153, %while.body, %if.then144, %if.else, %if.then151 %85 = phi i32 [ %81, %if.then144 ], [ %77, %if.else ], [ %82, %if.then151 ], [ %60, %while.body ], [ %82, %if.end153 ] %st.1 = phi i32 [ %st.0237, %if.then144 ], [ %add146, %if.else ], [ %add152, %if.then151 ], [ %st.0237, %while.body ], [ %st.0237, %if.end153 ] %fi.1 = phi i32 [ %sub145, %if.then144 ], [ %fi.0238, %if.else ], [ %fi.0238, %if.then151 ], [ %fi.0238, %while.body ], [ %fi.0238, %if.end153 ] %cmp72.not = icmp sgt i32 %st.1, %fi.1 br i1 %cmp72.not, label %while.end, label %while.body, !llvm.loop !30 while.end: ; preds = %for.end160, %for.end68 %st.0.lcssa = phi i32 [ 1, %for.end68 ], [ %st.1, %for.end160 ] %call162 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %r.0.lcssa, i32 noundef %st.0.lcssa) call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %dat) #11 call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %x) #11 call void @llvm.lifetime.end.p0(i64 6291456, ptr nonnull %g) #11 call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %arr) #11 call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %dp) #11 call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %cnt) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #9 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #10 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(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree norecurse nosync nounwind memory(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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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: write) } attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree "no-trapping-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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 0} !10 = !{!"", !6, i64 0, !6, i64 4} !11 = !{!12, !6, i64 0} !12 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8} !13 = !{!10, !6, i64 4} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"} !16 = !{!12, !6, i64 4} !17 = distinct !{!17, !15} !18 = distinct !{!18, !15} !19 = distinct !{!19, !15} !20 = !{!12, !6, i64 8} !21 = distinct !{!21, !15} !22 = distinct !{!22, !15, !23, !24} !23 = !{!"llvm.loop.isvectorized", i32 1} !24 = !{!"llvm.loop.unroll.runtime.disable"} !25 = distinct !{!25, !15, !24, !23} !26 = distinct !{!26, !15, !23, !24} !27 = distinct !{!27, !15, !24, !23} !28 = distinct !{!28, !15} !29 = distinct !{!29, !15} !30 = distinct !{!30, !15, !31} !31 = !{!"llvm.loop.unswitch.partial.disable"}
#include <stdio.h> int main() { int H,W,N,i,j,cnt=0,a[10000],jabara[10000]; scanf("%d %d %d", &H, &W, &N); for (i = 1; i <= N; i++) { scanf("%d", &a[i]); } for (j = 1; j <= N; j++) { for (i = 0; i < a[j]; i++) { jabara[cnt] = j; cnt++; } } cnt = 0; for (i = 0; i < H; i++) { if (i % 2 == 0) { for (j = 0; j < W; j++) { printf("%d ", jabara[cnt]); cnt++; } } else { for (j = 0; j < W; j++) { printf("%d ", jabara[cnt + W - j - 1]); } cnt += W; } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123144/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123144/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d \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 %N = alloca i32, align 4 %a = alloca [10000 x i32], align 16 %jabara = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %jabara) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not69 = icmp slt i32 %0, 1 br i1 %cmp.not69, label %for.cond19.preheader, label %for.body for.cond2.preheader: ; preds = %for.body %cmp3.not75 = icmp slt i32 %2, 1 br i1 %cmp3.not75, label %for.cond19.preheader, label %for.cond5.preheader.preheader for.cond5.preheader.preheader: ; preds = %for.cond2.preheader %1 = add nuw i32 %2, 1 %wide.trip.count = zext i32 %1 to i64 br label %for.cond5.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.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.not.not = icmp slt i64 %indvars.iv, %3 br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.inc16 %indvars.iv94 = phi i64 [ 1, %for.cond5.preheader.preheader ], [ %indvars.iv.next95, %for.inc16 ] %cnt.077 = phi i32 [ 0, %for.cond5.preheader.preheader ], [ %cnt.1.lcssa, %for.inc16 ] %arrayidx7 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv94 %4 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp871 = icmp sgt i32 %4, 0 br i1 %cmp871, label %for.body9.preheader, label %for.inc16 for.body9.preheader: ; preds = %for.cond5.preheader %5 = sext i32 %cnt.077 to i64 %6 = trunc i64 %indvars.iv94 to i32 %7 = zext i32 %4 to i64 %min.iters.check = icmp ult i32 %4, 8 br i1 %min.iters.check, label %for.body9.preheader110, label %vector.ph vector.ph: ; preds = %for.body9.preheader %n.vec = and i64 %7, 4294967288 %ind.end = add nsw i64 %n.vec, %5 %ind.end107 = trunc i64 %n.vec to i32 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %6, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %5 %8 = getelementptr inbounds [10000 x i32], ptr %jabara, i64 0, i64 %offset.idx store <4 x i32> %broadcast.splat, ptr %8, align 4, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 store <4 x i32> %broadcast.splat, ptr %9, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %7 br i1 %cmp.n, label %for.inc16.loopexit, label %for.body9.preheader110 for.body9.preheader110: ; preds = %for.body9.preheader, %middle.block %indvars.iv91.ph = phi i64 [ %5, %for.body9.preheader ], [ %ind.end, %middle.block ] %i.172.ph = phi i32 [ 0, %for.body9.preheader ], [ %ind.end107, %middle.block ] br label %for.body9 for.cond19.preheader: ; preds = %for.inc16, %entry, %for.cond2.preheader %11 = load i32, ptr %H, align 4, !tbaa !5 %cmp2085 = icmp sgt i32 %11, 0 br i1 %cmp2085, label %for.body21, label %for.end47 for.body9: ; preds = %for.body9.preheader110, %for.body9 %indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.body9 ], [ %indvars.iv91.ph, %for.body9.preheader110 ] %i.172 = phi i32 [ %inc14, %for.body9 ], [ %i.172.ph, %for.body9.preheader110 ] %arrayidx11 = getelementptr inbounds [10000 x i32], ptr %jabara, i64 0, i64 %indvars.iv91 store i32 %6, ptr %arrayidx11, align 4, !tbaa !5 %indvars.iv.next92 = add nsw i64 %indvars.iv91, 1 %inc14 = add nuw nsw i32 %i.172, 1 %exitcond.not = icmp eq i32 %inc14, %4 br i1 %exitcond.not, label %for.inc16.loopexit, label %for.body9, !llvm.loop !14 for.inc16.loopexit: ; preds = %for.body9, %middle.block %indvars.iv.next92.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next92, %for.body9 ] %12 = trunc i64 %indvars.iv.next92.lcssa to i32 br label %for.inc16 for.inc16: ; preds = %for.inc16.loopexit, %for.cond5.preheader %cnt.1.lcssa = phi i32 [ %cnt.077, %for.cond5.preheader ], [ %12, %for.inc16.loopexit ] %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %exitcond97.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count br i1 %exitcond97.not, label %for.cond19.preheader, label %for.cond5.preheader, !llvm.loop !15 for.body21: ; preds = %for.cond19.preheader, %if.end %cnt.287 = phi i32 [ %cnt.4, %if.end ], [ 0, %for.cond19.preheader ] %i.286 = phi i32 [ %inc46, %if.end ], [ 0, %for.cond19.preheader ] %rem = and i32 %i.286, 1 %cmp22 = icmp eq i32 %rem, 0 %13 = load i32, ptr %W, align 4, !tbaa !5 %cmp2481 = icmp sgt i32 %13, 0 br i1 %cmp22, label %for.cond23.preheader, label %for.cond33.preheader for.cond33.preheader: ; preds = %for.body21 br i1 %cmp2481, label %for.body35, label %for.end42 for.cond23.preheader: ; preds = %for.body21 br i1 %cmp2481, label %for.body25.preheader, label %if.end for.body25.preheader: ; preds = %for.cond23.preheader %14 = sext i32 %cnt.287 to i64 br label %for.body25 for.body25: ; preds = %for.body25.preheader, %for.body25 %indvars.iv98 = phi i64 [ %14, %for.body25.preheader ], [ %indvars.iv.next99, %for.body25 ] %j.182 = phi i32 [ 0, %for.body25.preheader ], [ %inc31, %for.body25 ] %arrayidx27 = getelementptr inbounds [10000 x i32], ptr %jabara, i64 0, i64 %indvars.iv98 %15 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %indvars.iv.next99 = add nsw i64 %indvars.iv98, 1 %inc31 = add nuw nsw i32 %j.182, 1 %16 = load i32, ptr %W, align 4, !tbaa !5 %cmp24 = icmp slt i32 %inc31, %16 br i1 %cmp24, label %for.body25, label %if.end.loopexit, !llvm.loop !16 for.body35: ; preds = %for.cond33.preheader, %for.body35 %17 = phi i32 [ %20, %for.body35 ], [ %13, %for.cond33.preheader ] %j.279 = phi i32 [ %inc41, %for.body35 ], [ 0, %for.cond33.preheader ] %18 = xor i32 %j.279, -1 %add = add i32 %cnt.287, %18 %sub36 = add i32 %add, %17 %idxprom37 = sext i32 %sub36 to i64 %arrayidx38 = getelementptr inbounds [10000 x i32], ptr %jabara, i64 0, i64 %idxprom37 %19 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %inc41 = add nuw nsw i32 %j.279, 1 %20 = load i32, ptr %W, align 4, !tbaa !5 %cmp34 = icmp slt i32 %inc41, %20 br i1 %cmp34, label %for.body35, label %for.end42, !llvm.loop !17 for.end42: ; preds = %for.body35, %for.cond33.preheader %.lcssa = phi i32 [ %13, %for.cond33.preheader ], [ %20, %for.body35 ] %add43 = add nsw i32 %.lcssa, %cnt.287 br label %if.end if.end.loopexit: ; preds = %for.body25 %21 = trunc i64 %indvars.iv.next99 to i32 br label %if.end if.end: ; preds = %if.end.loopexit, %for.cond23.preheader, %for.end42 %cnt.4 = phi i32 [ %add43, %for.end42 ], [ %cnt.287, %for.cond23.preheader ], [ %21, %if.end.loopexit ] %putchar = call i32 @putchar(i32 10) %inc46 = add nuw nsw i32 %i.286, 1 %22 = load i32, ptr %H, align 4, !tbaa !5 %cmp20 = icmp slt i32 %inc46, %22 br i1 %cmp20, label %for.body21, label %for.end47, !llvm.loop !18 for.end47: ; preds = %if.end, %for.cond19.preheader call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %jabara) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !13, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include<stdio.h> #include<string.h> int main() { char s[1001], t[1001]; scanf("%s", s); scanf("%s", t); char *p; int i,j; int count,ans; ans = 100000; for (i=0;i<strlen(s)-strlen(t)+1;i++) { p = &s[i]; count =0; for (j=0;j<strlen(t);j++) { if (t[j]!=p[j]) { count++; } } //printf("%d ",count); if (count<ans) { ans = count; } } printf("%d", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123195/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123195/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1001 x i8], align 16 %t = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #6 %sub = add i64 %call4, 1 %cmp45.not = icmp eq i64 %sub, %call6 br i1 %cmp45.not, label %for.end30, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = sub i64 %sub, %call6 %cmp1241.not = icmp eq i64 %call6, 0 %umax59 = call i64 @llvm.umax.i64(i64 %add, i64 1) br i1 %cmp1241.not, label %for.end30, label %for.body.us.preheader for.body.us.preheader: ; preds = %for.body.lr.ph %min.iters.check = icmp ult i64 %call6, 8 %n.vec = and i64 %call6, -8 %cmp.n = icmp eq i64 %call6, %n.vec br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %for.cond8.for.end_crit_edge.us %indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.cond8.for.end_crit_edge.us ], [ 0, %for.body.us.preheader ] %ans.047.us = phi i32 [ %spec.select40.us, %for.cond8.for.end_crit_edge.us ], [ 100000, %for.body.us.preheader ] %arrayidx.us = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %indvars.iv52 br i1 %min.iters.check, label %for.body14.us.preheader, label %vector.body vector.body: ; preds = %for.body.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.body.us ] %vec.phi = phi <4 x i32> [ %8, %vector.body ], [ zeroinitializer, %for.body.us ] %vec.phi63 = phi <4 x i32> [ %9, %vector.body ], [ zeroinitializer, %for.body.us ] %0 = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i8, ptr %0, i64 4 %wide.load64 = load <4 x i8>, ptr %1, align 4, !tbaa !5 %2 = getelementptr inbounds i8, ptr %arrayidx.us, i64 %index %wide.load65 = load <4 x i8>, ptr %2, align 1, !tbaa !5 %3 = getelementptr inbounds i8, ptr %2, i64 4 %wide.load66 = load <4 x i8>, ptr %3, align 1, !tbaa !5 %4 = icmp ne <4 x i8> %wide.load, %wide.load65 %5 = icmp ne <4 x i8> %wide.load64, %wide.load66 %6 = zext <4 x i1> %4 to <4 x i32> %7 = zext <4 x i1> %5 to <4 x i32> %8 = add <4 x i32> %vec.phi, %6 %9 = add <4 x i32> %vec.phi63, %7 %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 !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %9, %8 %11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond8.for.end_crit_edge.us, label %for.body14.us.preheader for.body14.us.preheader: ; preds = %for.body.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.us ], [ %n.vec, %middle.block ] %count.043.us.ph = phi i32 [ 0, %for.body.us ], [ %11, %middle.block ] br label %for.body14.us for.body14.us: ; preds = %for.body14.us.preheader, %for.body14.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body14.us ], [ %indvars.iv.ph, %for.body14.us.preheader ] %count.043.us = phi i32 [ %spec.select.us, %for.body14.us ], [ %count.043.us.ph, %for.body14.us.preheader ] %arrayidx16.us = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %indvars.iv %12 = load i8, ptr %arrayidx16.us, align 1, !tbaa !5 %arrayidx19.us = getelementptr inbounds i8, ptr %arrayidx.us, i64 %indvars.iv %13 = load i8, ptr %arrayidx19.us, align 1, !tbaa !5 %cmp21.not.us = icmp ne i8 %12, %13 %inc.us = zext i1 %cmp21.not.us to i32 %spec.select.us = add nuw nsw i32 %count.043.us, %inc.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call6 br i1 %exitcond.not, label %for.cond8.for.end_crit_edge.us, label %for.body14.us, !llvm.loop !12 for.cond8.for.end_crit_edge.us: ; preds = %for.body14.us, %middle.block %spec.select.us.lcssa = phi i32 [ %11, %middle.block ], [ %spec.select.us, %for.body14.us ] %spec.select40.us = call i32 @llvm.smin.i32(i32 %spec.select.us.lcssa, i32 %ans.047.us) %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %exitcond55.not = icmp eq i64 %indvars.iv.next53, %umax59 br i1 %exitcond55.not, label %for.end30, label %for.body.us, !llvm.loop !13 for.end30: ; preds = %for.cond8.for.end_crit_edge.us, %for.body.lr.ph, %entry %ans.0.lcssa = phi i32 [ 100000, %entry ], [ 0, %for.body.lr.ph ], [ %spec.select40.us, %for.cond8.for.end_crit_edge.us ] %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10} !13 = distinct !{!13, !9}
#include <stdio.h> #include <string.h> int main(void){ char s[1001],t[1001]; int countnum,i,j,k,diff=0,ans=2000; scanf("%s",s); scanf("%s",t); // strlen(s)-strlen(t)+1 ←カウントする回数 countnum = (int)(strlen(s)-strlen(t))+1; for(i=0;i<countnum;i++){ diff = 0; for(j=0;j<(int)strlen(t);j++){ k=i+j; if(s[k] != t[j]){ diff++; } } if(diff<ans){ ans = diff; } } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123238/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123238/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1001 x i8], align 16 %t = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #6 %sub = sub i64 %call4, %call6 %0 = and i64 %sub, 2147483648 %cmp.not43.not = icmp eq i64 %0, 0 br i1 %cmp.not43.not, label %for.cond8.preheader.lr.ph, label %for.end29 for.cond8.preheader.lr.ph: ; preds = %entry %conv11 = trunc i64 %call6 to i32 %cmp1240 = icmp sgt i32 %conv11, 0 br i1 %cmp1240, label %for.cond8.preheader.us.preheader, label %for.end29 for.cond8.preheader.us.preheader: ; preds = %for.cond8.preheader.lr.ph %1 = add i64 %call4, 1 %2 = sub i64 %1, %call6 %wide.trip.count54 = and i64 %2, 4294967295 %wide.trip.count = and i64 %call6, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 %n.mod.vf = and i64 %call6, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf %cmp.n = icmp eq i64 %n.mod.vf, 0 br label %for.cond8.preheader.us for.cond8.preheader.us: ; preds = %for.cond8.preheader.us.preheader, %for.cond8.for.end_crit_edge.us %indvars.iv51 = phi i64 [ 0, %for.cond8.preheader.us.preheader ], [ %indvars.iv.next52, %for.cond8.for.end_crit_edge.us ] %ans.045.us = phi i32 [ 2000, %for.cond8.preheader.us.preheader ], [ %spec.select39.us, %for.cond8.for.end_crit_edge.us ] br i1 %min.iters.check, label %for.body14.us.preheader, label %vector.body vector.body: ; preds = %for.cond8.preheader.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond8.preheader.us ] %vec.phi = phi <4 x i32> [ %12, %vector.body ], [ zeroinitializer, %for.cond8.preheader.us ] %vec.phi58 = phi <4 x i32> [ %13, %vector.body ], [ zeroinitializer, %for.cond8.preheader.us ] %3 = add nuw nsw i64 %index, %indvars.iv51 %4 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %3 %wide.load = load <4 x i8>, ptr %4, align 1, !tbaa !5 %5 = getelementptr inbounds i8, ptr %4, i64 4 %wide.load59 = load <4 x i8>, ptr %5, align 1, !tbaa !5 %6 = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %index %wide.load60 = load <4 x i8>, ptr %6, align 8, !tbaa !5 %7 = getelementptr inbounds i8, ptr %6, i64 4 %wide.load61 = load <4 x i8>, ptr %7, align 4, !tbaa !5 %8 = icmp ne <4 x i8> %wide.load, %wide.load60 %9 = icmp ne <4 x i8> %wide.load59, %wide.load61 %10 = zext <4 x i1> %8 to <4 x i32> %11 = zext <4 x i1> %9 to <4 x i32> %12 = add <4 x i32> %vec.phi, %10 %13 = add <4 x i32> %vec.phi58, %11 %index.next = add nuw i64 %index, 8 %14 = icmp eq i64 %index.next, %n.vec br i1 %14, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %13, %12 %15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond8.for.end_crit_edge.us, label %for.body14.us.preheader for.body14.us.preheader: ; preds = %for.cond8.preheader.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond8.preheader.us ], [ %n.vec, %middle.block ] %diff.042.us.ph = phi i32 [ 0, %for.cond8.preheader.us ], [ %15, %middle.block ] br label %for.body14.us for.body14.us: ; preds = %for.body14.us.preheader, %for.body14.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body14.us ], [ %indvars.iv.ph, %for.body14.us.preheader ] %diff.042.us = phi i32 [ %spec.select.us, %for.body14.us ], [ %diff.042.us.ph, %for.body14.us.preheader ] %16 = add nuw nsw i64 %indvars.iv, %indvars.iv51 %arrayidx.us = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %16 %17 = load i8, ptr %arrayidx.us, align 1, !tbaa !5 %arrayidx18.us = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %indvars.iv %18 = load i8, ptr %arrayidx18.us, align 1, !tbaa !5 %cmp20.not.us = icmp ne i8 %17, %18 %inc.us = zext i1 %cmp20.not.us to i32 %spec.select.us = add nuw nsw i32 %diff.042.us, %inc.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond50.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond50.not, label %for.cond8.for.end_crit_edge.us, label %for.body14.us, !llvm.loop !12 for.cond8.for.end_crit_edge.us: ; preds = %for.body14.us, %middle.block %spec.select.us.lcssa = phi i32 [ %15, %middle.block ], [ %spec.select.us, %for.body14.us ] %spec.select39.us = call i32 @llvm.smin.i32(i32 %spec.select.us.lcssa, i32 %ans.045.us) %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1 %exitcond55.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count54 br i1 %exitcond55.not, label %for.end29, label %for.cond8.preheader.us, !llvm.loop !13 for.end29: ; preds = %for.cond8.for.end_crit_edge.us, %for.cond8.preheader.lr.ph, %entry %ans.0.lcssa = phi i32 [ 2000, %entry ], [ 0, %for.cond8.preheader.lr.ph ], [ %spec.select39.us, %for.cond8.for.end_crit_edge.us ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10} !13 = distinct !{!13, !9}
#include <stdio.h> #include <string.h> int main() { char s[1001]; char t[1001]; scanf("%s%s",&s,&t); int i,j,cnt,sum; cnt = 0; sum = 0; i = 0; while (s[i]) { j = 0; cnt = 0; while (t[j]) { if (t[j] == s[i]) cnt++; if (s[i] == '\0') { cnt = 0; break; } j++; i++; } if (sum < cnt) sum = cnt; i -= j; i++; } printf("%d",strlen(t)-sum); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123289/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123289/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1001 x i8], align 16 %t = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t) %0 = load i8, ptr %s, align 16, !tbaa !5 %tobool.not52 = icmp eq i8 %0, 0 br i1 %tobool.not52, label %while.end26, label %while.cond1.preheader.lr.ph while.cond1.preheader.lr.ph: ; preds = %entry %1 = load i8, ptr %t, align 16, !tbaa !5 %tobool4.not43 = icmp eq i8 %1, 0 br i1 %tobool4.not43, label %while.end26, label %while.cond1.preheader while.cond1.preheader: ; preds = %while.cond1.preheader.lr.ph, %while.end %sum.054 = phi i32 [ %spec.select42, %while.end ], [ 0, %while.cond1.preheader.lr.ph ] %i.053 = phi i32 [ %inc25, %while.end ], [ 0, %while.cond1.preheader.lr.ph ] %2 = sext i32 %i.053 to i64 br label %while.body5 while.body5: ; preds = %while.cond1.preheader, %if.end18 %indvars.iv57 = phi i64 [ %2, %while.cond1.preheader ], [ %indvars.iv.next58, %if.end18 ] %indvars.iv = phi i64 [ 0, %while.cond1.preheader ], [ %indvars.iv.next, %if.end18 ] %3 = phi i8 [ %1, %while.cond1.preheader ], [ %5, %if.end18 ] %cnt.046 = phi i32 [ 0, %while.cond1.preheader ], [ %spec.select, %if.end18 ] %j.045 = phi i32 [ 0, %while.cond1.preheader ], [ %inc19, %if.end18 ] %i.144 = phi i32 [ %i.053, %while.cond1.preheader ], [ %inc20, %if.end18 ] %arrayidx9 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %indvars.iv57 %4 = load i8, ptr %arrayidx9, align 1, !tbaa !5 %cmp15 = icmp eq i8 %4, 0 br i1 %cmp15, label %while.end.split.loop.exit59, label %if.end18 if.end18: ; preds = %while.body5 %cmp = icmp eq i8 %3, %4 %inc = zext i1 %cmp to i32 %spec.select = add nuw nsw i32 %cnt.046, %inc %indvars.iv.next = add nuw i64 %indvars.iv, 1 %inc19 = add nuw nsw i32 %j.045, 1 %indvars.iv.next58 = add i64 %indvars.iv57, 1 %inc20 = add nsw i32 %i.144, 1 %arrayidx3 = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %indvars.iv.next %5 = load i8, ptr %arrayidx3, align 1, !tbaa !5 %tobool4.not = icmp eq i8 %5, 0 br i1 %tobool4.not, label %while.end, label %while.body5, !llvm.loop !8 while.end.split.loop.exit59: ; preds = %while.body5 %6 = trunc i64 %indvars.iv to i32 %7 = trunc i64 %indvars.iv57 to i32 br label %while.end while.end: ; preds = %if.end18, %while.end.split.loop.exit59 %i.1.lcssa = phi i32 [ %7, %while.end.split.loop.exit59 ], [ %inc20, %if.end18 ] %j.0.lcssa = phi i32 [ %6, %while.end.split.loop.exit59 ], [ %inc19, %if.end18 ] %cnt.2 = phi i32 [ 0, %while.end.split.loop.exit59 ], [ %spec.select, %if.end18 ] %spec.select42 = call i32 @llvm.smax.i32(i32 %sum.054, i32 %cnt.2) %sub = add i32 %i.1.lcssa, 1 %inc25 = sub i32 %sub, %j.0.lcssa %idxprom = sext i32 %inc25 to i64 %arrayidx = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom %8 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %8, 0 br i1 %tobool.not, label %while.end26.loopexit56, label %while.cond1.preheader, !llvm.loop !10 while.end26.loopexit56: ; preds = %while.end %9 = zext i32 %spec.select42 to i64 br label %while.end26 while.end26: ; preds = %while.cond1.preheader.lr.ph, %while.end26.loopexit56, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %9, %while.end26.loopexit56 ], [ 0, %while.cond1.preheader.lr.ph ] %call27 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #6 %sub29 = sub i64 %call27, %sum.0.lcssa %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub29) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 1001, 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 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include<stdio.h> #include<string.h> int main(){ char s[103]; scanf("%s",s); int l; l=strlen(s); for(int i=0;i<l;i++) printf("x"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123353/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123353/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [103 x i8], align 16 call void @llvm.lifetime.start.p0(i64 103, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call2 to i32 %cmp6 = icmp sgt i32 %conv, 0 br i1 %cmp6, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 103, ptr nonnull %s) #5 ret i32 0 for.body: ; preds = %entry, %for.body %i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %putchar = call i32 @putchar(i32 120) %inc = add nuw nsw i32 %i.07, 1 %exitcond.not = icmp eq i32 %inc, %conv br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !5 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int i = 0; char s[100]; scanf("%s", &s); while(s[i] != '\0'){ if(s[i] < 120){ s[i] = s[i] + (120 - s[i]); }else{ s[i] = s[i] - (s[i] - 120); } i++; } printf("%s",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123397/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123397/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not36 = icmp eq i8 %0, 0 br i1 %cmp.not36, label %while.end, label %if.end if.end: ; preds = %entry, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ] %arrayidx38 = phi ptr [ %arrayidx, %if.end ], [ %s, %entry ] store i8 120, ptr %arrayidx38, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv.next %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %1, 0 br i1 %cmp.not, label %while.end, label %if.end, !llvm.loop !8 while.end: ; preds = %if.end, %entry %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main() { unsigned char snake[55][55]={0}; unsigned char n=0,m=0,i=0,j=0; scanf("%d %d",&n,&m); for(i=0;i<n;i++) for(j=0;j<m;j++) snake[i][j]='.'; for(i=0;i<n;i++) { if((i+1)%2==1) { for(j=0;j<m;j++) snake[i][j]='#'; } else { if(((i+1)/2)%2==1) snake[i][m-1]='#'; else snake[i][0]='#'; } } for(i=0;i<n;i++) puts(snake[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12344/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12344/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %snake = alloca [55 x [55 x i8]], align 16 %n = alloca i8, align 1 %m = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 3025, ptr nonnull %snake) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3025) %snake, i8 0, i64 3025, i1 false) call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %n) #4 store i8 0, ptr %n, align 1, !tbaa !5 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %m) #4 store i8 0, ptr %m, align 1, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i8, ptr %n, align 1, !tbaa !5 %cmp87.not = icmp eq i8 %0, 0 br i1 %cmp87.not, label %for.end66, label %for.cond3.preheader.lr.ph for.cond3.preheader.lr.ph: ; preds = %entry %1 = load i8, ptr %m, align 1, !tbaa !5 %cmp685.not = icmp eq i8 %1, 0 br i1 %cmp685.not, label %for.body19.lr.ph, label %for.cond3.preheader.us.preheader for.cond3.preheader.us.preheader: ; preds = %for.cond3.preheader.lr.ph %2 = zext i8 %1 to i64 %wide.trip.count = zext i8 %0 to i64 %xtraiter = and i64 %wide.trip.count, 7 %3 = icmp ult i8 %0, 8 br i1 %3, label %for.cond14.preheader.unr-lcssa, label %for.cond3.preheader.us.preheader.new for.cond3.preheader.us.preheader.new: ; preds = %for.cond3.preheader.us.preheader %unroll_iter = and i64 %wide.trip.count, 248 %invariant.gep = getelementptr i8, ptr %snake, i64 55 %invariant.gep171 = getelementptr i8, ptr %snake, i64 110 %invariant.gep173 = getelementptr i8, ptr %snake, i64 165 %invariant.gep175 = getelementptr i8, ptr %snake, i64 220 %invariant.gep177 = getelementptr i8, ptr %snake, i64 275 %invariant.gep179 = getelementptr i8, ptr %snake, i64 330 %invariant.gep181 = getelementptr i8, ptr %snake, i64 385 br label %for.cond3.preheader.us for.cond3.preheader.us: ; preds = %for.cond3.preheader.us, %for.cond3.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond3.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond3.preheader.us ] %niter = phi i64 [ 0, %for.cond3.preheader.us.preheader.new ], [ %niter.next.7, %for.cond3.preheader.us ] %4 = mul nuw nsw i64 %indvar, 55 %scevgep = getelementptr i8, ptr %snake, i64 %4 call void @llvm.memset.p0.i64(ptr align 8 %scevgep, i8 46, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 55 %gep = getelementptr i8, ptr %invariant.gep, i64 %5 call void @llvm.memset.p0.i64(ptr align 1 %gep, i8 46, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 55 %gep172 = getelementptr i8, ptr %invariant.gep171, i64 %6 call void @llvm.memset.p0.i64(ptr align 2 %gep172, i8 46, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 55 %gep174 = getelementptr i8, ptr %invariant.gep173, i64 %7 call void @llvm.memset.p0.i64(ptr align 1 %gep174, i8 46, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 55 %gep176 = getelementptr i8, ptr %invariant.gep175, i64 %8 call void @llvm.memset.p0.i64(ptr align 4 %gep176, i8 46, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 55 %gep178 = getelementptr i8, ptr %invariant.gep177, i64 %9 call void @llvm.memset.p0.i64(ptr align 1 %gep178, i8 46, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 55 %gep180 = getelementptr i8, ptr %invariant.gep179, i64 %10 call void @llvm.memset.p0.i64(ptr align 2 %gep180, i8 46, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 55 %gep182 = getelementptr i8, ptr %invariant.gep181, i64 %11 call void @llvm.memset.p0.i64(ptr align 1 %gep182, i8 46, i64 %2, i1 false), !tbaa !5 %indvar.next.7 = add nuw nsw i64 %indvar, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond14.preheader.unr-lcssa, label %for.cond3.preheader.us, !llvm.loop !8 for.cond14.preheader.unr-lcssa: ; preds = %for.cond3.preheader.us, %for.cond3.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond3.preheader.us.preheader ], [ %indvar.next.7, %for.cond3.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond14.preheader, label %for.cond3.preheader.us.epil for.cond3.preheader.us.epil: ; preds = %for.cond14.preheader.unr-lcssa, %for.cond3.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond3.preheader.us.epil ], [ %indvar.unr, %for.cond14.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond3.preheader.us.epil ], [ 0, %for.cond14.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 55 %scevgep.epil = getelementptr i8, ptr %snake, i64 %12 call void @llvm.memset.p0.i64(ptr align 1 %scevgep.epil, i8 46, i64 %2, i1 false), !tbaa !5 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond14.preheader, label %for.cond3.preheader.us.epil, !llvm.loop !10 for.cond14.preheader: ; preds = %for.cond3.preheader.us.epil, %for.cond14.preheader.unr-lcssa br i1 %cmp87.not, label %for.end66, label %for.body19.lr.ph for.body19.lr.ph: ; preds = %for.cond3.preheader.lr.ph, %for.cond14.preheader %13 = load i8, ptr %m, align 1 %.fr = freeze i8 %13 %cmp2689.not = icmp eq i8 %.fr, 0 %conv44 = zext i8 %.fr to i64 %sub = add nsw i64 %conv44, -1 %wide.trip.count107 = zext i8 %0 to i64 br i1 %cmp2689.not, label %iter.check, label %for.body19.us iter.check: ; preds = %for.body19.lr.ph %min.iters.check = icmp ult i8 %0, 8 br i1 %min.iters.check, label %for.body19.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check115 = icmp ult i8 %0, 16 br i1 %min.iters.check115, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count107, 240 br label %vector.body vector.body: ; preds = %pred.store.continue145, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue145 ] %vec.ind = phi <16 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>, %vector.ph ], [ %vec.ind.next, %pred.store.continue145 ] %14 = add nuw nsw <16 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1> %15 = and <16 x i32> %14, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1> %16 = icmp eq <16 x i32> %15, zeroinitializer %17 = extractelement <16 x i1> %16, i64 0 br i1 %17, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %18 = extractelement <16 x i32> %14, i64 0 %19 = and i32 %18, 2 %20 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %index, i64 %sub %21 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %index %22 = icmp eq i32 %19, 0 %23 = select i1 %22, ptr %21, ptr %20 store i8 35, ptr %23, align 1, !tbaa !5 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %24 = extractelement <16 x i1> %16, i64 1 br i1 %24, label %pred.store.if116, label %pred.store.continue117 pred.store.if116: ; preds = %pred.store.continue %25 = or i64 %index, 1 %26 = extractelement <16 x i32> %14, i64 1 %27 = and i32 %26, 2 %28 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %25, i64 %sub %29 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %25 %30 = icmp eq i32 %27, 0 %31 = select i1 %30, ptr %29, ptr %28 store i8 35, ptr %31, align 1, !tbaa !5 br label %pred.store.continue117 pred.store.continue117: ; preds = %pred.store.if116, %pred.store.continue %32 = extractelement <16 x i1> %16, i64 2 br i1 %32, label %pred.store.if118, label %pred.store.continue119 pred.store.if118: ; preds = %pred.store.continue117 %33 = or i64 %index, 2 %34 = extractelement <16 x i32> %14, i64 2 %35 = and i32 %34, 2 %36 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %33, i64 %sub %37 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %33 %38 = icmp eq i32 %35, 0 %39 = select i1 %38, ptr %37, ptr %36 store i8 35, ptr %39, align 1, !tbaa !5 br label %pred.store.continue119 pred.store.continue119: ; preds = %pred.store.if118, %pred.store.continue117 %40 = extractelement <16 x i1> %16, i64 3 br i1 %40, label %pred.store.if120, label %pred.store.continue121 pred.store.if120: ; preds = %pred.store.continue119 %41 = or i64 %index, 3 %42 = extractelement <16 x i32> %14, i64 3 %43 = and i32 %42, 2 %44 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %41, i64 %sub %45 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %41 %46 = icmp eq i32 %43, 0 %47 = select i1 %46, ptr %45, ptr %44 store i8 35, ptr %47, align 1, !tbaa !5 br label %pred.store.continue121 pred.store.continue121: ; preds = %pred.store.if120, %pred.store.continue119 %48 = extractelement <16 x i1> %16, i64 4 br i1 %48, label %pred.store.if122, label %pred.store.continue123 pred.store.if122: ; preds = %pred.store.continue121 %49 = or i64 %index, 4 %50 = extractelement <16 x i32> %14, i64 4 %51 = and i32 %50, 2 %52 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %49, i64 %sub %53 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %49 %54 = icmp eq i32 %51, 0 %55 = select i1 %54, ptr %53, ptr %52 store i8 35, ptr %55, align 1, !tbaa !5 br label %pred.store.continue123 pred.store.continue123: ; preds = %pred.store.if122, %pred.store.continue121 %56 = extractelement <16 x i1> %16, i64 5 br i1 %56, label %pred.store.if124, label %pred.store.continue125 pred.store.if124: ; preds = %pred.store.continue123 %57 = or i64 %index, 5 %58 = extractelement <16 x i32> %14, i64 5 %59 = and i32 %58, 2 %60 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %57, i64 %sub %61 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %57 %62 = icmp eq i32 %59, 0 %63 = select i1 %62, ptr %61, ptr %60 store i8 35, ptr %63, align 1, !tbaa !5 br label %pred.store.continue125 pred.store.continue125: ; preds = %pred.store.if124, %pred.store.continue123 %64 = extractelement <16 x i1> %16, i64 6 br i1 %64, label %pred.store.if126, label %pred.store.continue127 pred.store.if126: ; preds = %pred.store.continue125 %65 = or i64 %index, 6 %66 = extractelement <16 x i32> %14, i64 6 %67 = and i32 %66, 2 %68 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %65, i64 %sub %69 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %65 %70 = icmp eq i32 %67, 0 %71 = select i1 %70, ptr %69, ptr %68 store i8 35, ptr %71, align 1, !tbaa !5 br label %pred.store.continue127 pred.store.continue127: ; preds = %pred.store.if126, %pred.store.continue125 %72 = extractelement <16 x i1> %16, i64 7 br i1 %72, label %pred.store.if128, label %pred.store.continue129 pred.store.if128: ; preds = %pred.store.continue127 %73 = or i64 %index, 7 %74 = extractelement <16 x i32> %14, i64 7 %75 = and i32 %74, 2 %76 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %73, i64 %sub %77 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %73 %78 = icmp eq i32 %75, 0 %79 = select i1 %78, ptr %77, ptr %76 store i8 35, ptr %79, align 1, !tbaa !5 br label %pred.store.continue129 pred.store.continue129: ; preds = %pred.store.if128, %pred.store.continue127 %80 = extractelement <16 x i1> %16, i64 8 br i1 %80, label %pred.store.if130, label %pred.store.continue131 pred.store.if130: ; preds = %pred.store.continue129 %81 = or i64 %index, 8 %82 = extractelement <16 x i32> %14, i64 8 %83 = and i32 %82, 2 %84 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %81, i64 %sub %85 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %81 %86 = icmp eq i32 %83, 0 %87 = select i1 %86, ptr %85, ptr %84 store i8 35, ptr %87, align 1, !tbaa !5 br label %pred.store.continue131 pred.store.continue131: ; preds = %pred.store.if130, %pred.store.continue129 %88 = extractelement <16 x i1> %16, i64 9 br i1 %88, label %pred.store.if132, label %pred.store.continue133 pred.store.if132: ; preds = %pred.store.continue131 %89 = or i64 %index, 9 %90 = extractelement <16 x i32> %14, i64 9 %91 = and i32 %90, 2 %92 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %89, i64 %sub %93 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %89 %94 = icmp eq i32 %91, 0 %95 = select i1 %94, ptr %93, ptr %92 store i8 35, ptr %95, align 1, !tbaa !5 br label %pred.store.continue133 pred.store.continue133: ; preds = %pred.store.if132, %pred.store.continue131 %96 = extractelement <16 x i1> %16, i64 10 br i1 %96, label %pred.store.if134, label %pred.store.continue135 pred.store.if134: ; preds = %pred.store.continue133 %97 = or i64 %index, 10 %98 = extractelement <16 x i32> %14, i64 10 %99 = and i32 %98, 2 %100 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %97, i64 %sub %101 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %97 %102 = icmp eq i32 %99, 0 %103 = select i1 %102, ptr %101, ptr %100 store i8 35, ptr %103, align 1, !tbaa !5 br label %pred.store.continue135 pred.store.continue135: ; preds = %pred.store.if134, %pred.store.continue133 %104 = extractelement <16 x i1> %16, i64 11 br i1 %104, label %pred.store.if136, label %pred.store.continue137 pred.store.if136: ; preds = %pred.store.continue135 %105 = or i64 %index, 11 %106 = extractelement <16 x i32> %14, i64 11 %107 = and i32 %106, 2 %108 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %105, i64 %sub %109 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %105 %110 = icmp eq i32 %107, 0 %111 = select i1 %110, ptr %109, ptr %108 store i8 35, ptr %111, align 1, !tbaa !5 br label %pred.store.continue137 pred.store.continue137: ; preds = %pred.store.if136, %pred.store.continue135 %112 = extractelement <16 x i1> %16, i64 12 br i1 %112, label %pred.store.if138, label %pred.store.continue139 pred.store.if138: ; preds = %pred.store.continue137 %113 = or i64 %index, 12 %114 = extractelement <16 x i32> %14, i64 12 %115 = and i32 %114, 2 %116 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %113, i64 %sub %117 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %113 %118 = icmp eq i32 %115, 0 %119 = select i1 %118, ptr %117, ptr %116 store i8 35, ptr %119, align 1, !tbaa !5 br label %pred.store.continue139 pred.store.continue139: ; preds = %pred.store.if138, %pred.store.continue137 %120 = extractelement <16 x i1> %16, i64 13 br i1 %120, label %pred.store.if140, label %pred.store.continue141 pred.store.if140: ; preds = %pred.store.continue139 %121 = or i64 %index, 13 %122 = extractelement <16 x i32> %14, i64 13 %123 = and i32 %122, 2 %124 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %121, i64 %sub %125 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %121 %126 = icmp eq i32 %123, 0 %127 = select i1 %126, ptr %125, ptr %124 store i8 35, ptr %127, align 1, !tbaa !5 br label %pred.store.continue141 pred.store.continue141: ; preds = %pred.store.if140, %pred.store.continue139 %128 = extractelement <16 x i1> %16, i64 14 br i1 %128, label %pred.store.if142, label %pred.store.continue143 pred.store.if142: ; preds = %pred.store.continue141 %129 = or i64 %index, 14 %130 = extractelement <16 x i32> %14, i64 14 %131 = and i32 %130, 2 %132 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %129, i64 %sub %133 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %129 %134 = icmp eq i32 %131, 0 %135 = select i1 %134, ptr %133, ptr %132 store i8 35, ptr %135, align 1, !tbaa !5 br label %pred.store.continue143 pred.store.continue143: ; preds = %pred.store.if142, %pred.store.continue141 %136 = extractelement <16 x i1> %16, i64 15 br i1 %136, label %pred.store.if144, label %pred.store.continue145 pred.store.if144: ; preds = %pred.store.continue143 %137 = or i64 %index, 15 %138 = extractelement <16 x i32> %14, i64 15 %139 = and i32 %138, 2 %140 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %137, i64 %sub %141 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %137 %142 = icmp eq i32 %139, 0 %143 = select i1 %142, ptr %141, ptr %140 store i8 35, ptr %143, align 1, !tbaa !5 br label %pred.store.continue145 pred.store.continue145: ; preds = %pred.store.if144, %pred.store.continue143 %index.next = add nuw i64 %index, 16 %vec.ind.next = add <16 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16> %144 = icmp eq i64 %index.next, %n.vec br i1 %144, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %pred.store.continue145 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count107 br i1 %cmp.n, label %for.cond55.preheader, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %n.vec.remaining = and i64 %wide.trip.count107, 8 %min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check.not.not, label %for.body19.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec147 = and i64 %wide.trip.count107, 248 %145 = trunc i64 %vec.epilog.resume.val to i32 %.splatinsert = insertelement <8 x i32> poison, i32 %145, i64 0 %.splat = shufflevector <8 x i32> %.splatinsert, <8 x i32> poison, <8 x i32> zeroinitializer %induction = or <8 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %pred.store.continue168, %vec.epilog.ph %index150 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next169, %pred.store.continue168 ] %vec.ind151 = phi <8 x i32> [ %induction, %vec.epilog.ph ], [ %vec.ind.next152, %pred.store.continue168 ] %146 = add nuw nsw <8 x i32> %vec.ind151, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1> %147 = and <8 x i32> %146, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1> %148 = icmp eq <8 x i32> %147, zeroinitializer %149 = extractelement <8 x i1> %148, i64 0 br i1 %149, label %pred.store.if153, label %pred.store.continue154 pred.store.if153: ; preds = %vec.epilog.vector.body %150 = extractelement <8 x i32> %146, i64 0 %151 = and i32 %150, 2 %152 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %index150, i64 %sub %153 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %index150 %154 = icmp eq i32 %151, 0 %155 = select i1 %154, ptr %153, ptr %152 store i8 35, ptr %155, align 1, !tbaa !5 br label %pred.store.continue154 pred.store.continue154: ; preds = %pred.store.if153, %vec.epilog.vector.body %156 = extractelement <8 x i1> %148, i64 1 br i1 %156, label %pred.store.if155, label %pred.store.continue156 pred.store.if155: ; preds = %pred.store.continue154 %157 = or i64 %index150, 1 %158 = extractelement <8 x i32> %146, i64 1 %159 = and i32 %158, 2 %160 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %157, i64 %sub %161 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %157 %162 = icmp eq i32 %159, 0 %163 = select i1 %162, ptr %161, ptr %160 store i8 35, ptr %163, align 1, !tbaa !5 br label %pred.store.continue156 pred.store.continue156: ; preds = %pred.store.if155, %pred.store.continue154 %164 = extractelement <8 x i1> %148, i64 2 br i1 %164, label %pred.store.if157, label %pred.store.continue158 pred.store.if157: ; preds = %pred.store.continue156 %165 = or i64 %index150, 2 %166 = extractelement <8 x i32> %146, i64 2 %167 = and i32 %166, 2 %168 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %165, i64 %sub %169 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %165 %170 = icmp eq i32 %167, 0 %171 = select i1 %170, ptr %169, ptr %168 store i8 35, ptr %171, align 1, !tbaa !5 br label %pred.store.continue158 pred.store.continue158: ; preds = %pred.store.if157, %pred.store.continue156 %172 = extractelement <8 x i1> %148, i64 3 br i1 %172, label %pred.store.if159, label %pred.store.continue160 pred.store.if159: ; preds = %pred.store.continue158 %173 = or i64 %index150, 3 %174 = extractelement <8 x i32> %146, i64 3 %175 = and i32 %174, 2 %176 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %173, i64 %sub %177 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %173 %178 = icmp eq i32 %175, 0 %179 = select i1 %178, ptr %177, ptr %176 store i8 35, ptr %179, align 1, !tbaa !5 br label %pred.store.continue160 pred.store.continue160: ; preds = %pred.store.if159, %pred.store.continue158 %180 = extractelement <8 x i1> %148, i64 4 br i1 %180, label %pred.store.if161, label %pred.store.continue162 pred.store.if161: ; preds = %pred.store.continue160 %181 = or i64 %index150, 4 %182 = extractelement <8 x i32> %146, i64 4 %183 = and i32 %182, 2 %184 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %181, i64 %sub %185 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %181 %186 = icmp eq i32 %183, 0 %187 = select i1 %186, ptr %185, ptr %184 store i8 35, ptr %187, align 1, !tbaa !5 br label %pred.store.continue162 pred.store.continue162: ; preds = %pred.store.if161, %pred.store.continue160 %188 = extractelement <8 x i1> %148, i64 5 br i1 %188, label %pred.store.if163, label %pred.store.continue164 pred.store.if163: ; preds = %pred.store.continue162 %189 = or i64 %index150, 5 %190 = extractelement <8 x i32> %146, i64 5 %191 = and i32 %190, 2 %192 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %189, i64 %sub %193 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %189 %194 = icmp eq i32 %191, 0 %195 = select i1 %194, ptr %193, ptr %192 store i8 35, ptr %195, align 1, !tbaa !5 br label %pred.store.continue164 pred.store.continue164: ; preds = %pred.store.if163, %pred.store.continue162 %196 = extractelement <8 x i1> %148, i64 6 br i1 %196, label %pred.store.if165, label %pred.store.continue166 pred.store.if165: ; preds = %pred.store.continue164 %197 = or i64 %index150, 6 %198 = extractelement <8 x i32> %146, i64 6 %199 = and i32 %198, 2 %200 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %197, i64 %sub %201 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %197 %202 = icmp eq i32 %199, 0 %203 = select i1 %202, ptr %201, ptr %200 store i8 35, ptr %203, align 1, !tbaa !5 br label %pred.store.continue166 pred.store.continue166: ; preds = %pred.store.if165, %pred.store.continue164 %204 = extractelement <8 x i1> %148, i64 7 br i1 %204, label %pred.store.if167, label %pred.store.continue168 pred.store.if167: ; preds = %pred.store.continue166 %205 = or i64 %index150, 7 %206 = extractelement <8 x i32> %146, i64 7 %207 = and i32 %206, 2 %208 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %205, i64 %sub %209 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %205 %210 = icmp eq i32 %207, 0 %211 = select i1 %210, ptr %209, ptr %208 store i8 35, ptr %211, align 1, !tbaa !5 br label %pred.store.continue168 pred.store.continue168: ; preds = %pred.store.if167, %pred.store.continue166 %index.next169 = add nuw i64 %index150, 8 %vec.ind.next152 = add <8 x i32> %vec.ind151, <i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8> %212 = icmp eq i64 %index.next169, %n.vec147 br i1 %212, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !15 vec.epilog.middle.block: ; preds = %pred.store.continue168 %cmp.n149 = icmp eq i64 %n.vec147, %wide.trip.count107 br i1 %cmp.n149, label %for.cond55.preheader, label %for.body19.preheader for.body19.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec147, %vec.epilog.middle.block ] br label %for.body19 for.body19.us: ; preds = %for.body19.lr.ph, %for.inc52.us %indvar99 = phi i64 [ %indvar.next100, %for.inc52.us ], [ 0, %for.body19.lr.ph ] %213 = trunc i64 %indvar99 to i32 %add.us = add nuw nsw i32 %213, 1 %rem.us = and i32 %add.us, 1 %cmp21.not.us = icmp eq i32 %rem.us, 0 br i1 %cmp21.not.us, label %if.else.us, label %for.cond23.preheader.us if.else.us: ; preds = %for.body19.us %214 = and i32 %add.us, 2 %cmp39.not.us = icmp eq i32 %214, 0 br i1 %cmp39.not.us, label %if.else47.us, label %if.then41.us if.then41.us: ; preds = %if.else.us %arrayidx46.us = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %indvar99, i64 %sub store i8 35, ptr %arrayidx46.us, align 1, !tbaa !5 br label %for.inc52.us if.else47.us: ; preds = %if.else.us %arrayidx49.us = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %indvar99 store i8 35, ptr %arrayidx49.us, align 1, !tbaa !5 br label %for.inc52.us for.inc52.us: ; preds = %for.cond23.preheader.us, %if.else47.us, %if.then41.us %indvar.next100 = add nuw nsw i64 %indvar99, 1 %exitcond105.not = icmp eq i64 %indvar.next100, %wide.trip.count107 br i1 %exitcond105.not, label %for.cond55.preheader, label %for.body19.us, !llvm.loop !16 for.cond23.preheader.us: ; preds = %for.body19.us %215 = mul nuw nsw i64 %indvar99, 55 %scevgep101 = getelementptr i8, ptr %snake, i64 %215 call void @llvm.memset.p0.i64(ptr align 1 %scevgep101, i8 35, i64 %conv44, i1 false), !tbaa !5 br label %for.inc52.us for.cond55.preheader: ; preds = %for.inc52.us, %for.inc52, %middle.block, %vec.epilog.middle.block br i1 %cmp87.not, label %for.end66, label %for.body60 for.body19: ; preds = %for.body19.preheader, %for.inc52 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc52 ], [ %indvars.iv.ph, %for.body19.preheader ] %216 = trunc i64 %indvars.iv to i32 %add = add nuw nsw i32 %216, 1 %rem = and i32 %add, 1 %cmp21.not = icmp eq i32 %rem, 0 br i1 %cmp21.not, label %if.else, label %for.inc52 if.else: ; preds = %for.body19 %217 = and i32 %add, 2 %cmp39.not = icmp eq i32 %217, 0 %arrayidx49 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %indvars.iv %arrayidx46 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %indvars.iv, i64 %sub %arrayidx49.sink = select i1 %cmp39.not, ptr %arrayidx49, ptr %arrayidx46 store i8 35, ptr %arrayidx49.sink, align 1, !tbaa !5 br label %for.inc52 for.inc52: ; preds = %if.else, %for.body19 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond108.not = icmp eq i64 %indvars.iv.next, %wide.trip.count107 br i1 %exitcond108.not, label %for.cond55.preheader, label %for.body19, !llvm.loop !17 for.body60: ; preds = %for.cond55.preheader, %for.body60 %indvars.iv109 = phi i64 [ %indvars.iv.next110, %for.body60 ], [ 0, %for.cond55.preheader ] %arrayidx62 = getelementptr inbounds [55 x [55 x i8]], ptr %snake, i64 0, i64 %indvars.iv109 %call63 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %arrayidx62) %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1 %218 = load i8, ptr %n, align 1, !tbaa !5 %219 = zext i8 %218 to i64 %cmp58 = icmp ult i64 %indvars.iv.next110, %219 br i1 %cmp58, label %for.body60, label %for.end66, !llvm.loop !18 for.end66: ; preds = %for.body60, %entry, %for.cond14.preheader, %for.cond55.preheader call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 3025, ptr nonnull %snake) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.unroll.disable"} !12 = distinct !{!12, !9, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !9, !13, !14} !16 = distinct !{!16, !9} !17 = distinct !{!17, !9, !14, !13} !18 = distinct !{!18, !9}
#include<stdio.h> int main(){ char a[100]; int i=0; int cnt=0; scanf("%s",a); while(a[i]){ cnt++; i++; } for(int i=0;i<cnt;i++) printf("x"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123483/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123483/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i8, ptr %a, align 16, !tbaa !5 %tobool.not8 = icmp eq i8 %0, 0 br i1 %tobool.not8, label %for.cond.cleanup, label %while.body for.cond.preheader: ; preds = %while.body %indvars = trunc i64 %indvars.iv.next to i32 %cmp11.not = icmp eq i32 %indvars, 0 br i1 %cmp11.not, label %for.cond.cleanup, label %for.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 %indvars.iv.next %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %1, 0 br i1 %tobool.not, label %for.cond.preheader, label %while.body, !llvm.loop !8 for.cond.cleanup: ; preds = %for.body, %entry, %for.cond.preheader call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %a) #4 ret i32 0 for.body: ; preds = %for.cond.preheader, %for.body %i2.012 = phi i32 [ %inc4, %for.body ], [ 0, %for.cond.preheader ] %putchar = call i32 @putchar(i32 120) %inc4 = add nuw nsw i32 %i2.012, 1 %exitcond.not = icmp eq i32 %inc4, %indvars br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !10 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include<stdio.h> int main(){ char s[100]; scanf("%s",s); for(int i=0;i<100;i++){ printf("x"); if(s[i+1]=='\0'){ printf("\n"); break; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123526/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123526/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) br label %for.cond for.cond: ; preds = %for.body, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %exitcond.not = icmp eq i64 %indvars.iv, 100 br i1 %exitcond.not, label %cleanup, label %for.body for.body: ; preds = %for.cond %putchar = call i32 @putchar(i32 120) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv.next %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp2 = icmp eq i8 %0, 0 br i1 %cmp2, label %if.then, label %for.cond, !llvm.loop !8 if.then: ; preds = %for.body %putchar8 = call i32 @putchar(i32 10) br label %cleanup cleanup: ; preds = %for.cond, %if.then call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int n=3,m=3, i, j; scanf("%d %d",&n,&m); for(j=0;j<n;j++){ if(j%2==0){ for(i=0;i<m;i++){ printf("#"); } }else if(j%4==1){ for(i=0;i<m-1;i++){ printf("."); } printf("#"); }else if(j%4==3){ printf("#"); for(i=0;i<m-1;i++){ printf("."); } } printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12357/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12357/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; 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 store i32 3, ptr %n, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 store i32 3, ptr %m, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp59 = icmp sgt i32 %0, 0 br i1 %cmp59, label %for.body, label %for.end35 for.body: ; preds = %entry, %if.end31 %j.060 = phi i32 [ %inc34, %if.end31 ], [ 0, %entry ] %rem = and i32 %j.060, 1 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %for.cond2.preheader, label %if.else for.cond2.preheader: ; preds = %for.body %1 = load i32, ptr %m, align 4, !tbaa !5 %cmp357 = icmp sgt i32 %1, 0 br i1 %cmp357, label %for.body4, label %if.end31 for.body4: ; preds = %for.cond2.preheader, %for.body4 %i.058 = phi i32 [ %inc, %for.body4 ], [ 0, %for.cond2.preheader ] %putchar49 = call i32 @putchar(i32 35) %inc = add nuw nsw i32 %i.058, 1 %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %2 br i1 %cmp3, label %for.body4, label %if.end31, !llvm.loop !9 if.else: ; preds = %for.body %rem6 = and i32 %j.060, 3 switch i32 %rem6, label %if.end31 [ i32 1, label %for.cond9.preheader i32 3, label %if.then20 ] for.cond9.preheader: ; preds = %if.else %3 = load i32, ptr %m, align 4, !tbaa !5 %cmp1055 = icmp sgt i32 %3, 1 br i1 %cmp1055, label %for.body11, label %for.end15 for.body11: ; preds = %for.cond9.preheader, %for.body11 %i.156 = phi i32 [ %inc14, %for.body11 ], [ 0, %for.cond9.preheader ] %putchar47 = call i32 @putchar(i32 46) %inc14 = add nuw nsw i32 %i.156, 1 %4 = load i32, ptr %m, align 4, !tbaa !5 %sub = add nsw i32 %4, -1 %cmp10 = icmp slt i32 %inc14, %sub br i1 %cmp10, label %for.body11, label %for.end15, !llvm.loop !11 for.end15: ; preds = %for.body11, %for.cond9.preheader %putchar46 = call i32 @putchar(i32 35) br label %if.end31 if.then20: ; preds = %if.else %putchar = call i32 @putchar(i32 35) %5 = load i32, ptr %m, align 4, !tbaa !5 %cmp2452 = icmp sgt i32 %5, 1 br i1 %cmp2452, label %for.body25, label %if.end31 for.body25: ; preds = %if.then20, %for.body25 %i.253 = phi i32 [ %inc28, %for.body25 ], [ 0, %if.then20 ] %putchar45 = call i32 @putchar(i32 46) %inc28 = add nuw nsw i32 %i.253, 1 %6 = load i32, ptr %m, align 4, !tbaa !5 %sub23 = add nsw i32 %6, -1 %cmp24 = icmp slt i32 %inc28, %sub23 br i1 %cmp24, label %for.body25, label %if.end31, !llvm.loop !12 if.end31: ; preds = %for.body25, %for.body4, %if.then20, %for.cond2.preheader, %if.else, %for.end15 %putchar48 = call i32 @putchar(i32 10) %inc34 = add nuw nsw i32 %j.060, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc34, %7 br i1 %cmp, label %for.body, label %for.end35, !llvm.loop !13 for.end35: ; preds = %if.end31, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #include<string.h> int main(void) { char S[100]; int i; scanf("%s", S); for(i = 0; i < strlen(S); i++) { S[i] = 'x'; } printf("%s", S); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123612/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123612/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %char0 = load i8, ptr %S, align 16 %cmp9.not = icmp eq i8 %char0, 0 br i1 %cmp9.not, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %indvars.iv store i8 120, ptr %arrayidx, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #5 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !8 for.end: ; preds = %for.body, %entry %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %S) call void @llvm.lifetime.end.p0(i64 100, 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 nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
//set many funcs template //Ver.20190820 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.h> #include<assert.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;} void swap(int *a,int *b){int c;c=(*a);(*a)=(*b);(*b)=c;} 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;} void llswap(long long *a,long long *b){long long c;c=(*a);(*a)=(*b);(*b)=c;} 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);} void dbswap(double *a,double *b){double c;c=(*a);(*a)=(*b);(*b)=c;} void chswap(char *a,char *b){char c;c=(*a);(*a)=(*b);(*b)=c;} 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);} int chsortfncsj(const void *a,const void *b){if(*(char *)a>*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;} int chsortfnckj(const void *a,const void *b){if(*(char *)a<*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;} void shuffledget(int x[],int n){ 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; } void prarr(int arr[],int n){ int i; for(i=0;i<n;i++){ if(i){printf(" ");} printf("%d",arr[i]); } printf("\n"); return; } void getperm(int a[],int n){ int i,p; for(i=0;i<n;i++){ a[i]=i; } for(i=n-1;i>=1;i--){ p=rand()%(i+1); swap(&a[p],&a[i]); } } 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; } void coordinate_comp(int a[],int n){ int i,c=0; sd dat[524288]; for(i=0;i<n;i++){ dat[i].val=a[i]; dat[i].node=i; } qsort(dat,n,sizeof(dat[0]),sdsortfnc); a[dat[0].node]=c; for(i=1;i<n;i++){ if(dat[i-1].val!=dat[i].val){c++;} a[dat[i].node]=c; } } int main(void){ //srand(time(0)); int i,j,n,m,k,a,b,c,h,w,r=0,l; char s[524288]; scanf("%s",s); l=strlen(s); for(i=0;i<l;i++){s[i]='x';} printf("%s\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123656/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123656/source.c" target datalayout = "e-m:e-p270: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.sd = type { i32, i32 } @.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 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\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 norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !16 %1 = load i32, ptr %b, align 4, !tbaa !16 store i32 %1, ptr %a, align 4, !tbaa !16 store i32 %0, ptr %b, align 4, !tbaa !16 ret void } ; 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 !20 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 !20 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 !21 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 !21 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 !22 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 !23 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 !25 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 !26 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 !27 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 !28 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(argmem: readwrite) uwtable define dso_local void @llswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 store i64 %1, ptr %a, align 8, !tbaa !29 store i64 %0, ptr %b, align 8, !tbaa !29 ret void } ; 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: readwrite) uwtable define dso_local void @dbswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 store double %1, ptr %a, align 8, !tbaa !31 store double %0, ptr %b, align 8, !tbaa !31 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @chswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load i8, ptr %a, align 1, !tbaa !33 %1 = load i8, ptr %b, align 1, !tbaa !33 store i8 %1, ptr %a, align 1, !tbaa !33 store i8 %0, ptr %b, align 1, !tbaa !33 ret void } ; 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 #5 { entry: %0 = load i32, ptr %a, align 4, !tbaa !16 %1 = load i32, ptr %b, align 4, !tbaa !16 %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 #5 { entry: %0 = load i32, ptr %a, align 4, !tbaa !16 %1 = load i32, ptr %b, align 4, !tbaa !16 %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 #5 { 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 #5 { 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 #5 { 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 #5 { 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 #6 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #17 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #17 ret i32 %call } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @chsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i8, ptr %a, align 1, !tbaa !33 %1 = load i8, ptr %b, align 1, !tbaa !33 %cmp = icmp sgt i8 %0, %1 %cmp5 = icmp ne i8 %0, %1 %. = sext i1 %cmp5 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 @chsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i8, ptr %a, align 1, !tbaa !33 %1 = load i8, ptr %b, align 1, !tbaa !33 %cmp = icmp slt i8 %0, %1 %cmp5 = icmp ne i8 %0, %1 %. = sext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #8 { entry: %b = alloca [524288 x i32], align 16 call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #18 %cmp40 = icmp sgt i32 %n, 0 br i1 %cmp40, label %for.body.preheader, label %for.end25 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.preheader57, 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 !16 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 16, !tbaa !16 %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 !34 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader57 for.body.preheader57: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond1.preheader: ; preds = %for.body, %middle.block br i1 %cmp40, label %for.body3.preheader, label %for.end25 for.body3.preheader: ; preds = %for.cond1.preheader %3 = zext i32 %n to i64 br label %for.body3 for.body: ; preds = %for.body.preheader57, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader57 ] %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 !16 %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.cond1.preheader, label %for.body, !llvm.loop !35 for.cond15.preheader: ; preds = %for.body3 br i1 %cmp40, label %for.body17.preheader, label %for.end25 for.body17.preheader: ; preds = %for.cond15.preheader %wide.trip.count54 = zext i32 %n to i64 br label %for.body17 for.body3: ; preds = %for.body3.preheader, %for.body3 %indvars.iv47 = phi i64 [ %3, %for.body3.preheader ], [ %indvars.iv.next48, %for.body3 ] %call = tail call i32 @rand() #18 %5 = trunc i64 %indvars.iv47 to i32 %rem = srem i32 %call, %5 %indvars.iv.next48 = add nsw i64 %indvars.iv47, -1 %idxprom4 = and i64 %indvars.iv.next48, 4294967295 %arrayidx5 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom4 %6 = load i32, ptr %arrayidx5, align 4, !tbaa !16 %idxprom6 = sext i32 %rem to i64 %arrayidx7 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom6 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !16 store i32 %7, ptr %arrayidx5, align 4, !tbaa !16 store i32 %6, ptr %arrayidx7, align 4, !tbaa !16 %cmp2 = icmp ugt i64 %indvars.iv47, 1 br i1 %cmp2, label %for.body3, label %for.cond15.preheader, !llvm.loop !36 for.body17: ; preds = %for.body17.preheader, %for.body17 %indvars.iv50 = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next51, %for.body17 ] %arrayidx19 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv50 %8 = load i32, ptr %arrayidx19, align 4, !tbaa !16 %idxprom20 = sext i32 %8 to i64 %arrayidx21 = getelementptr inbounds i32, ptr %x, i64 %idxprom20 %call22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx21) %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1 %exitcond55.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count54 br i1 %exitcond55.not, label %for.end25, label %for.body17, !llvm.loop !37 for.end25: ; preds = %for.body17, %entry, %for.cond1.preheader, %for.cond15.preheader call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #18 ret void } ; Function Attrs: nounwind declare i32 @rand() local_unnamed_addr #9 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10 ; 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 #11 { 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 !16 %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 !38 while.end: ; preds = %while.body, %entry %st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ] ret i32 %st.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local void @prarr(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #12 { entry: %cmp7 = icmp sgt i32 %n, 0 br i1 %cmp7, label %if.end.peel, label %for.end if.end.peel: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %.pre = load i32, ptr %arr, align 4, !tbaa !16 %call1.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %exitcond.peel.not = icmp eq i32 %n, 1 br i1 %exitcond.peel.not, label %for.end, label %if.end if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar6 = tail call i32 @putchar(i32 32) %arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !16 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !39 for.end: ; preds = %if.end, %if.end.peel, %entry %putchar = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10 ; Function Attrs: nounwind uwtable define dso_local void @getperm(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #8 { entry: %cmp20 = icmp sgt i32 %n, 0 br i1 %cmp20, label %for.body.preheader, label %for.end9 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.preheader30, 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 i32, ptr %a, i64 %index store <4 x i32> %vec.ind, ptr %0, align 4, !tbaa !16 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 4, !tbaa !16 %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 !41 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader30 for.body.preheader30: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond1.preheader: ; preds = %for.body, %middle.block %cmp222 = icmp sgt i32 %n, 1 br i1 %cmp222, label %for.body3.preheader, label %for.end9 for.body3.preheader: ; preds = %for.cond1.preheader %3 = zext i32 %n to i64 br label %for.body3 for.body: ; preds = %for.body.preheader30, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader30 ] %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %4 = trunc i64 %indvars.iv to i32 store i32 %4, ptr %arrayidx, align 4, !tbaa !16 %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.cond1.preheader, label %for.body, !llvm.loop !42 for.body3: ; preds = %for.body3.preheader, %for.body3 %indvars.iv25 = phi i64 [ %3, %for.body3.preheader ], [ %indvars.iv.next26, %for.body3 ] %indvars.iv.next26 = add nsw i64 %indvars.iv25, -1 %call = tail call i32 @rand() #18 %5 = trunc i64 %indvars.iv25 to i32 %rem = srem i32 %call, %5 %idxprom4 = sext i32 %rem to i64 %arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %idxprom4 %idxprom6 = and i64 %indvars.iv.next26, 4294967295 %arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %idxprom6 %6 = load i32, ptr %arrayidx5, align 4, !tbaa !16 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !16 store i32 %7, ptr %arrayidx5, align 4, !tbaa !16 store i32 %6, ptr %arrayidx7, align 4, !tbaa !16 %cmp2 = icmp ugt i64 %indvars.iv25, 2 br i1 %cmp2, label %for.body3, label %for.end9, !llvm.loop !43 for.end9: ; preds = %for.body3, %entry, %for.cond1.preheader ret void } ; 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) #5 { entry: %0 = load i32, ptr %a, align 4, !tbaa !44 %1 = load i32, ptr %b, align 4, !tbaa !44 %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: nofree nounwind uwtable define dso_local void @coordinate_comp(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #12 { entry: %dat = alloca [524288 x %struct.sd], align 16 call void @llvm.lifetime.start.p0(i64 4194304, ptr nonnull %dat) #18 %cmp46 = icmp sgt i32 %n, 0 br i1 %cmp46, 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, 4 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, 4294967292 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <2 x i32> %vec.ind, <i32 2, i32 2> %0 = or i64 %index, 2 %1 = getelementptr inbounds i32, ptr %a, i64 %index %wide.load = load <2 x i32>, ptr %1, align 4, !tbaa !16 %2 = getelementptr inbounds i32, ptr %1, i64 2 %wide.load59 = load <2 x i32>, ptr %2, align 4, !tbaa !16 %3 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %index %4 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %0 %interleaved.vec = shufflevector <2 x i32> %wide.load, <2 x i32> %vec.ind, <4 x i32> <i32 0, i32 2, i32 1, i32 3> store <4 x i32> %interleaved.vec, ptr %3, align 16, !tbaa !16 %interleaved.vec60 = shufflevector <2 x i32> %wide.load59, <2 x i32> %step.add, <4 x i32> <i32 0, i32 2, i32 1, i32 3> store <4 x i32> %interleaved.vec60, ptr %4, align 16, !tbaa !16 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4> %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !46 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %for.body.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.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 i32, ptr %a, i64 %indvars.iv %6 = load i32, ptr %arrayidx, align 4, !tbaa !16 %arrayidx2 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv store i32 %6, ptr %arrayidx2, align 8, !tbaa !44 %node = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv, i32 1 %7 = trunc i64 %indvars.iv to i32 store i32 %7, ptr %node, align 4, !tbaa !47 %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 !48 for.end: ; preds = %for.body, %middle.block, %entry %conv = sext i32 %n to i64 call void @qsort(ptr noundef nonnull %dat, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @sdsortfnc) #18 %node6 = getelementptr inbounds %struct.sd, ptr %dat, i64 0, i32 1 %8 = load i32, ptr %node6, align 4, !tbaa !47 %idxprom7 = sext i32 %8 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %a, i64 %idxprom7 store i32 0, ptr %arrayidx8, align 4, !tbaa !16 %cmp1048 = icmp sgt i32 %n, 1 br i1 %cmp1048, label %for.body12.preheader, label %for.end29 for.body12.preheader: ; preds = %for.end %wide.trip.count56 = zext i32 %n to i64 %.pre = load i32, ptr %dat, align 16, !tbaa !44 %9 = add nsw i64 %wide.trip.count56, -1 %xtraiter = and i64 %9, 1 %10 = icmp eq i32 %n, 2 br i1 %10, label %for.end29.loopexit.unr-lcssa, label %for.body12.preheader.new for.body12.preheader.new: ; preds = %for.body12.preheader %unroll_iter = and i64 %9, -2 br label %for.body12 for.body12: ; preds = %for.body12, %for.body12.preheader.new %11 = phi i32 [ %.pre, %for.body12.preheader.new ], [ %14, %for.body12 ] %indvars.iv52 = phi i64 [ 1, %for.body12.preheader.new ], [ %indvars.iv.next53.1, %for.body12 ] %c.050 = phi i32 [ 0, %for.body12.preheader.new ], [ %spec.select.1, %for.body12 ] %niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ] %arrayidx17 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52 %12 = load i32, ptr %arrayidx17, align 8, !tbaa !44 %cmp19.not = icmp ne i32 %11, %12 %inc21 = zext i1 %cmp19.not to i32 %spec.select = add nuw nsw i32 %c.050, %inc21 %node24 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52, i32 1 %13 = load i32, ptr %node24, align 4, !tbaa !47 %idxprom25 = sext i32 %13 to i64 %arrayidx26 = getelementptr inbounds i32, ptr %a, i64 %idxprom25 store i32 %spec.select, ptr %arrayidx26, align 4, !tbaa !16 %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %arrayidx17.1 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv.next53 %14 = load i32, ptr %arrayidx17.1, align 8, !tbaa !44 %cmp19.not.1 = icmp ne i32 %12, %14 %inc21.1 = zext i1 %cmp19.not.1 to i32 %spec.select.1 = add nuw nsw i32 %spec.select, %inc21.1 %node24.1 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv.next53, i32 1 %15 = load i32, ptr %node24.1, align 4, !tbaa !47 %idxprom25.1 = sext i32 %15 to i64 %arrayidx26.1 = getelementptr inbounds i32, ptr %a, i64 %idxprom25.1 store i32 %spec.select.1, ptr %arrayidx26.1, align 4, !tbaa !16 %indvars.iv.next53.1 = add nuw nsw i64 %indvars.iv52, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end29.loopexit.unr-lcssa, label %for.body12, !llvm.loop !49 for.end29.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader %.unr = phi i32 [ %.pre, %for.body12.preheader ], [ %14, %for.body12 ] %indvars.iv52.unr = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next53.1, %for.body12 ] %c.050.unr = phi i32 [ 0, %for.body12.preheader ], [ %spec.select.1, %for.body12 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end29, label %for.body12.epil for.body12.epil: ; preds = %for.end29.loopexit.unr-lcssa %arrayidx17.epil = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52.unr %16 = load i32, ptr %arrayidx17.epil, align 8, !tbaa !44 %cmp19.not.epil = icmp ne i32 %.unr, %16 %inc21.epil = zext i1 %cmp19.not.epil to i32 %spec.select.epil = add nuw nsw i32 %c.050.unr, %inc21.epil %node24.epil = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52.unr, i32 1 %17 = load i32, ptr %node24.epil, align 4, !tbaa !47 %idxprom25.epil = sext i32 %17 to i64 %arrayidx26.epil = getelementptr inbounds i32, ptr %a, i64 %idxprom25.epil store i32 %spec.select.epil, ptr %arrayidx26.epil, align 4, !tbaa !16 br label %for.end29 for.end29: ; preds = %for.body12.epil, %for.end29.loopexit.unr-lcssa, %for.end call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %dat) #18 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #13 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #12 { entry: %s = alloca [524288 x i8], align 16 call void @llvm.lifetime.start.p0(i64 524288, ptr nonnull %s) #18 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #17 %conv = trunc i64 %call2 to i32 %cmp8 = icmp sgt i32 %conv, 0 br i1 %cmp8, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = and i64 %call2, 4294967295 call void @llvm.memset.p0.i64(ptr nonnull align 16 %s, i8 120, i64 %0, i1 false), !tbaa !33 br label %for.end for.end: ; preds = %for.body.preheader, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 524288, ptr nonnull %s) #18 ret i32 0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #14 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #14 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #15 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #15 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: 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 nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nounwind "no-trapping-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 nounwind "no-trapping-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: 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 #12 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-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 } attributes #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #16 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #17 = { nounwind willreturn memory(read) } attributes #18 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"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 = !{!17, !17, i64 0} !17 = !{!"int", !18, i64 0} !18 = !{!"omnipotent char", !19, i64 0} !19 = !{!"Simple C/C++ TBAA"} !20 = distinct !{!20, !6} !21 = distinct !{!21, !6} !22 = distinct !{!22, !6} !23 = distinct !{!23, !24} !24 = !{!"llvm.loop.unroll.disable"} !25 = distinct !{!25, !6} !26 = distinct !{!26, !24} !27 = distinct !{!27, !6} !28 = distinct !{!28, !6} !29 = !{!30, !30, i64 0} !30 = !{!"long long", !18, i64 0} !31 = !{!32, !32, i64 0} !32 = !{!"double", !18, i64 0} !33 = !{!18, !18, i64 0} !34 = distinct !{!34, !6, !9, !10} !35 = distinct !{!35, !6, !10, !9} !36 = distinct !{!36, !6} !37 = distinct !{!37, !6} !38 = distinct !{!38, !6} !39 = distinct !{!39, !6, !40} !40 = !{!"llvm.loop.peeled.count", i32 1} !41 = distinct !{!41, !6, !9, !10} !42 = distinct !{!42, !6, !10, !9} !43 = distinct !{!43, !6} !44 = !{!45, !17, i64 0} !45 = !{!"", !17, i64 0, !17, i64 4} !46 = distinct !{!46, !6, !9, !10} !47 = !{!45, !17, i64 4} !48 = distinct !{!48, !6, !10, !9} !49 = distinct !{!49, !6}
#include <stdio.h> #include <string.h> int main() { char s[101] = {0}; scanf("%s", s); for (int i = 0; i < strlen(s); i++) { s[i] = 'x'; } printf("%s", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123720/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123720/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) %s, i8 0, i64 101, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %char0 = load i8, ptr %s, align 16 %cmp9.not = icmp eq i8 %char0, 0 br i1 %cmp9.not, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.body, %entry %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv store i8 120, ptr %arrayidx, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !8 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ char s[101]; int i=0; for(i=0;i<101;i++){ s[i]=0; } scanf("%s",s); i=0; while(s[i]!=0){ printf("x"); i++; } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123771/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123771/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) %s, i8 0, i64 101, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp3.not14 = icmp eq i8 %0, 0 br i1 %cmp3.not14, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %putchar12 = call i32 @putchar(i32 120) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next %1 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp3.not = icmp eq i8 %1, 0 br i1 %cmp3.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %while.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 101, 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int A,B; scanf("%d %d", &A, &B); int coin = 0; for(int i=0; i<2; i++){ if(A>B){ coin += A; A--; }else{ coin += B; B--; } } printf("%d", coin); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123814/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123814/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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) %A.promoted = load i32, ptr %A, align 4, !tbaa !5 %B.promoted = load i32, ptr %B, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %A.promoted, %B.promoted br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %entry %dec = add nsw i32 %A.promoted, -1 store i32 %dec, ptr %A, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %dec3 = add nsw i32 %B.promoted, -1 store i32 %dec3, ptr %B, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else %dec311 = phi i32 [ %B.promoted, %if.then ], [ %dec3, %if.else ] %dec9 = phi i32 [ %dec, %if.then ], [ %A.promoted, %if.else ] %.pn = phi i32 [ %A.promoted, %if.then ], [ %B.promoted, %if.else ] %cmp1.1 = icmp sgt i32 %dec9, %dec311 br i1 %cmp1.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %dec3.1 = add nsw i32 %dec311, -1 store i32 %dec3.1, ptr %B, align 4, !tbaa !5 br label %for.inc.1 if.then.1: ; preds = %for.inc %dec.1 = add nsw i32 %dec9, -1 store i32 %dec.1, ptr %A, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.else.1 %.pn.1 = phi i32 [ %dec9, %if.then.1 ], [ %dec311, %if.else.1 ] %coin.1.1 = add nsw i32 %.pn.1, %.pn %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %coin.1.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a,b,ans; scanf("%d%d",&a,&b); if(a == b){ ans = a*2; }else if(a>b){ ans = a*2-1; }else{ ans = b*2-1; } printf("%d",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123865/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123865/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = shl nsw i32 %0, 1 br label %if.end7 if.else: ; preds = %entry %cmp1 = icmp sgt i32 %0, %1 br i1 %cmp1, label %if.then2, label %if.else4 if.then2: ; preds = %if.else %mul3 = shl nsw i32 %0, 1 %sub = add nsw i32 %mul3, -1 br label %if.end7 if.else4: ; preds = %if.else %mul5 = shl nsw i32 %1, 1 %sub6 = add nsw i32 %mul5, -1 br label %if.end7 if.end7: ; preds = %if.then2, %if.else4, %if.then %ans.0 = phi i32 [ %mul, %if.then ], [ %sub, %if.then2 ], [ %sub6, %if.else4 ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b; scanf("%d%d",&a,&b); if(a==b) printf("%d",a*2); else if(a==b-1 || b==a-1) printf("%d",a+b); else { if(a>b) printf("%d",(a*2)-1); else printf("%d",(b*2)-1); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123915/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123915/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = shl nsw i32 %0, 1 br label %if.end18 if.else: ; preds = %entry %sub = add nsw i32 %1, -1 %cmp2 = icmp eq i32 %0, %sub %sub3 = add nsw i32 %0, -1 %cmp4 = icmp eq i32 %1, %sub3 %or.cond = select i1 %cmp2, i1 true, i1 %cmp4 br i1 %or.cond, label %if.then5, label %if.else7 if.then5: ; preds = %if.else %add = add nsw i32 %1, %0 br label %if.end18 if.else7: ; preds = %if.else %cmp8 = icmp sgt i32 %0, %1 br i1 %cmp8, label %if.then9, label %if.else13 if.then9: ; preds = %if.else7 %mul10 = shl nsw i32 %0, 1 %sub11 = add nsw i32 %mul10, -1 br label %if.end18 if.else13: ; preds = %if.else7 %mul14 = shl nsw i32 %1, 1 %sub15 = add nsw i32 %mul14, -1 br label %if.end18 if.end18: ; preds = %if.then5, %if.else13, %if.then9, %if.then %add.sink = phi i32 [ %add, %if.then5 ], [ %sub15, %if.else13 ], [ %sub11, %if.then9 ], [ %mul, %if.then ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.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> //A - Buttons int main(){ int a,b; scanf("%d %d",&a,&b); int coins=0; for(int i=0;i<2;i++){ if(a>b){ coins+=a; a--; }else{ coins+=b; b--; } } printf("%d\n",coins); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123959/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123959/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %a.promoted, %b.promoted br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %entry %dec = add nsw i32 %a.promoted, -1 store i32 %dec, ptr %a, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %dec3 = add nsw i32 %b.promoted, -1 store i32 %dec3, ptr %b, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else %dec311 = phi i32 [ %b.promoted, %if.then ], [ %dec3, %if.else ] %dec9 = phi i32 [ %dec, %if.then ], [ %a.promoted, %if.else ] %.pn = phi i32 [ %a.promoted, %if.then ], [ %b.promoted, %if.else ] %cmp1.1 = icmp sgt i32 %dec9, %dec311 br i1 %cmp1.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %dec3.1 = add nsw i32 %dec311, -1 store i32 %dec3.1, ptr %b, align 4, !tbaa !5 br label %for.inc.1 if.then.1: ; preds = %for.inc %dec.1 = add nsw i32 %dec9, -1 store i32 %dec.1, ptr %a, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.else.1 %.pn.1 = phi i32 [ %dec9, %if.then.1 ], [ %dec311, %if.else.1 ] %coins.1.1 = add nsw i32 %.pn.1, %.pn %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %coins.1.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> //#include<std.lib> int main(void) { int A; int B; int ans=0; scanf("%d",&A); scanf("%d",&B); for(int i=0;i<2;i++) { if(A>B){ ans+=A; A--; } else if(B>A){ ans+=B; B--; } else if(A==B){ ans+=A; A--; } } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124000/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124000/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %A.promoted = load i32, ptr %A, align 4, !tbaa !5 %B.promoted = load i32, ptr %B, align 4, !tbaa !5 %cmp2 = icmp sgt i32 %A.promoted, %B.promoted br i1 %cmp2, label %if.then, label %if.else if.then: ; preds = %entry %dec = add nsw i32 %A.promoted, -1 store i32 %dec, ptr %A, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %cmp3 = icmp sgt i32 %B.promoted, %A.promoted br i1 %cmp3, label %if.then4, label %if.else7 if.then4: ; preds = %if.else %dec6 = add nsw i32 %B.promoted, -1 store i32 %dec6, ptr %B, align 4, !tbaa !5 br label %for.inc if.else7: ; preds = %if.else %cmp8 = icmp eq i32 %A.promoted, %B.promoted br i1 %cmp8, label %if.else.1.thread, label %for.inc if.else.1.thread: ; preds = %if.else7 %dec11 = add nsw i32 %A.promoted, -1 store i32 %dec11, ptr %A, align 4, !tbaa !5 br label %if.then4.1 for.inc: ; preds = %if.then, %if.else7, %if.then4 %dec622 = phi i32 [ %B.promoted, %if.then ], [ %dec6, %if.then4 ], [ %B.promoted, %if.else7 ] %dec1120 = phi i32 [ %dec, %if.then ], [ %A.promoted, %if.then4 ], [ %A.promoted, %if.else7 ] %ans.1 = phi i32 [ %A.promoted, %if.then ], [ %B.promoted, %if.then4 ], [ 0, %if.else7 ] %cmp2.1 = icmp sgt i32 %dec1120, %dec622 br i1 %cmp2.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %cmp3.1 = icmp sgt i32 %dec622, %dec1120 br i1 %cmp3.1, label %if.then4.1, label %if.else7.1 if.else7.1: ; preds = %if.else.1 %cmp8.1 = icmp eq i32 %dec1120, %dec622 br i1 %cmp8.1, label %if.then9.1, label %for.inc.1 if.then9.1: ; preds = %if.else7.1 %add10.1 = add nsw i32 %dec622, %ans.1 %dec11.1 = add nsw i32 %dec622, -1 store i32 %dec11.1, ptr %A, align 4, !tbaa !5 br label %for.inc.1 if.then4.1: ; preds = %if.else.1.thread, %if.else.1 %dec6223240 = phi i32 [ %A.promoted, %if.else.1.thread ], [ %dec622, %if.else.1 ] %ans.13439 = phi i32 [ %A.promoted, %if.else.1.thread ], [ %ans.1, %if.else.1 ] %add5.1 = add nsw i32 %dec6223240, %ans.13439 %dec6.1 = add nsw i32 %dec6223240, -1 store i32 %dec6.1, ptr %B, align 4, !tbaa !5 br label %for.inc.1 if.then.1: ; preds = %for.inc %add.1 = add nsw i32 %dec1120, %ans.1 %dec.1 = add nsw i32 %dec1120, -1 store i32 %dec.1, ptr %A, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.then4.1, %if.then9.1, %if.else7.1 %ans.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %add5.1, %if.then4.1 ], [ %add10.1, %if.then9.1 ], [ %ans.1, %if.else7.1 ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); if(a==b)printf("%d",a*2); if(a>b)printf("%d",a*2-1); if(a<b)printf("%d",b*2-1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124044/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124044/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %cmp = icmp eq i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %mul = shl nsw i32 %0, 1 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) %.pre = load i32, ptr %a, align 4, !tbaa !5 %.pre15 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %.pre15, %if.then ], [ %1, %entry ] %3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ] %cmp2 = icmp sgt i32 %3, %2 br i1 %cmp2, label %if.then3, label %if.end6 if.then3: ; preds = %if.end %mul4 = shl nsw i32 %3, 1 %sub = add nsw i32 %mul4, -1 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) %.pre16 = load i32, ptr %a, align 4, !tbaa !5 %.pre17 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then3, %if.end %4 = phi i32 [ %.pre17, %if.then3 ], [ %2, %if.end ] %5 = phi i32 [ %.pre16, %if.then3 ], [ %3, %if.end ] %cmp7 = icmp slt i32 %5, %4 br i1 %cmp7, label %if.then8, label %if.end12 if.then8: ; preds = %if.end6 %mul9 = shl nsw i32 %4, 1 %sub10 = add nsw i32 %mul9, -1 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub10) br label %if.end12 if.end12: ; preds = %if.then8, %if.end6 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){ printf("%d\n",a+b); }else if(a>b){ printf("%d\n",a+a-1); }else{ printf("%d\n",b+b-1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124088/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124088/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %add = shl nsw i32 %0, 1 br label %if.end10 if.else: ; preds = %entry %cmp2 = icmp sgt i32 %0, %1 br i1 %cmp2, label %if.then3, label %if.else6 if.then3: ; preds = %if.else %add4 = shl nsw i32 %0, 1 %sub = add nsw i32 %add4, -1 br label %if.end10 if.else6: ; preds = %if.else %add7 = shl nsw i32 %1, 1 %sub8 = add nsw i32 %add7, -1 br label %if.end10 if.end10: ; preds = %if.then3, %if.else6, %if.then %sub.sink = phi i32 [ %sub, %if.then3 ], [ %sub8, %if.else6 ], [ %add, %if.then ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.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> #include<stdlib.h> int main(){ int a,b,i,r; r=0; scanf("%d%d",&a,&b); for(i=0;i<2;i++){ if(a>b){ r=r+a; a--; } else{ r=r+b; b--; } } printf("%d",r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124130/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124130/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %a.promoted, %b.promoted br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %entry %dec = add nsw i32 %a.promoted, -1 store i32 %dec, ptr %a, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %dec3 = add nsw i32 %b.promoted, -1 store i32 %dec3, ptr %b, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else %dec311 = phi i32 [ %b.promoted, %if.then ], [ %dec3, %if.else ] %dec9 = phi i32 [ %dec, %if.then ], [ %a.promoted, %if.else ] %.pn = phi i32 [ %a.promoted, %if.then ], [ %b.promoted, %if.else ] %cmp1.1 = icmp sgt i32 %dec9, %dec311 br i1 %cmp1.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %dec3.1 = add nsw i32 %dec311, -1 store i32 %dec3.1, ptr %b, align 4, !tbaa !5 br label %for.inc.1 if.then.1: ; preds = %for.inc %dec.1 = add nsw i32 %dec9, -1 store i32 %dec.1, ptr %a, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.else.1 %.pn.1 = phi i32 [ %dec9, %if.then.1 ], [ %dec311, %if.else.1 ] %r.1.1 = add nsw i32 %.pn.1, %.pn %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.1.1) 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; int b; scanf("%d",&a); scanf("%d",&b); if(a>b){ printf("%d",2*a-1); } else if(a==b){ printf("%d",a+b); } else if(a<b){ printf("%d",2*b-1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124181/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124181/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = shl nsw i32 %0, 1 %sub = add nsw i32 %mul, -1 br label %if.end13.sink.split if.else: ; preds = %entry %cmp3 = icmp eq i32 %0, %1 br i1 %cmp3, label %if.then4, label %if.else6 if.then4: ; preds = %if.else %add = shl nsw i32 %0, 1 br label %if.end13.sink.split if.else6: ; preds = %if.else %cmp7 = icmp slt i32 %0, %1 br i1 %cmp7, label %if.then8, label %if.end13 if.then8: ; preds = %if.else6 %mul9 = shl nsw i32 %1, 1 %sub10 = add nsw i32 %mul9, -1 br label %if.end13.sink.split if.end13.sink.split: ; preds = %if.then, %if.then8, %if.then4 %add.sink = phi i32 [ %add, %if.then4 ], [ %sub10, %if.then8 ], [ %sub, %if.then ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add.sink) br label %if.end13 if.end13: ; preds = %if.end13.sink.split, %if.else6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a,b,c,d,e,f = 0; scanf("%d",&a); scanf("%d",&b); if(a>=b){ c = a; d = a - 1; f = b; } else if(a<b){ c = b; d = b - 1; f = a; } if(d>=f){ c += d; } if(d<f){ c += f; } printf("%d",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124224/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124224/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %c.0 = call i32 @llvm.smax.i32(i32 %0, i32 %1) %f.0 = call i32 @llvm.smin.i32(i32 %0, i32 %1) %cmp6.not.not = icmp sgt i32 %c.0, %f.0 %reass.add = shl i32 %c.0, 1 %add = add i32 %reass.add, -1 %add11 = add nsw i32 %1, %0 %c.2 = select i1 %cmp6.not.not, i32 %add, i32 %add11 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %c.2) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a,b; scanf("%d %d" , &a,&b); if(a==b) printf("%d\n",2*a); else { if(a<b) a= b; printf("%d\n",2*a-1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124268/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124268/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = shl nsw i32 %0, 1 br label %if.end6 if.else: ; preds = %entry %cmp2 = icmp slt i32 %0, %1 br i1 %cmp2, label %if.then3, label %if.end if.then3: ; preds = %if.else store i32 %1, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then3, %if.else %2 = phi i32 [ %1, %if.then3 ], [ %0, %if.else ] %mul4 = shl nsw i32 %2, 1 %sub = add nsw i32 %mul4, -1 br label %if.end6 if.end6: ; preds = %if.end, %if.then %sub.sink = phi i32 [ %sub, %if.end ], [ %mul, %if.then ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.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 buttonA=0,buttonB=0; int total=0; scanf("%d%d",&buttonA,&buttonB); for(int i=0;i<2;i++) { if(buttonA>=buttonB&&buttonA>=3) { total+=buttonA; buttonA--; } else if(buttonB<=20) { total+=buttonB; buttonB--; } } printf("%d\n",total); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124310/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124310/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %buttonA = alloca i32, align 4 %buttonB = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %buttonA) #3 store i32 0, ptr %buttonA, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %buttonB) #3 store i32 0, ptr %buttonB, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %buttonA, ptr noundef nonnull %buttonB) %buttonA.promoted = load i32, ptr %buttonA, align 4 %buttonB.promoted = load i32, ptr %buttonB, align 4, !tbaa !5 %cmp1 = icmp sge i32 %buttonA.promoted, %buttonB.promoted %cmp2 = icmp sgt i32 %buttonA.promoted, 2 %or.cond = and i1 %cmp2, %cmp1 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %dec = add nsw i32 %buttonA.promoted, -1 store i32 %dec, ptr %buttonA, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %cmp3 = icmp slt i32 %buttonB.promoted, 21 br i1 %cmp3, label %if.then4, label %for.inc if.then4: ; preds = %if.else %dec6 = add nsw i32 %buttonB.promoted, -1 store i32 %dec6, ptr %buttonB, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.then4, %if.else %dec615 = phi i32 [ %buttonB.promoted, %if.then ], [ %dec6, %if.then4 ], [ %buttonB.promoted, %if.else ] %dec13 = phi i32 [ %dec, %if.then ], [ %buttonA.promoted, %if.then4 ], [ %buttonA.promoted, %if.else ] %total.1 = phi i32 [ %buttonA.promoted, %if.then ], [ %buttonB.promoted, %if.then4 ], [ 0, %if.else ] %cmp1.1 = icmp sge i32 %dec13, %dec615 %cmp2.1 = icmp sgt i32 %dec13, 2 %or.cond.1 = and i1 %cmp2.1, %cmp1.1 br i1 %or.cond.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %cmp3.1 = icmp slt i32 %dec615, 21 br i1 %cmp3.1, label %if.then4.1, label %for.inc.1 if.then4.1: ; preds = %if.else.1 %add5.1 = add nsw i32 %dec615, %total.1 %dec6.1 = add nsw i32 %dec615, -1 store i32 %dec6.1, ptr %buttonB, align 4, !tbaa !5 br label %for.inc.1 if.then.1: ; preds = %for.inc %add.1 = add nsw i32 %dec13, %total.1 %dec.1 = add nsw i32 %dec13, -1 store i32 %dec.1, ptr %buttonA, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.then4.1, %if.else.1 %total.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %add5.1, %if.then4.1 ], [ %total.1, %if.else.1 ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %total.1.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %buttonB) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %buttonA) #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> #include <string.h> int main(){ int a, b; scanf("%d%d", &a, &b); if(a > b){ printf("%d", a + a -1); }else if(a == b){ printf("%d", a + b); }else{ printf("%d", b + b - 1); } printf("\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124354/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124354/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #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 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %add = shl nsw i32 %0, 1 %sub = add nsw i32 %add, -1 br label %if.end10 if.else: ; preds = %entry %cmp2 = icmp eq i32 %0, %1 br i1 %cmp2, label %if.then3, label %if.else6 if.then3: ; preds = %if.else %add4 = shl nsw i32 %0, 1 br label %if.end10 if.else6: ; preds = %if.else %add7 = shl nsw i32 %1, 1 %sub8 = add nsw i32 %add7, -1 br label %if.end10 if.end10: ; preds = %if.then3, %if.else6, %if.then %add4.sink = phi i32 [ %add4, %if.then3 ], [ %sub8, %if.else6 ], [ %sub, %if.then ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add4.sink) %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a,b,ans=0; scanf("%d%d",&a,&b); for(int i=0;i<2;i++){ if(a>b){ ans+=a; a--; }else{ ans+=b; b--; } } printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124398/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124398/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %a.promoted, %b.promoted br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %entry %dec = add nsw i32 %a.promoted, -1 store i32 %dec, ptr %a, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %dec3 = add nsw i32 %b.promoted, -1 store i32 %dec3, ptr %b, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else %dec311 = phi i32 [ %b.promoted, %if.then ], [ %dec3, %if.else ] %dec9 = phi i32 [ %dec, %if.then ], [ %a.promoted, %if.else ] %.pn = phi i32 [ %a.promoted, %if.then ], [ %b.promoted, %if.else ] %cmp1.1 = icmp sgt i32 %dec9, %dec311 br i1 %cmp1.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %dec3.1 = add nsw i32 %dec311, -1 store i32 %dec3.1, ptr %b, align 4, !tbaa !5 br label %for.inc.1 if.then.1: ; preds = %for.inc %dec.1 = add nsw i32 %dec9, -1 store i32 %dec.1, ptr %a, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.else.1 %.pn.1 = phi i32 [ %dec9, %if.then.1 ], [ %dec311, %if.else.1 ] %ans.1.1 = add nsw i32 %.pn.1, %.pn %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<string.h> int main(){ int num[128],tempn,index[128][128],i,j,k,l,m,alc,count; char word[128][128],tempw[128],dict[128][128]; i=0; while(~scanf("%s %d",word[i],&num[i]))i++; i=i-1; j=0; while(j<i) { if(strcmp(word[j],word[j+1])>0) { strcpy(tempw,word[j]); strcpy(word[j],word[j+1]); strcpy(word[j+1],tempw); tempn=num[j]; num[j]=num[j+1]; num[j+1]=tempn; j=0; } else j++; } l=0; alc=0; count=0; for(k=0;k<=i;k++) { if(k==0) { strcpy(dict[0],word[0]); index[0][0]=num[0]; l++; } else { if(strcmp(dict[l-alc-1],word[k]) != 0) { count=0; strcpy(dict[l-alc],word[k]); index[l-alc][0]=num[k]; l++; } else { count++; alc++; index[l-alc][count]=num[k]; l++; } } } for(k=0;k<i;k++) { m=0; while(index[k][m+1] != 0) { if(index[k][m]>index[k][m+1]) { tempn=index[k][m]; index[k][m]=index[k][m+1]; index[k][m+1]=tempn; m=0; } else m++; } } for(k=0;k<l-alc;k++) { m=0; printf("%s\n",dict[k]); while(index[k][m+1] != 0) { printf("%d ",index[k][m]); m++; } printf("%d\n",index[k][m]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124455/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124455/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%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: %num = alloca [128 x i32], align 16 %index = alloca [128 x [128 x i32]], align 16 %word = alloca [128 x [128 x i8]], align 16 %tempw = alloca [128 x i8], align 16 %dict = alloca [128 x [128 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %num) #6 call void @llvm.lifetime.start.p0(i64 65536, ptr nonnull %index) #6 call void @llvm.lifetime.start.p0(i64 16384, ptr nonnull %word) #6 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %tempw) #6 call void @llvm.lifetime.start.p0(i64 16384, ptr nonnull %dict) #6 br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv274 = phi i32 [ %indvars.iv.next275, %while.cond ], [ -1, %entry ] %indvars.iv267 = phi i32 [ %indvars.iv.next268, %while.cond ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [128 x [128 x i8]], ptr %word, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [128 x i32], ptr %num, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %tobool.not = icmp eq i32 %call, -1 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next268 = add nuw i32 %indvars.iv267, 1 %indvars.iv.next275 = add nsw i32 %indvars.iv274, 1 br i1 %tobool.not, label %while.end, label %while.cond, !llvm.loop !5 while.end: ; preds = %while.cond %0 = trunc i64 %indvars.iv to i32 %sub = add nsw i32 %0, -1 %cmp239 = icmp ugt i32 %0, 1 br i1 %cmp239, label %while.body4, label %for.cond.preheader for.cond.preheader: ; preds = %if.end, %while.end %cmp44.not.not241.not = icmp eq i32 %0, 0 br i1 %cmp44.not.not241.not, label %for.cond144.preheader, label %for.inc.peel for.inc.peel: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %indvars.iv267 to i64 %1 = load i32, ptr %num, align 16 %call51.peel = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %dict, ptr noundef nonnull dereferenceable(1) %word) #6 store i32 %1, ptr %index, align 16, !tbaa !7 %exitcond.peel.not = icmp eq i32 %indvars.iv267, 1 br i1 %exitcond.peel.not, label %for.cond97.preheader, label %if.else56 while.body4: ; preds = %while.end, %if.end %j.0240 = phi i32 [ %j.1, %if.end ], [ 0, %while.end ] %idxprom5 = sext i32 %j.0240 to i64 %arrayidx6 = getelementptr inbounds [128 x [128 x i8]], ptr %word, i64 0, i64 %idxprom5 %add = add nsw i32 %j.0240, 1 %idxprom8 = sext i32 %add to i64 %arrayidx9 = getelementptr inbounds [128 x [128 x i8]], ptr %word, i64 0, i64 %idxprom8 %call11 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx6, ptr noundef nonnull dereferenceable(1) %arrayidx9) #7 %cmp12 = icmp sgt i32 %call11, 0 br i1 %cmp12, label %if.then, label %if.end if.then: ; preds = %while.body4 %call17 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %tempw, ptr noundef nonnull dereferenceable(1) %arrayidx6) #6 %call25 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx6, ptr noundef nonnull dereferenceable(1) %arrayidx9) #6 %call31 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx9, ptr noundef nonnull dereferenceable(1) %tempw) #6 %arrayidx33 = getelementptr inbounds [128 x i32], ptr %num, i64 0, i64 %idxprom5 %2 = load <2 x i32>, ptr %arrayidx33, align 4, !tbaa !7 %3 = shufflevector <2 x i32> %2, <2 x i32> poison, <2 x i32> <i32 1, i32 0> store <2 x i32> %3, ptr %arrayidx33, align 4, !tbaa !7 br label %if.end if.end: ; preds = %while.body4, %if.then %j.1 = phi i32 [ 0, %if.then ], [ %add, %while.body4 ] %cmp = icmp slt i32 %j.1, %sub br i1 %cmp, label %while.body4, label %for.cond.preheader, !llvm.loop !11 for.cond97.preheader.loopexit.loopexit: ; preds = %for.inc %indvars = trunc i64 %indvars.iv.next263 to i32 br label %for.cond97.preheader for.cond97.preheader: ; preds = %for.inc.peel, %for.cond97.preheader.loopexit.loopexit %l.0.lcssa = phi i32 [ 1, %for.inc.peel ], [ %indvars, %for.cond97.preheader.loopexit.loopexit ] %alc.0.lcssa = phi i32 [ 0, %for.inc.peel ], [ %alc.1, %for.cond97.preheader.loopexit.loopexit ] br i1 %cmp239, label %while.cond100.preheader.preheader, label %for.cond144.preheader while.cond100.preheader.preheader: ; preds = %for.cond97.preheader %wide.trip.count276 = zext i32 %indvars.iv274 to i64 br label %while.cond100.preheader if.else56: ; preds = %for.inc.peel, %for.inc %indvars.iv262 = phi i64 [ %indvars.iv.next263, %for.inc ], [ 1, %for.inc.peel ] %count.0245 = phi i32 [ %count.1, %for.inc ], [ 0, %for.inc.peel ] %alc.0244 = phi i32 [ %alc.1, %for.inc ], [ 0, %for.inc.peel ] %indvars264 = trunc i64 %indvars.iv262 to i32 %sub57 = sub nsw i32 %indvars264, %alc.0244 %sub58 = add nsw i32 %sub57, -1 %idxprom59 = sext i32 %sub58 to i64 %arrayidx60 = getelementptr inbounds [128 x [128 x i8]], ptr %dict, i64 0, i64 %idxprom59 %arrayidx63 = getelementptr inbounds [128 x [128 x i8]], ptr %word, i64 0, i64 %indvars.iv262 %call65 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx60, ptr noundef nonnull dereferenceable(1) %arrayidx63) #7 %cmp66.not = icmp eq i32 %call65, 0 br i1 %cmp66.not, label %if.else83, label %if.then67 if.then67: ; preds = %if.else56 %idxprom69 = sext i32 %sub57 to i64 %arrayidx70 = getelementptr inbounds [128 x [128 x i8]], ptr %dict, i64 0, i64 %idxprom69 %call75 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx70, ptr noundef nonnull dereferenceable(1) %arrayidx63) #6 %arrayidx77 = getelementptr inbounds [128 x i32], ptr %num, i64 0, i64 %indvars.iv262 %4 = load i32, ptr %arrayidx77, align 4, !tbaa !7 %arrayidx80 = getelementptr inbounds [128 x [128 x i32]], ptr %index, i64 0, i64 %idxprom69 store i32 %4, ptr %arrayidx80, align 16, !tbaa !7 br label %for.inc if.else83: ; preds = %if.else56 %inc84 = add nsw i32 %count.0245, 1 %inc85 = add nsw i32 %alc.0244, 1 %arrayidx87 = getelementptr inbounds [128 x i32], ptr %num, i64 0, i64 %indvars.iv262 %5 = load i32, ptr %arrayidx87, align 4, !tbaa !7 %sub88 = sub nsw i32 %indvars264, %inc85 %idxprom89 = sext i32 %sub88 to i64 %idxprom91 = sext i32 %inc84 to i64 %arrayidx92 = getelementptr inbounds [128 x [128 x i32]], ptr %index, i64 0, i64 %idxprom89, i64 %idxprom91 store i32 %5, ptr %arrayidx92, align 4, !tbaa !7 br label %for.inc for.inc: ; preds = %if.else83, %if.then67 %alc.1 = phi i32 [ %alc.0244, %if.then67 ], [ %inc85, %if.else83 ] %count.1 = phi i32 [ 0, %if.then67 ], [ %inc84, %if.else83 ] %indvars.iv.next263 = add nuw nsw i64 %indvars.iv262, 1 %exitcond.not = icmp eq i64 %indvars.iv.next263, %wide.trip.count br i1 %exitcond.not, label %for.cond97.preheader.loopexit.loopexit, label %if.else56, !llvm.loop !12 while.cond100.preheader: ; preds = %while.cond100.preheader.preheader, %for.inc141 %indvars.iv270 = phi i64 [ 0, %while.cond100.preheader.preheader ], [ %indvars.iv.next271, %for.inc141 ] %arrayidx105247 = getelementptr inbounds [128 x [128 x i32]], ptr %index, i64 0, i64 %indvars.iv270, i64 1 %6 = load i32, ptr %arrayidx105247, align 4, !tbaa !7 %cmp106.not248 = icmp eq i32 %6, 0 br i1 %cmp106.not248, label %for.inc141, label %while.body107 for.cond144.preheader: ; preds = %for.inc141, %for.cond.preheader, %for.cond97.preheader %alc.0.lcssa295 = phi i32 [ %alc.0.lcssa, %for.cond97.preheader ], [ 0, %for.cond.preheader ], [ %alc.0.lcssa, %for.inc141 ] %l.0.lcssa294 = phi i32 [ %l.0.lcssa, %for.cond97.preheader ], [ 0, %for.cond.preheader ], [ %l.0.lcssa, %for.inc141 ] %sub145 = sub nsw i32 %l.0.lcssa294, %alc.0.lcssa295 %cmp146259 = icmp sgt i32 %sub145, 0 br i1 %cmp146259, label %for.body147.preheader, label %for.end174 for.body147.preheader: ; preds = %for.cond144.preheader %wide.trip.count290 = zext i32 %sub145 to i64 br label %for.body147 while.body107: ; preds = %while.cond100.preheader, %if.end139 %7 = phi i32 [ %9, %if.end139 ], [ %6, %while.cond100.preheader ] %arrayidx105251 = phi ptr [ %arrayidx105, %if.end139 ], [ %arrayidx105247, %while.cond100.preheader ] %add103250 = phi i32 [ %add103, %if.end139 ], [ 1, %while.cond100.preheader ] %m.0249 = phi i32 [ %m.1, %if.end139 ], [ 0, %while.cond100.preheader ] %idxprom110 = sext i32 %m.0249 to i64 %arrayidx111 = getelementptr inbounds [128 x [128 x i32]], ptr %index, i64 0, i64 %indvars.iv270, i64 %idxprom110 %8 = load i32, ptr %arrayidx111, align 4, !tbaa !7 %cmp117 = icmp sgt i32 %8, %7 br i1 %cmp117, label %if.then118, label %if.end139 if.then118: ; preds = %while.body107 store i32 %7, ptr %arrayidx111, align 4, !tbaa !7 store i32 %8, ptr %arrayidx105251, align 4, !tbaa !7 br label %if.end139 if.end139: ; preds = %while.body107, %if.then118 %m.1 = phi i32 [ 0, %if.then118 ], [ %add103250, %while.body107 ] %add103 = add nsw i32 %m.1, 1 %idxprom104 = sext i32 %add103 to i64 %arrayidx105 = getelementptr inbounds [128 x [128 x i32]], ptr %index, i64 0, i64 %indvars.iv270, i64 %idxprom104 %9 = load i32, ptr %arrayidx105, align 4, !tbaa !7 %cmp106.not = icmp eq i32 %9, 0 br i1 %cmp106.not, label %for.inc141, label %while.body107, !llvm.loop !14 for.inc141: ; preds = %if.end139, %while.cond100.preheader %indvars.iv.next271 = add nuw nsw i64 %indvars.iv270, 1 %exitcond277.not = icmp eq i64 %indvars.iv.next271, %wide.trip.count276 br i1 %exitcond277.not, label %for.cond144.preheader, label %while.cond100.preheader, !llvm.loop !15 for.body147: ; preds = %for.body147.preheader, %while.end166 %indvars.iv286 = phi i64 [ 0, %for.body147.preheader ], [ %indvars.iv.next287, %while.end166 ] %arrayidx149 = getelementptr inbounds [128 x [128 x i8]], ptr %dict, i64 0, i64 %indvars.iv286 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx149) %arrayidx157254 = getelementptr inbounds [128 x [128 x i32]], ptr %index, i64 0, i64 %indvars.iv286, i64 1 %10 = load i32, ptr %arrayidx157254, align 4, !tbaa !7 %cmp158.not255 = icmp eq i32 %10, 0 br i1 %cmp158.not255, label %while.end166, label %while.body159 while.body159: ; preds = %for.body147, %while.body159 %indvars.iv280 = phi i64 [ %indvars.iv.next281, %while.body159 ], [ 0, %for.body147 ] %indvars.iv278 = phi i64 [ %indvars.iv.next279, %while.body159 ], [ 1, %for.body147 ] %indvars.iv.next281 = add nuw nsw i64 %indvars.iv280, 1 %arrayidx163 = getelementptr inbounds [128 x [128 x i32]], ptr %index, i64 0, i64 %indvars.iv286, i64 %indvars.iv280 %11 = load i32, ptr %arrayidx163, align 4, !tbaa !7 %call164 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %indvars.iv.next279 = add nuw i64 %indvars.iv278, 1 %arrayidx157 = getelementptr inbounds [128 x [128 x i32]], ptr %index, i64 0, i64 %indvars.iv286, i64 %indvars.iv.next279 %12 = load i32, ptr %arrayidx157, align 4, !tbaa !7 %cmp158.not = icmp eq i32 %12, 0 br i1 %cmp158.not, label %while.end166, label %while.body159, !llvm.loop !16 while.end166: ; preds = %while.body159, %for.body147 %m.2.lcssa = phi i64 [ 0, %for.body147 ], [ %indvars.iv278, %while.body159 ] %idxprom169 = and i64 %m.2.lcssa, 4294967295 %arrayidx170 = getelementptr inbounds [128 x [128 x i32]], ptr %index, i64 0, i64 %indvars.iv286, i64 %idxprom169 %13 = load i32, ptr %arrayidx170, align 4, !tbaa !7 %call171 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %13) %indvars.iv.next287 = add nuw nsw i64 %indvars.iv286, 1 %exitcond291.not = icmp eq i64 %indvars.iv.next287, %wide.trip.count290 br i1 %exitcond291.not, label %for.end174, label %for.body147, !llvm.loop !17 for.end174: ; preds = %while.end166, %for.cond144.preheader call void @llvm.lifetime.end.p0(i64 16384, ptr nonnull %dict) #6 call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %tempw) #6 call void @llvm.lifetime.end.p0(i64 16384, ptr nonnull %word) #6 call void @llvm.lifetime.end.p0(i64 65536, ptr nonnull %index) #6 call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %num) #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 i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) 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 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6, !13} !13 = !{!"llvm.loop.peeled.count", i32 1} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6}
#include <stdio.h> #include <stdlib.h> #define WHITE 1 #define GREY 2 #define BLACK 3 int adj[100][1000]={{}, {}}; int color[100]={}; int parent[100]={}; int flag=0; // Have a closed circuit 1, otherwise 0; int E,V; void dfs_visit(int u); int main(){ int u, v; int i; //input scanf("%d %d", &V, &E); for(i=0;i<E;i++){ scanf("%d %d", &u, &v); if(u != v){ adj[u][v] = 1; color[u] = WHITE; color[v] = WHITE; } } for(u=0;u<V;u++){ if(color[u] == WHITE) dfs_visit(u); } printf("%d\n", flag); return 0; } // DFS check void dfs_visit(int u){ int v; color[u]=GREY; for(v=0;v<E;v++){ if(adj[u][v]==1){ if(color[v]==WHITE){ parent[v]=u; dfs_visit(v); } if(color[v]==GREY){ flag=1; break; } } } color[u]=BLACK; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124505/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124505/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @adj = dso_local local_unnamed_addr global [100 x [1000 x i32]] zeroinitializer, align 16 @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @parent = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @flag = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @V = dso_local global i32 0, align 4 @E = dso_local 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: %u = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @V, ptr noundef nonnull @E) %0 = load i32, ptr @E, align 4, !tbaa !5 %cmp24 = icmp sgt i32 %0, 0 br i1 %cmp24, label %for.body, label %for.cond9.preheader for.cond9.preheader: ; preds = %for.inc, %entry store i32 0, ptr %u, align 4, !tbaa !5 %1 = load i32, ptr @V, align 4, !tbaa !5 %cmp1026 = icmp sgt i32 %1, 0 br i1 %cmp1026, label %for.body11, label %for.end19 for.body: ; preds = %entry, %for.inc %i.025 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %u, ptr noundef nonnull %v) %2 = load i32, ptr %u, align 4, !tbaa !5 %3 = load i32, ptr %v, align 4, !tbaa !5 %cmp2.not = icmp eq i32 %2, %3 br i1 %cmp2.not, label %for.inc, label %if.then if.then: ; preds = %for.body %idxprom = sext i32 %2 to i64 %idxprom3 = sext i32 %3 to i64 %arrayidx4 = getelementptr inbounds [100 x [1000 x i32]], ptr @adj, i64 0, i64 %idxprom, i64 %idxprom3 store i32 1, ptr %arrayidx4, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx6, align 4, !tbaa !5 %arrayidx8 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom3 store i32 1, ptr %arrayidx8, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then %inc = add nuw nsw i32 %i.025, 1 %4 = load i32, ptr @E, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.cond9.preheader, !llvm.loop !9 for.body11: ; preds = %for.cond9.preheader, %for.inc17 %5 = phi i32 [ %7, %for.inc17 ], [ %1, %for.cond9.preheader ] %storemerge27 = phi i32 [ %inc18, %for.inc17 ], [ 0, %for.cond9.preheader ] %idxprom12 = sext i32 %storemerge27 to i64 %arrayidx13 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom12 %6 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp eq i32 %6, 1 br i1 %cmp14, label %if.then15, label %for.inc17 if.then15: ; preds = %for.body11 call void @dfs_visit(i32 noundef %storemerge27) %.pre = load i32, ptr %u, align 4, !tbaa !5 %.pre28 = load i32, ptr @V, align 4, !tbaa !5 br label %for.inc17 for.inc17: ; preds = %for.body11, %if.then15 %7 = phi i32 [ %5, %for.body11 ], [ %.pre28, %if.then15 ] %8 = phi i32 [ %storemerge27, %for.body11 ], [ %.pre, %if.then15 ] %inc18 = add nsw i32 %8, 1 store i32 %inc18, ptr %u, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc18, %7 br i1 %cmp10, label %for.body11, label %for.end19, !llvm.loop !11 for.end19: ; preds = %for.inc17, %for.cond9.preheader %9 = load i32, ptr @flag, align 4, !tbaa !5 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs_visit(i32 noundef %u) local_unnamed_addr #3 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 2, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @E, align 4, !tbaa !5 %cmp29 = icmp sgt i32 %0, 0 br i1 %cmp29, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %1 = phi i32 [ %6, %for.inc ], [ %0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx4 = getelementptr inbounds [100 x [1000 x i32]], ptr @adj, i64 0, i64 %idxprom, i64 %indvars.iv %2 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp5 = icmp eq i32 %2, 1 br i1 %cmp5, label %if.then, label %for.inc if.then: ; preds = %for.body %arrayidx7 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %3 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8 = icmp eq i32 %3, 1 br i1 %cmp8, label %if.then9, label %if.end if.then9: ; preds = %if.then %arrayidx11 = getelementptr inbounds [100 x i32], ptr @parent, i64 0, i64 %indvars.iv store i32 %u, ptr %arrayidx11, align 4, !tbaa !5 %4 = trunc i64 %indvars.iv to i32 tail call void @dfs_visit(i32 noundef %4) %.pr = load i32, ptr %arrayidx7, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then9, %if.then %5 = phi i32 [ %.pr, %if.then9 ], [ %3, %if.then ] %cmp14 = icmp eq i32 %5, 2 br i1 %cmp14, label %if.then15, label %if.end.for.inc_crit_edge if.end.for.inc_crit_edge: ; preds = %if.end %.pre = load i32, ptr @E, align 4, !tbaa !5 br label %for.inc if.then15: ; preds = %if.end store i32 1, ptr @flag, align 4, !tbaa !5 br label %for.end for.inc: ; preds = %if.end.for.inc_crit_edge, %for.body %6 = phi i32 [ %.pre, %if.end.for.inc_crit_edge ], [ %1, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.inc, %entry, %if.then15 store i32 3, ptr %arrayidx, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 <stdlib.h> #include <string.h> #include <stdbool.h> struct Unir { struct Unir * ant; int encontrado; char valor; bool selecionado; } typedef tUnir; void printUnir(tUnir * Unir) { if (Unir->ant != NULL) { printUnir(Unir->ant); } if (Unir->selecionado) { printf("%c", Unir->valor); } } void printLSB(char * s, char * t, int n, int m) { int i, j; tUnir iguais[n][m]; for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { iguais[i][j].encontrado = 0; iguais[i][j].ant = NULL; iguais[i][j].valor = '\0'; iguais[i][j].selecionado = false; } } for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { iguais[i][j].valor = s[i]; if (iguais[i][j].valor == t[j]) { iguais[i][j].encontrado = 1; iguais[i][j].selecionado = true; } else { iguais[i][j].encontrado = 0; iguais[i][j].selecionado = false; } if (i > 0 && j > 0) { iguais[i][j].ant = &iguais[i - 1][j - 1]; iguais[i][j].encontrado += iguais[i][j].ant->encontrado; } if (i > 0) { if (iguais[i - 1][j].encontrado > iguais[i][j].encontrado) { iguais[i][j].ant = &iguais[i - 1][j]; iguais[i][j].encontrado = iguais[i - 1][j].encontrado; iguais[i][j].selecionado = false; } } if (j > 0) { if (iguais[i][j - 1].encontrado > iguais[i][j].encontrado) { iguais[i][j].ant = &iguais[i][j - 1]; iguais[i][j].encontrado = iguais[i][j - 1].encontrado; iguais[i][j].selecionado = false; } } } } printUnir(&iguais[n - 1][m - 1]); printf("\n"); } int main() { char s[3000], t[3000]; scanf("%s", s); scanf("%s", t); int n = strlen(s); int m = strlen(t); if (n < m) { printLSB(s, t, n, m); } else { printLSB(t, s, m, n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124563/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124563/source.c" target datalayout = "e-m:e-p270: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.Unir = type { ptr, i32, i8, i8 } @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @printUnir(ptr nocapture noundef readonly %Unir) local_unnamed_addr #0 { entry: %0 = load ptr, ptr %Unir, align 8, !tbaa !5 %cmp.not = icmp eq ptr %0, null br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry tail call void @printUnir(ptr noundef nonnull %0) br label %if.end if.end: ; preds = %if.then, %entry %selecionado = getelementptr inbounds %struct.Unir, ptr %Unir, i64 0, i32 3 %1 = load i8, ptr %selecionado, align 1, !tbaa !12, !range !13, !noundef !14 %tobool.not = icmp eq i8 %1, 0 br i1 %tobool.not, label %if.end3, label %if.then2 if.then2: ; preds = %if.end %valor = getelementptr inbounds %struct.Unir, ptr %Unir, i64 0, i32 2 %2 = load i8, ptr %valor, align 4, !tbaa !15 %conv = sext i8 %2 to i32 %putchar = tail call i32 @putchar(i32 %conv) br label %if.end3 if.end3: ; preds = %if.then2, %if.end ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @printLSB(ptr nocapture noundef readonly %s, ptr nocapture noundef readonly %t, i32 noundef %n, i32 noundef %m) local_unnamed_addr #0 { entry: %0 = zext i32 %n to i64 %1 = zext i32 %m to i64 %2 = mul nuw i64 %1, %0 %vla = alloca %struct.Unir, i64 %2, align 16 %cmp269 = icmp sgt i32 %n, 0 %cmp2267 = icmp sgt i32 %m, 0 %or.cond = and i1 %cmp269, %cmp2267 br i1 %or.cond, label %for.cond1.preheader.us.preheader, label %for.end186 for.cond1.preheader.us.preheader: ; preds = %entry %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %m, 8 %unroll_iter = and i64 %1, 4294967288 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc18_crit_edge.us %indvars.iv278 = phi i64 [ %indvars.iv.next279, %for.cond1.for.inc18_crit_edge.us ], [ 0, %for.cond1.preheader.us.preheader ] %4 = mul nuw nsw i64 %indvars.iv278, %1 %arrayidx.us = getelementptr inbounds %struct.Unir, ptr %vla, i64 %4 br i1 %3, label %for.cond1.for.inc18_crit_edge.us.unr-lcssa, label %for.body3.us for.body3.us: ; preds = %for.cond1.preheader.us, %for.body3.us %indvars.iv = phi i64 [ %indvars.iv.next.7, %for.body3.us ], [ 0, %for.cond1.preheader.us ] %niter = phi i64 [ %niter.next.7, %for.body3.us ], [ 0, %for.cond1.preheader.us ] %arrayidx5.us = getelementptr inbounds %struct.Unir, ptr %arrayidx.us, i64 %indvars.iv %indvars.iv.next = or i64 %indvars.iv, 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(14) %arrayidx5.us, i8 0, i64 14, i1 false) %arrayidx5.us.1 = getelementptr inbounds %struct.Unir, ptr %arrayidx.us, i64 %indvars.iv.next %indvars.iv.next.1 = or i64 %indvars.iv, 2 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(14) %arrayidx5.us.1, i8 0, i64 14, i1 false) %arrayidx5.us.2 = getelementptr inbounds %struct.Unir, ptr %arrayidx.us, i64 %indvars.iv.next.1 %indvars.iv.next.2 = or i64 %indvars.iv, 3 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(14) %arrayidx5.us.2, i8 0, i64 14, i1 false) %arrayidx5.us.3 = getelementptr inbounds %struct.Unir, ptr %arrayidx.us, i64 %indvars.iv.next.2 %indvars.iv.next.3 = or i64 %indvars.iv, 4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(14) %arrayidx5.us.3, i8 0, i64 14, i1 false) %arrayidx5.us.4 = getelementptr inbounds %struct.Unir, ptr %arrayidx.us, i64 %indvars.iv.next.3 %indvars.iv.next.4 = or i64 %indvars.iv, 5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(14) %arrayidx5.us.4, i8 0, i64 14, i1 false) %arrayidx5.us.5 = getelementptr inbounds %struct.Unir, ptr %arrayidx.us, i64 %indvars.iv.next.4 %indvars.iv.next.5 = or i64 %indvars.iv, 6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(14) %arrayidx5.us.5, i8 0, i64 14, i1 false) %arrayidx5.us.6 = getelementptr inbounds %struct.Unir, ptr %arrayidx.us, i64 %indvars.iv.next.5 %indvars.iv.next.6 = or i64 %indvars.iv, 7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(14) %arrayidx5.us.6, i8 0, i64 14, i1 false) %arrayidx5.us.7 = getelementptr inbounds %struct.Unir, ptr %arrayidx.us, i64 %indvars.iv.next.6 %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(14) %arrayidx5.us.7, i8 0, i64 14, i1 false) %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.cond1.for.inc18_crit_edge.us.unr-lcssa, label %for.body3.us, !llvm.loop !16 for.cond1.for.inc18_crit_edge.us.unr-lcssa: ; preds = %for.body3.us, %for.cond1.preheader.us %indvars.iv.unr = phi i64 [ 0, %for.cond1.preheader.us ], [ %indvars.iv.next.7, %for.body3.us ] br i1 %lcmp.mod.not, label %for.cond1.for.inc18_crit_edge.us, label %for.body3.us.epil for.body3.us.epil: ; preds = %for.cond1.for.inc18_crit_edge.us.unr-lcssa, %for.body3.us.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body3.us.epil ], [ %indvars.iv.unr, %for.cond1.for.inc18_crit_edge.us.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body3.us.epil ], [ 0, %for.cond1.for.inc18_crit_edge.us.unr-lcssa ] %arrayidx5.us.epil = getelementptr inbounds %struct.Unir, ptr %arrayidx.us, i64 %indvars.iv.epil %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(14) %arrayidx5.us.epil, i8 0, i64 14, i1 false) %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.cond1.for.inc18_crit_edge.us, label %for.body3.us.epil, !llvm.loop !18 for.cond1.for.inc18_crit_edge.us: ; preds = %for.body3.us.epil, %for.cond1.for.inc18_crit_edge.us.unr-lcssa %indvars.iv.next279 = add nuw nsw i64 %indvars.iv278, 1 %exitcond282.not = icmp eq i64 %indvars.iv.next279, %0 br i1 %exitcond282.not, label %for.cond21.preheader, label %for.cond1.preheader.us, !llvm.loop !20 for.cond21.preheader: ; preds = %for.cond1.for.inc18_crit_edge.us %cmp25271 = icmp sgt i32 %m, 0 %or.cond304 = and i1 %cmp269, %cmp25271 br i1 %or.cond304, label %for.cond24.preheader.us.preheader, label %for.end186 for.cond24.preheader.us.preheader: ; preds = %for.cond21.preheader %.pre = load i8, ptr %t, align 1, !tbaa !21 %exitcond289.peel.not = icmp eq i32 %m, 1 br label %for.cond24.preheader.us for.cond24.preheader.us: ; preds = %for.cond24.preheader.us.preheader, %for.cond24.for.inc184_crit_edge.us %indvars.iv291 = phi i64 [ 0, %for.cond24.preheader.us.preheader ], [ %indvars.iv.next292, %for.cond24.for.inc184_crit_edge.us ] %arrayidx28.us = getelementptr inbounds i8, ptr %s, i64 %indvars.iv291 %5 = load i8, ptr %arrayidx28.us, align 1, !tbaa !21 %6 = mul nuw nsw i64 %indvars.iv291, %1 %arrayidx30.us = getelementptr inbounds %struct.Unir, ptr %vla, i64 %6 %cmp64.us.not = icmp eq i64 %indvars.iv291, 0 %7 = add nuw i64 %indvars.iv291, 4294967295 %idxprom69.us = and i64 %7, 4294967295 %8 = mul nuw nsw i64 %idxprom69.us, %1 %arrayidx70.us = getelementptr inbounds %struct.Unir, ptr %vla, i64 %8 %valor33.us.peel = getelementptr inbounds %struct.Unir, ptr %vla, i64 %6, i32 2 store i8 %5, ptr %valor33.us.peel, align 4, !tbaa !15 %cmp42.us.peel = icmp eq i8 %5, %.pre %spec.select = zext i1 %cmp42.us.peel to i32 %spec.select305 = zext i1 %cmp42.us.peel to i8 %9 = getelementptr inbounds %struct.Unir, ptr %vla, i64 %6, i32 1 store i32 %spec.select, ptr %9, align 8 %10 = getelementptr inbounds %struct.Unir, ptr %vla, i64 %6, i32 3 store i8 %spec.select305, ptr %10, align 1 br i1 %cmp64.us.not, label %for.inc181.us.peel, label %if.then93.us.peel if.then93.us.peel: ; preds = %for.cond24.preheader.us %encontrado99.us.peel.phi.trans.insert = getelementptr inbounds %struct.Unir, ptr %vla, i64 %8, i32 1 %.pre301 = load i32, ptr %encontrado99.us.peel.phi.trans.insert, align 8, !tbaa !22 %cmp105.us.peel = icmp sgt i32 %.pre301, %spec.select br i1 %cmp105.us.peel, label %if.then107.us.peel, label %for.inc181.us.peel if.then107.us.peel: ; preds = %if.then93.us.peel store ptr %arrayidx70.us, ptr %arrayidx30.us, align 16, !tbaa !5 store i32 %.pre301, ptr %9, align 8, !tbaa !22 store i8 0, ptr %10, align 1, !tbaa !12 br label %for.inc181.us.peel for.inc181.us.peel: ; preds = %for.cond24.preheader.us, %if.then93.us.peel, %if.then107.us.peel br i1 %exitcond289.peel.not, label %for.cond24.for.inc184_crit_edge.us, label %for.body26.us for.body26.us: ; preds = %for.inc181.us.peel, %for.inc181.us %indvars.iv283 = phi i64 [ %indvars.iv.next284, %for.inc181.us ], [ 1, %for.inc181.us.peel ] %arrayidx32.us = getelementptr inbounds %struct.Unir, ptr %arrayidx30.us, i64 %indvars.iv283 %valor33.us = getelementptr inbounds %struct.Unir, ptr %arrayidx30.us, i64 %indvars.iv283, i32 2 store i8 %5, ptr %valor33.us, align 4, !tbaa !15 %arrayidx40.us = getelementptr inbounds i8, ptr %t, i64 %indvars.iv283 %11 = load i8, ptr %arrayidx40.us, align 1, !tbaa !21 %cmp42.us = icmp eq i8 %5, %11 %spec.select306 = zext i1 %cmp42.us to i32 %spec.select307 = zext i1 %cmp42.us to i8 %12 = getelementptr inbounds %struct.Unir, ptr %arrayidx30.us, i64 %indvars.iv283, i32 1 store i32 %spec.select306, ptr %12, align 8 %13 = getelementptr inbounds %struct.Unir, ptr %arrayidx30.us, i64 %indvars.iv283, i32 3 store i8 %spec.select307, ptr %13, align 1 br i1 %cmp64.us.not, label %if.then138.us, label %if.then93.us if.then93.us: ; preds = %for.body26.us %14 = add nuw i64 %indvars.iv283, 4294967295 %idxprom72.us = and i64 %14, 4294967295 %arrayidx73.us = getelementptr inbounds %struct.Unir, ptr %arrayidx70.us, i64 %idxprom72.us store ptr %arrayidx73.us, ptr %arrayidx32.us, align 16, !tbaa !5 %encontrado84.us = getelementptr inbounds %struct.Unir, ptr %arrayidx70.us, i64 %idxprom72.us, i32 1 %15 = load i32, ptr %encontrado84.us, align 8, !tbaa !22 %add.us = add nsw i32 %15, %spec.select306 store i32 %add.us, ptr %12, align 8, !tbaa !22 %encontrado99.us = getelementptr inbounds %struct.Unir, ptr %arrayidx70.us, i64 %indvars.iv283, i32 1 %16 = load i32, ptr %encontrado99.us, align 8, !tbaa !22 %cmp105.us = icmp sgt i32 %16, %add.us br i1 %cmp105.us, label %if.then107.us, label %if.then138.us if.then107.us: ; preds = %if.then93.us %arrayidx98.us = getelementptr inbounds %struct.Unir, ptr %arrayidx70.us, i64 %indvars.iv283 store ptr %arrayidx98.us, ptr %arrayidx32.us, align 16, !tbaa !5 store i32 %16, ptr %12, align 8, !tbaa !22 store i8 0, ptr %13, align 1, !tbaa !12 br label %if.then138.us if.then138.us: ; preds = %if.then93.us, %if.then107.us, %for.body26.us %17 = phi i32 [ %16, %if.then107.us ], [ %add.us, %if.then93.us ], [ %spec.select306, %for.body26.us ] %18 = add nuw i64 %indvars.iv283, 4294967295 %idxprom142.us = and i64 %18, 4294967295 %encontrado144.us = getelementptr inbounds %struct.Unir, ptr %arrayidx30.us, i64 %idxprom142.us, i32 1 %19 = load i32, ptr %encontrado144.us, align 8, !tbaa !22 %cmp150.us = icmp sgt i32 %19, %17 br i1 %cmp150.us, label %if.then152.us, label %for.inc181.us if.then152.us: ; preds = %if.then138.us %arrayidx143.us = getelementptr inbounds %struct.Unir, ptr %arrayidx30.us, i64 %idxprom142.us store ptr %arrayidx143.us, ptr %arrayidx32.us, align 16, !tbaa !5 store i32 %19, ptr %12, align 8, !tbaa !22 store i8 0, ptr %13, align 1, !tbaa !12 br label %for.inc181.us for.inc181.us: ; preds = %if.then152.us, %if.then138.us %indvars.iv.next284 = add nuw nsw i64 %indvars.iv283, 1 %exitcond289.not = icmp eq i64 %indvars.iv.next284, %1 br i1 %exitcond289.not, label %for.cond24.for.inc184_crit_edge.us, label %for.body26.us, !llvm.loop !23 for.cond24.for.inc184_crit_edge.us: ; preds = %for.inc181.us, %for.inc181.us.peel %indvars.iv.next292 = add nuw nsw i64 %indvars.iv291, 1 %exitcond297.not = icmp eq i64 %indvars.iv.next292, %0 br i1 %exitcond297.not, label %for.end186, label %for.cond24.preheader.us, !llvm.loop !25 for.end186: ; preds = %for.cond24.for.inc184_crit_edge.us, %entry, %for.cond21.preheader %sub187 = add nsw i32 %n, -1 %idxprom188 = sext i32 %sub187 to i64 %20 = mul nsw i64 %idxprom188, %1 %arrayidx189 = getelementptr inbounds %struct.Unir, ptr %vla, i64 %20 %sub190 = add nsw i32 %m, -1 %idxprom191 = sext i32 %sub190 to i64 %arrayidx192 = getelementptr inbounds %struct.Unir, ptr %arrayidx189, i64 %idxprom191 call void @printUnir(ptr noundef nonnull %arrayidx192) %putchar = call i32 @putchar(i32 10) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [3000 x i8], align 16 %t = alloca [3000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 3000, ptr nonnull %s) #6 call void @llvm.lifetime.start.p0(i64 3000, ptr nonnull %t) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %s) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7 %conv = trunc i64 %call4 to i32 %call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #7 %conv7 = trunc i64 %call6 to i32 %cmp = icmp slt i32 %conv, %conv7 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry call void @printLSB(ptr noundef nonnull %s, ptr noundef nonnull %t, i32 noundef %conv, i32 noundef %conv7) br label %if.end if.else: ; preds = %entry call void @printLSB(ptr noundef nonnull %t, ptr noundef nonnull %s, i32 noundef %conv7, i32 noundef %conv) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 3000, ptr nonnull %t) #6 call void @llvm.lifetime.end.p0(i64 3000, ptr nonnull %s) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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 nounwind willreturn memory(argmem: write) } 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, !7, i64 0} !6 = !{!"Unir", !7, i64 0, !10, i64 8, !8, i64 12, !11, i64 13} !7 = !{!"any pointer", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!"int", !8, i64 0} !11 = !{!"_Bool", !8, i64 0} !12 = !{!6, !11, i64 13} !13 = !{i8 0, i8 2} !14 = !{} !15 = !{!6, !8, i64 12} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.mustprogress"} !18 = distinct !{!18, !19} !19 = !{!"llvm.loop.unroll.disable"} !20 = distinct !{!20, !17} !21 = !{!8, !8, i64 0} !22 = !{!6, !10, i64 8} !23 = distinct !{!23, !17, !24} !24 = !{!"llvm.loop.peeled.count", i32 1} !25 = distinct !{!25, !17}
#if 0 cat <<EOF >mistaken-paste #endif // thanks for @rsk0315_h4x #pragma GCC diagnostic ignored "-Wincompatible-pointer-types" #define _USE_MATH_DEFINES #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> #include <time.h> #define BIG 2000000007 #define VERYBIG 2000000000000007LL #define MOD 1000000007 #define FOD 998244353 typedef uint64_t ull; typedef int64_t sll; #define N_MAX 1000000 #ifdef __cplusplus #include <queue> #include <stack> #include <tuple> #include <set> #include <map> #include <string> #include <algorithm> #include <functional> #include <array> using std::queue; using std::priority_queue; using std::stack; using std::tuple; using std::set; using std::map; using std::vector; using std::greater; using std::pair; using std::string; using std::get; template <typename T, typename U> pair<T, U> operator+(pair<T, U> l, pair<T, U> r) { return pair<T, U>(l.first + r.first, l.second + r.second); } #endif typedef struct { int32_t a; int32_t b; } hw; typedef struct { sll a; sll b; } hwll; typedef struct { sll a; sll b; sll c; } hwllc; typedef struct { hwll a; hwll b; } linell; ull n, m; ull h, w; ull k; ull q; sll va, vb, vc, vd, ve, vf; ull ua, ub, uc, ud, ue, uf; long double vra, vrb, vrc; double vda, vdb, vdc; char ch, dh; ull umin (ull x, ull y) { return (x < y) ? x : y; } ull umax (ull x, ull y) { return (x > y) ? x : y; } sll smin (sll x, sll y) { return (x < y) ? x : y; } sll smax (sll x, sll y) { return (x > y) ? x : y; } ull gcd (ull x, ull y) { if (x < y) { return gcd(y, x); } else if (y == 0) { return x; } else { return gcd(y, x % y); } } ull bitpow (ull a, ull x, ull modulo) { ull result = 1; while (x) { if (x & 1) { result *= a; result %= modulo; } x /= 2; a = (a * a) % modulo; } return result; } ull divide (ull a, ull b, ull modulo) { return (a * bitpow(b, modulo - 2, modulo)) % modulo; } ull udiff (ull a, ull b) { if (a >= b) { return a - b; } else { return b - a; } } sll sdiff (sll a, sll b) { if (a >= b) { return a - b; } else { return b - a; } } int bitcount (ull n) { int result = 0; while (n) { if (n & 1) result++; n /= 2; } return result; } #define BEGCMP(NAME) int32_t NAME (const void *left, const void *right) #define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right #define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1 // int32_t pullcomp (const void *left, const void *right) { // ull l = *(ull*)left; // ull r = *(ull*)right; // if (l < r) { // return -1; // } // if (l > r) { // return +1; // } // return 0; // } BEGCMP(pullcomp){ DEFLR(ull); CMPRET(l, r); return 0; } BEGCMP(prevcomp){ DEFLR(ull); CMPRET(r, l); return 0; } BEGCMP(psllcomp){ DEFLR(sll); CMPRET(l, r); return 0; } BEGCMP(pcharcomp){ DEFLR(char); CMPRET(l, r); return 0; } BEGCMP(pdoublecomp){ DEFLR(double); CMPRET(l, r); return 0; } int32_t pstrcomp (const void *left, const void *right) { char* l = *(char**)left; char* r = *(char**)right; return strcmp(l, r); } BEGCMP(phwllABcomp){ DEFLR(hwll); CMPRET(l.a, r.a); CMPRET(l.b, r.b); return 0; } BEGCMP(phwllREVcomp){ DEFLR(hwll); CMPRET(l.b, r.b); CMPRET(l.a, r.a); return 0; } BEGCMP(ptriplecomp){ DEFLR(hwllc); CMPRET(l.a, r.a); CMPRET(l.b, r.b); CMPRET(l.c, r.c); return 0; } BEGCMP(ptripleREVcomp){ DEFLR(hwllc); CMPRET(l.b, r.b); CMPRET(l.a, r.a); CMPRET(l.c, r.c); return 0; } int32_t pquadcomp (const void *left, const void *right) { linell l = *(linell*)left; linell r = *(linell*)right; sll ac = phwllABcomp(&(l.a), &(r.a)); if (ac) return ac; sll bc = phwllABcomp(&(l.b), &(r.b)); if (bc) return bc; return 0; } bool isinrange (sll left, sll x, sll right) { return (left <= x && x <= right); } bool isinrange_soft (sll left, sll x, sll right) { return (left <= x && x <= right) || (left >= x && x >= right); } sll a[N_MAX + 5]; // ull a[N_MAX + 5]; // sll a[3001][3001]; sll b[N_MAX + 5]; // ull b[N_MAX + 5]; // sll b[3001][3001]; sll c[N_MAX + 5]; ull d[N_MAX + 5]; sll e[N_MAX]; char s[N_MAX + 1]; // char s[3010][3010]; char t[N_MAX + 1]; // char t[3010][3010]; char u[N_MAX + 1]; hwll xy[N_MAX + 5]; hwllc tup[N_MAX + 5]; sll table[3005][3005]; // here we go double p[N_MAX]; sll seg[524288], base = 262144; sll segf_ (sll l, sll r, sll beg, sll end, sll i) { if (end <= l || r <= beg) return 0; if (l <= beg && end <= r) return seg[i]; sll med = (beg + end) / 2; sll vl = segf_(l, r, beg, med, i * 2); sll vr = segf_(l, r, med, end, i * 2 + 1); return smax(vl, vr); } sll segf (sll l, sll r) { return segf_(l, r, 0, base, 1); } void segup (sll v, sll x) { seg[v += base] = x; while (v /= 2) { seg[v] = smax(seg[v * 2], seg[v * 2 + 1]); } } ull bcnt (ull x) { if (!x) return 0; return bcnt(x / 2) + (x % 2); } ull dp[3005][3005]; ull solve () { sll i, j, ki, li; // ull result = 0; sll result = 0; double dresult = 0; // ull maybe = 0; sll maybe = 0; // ull sum = 0; sll sum = 0; sll item; ull *dpcell; n = strlen(s); m = strlen(t); for (i = 0; i <= n; i++) { for (j = 0; j <= m; j++) { dp[i][j] = 0; if (i) dp[i][j] = umax(dp[i][j], dp[i - 1][j]); if (j) dp[i][j] = umax(dp[i][j], dp[i][j - 1]); if (i && j && s[i - 1] == t[j - 1]) dp[i][j] = umax(dp[i][j], dp[i - 1][j - 1] + 1); } } i = n; j = m; while (dp[i][j]) { if (dp[i - 1][j] == dp[i][j]) { i--; } else if (dp[i][j - 1] == dp[i][j]) { j--; } else { i--; j--; u[dp[i][j]] = s[i]; } } puts(u); // printf("%lld\n", result); // printf("%.15lf\n", dresult); // puts(s); return 0; success: puts("YES"); // puts("Yes"); // printf("%llu\n", result); // puts("0"); // puts("Yay!"); return 0; fail: // puts("NO"); // puts("No"); // puts("0"); puts("-1"); // puts("-1 -1 -1"); // puts("Impossible"); return 1; } int32_t main (void) { int32_t i, j; int32_t x, y; // scanf("%llu%llu", &h, &w); // scanf("%llu", &n, &m); // scanf("%llu", &k, &n, &m); // scanf("%llu%llu", &h, &w); // scanf("%llu", &q); scanf("%s", s); // scanf("%lld%lld", &va, &vb, &vc, &vd); // scanf("%llu%llu%llu", &ua, &ub, &uc, &ud); scanf("%s", t); // scanf("%lld", &m); // for (i = 0; i < n; i++) { // // scanf("%lld%lld", &xy[i].a, &xy[i].b); // // scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c); // scanf("%lld", &a[i]); // // scanf("%lld", &b[i]); // // scanf("%lld", &c[i]); // // scanf("%lld", &d[i]); // // a[i]--; // // b[i]--; // // c[i]--; // // d[i]--; // // xy[i].a--; // // xy[i].b--; // // tup[i].a--; // // tup[i].b--; // } // scanf("%llu", &m, &k); // scanf("%llu", &q); // scanf("%s", s); // for (i = 0; i < n; i++) { // scanf("%lld", &a[i]); // // scanf("%lld", &b[i]); // // b[i]--; // // c[i]--; // } // scanf("%llu", &q); // for (i = 0; i < q; i++) { // scanf("%lld%lld", &xy[i].a, &xy[i].b); // xy[i].a--; // xy[i].b--; // } // for (i = 0; i < n; i++) { // for (j = 0; j < n; j++) { // scanf("%lld", &table[i][j]); // // table[i][j]--; // } // } // for (i = 0; i < h; i++) { // scanf("%s", s[i]); // } // scanf("%llu", &q); solve(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124613/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124613/source.c" target datalayout = "e-m:e-p270: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.hwll = type { i64, i64 } %struct.hwllc = type { i64, i64, i64 } @base = dso_local local_unnamed_addr global i64 262144, align 8 @seg = dso_local local_unnamed_addr global [524288 x i64] zeroinitializer, align 16 @s = dso_local global [1000001 x i8] zeroinitializer, align 16 @n = dso_local local_unnamed_addr global i64 0, align 8 @t = dso_local global [1000001 x i8] zeroinitializer, align 16 @m = dso_local local_unnamed_addr global i64 0, align 8 @dp = dso_local local_unnamed_addr global [3005 x [3005 x i64]] zeroinitializer, align 16 @u = dso_local global [1000001 x i8] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @h = dso_local local_unnamed_addr global i64 0, align 8 @w = dso_local local_unnamed_addr global i64 0, align 8 @k = dso_local local_unnamed_addr global i64 0, align 8 @q = dso_local local_unnamed_addr global i64 0, align 8 @va = dso_local local_unnamed_addr global i64 0, align 8 @vb = dso_local local_unnamed_addr global i64 0, align 8 @vc = dso_local local_unnamed_addr global i64 0, align 8 @vd = dso_local local_unnamed_addr global i64 0, align 8 @ve = dso_local local_unnamed_addr global i64 0, align 8 @vf = dso_local local_unnamed_addr global i64 0, align 8 @ua = dso_local local_unnamed_addr global i64 0, align 8 @ub = dso_local local_unnamed_addr global i64 0, align 8 @uc = dso_local local_unnamed_addr global i64 0, align 8 @ud = dso_local local_unnamed_addr global i64 0, align 8 @ue = dso_local local_unnamed_addr global i64 0, align 8 @uf = dso_local local_unnamed_addr global i64 0, align 8 @vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @ch = dso_local local_unnamed_addr global i8 0, align 1 @dh = dso_local local_unnamed_addr global i8 0, align 1 @a = dso_local local_unnamed_addr global [1000005 x i64] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global [1000005 x i64] zeroinitializer, align 16 @c = dso_local local_unnamed_addr global [1000005 x i64] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [1000005 x i64] zeroinitializer, align 16 @e = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @xy = dso_local local_unnamed_addr global [1000005 x %struct.hwll] zeroinitializer, align 16 @tup = dso_local local_unnamed_addr global [1000005 x %struct.hwllc] zeroinitializer, align 16 @table = dso_local local_unnamed_addr global [3005 x [3005 x i64]] zeroinitializer, align 16 @p = dso_local local_unnamed_addr global [1000000 x double] zeroinitializer, align 16 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse.backedge, %entry %x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ] %y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ] %cmp = icmp ult i64 %x.tr, %y.tr br i1 %cmp, label %tailrecurse.backedge, label %if.else if.else: ; preds = %tailrecurse %cmp1 = icmp eq i64 %y.tr, 0 br i1 %cmp1, label %return, label %if.else3 if.else3: ; preds = %if.else %rem = urem i64 %x.tr, %y.tr br label %tailrecurse.backedge tailrecurse.backedge: ; preds = %if.else3, %tailrecurse %y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ] br label %tailrecurse return: ; preds = %if.else ret i64 %x.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 { entry: %tobool.not12 = icmp eq i64 %x, 0 br i1 %tobool.not12, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ] %a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ] %x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ] %and = and i64 %x.addr.013, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul i64 %result.015, %a.addr.014 %rem = urem i64 %mul, %modulo br label %if.end if.end: ; preds = %if.then, %while.body %result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ] %div11 = lshr i64 %x.addr.013, 1 %mul2 = mul i64 %a.addr.014, %a.addr.014 %rem3 = urem i64 %mul2, %modulo %tobool.not = icmp ult i64 %x.addr.013, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %if.end, %entry %result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ] ret i64 %result.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 { entry: %sub = add i64 %modulo, -2 %tobool.not12.i = icmp eq i64 %sub, 0 br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i while.body.i: ; preds = %entry, %if.end.i %result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ] %a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ] %x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ] %and.i = and i64 %x.addr.013.i, 1 %tobool1.not.i = icmp eq i64 %and.i, 0 br i1 %tobool1.not.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %while.body.i %mul.i = mul i64 %a.addr.014.i, %result.015.i %rem.i = urem i64 %mul.i, %modulo br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.i %result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ] %div11.i = lshr i64 %x.addr.013.i, 1 %mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i %rem3.i = urem i64 %mul2.i, %modulo %tobool.not.i = icmp ult i64 %x.addr.013.i, 2 br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5 bitpow.exit: ; preds = %if.end.i, %entry %result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ] %mul = mul i64 %result.0.lcssa.i, %a %rem = urem i64 %mul, %modulo ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not = icmp ult i64 %a, %b %sub = sub i64 %a, %b %sub1 = sub i64 %b, %a %retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub = sub nsw i64 %a, %b %retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true) ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 { entry: %tobool.not6 = icmp eq i64 %n, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ] %n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ] %0 = trunc i64 %n.addr.07 to i32 %1 = and i32 %0, 1 %spec.select = add i32 %1, %result.08 %div5 = lshr i64 %n.addr.07, 1 %tobool.not = icmp ult i64 %n.addr.07, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !7 while.end: ; preds = %while.body, %entry %result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ] ret i32 %result.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %cmp = icmp ult i64 %0, %1 %cmp1 = icmp ugt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @prevcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %cmp = icmp ult i64 %1, %0 %cmp1 = icmp ugt i64 %1, %0 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i8, ptr %left, align 1, !tbaa !12 %1 = load i8, ptr %right, align 1, !tbaa !12 %cmp = icmp slt i8 %0, %1 %cmp5 = icmp sgt i8 %0, %1 %. = zext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pdoublecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load double, ptr %left, align 8, !tbaa !13 %1 = load double, ptr %right, align 8, !tbaa !13 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp ogt double %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load ptr, ptr %left, align 8, !tbaa !15 %1 = load ptr, ptr %right, align 8, !tbaa !15 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #12 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp13, label %cleanup, label %if.end15 if.end15: ; preds = %if.end10 %cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp17, label %cleanup, label %if.end19 if.end19: ; preds = %if.end15 %cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload %. = zext i1 %cmp22 to i32 br label %cleanup cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ptripleREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp13, label %cleanup, label %if.end15 if.end15: ; preds = %if.end10 %cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp17, label %cleanup, label %if.end19 if.end19: ; preds = %if.end15 %cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload %. = zext i1 %cmp22 to i32 br label %cleanup cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pquadcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !20 %l.sroa.4.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.4.0.copyload = load i64, ptr %l.sroa.4.0.left.sroa_idx, align 8, !tbaa.struct !19 %l.sroa.5.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0.left.sroa_idx, align 8, !tbaa.struct !17 %l.sroa.6.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 24 %l.sroa.6.0.copyload = load i64, ptr %l.sroa.6.0.left.sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !20 %r.sroa.4.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.4.0.copyload = load i64, ptr %r.sroa.4.0.right.sroa_idx, align 8, !tbaa.struct !19 %r.sroa.5.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0.right.sroa_idx, align 8, !tbaa.struct !17 %r.sroa.6.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 24 %r.sroa.6.0.copyload = load i64, ptr %r.sroa.6.0.right.sroa_idx, align 8, !tbaa.struct !18 %cmp.i = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp.i, label %cleanup10, label %if.end.i if.end.i: ; preds = %entry %cmp4.i = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4.i, label %cleanup10, label %if.end6.i if.end6.i: ; preds = %if.end.i %cmp8.i = icmp slt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload br i1 %cmp8.i, label %cleanup10, label %phwllABcomp.exit phwllABcomp.exit: ; preds = %if.end6.i %cmp13.i.not = icmp sgt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload br i1 %cmp13.i.not, label %cleanup10, label %if.end if.end: ; preds = %phwllABcomp.exit %cmp.i21 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp.i21, label %cleanup10, label %if.end.i22 if.end.i22: ; preds = %if.end %cmp4.i23 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4.i23, label %cleanup10, label %if.end6.i24 if.end6.i24: ; preds = %if.end.i22 %cmp8.i25 = icmp slt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload br i1 %cmp8.i25, label %cleanup10, label %if.end10.i26 if.end10.i26: ; preds = %if.end6.i24 %cmp13.i27 = icmp sgt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload %..i28 = zext i1 %cmp13.i27 to i32 br label %cleanup10 cleanup10: ; preds = %if.end10.i26, %if.end6.i24, %if.end.i22, %if.end, %if.end6.i, %if.end.i, %entry, %phwllABcomp.exit %retval.1 = phi i32 [ 1, %phwllABcomp.exit ], [ -1, %if.end6.i ], [ 1, %if.end.i ], [ -1, %entry ], [ -1, %if.end ], [ 1, %if.end.i22 ], [ -1, %if.end6.i24 ], [ %..i28, %if.end10.i26 ] ret i32 %retval.1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 { entry: %cmp = icmp sle i64 %left, %x %cmp1 = icmp sle i64 %x, %right %0 = and i1 %cmp, %cmp1 ret i1 %0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 { entry: %cmp.not = icmp sgt i64 %left, %x %cmp1.not = icmp sgt i64 %x, %right %or.cond = or i1 %cmp.not, %cmp1.not br i1 %or.cond, label %lor.rhs, label %lor.end lor.rhs: ; preds = %entry %cmp2 = icmp sge i64 %left, %x %cmp3 = icmp sge i64 %x, %right %0 = and i1 %cmp2, %cmp3 br label %lor.end lor.end: ; preds = %entry, %lor.rhs %1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ] ret i1 %1 } ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @segf_(i64 noundef %l, i64 noundef %r, i64 noundef %beg, i64 noundef %end, i64 noundef %i) local_unnamed_addr #6 { entry: %cmp.not = icmp sgt i64 %end, %l %cmp1.not = icmp sgt i64 %r, %beg %or.cond = and i1 %cmp1.not, %cmp.not br i1 %or.cond, label %if.end, label %common.ret26 if.end: ; preds = %entry %cmp2.not = icmp sgt i64 %l, %beg %cmp3.not = icmp sgt i64 %end, %r %or.cond25 = or i1 %cmp2.not, %cmp3.not br i1 %or.cond25, label %if.end5, label %if.then4 if.then4: ; preds = %if.end %arrayidx = getelementptr inbounds [524288 x i64], ptr @seg, i64 0, i64 %i %0 = load i64, ptr %arrayidx, align 8, !tbaa !8 br label %common.ret26 common.ret26: ; preds = %entry, %if.then4, %if.end5 %common.ret26.op = phi i64 [ %cond.i, %if.end5 ], [ %0, %if.then4 ], [ 0, %entry ] ret i64 %common.ret26.op if.end5: ; preds = %if.end %add = add nsw i64 %end, %beg %div = sdiv i64 %add, 2 %mul = shl nsw i64 %i, 1 %call = tail call i64 @segf_(i64 noundef %l, i64 noundef %r, i64 noundef %beg, i64 noundef %div, i64 noundef %mul) %add7 = or i64 %mul, 1 %call8 = tail call i64 @segf_(i64 noundef %l, i64 noundef %r, i64 noundef %div, i64 noundef %end, i64 noundef %add7) %cond.i = tail call i64 @llvm.smax.i64(i64 %call, i64 %call8) br label %common.ret26 } ; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i64 @segf(i64 noundef %l, i64 noundef %r) local_unnamed_addr #7 { entry: %0 = load i64, ptr @base, align 8, !tbaa !8 %call = tail call i64 @segf_(i64 noundef %l, i64 noundef %r, i64 noundef 0, i64 noundef %0, i64 noundef 1) ret i64 %call } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @segup(i64 noundef %v, i64 noundef %x) local_unnamed_addr #8 { entry: %0 = load i64, ptr @base, align 8, !tbaa !8 %add = add nsw i64 %0, %v %arrayidx = getelementptr inbounds [524288 x i64], ptr @seg, i64 0, i64 %add store i64 %x, ptr %arrayidx, align 8, !tbaa !8 %v.addr.0.off10 = add i64 %add, 1 %tobool.not11 = icmp ult i64 %v.addr.0.off10, 3 br i1 %tobool.not11, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %v.addr.012 = phi i64 [ %div, %while.body ], [ %add, %entry ] %div = sdiv i64 %v.addr.012, 2 %mul = shl nsw i64 %div, 1 %arrayidx1 = getelementptr inbounds [524288 x i64], ptr @seg, i64 0, i64 %mul %1 = load i64, ptr %arrayidx1, align 16, !tbaa !8 %add3 = or i64 %mul, 1 %arrayidx4 = getelementptr inbounds [524288 x i64], ptr @seg, i64 0, i64 %add3 %2 = load i64, ptr %arrayidx4, align 8, !tbaa !8 %cond.i = tail call i64 @llvm.smax.i64(i64 %1, i64 %2) %arrayidx5 = getelementptr inbounds [524288 x i64], ptr @seg, i64 0, i64 %div store i64 %cond.i, ptr %arrayidx5, align 8, !tbaa !8 %v.addr.0.off = add nsw i64 %div, 1 %tobool.not = icmp ult i64 %v.addr.0.off, 3 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !21 while.end: ; preds = %while.body, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @bcnt(i64 noundef %x) local_unnamed_addr #1 { entry: %tobool.not4 = icmp eq i64 %x, 0 br i1 %tobool.not4, label %return, label %if.end if.end: ; preds = %entry, %if.end %x.tr6 = phi i64 [ %div3, %if.end ], [ %x, %entry ] %accumulator.tr5 = phi i64 [ %add, %if.end ], [ 0, %entry ] %div3 = lshr i64 %x.tr6, 1 %rem = and i64 %x.tr6, 1 %add = add i64 %rem, %accumulator.tr5 %tobool.not = icmp ult i64 %x.tr6, 2 br i1 %tobool.not, label %return, label %if.end return: ; preds = %if.end, %entry %accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %if.end ] ret i64 %accumulator.tr.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @solve() local_unnamed_addr #9 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #12 store i64 %call, ptr @n, align 8, !tbaa !8 %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @t) #12 store i64 %call1, ptr @m, align 8, !tbaa !8 %exitcond.peel.not = icmp eq i64 %call1, 0 %exitcond145.peel.not = icmp eq i64 %call1, 0 %min.iters.check = icmp ult i64 %call1, 4 %n.vec = and i64 %call1, -4 %ind.end = or i64 %n.vec, 1 %cmp.n = icmp eq i64 %call1, %n.vec br label %for.cond2.preheader for.cond2.preheader: ; preds = %entry, %for.inc45 %i.0138 = phi i64 [ 0, %entry ], [ %inc46, %for.inc45 ] %tobool.not = icmp eq i64 %i.0138, 0 %sub = add nsw i64 %i.0138, -1 %arrayidx28 = getelementptr inbounds [1000001 x i8], ptr @s, i64 0, i64 %sub br i1 %tobool.not, label %for.inc.peel, label %for.inc.us.peel for.inc.us.peel: ; preds = %for.cond2.preheader %arrayidx5.us.peel = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 %i.0138, i64 0 %arrayidx9.us.peel = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 %sub, i64 0 %0 = load i64, ptr %arrayidx9.us.peel, align 8, !tbaa !8 store i64 %0, ptr %arrayidx5.us.peel, align 8, !tbaa !8 br i1 %exitcond.peel.not, label %for.inc45, label %for.body4.us.peel.next for.body4.us.peel.next: ; preds = %for.inc.us.peel %1 = load i8, ptr %arrayidx28, align 1, !tbaa !12 br label %if.end23.us for.inc.peel: ; preds = %for.cond2.preheader store i64 0, ptr @dp, align 16, !tbaa !8 br i1 %exitcond145.peel.not, label %for.inc45, label %for.inc.preheader for.inc.preheader: ; preds = %for.inc.peel br i1 %min.iters.check, label %for.inc.preheader150, label %vector.body vector.body: ; preds = %for.inc.preheader, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.inc.preheader ] %offset.idx = or i64 %index, 1 %2 = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 0, i64 %offset.idx store <2 x i64> zeroinitializer, ptr %2, align 8, !tbaa !8 %3 = getelementptr inbounds i64, ptr %2, i64 2 store <2 x i64> zeroinitializer, ptr %3, align 8, !tbaa !8 %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !22 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.inc45, label %for.inc.preheader150 for.inc.preheader150: ; preds = %for.inc.preheader, %middle.block %j.0137.ph = phi i64 [ 1, %for.inc.preheader ], [ %ind.end, %middle.block ] br label %for.inc if.end23.us: ; preds = %for.inc.us, %for.body4.us.peel.next %5 = phi i64 [ %9, %for.inc.us ], [ %0, %for.body4.us.peel.next ] %j.0137.us = phi i64 [ %inc.us, %for.inc.us ], [ 1, %for.body4.us.peel.next ] %arrayidx5.us = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 %i.0138, i64 %j.0137.us %arrayidx9.us = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 %sub, i64 %j.0137.us %6 = load i64, ptr %arrayidx9.us, align 8, !tbaa !8 %sub18.us = add nsw i64 %j.0137.us, -1 %cond.i.us = tail call i64 @llvm.umax.i64(i64 %6, i64 %5) store i64 %cond.i.us, ptr %arrayidx5.us, align 8, !tbaa !8 %arrayidx30.us = getelementptr inbounds [1000001 x i8], ptr @t, i64 0, i64 %sub18.us %7 = load i8, ptr %arrayidx30.us, align 1, !tbaa !12 %cmp32.us = icmp eq i8 %1, %7 br i1 %cmp32.us, label %if.then34.us, label %for.inc.us if.then34.us: ; preds = %if.end23.us %arrayidx40.us = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 %sub, i64 %sub18.us %8 = load i64, ptr %arrayidx40.us, align 8, !tbaa !8 %add.us = add i64 %8, 1 %cond.i135.us = tail call i64 @llvm.umax.i64(i64 %cond.i.us, i64 %add.us) store i64 %cond.i135.us, ptr %arrayidx5.us, align 8, !tbaa !8 br label %for.inc.us for.inc.us: ; preds = %if.then34.us, %if.end23.us %9 = phi i64 [ %cond.i135.us, %if.then34.us ], [ %cond.i.us, %if.end23.us ] %inc.us = add nuw i64 %j.0137.us, 1 %exitcond.not = icmp eq i64 %j.0137.us, %call1 br i1 %exitcond.not, label %for.inc45, label %if.end23.us, !llvm.loop !26 while.cond.preheader: ; preds = %for.inc45 %arrayidx49139 = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 %call, i64 %call1 %10 = load i64, ptr %arrayidx49139, align 8, !tbaa !8 %tobool50.not140 = icmp eq i64 %10, 0 br i1 %tobool50.not140, label %while.end, label %while.body for.inc: ; preds = %for.inc.preheader150, %for.inc %j.0137 = phi i64 [ %inc, %for.inc ], [ %j.0137.ph, %for.inc.preheader150 ] %arrayidx5 = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 0, i64 %j.0137 store i64 0, ptr %arrayidx5, align 8, !tbaa !8 %inc = add nuw i64 %j.0137, 1 %exitcond145.not = icmp eq i64 %j.0137, %call1 br i1 %exitcond145.not, label %for.inc45, label %for.inc, !llvm.loop !27 for.inc45: ; preds = %for.inc.us, %for.inc, %middle.block, %for.inc.us.peel, %for.inc.peel %inc46 = add nuw i64 %i.0138, 1 %exitcond147 = icmp eq i64 %i.0138, %call br i1 %exitcond147, label %while.cond.preheader, label %for.cond2.preheader, !llvm.loop !28 while.body: ; preds = %while.cond.preheader, %if.end76 %11 = phi i64 [ %16, %if.end76 ], [ %10, %while.cond.preheader ] %i.1142 = phi i64 [ %i.2, %if.end76 ], [ %call, %while.cond.preheader ] %j.1141 = phi i64 [ %j.2, %if.end76 ], [ %call1, %while.cond.preheader ] %sub51 = add nsw i64 %i.1142, -1 %arrayidx53 = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 %sub51, i64 %j.1141 %12 = load i64, ptr %arrayidx53, align 8, !tbaa !8 %cmp56 = icmp eq i64 %12, %11 br i1 %cmp56, label %if.end76, label %if.else if.else: ; preds = %while.body %sub60 = add nsw i64 %j.1141, -1 %arrayidx61 = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 %i.1142, i64 %sub60 %13 = load i64, ptr %arrayidx61, align 8, !tbaa !8 %cmp64 = icmp eq i64 %13, %11 br i1 %cmp64, label %if.end76, label %if.else68 if.else68: ; preds = %if.else %arrayidx71 = getelementptr inbounds [1000001 x i8], ptr @s, i64 0, i64 %sub51 %14 = load i8, ptr %arrayidx71, align 1, !tbaa !12 %arrayidx73 = getelementptr inbounds [3005 x [3005 x i64]], ptr @dp, i64 0, i64 %sub51, i64 %sub60 %15 = load i64, ptr %arrayidx73, align 8, !tbaa !8 %arrayidx74 = getelementptr inbounds [1000001 x i8], ptr @u, i64 0, i64 %15 store i8 %14, ptr %arrayidx74, align 1, !tbaa !12 br label %if.end76 if.end76: ; preds = %if.else, %while.body, %if.else68 %16 = phi i64 [ %15, %if.else68 ], [ %11, %while.body ], [ %11, %if.else ] %j.2 = phi i64 [ %sub60, %if.else68 ], [ %j.1141, %while.body ], [ %sub60, %if.else ] %i.2 = phi i64 [ %sub51, %if.else68 ], [ %sub51, %while.body ], [ %i.1142, %if.else ] %tobool50.not = icmp eq i64 %16, 0 br i1 %tobool50.not, label %while.end, label %while.body, !llvm.loop !29 while.end: ; preds = %if.end76, %while.cond.preheader %call77 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @u) ret i64 0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #10 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #9 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @s) %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @t) %call2 = tail call i64 @solve() ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #11 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree 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 #7 = { nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #12 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = !{!9, !9, i64 0} !9 = !{!"long", !10, i64 0} !10 = !{!"omnipotent char", !11, i64 0} !11 = !{!"Simple C/C++ TBAA"} !12 = !{!10, !10, i64 0} !13 = !{!14, !14, i64 0} !14 = !{!"double", !10, i64 0} !15 = !{!16, !16, i64 0} !16 = !{!"any pointer", !10, i64 0} !17 = !{i64 0, i64 8, !8, i64 8, i64 8, !8} !18 = !{i64 0, i64 8, !8} !19 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8} !20 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8, i64 24, i64 8, !8} !21 = distinct !{!21, !6} !22 = distinct !{!22, !6, !23, !24, !25} !23 = !{!"llvm.loop.peeled.count", i32 1} !24 = !{!"llvm.loop.isvectorized", i32 1} !25 = !{!"llvm.loop.unroll.runtime.disable"} !26 = distinct !{!26, !6, !23} !27 = distinct !{!27, !6, !23, !25, !24} !28 = distinct !{!28, !6} !29 = distinct !{!29, !6}
#include <stdio.h> int main(void){ int N,M,i,o,temp,line[100]; scanf("%d %d",&N,&M); for(i=0;i<N;i++) scanf("%d",&line[i]); for(i=1;i<=M;i++){ for(o=0;o<N-1;o++){ if(line[o]%i > line[o+1]%i){ temp=line[o]; line[o]=line[o+1]; line[o+1]=temp; } } } for(i=0;i<N;i++) printf("%d\n",line[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124657/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124657/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %line = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %line) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp55 = icmp sgt i32 %0, 0 br i1 %cmp55, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %6, %for.body ] %2 = load i32, ptr %M, align 4, !tbaa !5 %cmp3.not59 = icmp sgt i32 %2, 0 %cmp657 = icmp sgt i32 %1, 1 %or.cond = and i1 %cmp3.not59, %cmp657 br i1 %or.cond, label %for.cond5.preheader.us.preheader, label %for.cond30.preheader for.cond5.preheader.us.preheader: ; preds = %for.cond2.preheader %sub = add i32 %1, -1 %wide.trip.count = zext i32 %sub to i64 br label %for.cond5.preheader.us for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc27_crit_edge.us %i.160.us = phi i32 [ %inc28.us, %for.cond5.for.inc27_crit_edge.us ], [ 1, %for.cond5.preheader.us.preheader ] %.pre = load i32, ptr %line, align 16, !tbaa !5 br label %for.body7.us for.body7.us: ; preds = %for.cond5.preheader.us, %for.inc24.us %3 = phi i32 [ %.pre, %for.cond5.preheader.us ], [ %5, %for.inc24.us ] %indvars.iv66 = phi i64 [ 0, %for.cond5.preheader.us ], [ %indvars.iv.next67, %for.inc24.us ] %rem.us = srem i32 %3, %i.160.us %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1 %arrayidx11.us = getelementptr inbounds [100 x i32], ptr %line, i64 0, i64 %indvars.iv.next67 %4 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5 %rem12.us = srem i32 %4, %i.160.us %cmp13.us = icmp sgt i32 %rem.us, %rem12.us br i1 %cmp13.us, label %if.then.us, label %for.inc24.us if.then.us: ; preds = %for.body7.us %arrayidx9.us = getelementptr inbounds [100 x i32], ptr %line, i64 0, i64 %indvars.iv66 store i32 %4, ptr %arrayidx9.us, align 4, !tbaa !5 store i32 %3, ptr %arrayidx11.us, align 4, !tbaa !5 br label %for.inc24.us for.inc24.us: ; preds = %if.then.us, %for.body7.us %5 = phi i32 [ %3, %if.then.us ], [ %4, %for.body7.us ] %exitcond.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count br i1 %exitcond.not, label %for.cond5.for.inc27_crit_edge.us, label %for.body7.us, !llvm.loop !9 for.cond5.for.inc27_crit_edge.us: ; preds = %for.inc24.us %inc28.us = add nuw i32 %i.160.us, 1 %exitcond69.not = icmp eq i32 %i.160.us, %2 br i1 %exitcond69.not, label %for.cond30.preheader, label %for.cond5.preheader.us, !llvm.loop !11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %line, 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 %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.cond2.preheader, !llvm.loop !12 for.cond30.preheader: ; preds = %for.cond5.for.inc27_crit_edge.us, %for.cond2.preheader %cmp3161 = icmp sgt i32 %1, 0 br i1 %cmp3161, label %for.body32, label %for.end38 for.body32: ; preds = %for.cond30.preheader, %for.body32 %indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.body32 ], [ 0, %for.cond30.preheader ] %arrayidx34 = getelementptr inbounds [100 x i32], ptr %line, i64 0, i64 %indvars.iv70 %8 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %9 = load i32, ptr %N, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp31 = icmp slt i64 %indvars.iv.next71, %10 br i1 %cmp31, label %for.body32, label %for.end38, !llvm.loop !13 for.end38: ; preds = %for.body32, %for.cond30.preheader call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %line) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
/* * Copyright 2015 Chen Ruichao <linuxer.sheep.0x@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdio.h> #include <stdlib.h> #define maxN 50 int N; int a1[maxN-1], a2[maxN-1], b[maxN]; int p[maxN]; /* cost of path that crosses main avenue at i-th column */ int cmp(const void * a, const void * b) { return *(int*)a - *(int*)b; } int main(void) { scanf("%d", &N); for (int i = 0; i < N-1; i++) scanf("%d", &a1[i]); for (int i = 0; i < N-1; i++) scanf("%d", &a2[i]); for (int i = 0; i < N ; i++) scanf("%d", & b[i]); for (int i = 1; i < N; i++) { a1[i] += a1[i-1]; a2[N-i-1] += a2[N-i]; } for (int i = 0; i < N; i++) p[i] = a1[i-1] + b[i] + a2[i]; qsort(p, N, sizeof *p, cmp); printf("%d\n", p[0] + p[1]); /* 2*maxN*maxV within int16_t */ return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12470/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12470/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @N = dso_local global i32 0, align 4 @a1 = dso_local global [49 x i32] zeroinitializer, align 16 @a2 = dso_local global [49 x i32] zeroinitializer, align 16 @b = dso_local global [50 x i32] zeroinitializer, align 16 @p = dso_local global [50 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #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: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N) %0 = load i32, ptr @N, align 4, !tbaa !5 %cmp84 = icmp sgt i32 %0, 1 br i1 %cmp84, label %for.body, label %for.cond15.preheader for.cond3.preheader: ; preds = %for.body %cmp587 = icmp sgt i32 %1, 1 br i1 %cmp587, label %for.body7, label %for.cond15.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [49 x i32], ptr @a1, i64 0, i64 %indvars.iv %call1 = tail 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 %sub = add nsw i32 %1, -1 %2 = sext i32 %sub to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond15.preheader: ; preds = %for.body7, %entry, %for.cond3.preheader %3 = phi i32 [ %1, %for.cond3.preheader ], [ %0, %entry ], [ %4, %for.body7 ] %cmp1689 = icmp sgt i32 %3, 0 br i1 %cmp1689, label %for.body18, label %for.cond.cleanup49 for.body7: ; preds = %for.cond3.preheader, %for.body7 %indvars.iv97 = phi i64 [ %indvars.iv.next98, %for.body7 ], [ 0, %for.cond3.preheader ] %arrayidx9 = getelementptr inbounds [49 x i32], ptr @a2, i64 0, i64 %indvars.iv97 %call10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9) %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1 %4 = load i32, ptr @N, align 4, !tbaa !5 %sub4 = add nsw i32 %4, -1 %5 = sext i32 %sub4 to i64 %cmp5 = icmp slt i64 %indvars.iv.next98, %5 br i1 %cmp5, label %for.body7, label %for.cond15.preheader, !llvm.loop !11 for.cond26.preheader: ; preds = %for.body18 %cmp2791 = icmp sgt i32 %10, 1 br i1 %cmp2791, label %for.body29.preheader, label %for.cond47.preheader for.body29.preheader: ; preds = %for.cond26.preheader %6 = zext i32 %10 to i64 %wide.trip.count = zext i32 %10 to i64 %.pre = load i32, ptr @a1, align 16, !tbaa !5 %7 = shl nuw nsw i64 %wide.trip.count, 2 %scevgep = getelementptr i8, ptr getelementptr ([49 x i32], ptr @a2, i64 -1, i64 48), i64 %7 %load_initial = load i32, ptr %scevgep, align 4 %8 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %8, 1 %9 = icmp eq i32 %10, 2 br i1 %9, label %for.cond47.preheader.loopexit.unr-lcssa, label %for.body29.preheader.new for.body29.preheader.new: ; preds = %for.body29.preheader %unroll_iter = and i64 %8, -2 br label %for.body29 for.body18: ; preds = %for.cond15.preheader, %for.body18 %indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.body18 ], [ 0, %for.cond15.preheader ] %arrayidx20 = getelementptr inbounds [50 x i32], ptr @b, i64 0, i64 %indvars.iv100 %call21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx20) %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1 %10 = load i32, ptr @N, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp16 = icmp slt i64 %indvars.iv.next101, %11 br i1 %cmp16, label %for.body18, label %for.cond26.preheader, !llvm.loop !12 for.cond47.preheader.loopexit.unr-lcssa: ; preds = %for.body29, %for.body29.preheader %store_forwarded.unr = phi i32 [ %load_initial, %for.body29.preheader ], [ %add42.1, %for.body29 ] %.unr = phi i32 [ %.pre, %for.body29.preheader ], [ %add.1, %for.body29 ] %indvars.iv103.unr = phi i64 [ 1, %for.body29.preheader ], [ %indvars.iv.next104.1, %for.body29 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond47.preheader, label %for.body29.epil for.body29.epil: ; preds = %for.cond47.preheader.loopexit.unr-lcssa %arrayidx34.epil = getelementptr inbounds [49 x i32], ptr @a1, i64 0, i64 %indvars.iv103.unr %12 = load i32, ptr %arrayidx34.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %12, %.unr store i32 %add.epil, ptr %arrayidx34.epil, align 4, !tbaa !5 %13 = xor i64 %indvars.iv103.unr, -1 %14 = add nsw i64 %13, %6 %arrayidx41.epil = getelementptr inbounds [49 x i32], ptr @a2, i64 0, i64 %14 %15 = load i32, ptr %arrayidx41.epil, align 4, !tbaa !5 %add42.epil = add nsw i32 %15, %store_forwarded.unr store i32 %add42.epil, ptr %arrayidx41.epil, align 4, !tbaa !5 br label %for.cond47.preheader for.cond47.preheader: ; preds = %for.body29.epil, %for.cond47.preheader.loopexit.unr-lcssa, %for.cond26.preheader %cmp4893 = icmp sgt i32 %10, 0 br i1 %cmp4893, label %for.body50.preheader, label %for.cond.cleanup49 for.body50.preheader: ; preds = %for.cond47.preheader %wide.trip.count113 = zext i32 %10 to i64 %min.iters.check = icmp ult i32 %10, 8 br i1 %min.iters.check, label %for.body50.preheader131, label %vector.ph vector.ph: ; preds = %for.body50.preheader %n.vec = and i64 %wide.trip.count113, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %16 = add nsw i64 %index, -1 %17 = getelementptr inbounds [49 x i32], ptr @a1, i64 0, i64 %16 %wide.load = load <4 x i32>, ptr %17, align 4, !tbaa !5 %18 = getelementptr inbounds i32, ptr %17, i64 4 %wide.load126 = load <4 x i32>, ptr %18, align 4, !tbaa !5 %19 = getelementptr inbounds [50 x i32], ptr @b, i64 0, i64 %index %wide.load127 = load <4 x i32>, ptr %19, align 16, !tbaa !5 %20 = getelementptr inbounds i32, ptr %19, i64 4 %wide.load128 = load <4 x i32>, ptr %20, align 16, !tbaa !5 %21 = add nsw <4 x i32> %wide.load127, %wide.load %22 = add nsw <4 x i32> %wide.load128, %wide.load126 %23 = getelementptr inbounds [49 x i32], ptr @a2, i64 0, i64 %index %wide.load129 = load <4 x i32>, ptr %23, align 16, !tbaa !5 %24 = getelementptr inbounds i32, ptr %23, i64 4 %wide.load130 = load <4 x i32>, ptr %24, align 16, !tbaa !5 %25 = add nsw <4 x i32> %21, %wide.load129 %26 = add nsw <4 x i32> %22, %wide.load130 %27 = getelementptr inbounds [50 x i32], ptr @p, i64 0, i64 %index store <4 x i32> %25, ptr %27, align 16, !tbaa !5 %28 = getelementptr inbounds i32, ptr %27, i64 4 store <4 x i32> %26, ptr %28, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %29 = icmp eq i64 %index.next, %n.vec br i1 %29, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count113 br i1 %cmp.n, label %for.cond.cleanup49, label %for.body50.preheader131 for.body50.preheader131: ; preds = %for.body50.preheader, %middle.block %indvars.iv109.ph = phi i64 [ 0, %for.body50.preheader ], [ %n.vec, %middle.block ] br label %for.body50 for.body29: ; preds = %for.body29, %for.body29.preheader.new %store_forwarded = phi i32 [ %load_initial, %for.body29.preheader.new ], [ %add42.1, %for.body29 ] %30 = phi i32 [ %.pre, %for.body29.preheader.new ], [ %add.1, %for.body29 ] %indvars.iv103 = phi i64 [ 1, %for.body29.preheader.new ], [ %indvars.iv.next104.1, %for.body29 ] %niter = phi i64 [ 0, %for.body29.preheader.new ], [ %niter.next.1, %for.body29 ] %arrayidx34 = getelementptr inbounds [49 x i32], ptr @a1, i64 0, i64 %indvars.iv103 %31 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %add = add nsw i32 %31, %30 store i32 %add, ptr %arrayidx34, align 4, !tbaa !5 %32 = xor i64 %indvars.iv103, -1 %33 = add nsw i64 %32, %6 %arrayidx41 = getelementptr inbounds [49 x i32], ptr @a2, i64 0, i64 %33 %34 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %add42 = add nsw i32 %34, %store_forwarded store i32 %add42, ptr %arrayidx41, align 4, !tbaa !5 %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1 %arrayidx34.1 = getelementptr inbounds [49 x i32], ptr @a1, i64 0, i64 %indvars.iv.next104 %35 = load i32, ptr %arrayidx34.1, align 4, !tbaa !5 %add.1 = add nsw i32 %35, %add store i32 %add.1, ptr %arrayidx34.1, align 4, !tbaa !5 %reass.sub = sub nsw i64 %6, %indvars.iv103 %36 = add i64 %reass.sub, -2 %arrayidx41.1 = getelementptr inbounds [49 x i32], ptr @a2, i64 0, i64 %36 %37 = load i32, ptr %arrayidx41.1, align 4, !tbaa !5 %add42.1 = add nsw i32 %37, %add42 store i32 %add42.1, ptr %arrayidx41.1, align 4, !tbaa !5 %indvars.iv.next104.1 = add nuw nsw i64 %indvars.iv103, 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.cond47.preheader.loopexit.unr-lcssa, label %for.body29, !llvm.loop !16 for.cond.cleanup49: ; preds = %for.body50, %middle.block, %for.cond15.preheader, %for.cond47.preheader %.lcssa118121 = phi i32 [ %10, %for.cond47.preheader ], [ %3, %for.cond15.preheader ], [ %10, %middle.block ], [ %10, %for.body50 ] %conv = sext i32 %.lcssa118121 to i64 tail call void @qsort(ptr noundef nonnull @p, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @cmp) #4 %38 = load i32, ptr @p, align 16, !tbaa !5 %39 = load i32, ptr getelementptr inbounds ([50 x i32], ptr @p, i64 0, i64 1), align 4, !tbaa !5 %add65 = add nsw i32 %39, %38 %call66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add65) ret i32 0 for.body50: ; preds = %for.body50.preheader131, %for.body50 %indvars.iv109 = phi i64 [ %indvars.iv.next110, %for.body50 ], [ %indvars.iv109.ph, %for.body50.preheader131 ] %40 = add nsw i64 %indvars.iv109, -1 %arrayidx53 = getelementptr inbounds [49 x i32], ptr @a1, i64 0, i64 %40 %41 = load i32, ptr %arrayidx53, align 4, !tbaa !5 %arrayidx55 = getelementptr inbounds [50 x i32], ptr @b, i64 0, i64 %indvars.iv109 %42 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %add56 = add nsw i32 %42, %41 %arrayidx58 = getelementptr inbounds [49 x i32], ptr @a2, i64 0, i64 %indvars.iv109 %43 = load i32, ptr %arrayidx58, align 4, !tbaa !5 %add59 = add nsw i32 %add56, %43 %arrayidx61 = getelementptr inbounds [50 x i32], ptr @p, i64 0, i64 %indvars.iv109 store i32 %add59, ptr %arrayidx61, align 4, !tbaa !5 %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1 %exitcond114.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count113 br i1 %exitcond114.not, label %for.cond.cleanup49, label %for.body50, !llvm.loop !17 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !15, !14}
#include <float.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // 内部変数 static FILE *szpFpI; // 入力 static long long slCnt; // 個数 static long long slM; // 積 // 内部変数 - テスト用 #ifdef D_TEST static int siRes; static FILE *szpFpA; #endif // 最大公約数 - 取得 long long fGetGCD( ) { int i, j; // 1つのみ if (slCnt == 1) { return slM; } // int以上 if (slCnt > INT_MAX) { return 1; } // 上限 int liLimit = (int)sqrt((double)slM); // 素因数分解・GCD - 取得 long long llGCD = 1; for (i = 2; i <= liLimit; i++) { int liCnt = 0; while (slM % i == 0) { slM /= i; liCnt++; } // GCD liCnt /= (int)slCnt; for (j = 0; j < liCnt; j++) { llGCD *= i; } } return llGCD; } // 実行メイン int fMain( int piTNo // <I> テスト番号 1~ ) { char lc1Buf[1024], lc1Out[1024]; // 入力 - セット #ifdef D_TEST sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo); szpFpI = fopen(lc1Buf, "r"); sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo); szpFpA = fopen(lc1Buf, "r"); siRes = 0; #else szpFpI = stdin; #endif // 個数・積 - 取得 fgets(lc1Buf, sizeof(lc1Buf), szpFpI); sscanf(lc1Buf, "%lld%lld", &slCnt, &slM); // 最大公約数 - 取得 long long llGCD = fGetGCD(); // 結果 - セット sprintf(lc1Out, "%lld\n", llGCD); // 結果 - 表示 #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpA); if (strcmp(lc1Buf, lc1Out)) { siRes = -1; } #else printf("%s", lc1Out); #endif // 残データ有無 #ifdef D_TEST lc1Buf[0] = '\0'; fgets(lc1Buf, sizeof(lc1Buf), szpFpA); if (strcmp(lc1Buf, "")) { siRes = -1; } #endif // テストファイルクローズ #ifdef D_TEST fclose(szpFpI); fclose(szpFpA); #endif // テスト結果 #ifdef D_TEST if (siRes == 0) { printf("OK %d\n", piTNo); } else { printf("NG %d\n", piTNo); } #endif return 0; } int main() { #ifdef D_TEST int i; for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) { fMain(i); } #else fMain(0); #endif return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124743/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124743/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @slCnt = internal global i64 0, align 8 @slM = internal global i64 0, align 8 @stdin = external local_unnamed_addr global ptr, align 8 @szpFpI = internal unnamed_addr global ptr null, align 8 @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind memory(readwrite, argmem: write, inaccessiblemem: write) uwtable define dso_local i64 @fGetGCD() local_unnamed_addr #0 { entry: %0 = load i64, ptr @slCnt, align 8, !tbaa !5 %cmp = icmp eq i64 %0, 1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %1 = load i64, ptr @slM, align 8, !tbaa !5 br label %cleanup if.end: ; preds = %entry %cmp1 = icmp sgt i64 %0, 2147483647 br i1 %cmp1, label %cleanup, label %if.end3 if.end3: ; preds = %if.end %2 = load i64, ptr @slM, align 8, !tbaa !5 %conv = sitofp i64 %2 to double %call = tail call double @sqrt(double noundef %conv) #5 %conv4 = fptosi double %call to i32 %cmp5.not44 = icmp slt i32 %conv4, 2 br i1 %cmp5.not44, label %cleanup, label %while.cond.preheader.lr.ph while.cond.preheader.lr.ph: ; preds = %if.end3 %slM.promoted41 = load i64, ptr @slM, align 8, !tbaa !5 %3 = load i64, ptr @slCnt, align 8, !tbaa !5 %conv11 = trunc i64 %3 to i32 %4 = add nuw i32 %conv4, 1 %wide.trip.count = zext i32 %4 to i64 br label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.preheader.lr.ph, %for.end %indvars.iv = phi i64 [ 2, %while.cond.preheader.lr.ph ], [ %indvars.iv.next, %for.end ] %llGCD.047 = phi i64 [ 1, %while.cond.preheader.lr.ph ], [ %llGCD.1.lcssa, %for.end ] %div.lcssa4345 = phi i64 [ %slM.promoted41, %while.cond.preheader.lr.ph ], [ %div.lcssa42, %for.end ] %rem32 = srem i64 %div.lcssa4345, %indvars.iv %cmp833 = icmp eq i64 %rem32, 0 br i1 %cmp833, label %while.body, label %while.end while.body: ; preds = %while.cond.preheader, %while.body %liCnt.035 = phi i32 [ %inc, %while.body ], [ 0, %while.cond.preheader ] %div3134 = phi i64 [ %div, %while.body ], [ %div.lcssa4345, %while.cond.preheader ] %div = sdiv i64 %div3134, %indvars.iv %inc = add nuw nsw i32 %liCnt.035, 1 %rem = srem i64 %div, %indvars.iv %cmp8 = icmp eq i64 %rem, 0 br i1 %cmp8, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i64 %div, ptr @slM, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader %div.lcssa42 = phi i64 [ %div, %while.cond.while.end_crit_edge ], [ %div.lcssa4345, %while.cond.preheader ] %liCnt.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ] %div12 = sdiv i32 %liCnt.0.lcssa, %conv11 %cmp1437 = icmp sgt i32 %div12, 0 br i1 %cmp1437, label %for.body16.preheader, label %for.end for.body16.preheader: ; preds = %while.end %xtraiter = and i32 %div12, 7 %5 = icmp ult i32 %div12, 8 br i1 %5, label %for.end.loopexit.unr-lcssa, label %for.body16.preheader.new for.body16.preheader.new: ; preds = %for.body16.preheader %unroll_iter = and i32 %div12, -8 br label %for.body16 for.body16: ; preds = %for.body16, %for.body16.preheader.new %llGCD.139 = phi i64 [ %llGCD.047, %for.body16.preheader.new ], [ %mul.7, %for.body16 ] %niter = phi i32 [ 0, %for.body16.preheader.new ], [ %niter.next.7, %for.body16 ] %mul = mul nsw i64 %llGCD.139, %indvars.iv %mul.1 = mul nsw i64 %mul, %indvars.iv %mul.2 = mul nsw i64 %mul.1, %indvars.iv %mul.3 = mul nsw i64 %mul.2, %indvars.iv %mul.4 = mul nsw i64 %mul.3, %indvars.iv %mul.5 = mul nsw i64 %mul.4, %indvars.iv %mul.6 = mul nsw i64 %mul.5, %indvars.iv %mul.7 = mul nsw i64 %mul.6, %indvars.iv %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.end.loopexit.unr-lcssa, label %for.body16, !llvm.loop !11 for.end.loopexit.unr-lcssa: ; preds = %for.body16, %for.body16.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body16.preheader ], [ %mul.7, %for.body16 ] %llGCD.139.unr = phi i64 [ %llGCD.047, %for.body16.preheader ], [ %mul.7, %for.body16 ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body16.epil for.body16.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body16.epil %llGCD.139.epil = phi i64 [ %mul.epil, %for.body16.epil ], [ %llGCD.139.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body16.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %llGCD.139.epil, %indvars.iv %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.end, label %for.body16.epil, !llvm.loop !12 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body16.epil, %while.end %llGCD.1.lcssa = phi i64 [ %llGCD.047, %while.end ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body16.epil ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond50.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond50.not, label %cleanup, label %while.cond.preheader, !llvm.loop !14 cleanup: ; preds = %for.end, %if.end3, %if.end, %if.then %retval.0 = phi i64 [ %1, %if.then ], [ 1, %if.end ], [ 1, %if.end3 ], [ %llGCD.1.lcssa, %for.end ] ret i64 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @fMain(i32 %piTNo) local_unnamed_addr #3 { entry: %lc1Buf = alloca [1024 x i8], align 16 %lc1Out = alloca [1024 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #5 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Out) #5 %0 = load ptr, ptr @stdin, align 8, !tbaa !15 store ptr %0, ptr @szpFpI, align 8, !tbaa !15 %call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull @slCnt, ptr noundef nonnull @slM) #5 %1 = load i64, ptr @slCnt, align 8, !tbaa !5 %cmp.i = icmp eq i64 %1, 1 br i1 %cmp.i, label %if.then.i, label %if.end.i if.then.i: ; preds = %entry %2 = load i64, ptr @slM, align 8, !tbaa !5 br label %fGetGCD.exit if.end.i: ; preds = %entry %cmp1.i = icmp sgt i64 %1, 2147483647 br i1 %cmp1.i, label %fGetGCD.exit, label %if.end3.i if.end3.i: ; preds = %if.end.i %3 = load i64, ptr @slM, align 8, !tbaa !5 %conv.i = sitofp i64 %3 to double %call.i = call double @sqrt(double noundef %conv.i) #5 %conv4.i = fptosi double %call.i to i32 %cmp5.not44.i = icmp slt i32 %conv4.i, 2 br i1 %cmp5.not44.i, label %fGetGCD.exit, label %while.cond.preheader.lr.ph.i while.cond.preheader.lr.ph.i: ; preds = %if.end3.i %slM.promoted41.i = load i64, ptr @slM, align 8, !tbaa !5 %4 = load i64, ptr @slCnt, align 8, !tbaa !5 %conv11.i = trunc i64 %4 to i32 %5 = add nuw i32 %conv4.i, 1 %wide.trip.count.i = zext i32 %5 to i64 br label %while.cond.preheader.i while.cond.preheader.i: ; preds = %for.end.i, %while.cond.preheader.lr.ph.i %indvars.iv.i = phi i64 [ 2, %while.cond.preheader.lr.ph.i ], [ %indvars.iv.next.i, %for.end.i ] %llGCD.047.i = phi i64 [ 1, %while.cond.preheader.lr.ph.i ], [ %llGCD.1.lcssa.i, %for.end.i ] %div.lcssa4345.i = phi i64 [ %slM.promoted41.i, %while.cond.preheader.lr.ph.i ], [ %div.lcssa42.i, %for.end.i ] %rem32.i = srem i64 %div.lcssa4345.i, %indvars.iv.i %cmp833.i = icmp eq i64 %rem32.i, 0 br i1 %cmp833.i, label %while.body.i, label %while.end.i while.body.i: ; preds = %while.cond.preheader.i, %while.body.i %liCnt.035.i = phi i32 [ %inc.i, %while.body.i ], [ 0, %while.cond.preheader.i ] %div3134.i = phi i64 [ %div.i, %while.body.i ], [ %div.lcssa4345.i, %while.cond.preheader.i ] %div.i = sdiv i64 %div3134.i, %indvars.iv.i %inc.i = add nuw nsw i32 %liCnt.035.i, 1 %rem.i = srem i64 %div.i, %indvars.iv.i %cmp8.i = icmp eq i64 %rem.i, 0 br i1 %cmp8.i, label %while.body.i, label %while.cond.while.end_crit_edge.i, !llvm.loop !9 while.cond.while.end_crit_edge.i: ; preds = %while.body.i store i64 %div.i, ptr @slM, align 8, !tbaa !5 br label %while.end.i while.end.i: ; preds = %while.cond.while.end_crit_edge.i, %while.cond.preheader.i %div.lcssa42.i = phi i64 [ %div.i, %while.cond.while.end_crit_edge.i ], [ %div.lcssa4345.i, %while.cond.preheader.i ] %liCnt.0.lcssa.i = phi i32 [ %inc.i, %while.cond.while.end_crit_edge.i ], [ 0, %while.cond.preheader.i ] %div12.i = sdiv i32 %liCnt.0.lcssa.i, %conv11.i %cmp1437.i = icmp sgt i32 %div12.i, 0 br i1 %cmp1437.i, label %for.body16.i.preheader, label %for.end.i for.body16.i.preheader: ; preds = %while.end.i %xtraiter = and i32 %div12.i, 7 %6 = icmp ult i32 %div12.i, 8 br i1 %6, label %for.end.i.loopexit.unr-lcssa, label %for.body16.i.preheader.new for.body16.i.preheader.new: ; preds = %for.body16.i.preheader %unroll_iter = and i32 %div12.i, -8 br label %for.body16.i for.body16.i: ; preds = %for.body16.i, %for.body16.i.preheader.new %llGCD.139.i = phi i64 [ %llGCD.047.i, %for.body16.i.preheader.new ], [ %mul.i.7, %for.body16.i ] %niter = phi i32 [ 0, %for.body16.i.preheader.new ], [ %niter.next.7, %for.body16.i ] %mul.i = mul nsw i64 %llGCD.139.i, %indvars.iv.i %mul.i.1 = mul nsw i64 %mul.i, %indvars.iv.i %mul.i.2 = mul nsw i64 %mul.i.1, %indvars.iv.i %mul.i.3 = mul nsw i64 %mul.i.2, %indvars.iv.i %mul.i.4 = mul nsw i64 %mul.i.3, %indvars.iv.i %mul.i.5 = mul nsw i64 %mul.i.4, %indvars.iv.i %mul.i.6 = mul nsw i64 %mul.i.5, %indvars.iv.i %mul.i.7 = mul nsw i64 %mul.i.6, %indvars.iv.i %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.end.i.loopexit.unr-lcssa, label %for.body16.i, !llvm.loop !11 for.end.i.loopexit.unr-lcssa: ; preds = %for.body16.i, %for.body16.i.preheader %mul.i.lcssa.ph = phi i64 [ undef, %for.body16.i.preheader ], [ %mul.i.7, %for.body16.i ] %llGCD.139.i.unr = phi i64 [ %llGCD.047.i, %for.body16.i.preheader ], [ %mul.i.7, %for.body16.i ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end.i, label %for.body16.i.epil for.body16.i.epil: ; preds = %for.end.i.loopexit.unr-lcssa, %for.body16.i.epil %llGCD.139.i.epil = phi i64 [ %mul.i.epil, %for.body16.i.epil ], [ %llGCD.139.i.unr, %for.end.i.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body16.i.epil ], [ 0, %for.end.i.loopexit.unr-lcssa ] %mul.i.epil = mul nsw i64 %llGCD.139.i.epil, %indvars.iv.i %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.end.i, label %for.body16.i.epil, !llvm.loop !17 for.end.i: ; preds = %for.end.i.loopexit.unr-lcssa, %for.body16.i.epil, %while.end.i %llGCD.1.lcssa.i = phi i64 [ %llGCD.047.i, %while.end.i ], [ %mul.i.lcssa.ph, %for.end.i.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body16.i.epil ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond50.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond50.not.i, label %fGetGCD.exit, label %while.cond.preheader.i, !llvm.loop !14 fGetGCD.exit: ; preds = %for.end.i, %if.then.i, %if.end.i, %if.end3.i %retval.0.i = phi i64 [ %2, %if.then.i ], [ 1, %if.end.i ], [ 1, %if.end3.i ], [ %llGCD.1.lcssa.i, %for.end.i ] %call5 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Out, ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %retval.0.i) #5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %lc1Out) call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Out) #5 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, 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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %call = tail call i32 @fMain(i32 poison) ret i32 0 } attributes #0 = { nofree nounwind memory(readwrite, argmem: write, inaccessiblemem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !10} !15 = !{!16, !16, i64 0} !16 = !{!"any pointer", !7, i64 0} !17 = distinct !{!17, !13}
#include<stdio.h> int main(){ int n,i,j,a[20]; char b[20],c[20]={"RGB"}; scanf("%d",&n); while(n--){ int d[20][20]={0}; for(i=0;i<9;i++)scanf("%d" ,&a[i]); for(i=0;i<9;i++)scanf(" %c",&b[i]); for(i=0;i<9;i++){ for(j=0;b[i]-c[j];j++); d[a[i]][j]++; } for(j=0;j<3;j++){ for(i=0;i<9;i++){ if(d[i][j]>2)d[i][j]-=3; if(d[i][j]>0){ if(d[i+1][j]<d[i][j]||d[i+2][j]<d[i][j])break; d[i+1][j]-=d[i][j]; d[i+2][j]-=d[i][j]; } } if(i-9)break; } printf("%d\n",j-3?0:1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124787/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124787/source.c" target datalayout = "e-m:e-p270: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.c = private unnamed_addr constant [20 x i8] c"RGB\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c" %c\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [20 x i32], align 16 %b = alloca [20 x i8], align 16 %d = alloca [20 x [20 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %dec169 = add nsw i32 %0, -1 store i32 %dec169, ptr %n, align 4, !tbaa !5 %tobool.not170 = icmp eq i32 %0, 0 br i1 %tobool.not170, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %arrayidx.1 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 1 %arrayidx.2 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 2 %arrayidx.3 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 3 %arrayidx.4 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 4 %arrayidx.5 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 5 %arrayidx.6 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 6 %arrayidx.7 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 7 %arrayidx.8 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 8 %arrayidx6.1 = getelementptr inbounds [20 x i8], ptr %b, i64 0, i64 1 %arrayidx6.2 = getelementptr inbounds [20 x i8], ptr %b, i64 0, i64 2 %arrayidx6.3 = getelementptr inbounds [20 x i8], ptr %b, i64 0, i64 3 %arrayidx6.4 = getelementptr inbounds [20 x i8], ptr %b, i64 0, i64 4 %arrayidx6.5 = getelementptr inbounds [20 x i8], ptr %b, i64 0, i64 5 %arrayidx6.6 = getelementptr inbounds [20 x i8], ptr %b, i64 0, i64 6 %arrayidx6.7 = getelementptr inbounds [20 x i8], ptr %b, i64 0, i64 7 %arrayidx6.8 = getelementptr inbounds [20 x i8], ptr %b, i64 0, i64 8 br label %while.body while.body: ; preds = %while.body.preheader, %for.end114 call void @llvm.lifetime.start.p0(i64 1600, ptr nonnull %d) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600) %d, i8 0, i64 1600, i1 false) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %call1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %call1.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %call1.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %call1.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %call1.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.6) %call1.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.7) %call1.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.8) %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b) %call7.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.1) %call7.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.2) %call7.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.3) %call7.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.4) %call7.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.5) %call7.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.6) %call7.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.7) %call7.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.8) %1 = load i8, ptr %b, align 16, !tbaa !9 br label %for.cond14 for.cond14: ; preds = %for.cond14, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond14 ], [ 0, %while.body ] %arrayidx18 = getelementptr inbounds [20 x i8], ptr @__const.main.c, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx18, align 1, !tbaa !9 %tobool20.not = icmp eq i8 %1, %2 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %tobool20.not, label %for.end24, label %for.cond14, !llvm.loop !10 for.end24: ; preds = %for.cond14 %3 = load i32, ptr %a, align 16, !tbaa !5 %idxprom27 = sext i32 %3 to i64 %arrayidx30 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 %idxprom27, i64 %indvars.iv %4 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %inc31 = add nsw i32 %4, 1 store i32 %inc31, ptr %arrayidx30, align 4, !tbaa !5 %5 = load i8, ptr %arrayidx6.1, align 1, !tbaa !9 br label %for.cond14.1 for.cond14.1: ; preds = %for.cond14.1, %for.end24 %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %for.cond14.1 ], [ 0, %for.end24 ] %arrayidx18.1 = getelementptr inbounds [20 x i8], ptr @__const.main.c, i64 0, i64 %indvars.iv.1 %6 = load i8, ptr %arrayidx18.1, align 1, !tbaa !9 %tobool20.not.1 = icmp eq i8 %5, %6 %indvars.iv.next.1 = add nuw i64 %indvars.iv.1, 1 br i1 %tobool20.not.1, label %for.end24.1, label %for.cond14.1, !llvm.loop !10 for.end24.1: ; preds = %for.cond14.1 %7 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %idxprom27.1 = sext i32 %7 to i64 %arrayidx30.1 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 %idxprom27.1, i64 %indvars.iv.1 %8 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5 %inc31.1 = add nsw i32 %8, 1 store i32 %inc31.1, ptr %arrayidx30.1, align 4, !tbaa !5 %9 = load i8, ptr %arrayidx6.2, align 2, !tbaa !9 br label %for.cond14.2 for.cond14.2: ; preds = %for.cond14.2, %for.end24.1 %indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %for.cond14.2 ], [ 0, %for.end24.1 ] %arrayidx18.2 = getelementptr inbounds [20 x i8], ptr @__const.main.c, i64 0, i64 %indvars.iv.2 %10 = load i8, ptr %arrayidx18.2, align 1, !tbaa !9 %tobool20.not.2 = icmp eq i8 %9, %10 %indvars.iv.next.2 = add nuw i64 %indvars.iv.2, 1 br i1 %tobool20.not.2, label %for.end24.2, label %for.cond14.2, !llvm.loop !10 for.end24.2: ; preds = %for.cond14.2 %11 = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %idxprom27.2 = sext i32 %11 to i64 %arrayidx30.2 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 %idxprom27.2, i64 %indvars.iv.2 %12 = load i32, ptr %arrayidx30.2, align 4, !tbaa !5 %inc31.2 = add nsw i32 %12, 1 store i32 %inc31.2, ptr %arrayidx30.2, align 4, !tbaa !5 %13 = load i8, ptr %arrayidx6.3, align 1, !tbaa !9 br label %for.cond14.3 for.cond14.3: ; preds = %for.cond14.3, %for.end24.2 %indvars.iv.3 = phi i64 [ %indvars.iv.next.3, %for.cond14.3 ], [ 0, %for.end24.2 ] %arrayidx18.3 = getelementptr inbounds [20 x i8], ptr @__const.main.c, i64 0, i64 %indvars.iv.3 %14 = load i8, ptr %arrayidx18.3, align 1, !tbaa !9 %tobool20.not.3 = icmp eq i8 %13, %14 %indvars.iv.next.3 = add nuw i64 %indvars.iv.3, 1 br i1 %tobool20.not.3, label %for.end24.3, label %for.cond14.3, !llvm.loop !10 for.end24.3: ; preds = %for.cond14.3 %15 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %idxprom27.3 = sext i32 %15 to i64 %arrayidx30.3 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 %idxprom27.3, i64 %indvars.iv.3 %16 = load i32, ptr %arrayidx30.3, align 4, !tbaa !5 %inc31.3 = add nsw i32 %16, 1 store i32 %inc31.3, ptr %arrayidx30.3, align 4, !tbaa !5 %17 = load i8, ptr %arrayidx6.4, align 4, !tbaa !9 br label %for.cond14.4 for.cond14.4: ; preds = %for.cond14.4, %for.end24.3 %indvars.iv.4 = phi i64 [ %indvars.iv.next.4, %for.cond14.4 ], [ 0, %for.end24.3 ] %arrayidx18.4 = getelementptr inbounds [20 x i8], ptr @__const.main.c, i64 0, i64 %indvars.iv.4 %18 = load i8, ptr %arrayidx18.4, align 1, !tbaa !9 %tobool20.not.4 = icmp eq i8 %17, %18 %indvars.iv.next.4 = add nuw i64 %indvars.iv.4, 1 br i1 %tobool20.not.4, label %for.end24.4, label %for.cond14.4, !llvm.loop !10 for.end24.4: ; preds = %for.cond14.4 %19 = load i32, ptr %arrayidx.4, align 16, !tbaa !5 %idxprom27.4 = sext i32 %19 to i64 %arrayidx30.4 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 %idxprom27.4, i64 %indvars.iv.4 %20 = load i32, ptr %arrayidx30.4, align 4, !tbaa !5 %inc31.4 = add nsw i32 %20, 1 store i32 %inc31.4, ptr %arrayidx30.4, align 4, !tbaa !5 %21 = load i8, ptr %arrayidx6.5, align 1, !tbaa !9 br label %for.cond14.5 for.cond14.5: ; preds = %for.cond14.5, %for.end24.4 %indvars.iv.5 = phi i64 [ %indvars.iv.next.5, %for.cond14.5 ], [ 0, %for.end24.4 ] %arrayidx18.5 = getelementptr inbounds [20 x i8], ptr @__const.main.c, i64 0, i64 %indvars.iv.5 %22 = load i8, ptr %arrayidx18.5, align 1, !tbaa !9 %tobool20.not.5 = icmp eq i8 %21, %22 %indvars.iv.next.5 = add nuw i64 %indvars.iv.5, 1 br i1 %tobool20.not.5, label %for.end24.5, label %for.cond14.5, !llvm.loop !10 for.end24.5: ; preds = %for.cond14.5 %23 = load i32, ptr %arrayidx.5, align 4, !tbaa !5 %idxprom27.5 = sext i32 %23 to i64 %arrayidx30.5 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 %idxprom27.5, i64 %indvars.iv.5 %24 = load i32, ptr %arrayidx30.5, align 4, !tbaa !5 %inc31.5 = add nsw i32 %24, 1 store i32 %inc31.5, ptr %arrayidx30.5, align 4, !tbaa !5 %25 = load i8, ptr %arrayidx6.6, align 2, !tbaa !9 br label %for.cond14.6 for.cond14.6: ; preds = %for.cond14.6, %for.end24.5 %indvars.iv.6 = phi i64 [ %indvars.iv.next.6, %for.cond14.6 ], [ 0, %for.end24.5 ] %arrayidx18.6 = getelementptr inbounds [20 x i8], ptr @__const.main.c, i64 0, i64 %indvars.iv.6 %26 = load i8, ptr %arrayidx18.6, align 1, !tbaa !9 %tobool20.not.6 = icmp eq i8 %25, %26 %indvars.iv.next.6 = add nuw i64 %indvars.iv.6, 1 br i1 %tobool20.not.6, label %for.end24.6, label %for.cond14.6, !llvm.loop !10 for.end24.6: ; preds = %for.cond14.6 %27 = load i32, ptr %arrayidx.6, align 8, !tbaa !5 %idxprom27.6 = sext i32 %27 to i64 %arrayidx30.6 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 %idxprom27.6, i64 %indvars.iv.6 %28 = load i32, ptr %arrayidx30.6, align 4, !tbaa !5 %inc31.6 = add nsw i32 %28, 1 store i32 %inc31.6, ptr %arrayidx30.6, align 4, !tbaa !5 %29 = load i8, ptr %arrayidx6.7, align 1, !tbaa !9 br label %for.cond14.7 for.cond14.7: ; preds = %for.cond14.7, %for.end24.6 %indvars.iv.7 = phi i64 [ %indvars.iv.next.7, %for.cond14.7 ], [ 0, %for.end24.6 ] %arrayidx18.7 = getelementptr inbounds [20 x i8], ptr @__const.main.c, i64 0, i64 %indvars.iv.7 %30 = load i8, ptr %arrayidx18.7, align 1, !tbaa !9 %tobool20.not.7 = icmp eq i8 %29, %30 %indvars.iv.next.7 = add nuw i64 %indvars.iv.7, 1 br i1 %tobool20.not.7, label %for.end24.7, label %for.cond14.7, !llvm.loop !10 for.end24.7: ; preds = %for.cond14.7 %31 = load i32, ptr %arrayidx.7, align 4, !tbaa !5 %idxprom27.7 = sext i32 %31 to i64 %arrayidx30.7 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 %idxprom27.7, i64 %indvars.iv.7 %32 = load i32, ptr %arrayidx30.7, align 4, !tbaa !5 %inc31.7 = add nsw i32 %32, 1 store i32 %inc31.7, ptr %arrayidx30.7, align 4, !tbaa !5 %33 = load i8, ptr %arrayidx6.8, align 8, !tbaa !9 br label %for.cond14.8 for.cond14.8: ; preds = %for.cond14.8, %for.end24.7 %indvars.iv.8 = phi i64 [ %indvars.iv.next.8, %for.cond14.8 ], [ 0, %for.end24.7 ] %arrayidx18.8 = getelementptr inbounds [20 x i8], ptr @__const.main.c, i64 0, i64 %indvars.iv.8 %34 = load i8, ptr %arrayidx18.8, align 1, !tbaa !9 %tobool20.not.8 = icmp eq i8 %33, %34 %indvars.iv.next.8 = add nuw i64 %indvars.iv.8, 1 br i1 %tobool20.not.8, label %for.end24.8, label %for.cond14.8, !llvm.loop !10 for.end24.8: ; preds = %for.cond14.8 %35 = load i32, ptr %arrayidx.8, align 16, !tbaa !5 %idxprom27.8 = sext i32 %35 to i64 %arrayidx30.8 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 %idxprom27.8, i64 %indvars.iv.8 %36 = load i32, ptr %arrayidx30.8, align 4, !tbaa !5 %inc31.8 = add nsw i32 %36, 1 store i32 %inc31.8, ptr %arrayidx30.8, align 4, !tbaa !5 br label %for.cond39.preheader for.cond39.preheader: ; preds = %for.end24.8, %for.inc112 %indvars.iv184 = phi i64 [ 0, %for.end24.8 ], [ %indvars.iv.next185, %for.inc112 ] %arrayidx46 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 0, i64 %indvars.iv184 %37 = load i32, ptr %arrayidx46, align 4, !tbaa !5 %cmp47 = icmp sgt i32 %37, 2 br i1 %cmp47, label %if.then, label %if.end if.then: ; preds = %for.cond39.preheader %sub53 = add nsw i32 %37, -3 store i32 %sub53, ptr %arrayidx46, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %for.cond39.preheader %38 = phi i32 [ %sub53, %if.then ], [ %37, %for.cond39.preheader ] %cmp58 = icmp sgt i32 %38, 0 %arrayidx64 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 1, i64 %indvars.iv184 %39 = load i32, ptr %arrayidx64, align 4, !tbaa !5 br i1 %cmp58, label %if.then60, label %for.inc105 if.then60: ; preds = %if.end %cmp69 = icmp slt i32 %39, %38 br i1 %cmp69, label %for.end114.split.loop.exit196, label %lor.lhs.false lor.lhs.false: ; preds = %if.then60 %arrayidx75 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 2, i64 %indvars.iv184 %40 = load i32, ptr %arrayidx75, align 4, !tbaa !5 %cmp80 = icmp slt i32 %40, %38 br i1 %cmp80, label %for.end114.split.loop.exit194, label %if.end83 if.end83: ; preds = %lor.lhs.false %sub93 = sub nsw i32 %39, %38 store i32 %sub93, ptr %arrayidx64, align 4, !tbaa !5 %sub103 = sub nsw i32 %40, %38 store i32 %sub103, ptr %arrayidx75, align 4, !tbaa !5 br label %for.inc105 for.inc105: ; preds = %if.end, %if.end83 %41 = phi i32 [ %sub93, %if.end83 ], [ %39, %if.end ] %cmp47.1 = icmp sgt i32 %41, 2 br i1 %cmp47.1, label %if.then.1, label %if.end.1 if.then.1: ; preds = %for.inc105 %arrayidx46.1 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 1, i64 %indvars.iv184 %sub53.1 = add nsw i32 %41, -3 store i32 %sub53.1, ptr %arrayidx46.1, align 4, !tbaa !5 br label %if.end.1 if.end.1: ; preds = %if.then.1, %for.inc105 %42 = phi i32 [ %sub53.1, %if.then.1 ], [ %41, %for.inc105 ] %cmp58.1 = icmp sgt i32 %42, 0 %arrayidx64.1 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 2, i64 %indvars.iv184 %43 = load i32, ptr %arrayidx64.1, align 4, !tbaa !5 br i1 %cmp58.1, label %if.then60.1, label %for.inc105.1 if.then60.1: ; preds = %if.end.1 %cmp69.1 = icmp slt i32 %43, %42 br i1 %cmp69.1, label %for.end114.split.loop.exit198, label %lor.lhs.false.1 lor.lhs.false.1: ; preds = %if.then60.1 %arrayidx75.1 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 3, i64 %indvars.iv184 %44 = load i32, ptr %arrayidx75.1, align 4, !tbaa !5 %cmp80.1 = icmp slt i32 %44, %42 br i1 %cmp80.1, label %for.end114.split.loop.exit200, label %if.end83.1 if.end83.1: ; preds = %lor.lhs.false.1 %sub93.1 = sub nsw i32 %43, %42 store i32 %sub93.1, ptr %arrayidx64.1, align 4, !tbaa !5 %sub103.1 = sub nsw i32 %44, %42 store i32 %sub103.1, ptr %arrayidx75.1, align 4, !tbaa !5 br label %for.inc105.1 for.inc105.1: ; preds = %if.end.1, %if.end83.1 %45 = phi i32 [ %sub93.1, %if.end83.1 ], [ %43, %if.end.1 ] %cmp47.2 = icmp sgt i32 %45, 2 br i1 %cmp47.2, label %if.then.2, label %if.end.2 if.then.2: ; preds = %for.inc105.1 %arrayidx46.2 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 2, i64 %indvars.iv184 %sub53.2 = add nsw i32 %45, -3 store i32 %sub53.2, ptr %arrayidx46.2, align 4, !tbaa !5 br label %if.end.2 if.end.2: ; preds = %if.then.2, %for.inc105.1 %46 = phi i32 [ %sub53.2, %if.then.2 ], [ %45, %for.inc105.1 ] %cmp58.2 = icmp sgt i32 %46, 0 %arrayidx64.2 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 3, i64 %indvars.iv184 %47 = load i32, ptr %arrayidx64.2, align 4, !tbaa !5 br i1 %cmp58.2, label %if.then60.2, label %for.inc105.2 if.then60.2: ; preds = %if.end.2 %cmp69.2 = icmp slt i32 %47, %46 br i1 %cmp69.2, label %for.end114.split.loop.exit202, label %lor.lhs.false.2 lor.lhs.false.2: ; preds = %if.then60.2 %arrayidx75.2 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 4, i64 %indvars.iv184 %48 = load i32, ptr %arrayidx75.2, align 4, !tbaa !5 %cmp80.2 = icmp slt i32 %48, %46 br i1 %cmp80.2, label %for.end114.split.loop.exit204, label %if.end83.2 if.end83.2: ; preds = %lor.lhs.false.2 %sub93.2 = sub nsw i32 %47, %46 store i32 %sub93.2, ptr %arrayidx64.2, align 4, !tbaa !5 %sub103.2 = sub nsw i32 %48, %46 store i32 %sub103.2, ptr %arrayidx75.2, align 4, !tbaa !5 br label %for.inc105.2 for.inc105.2: ; preds = %if.end.2, %if.end83.2 %49 = phi i32 [ %sub93.2, %if.end83.2 ], [ %47, %if.end.2 ] %cmp47.3 = icmp sgt i32 %49, 2 br i1 %cmp47.3, label %if.then.3, label %if.end.3 if.then.3: ; preds = %for.inc105.2 %arrayidx46.3 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 3, i64 %indvars.iv184 %sub53.3 = add nsw i32 %49, -3 store i32 %sub53.3, ptr %arrayidx46.3, align 4, !tbaa !5 br label %if.end.3 if.end.3: ; preds = %if.then.3, %for.inc105.2 %50 = phi i32 [ %sub53.3, %if.then.3 ], [ %49, %for.inc105.2 ] %cmp58.3 = icmp sgt i32 %50, 0 %arrayidx64.3 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 4, i64 %indvars.iv184 %51 = load i32, ptr %arrayidx64.3, align 4, !tbaa !5 br i1 %cmp58.3, label %if.then60.3, label %for.inc105.3 if.then60.3: ; preds = %if.end.3 %cmp69.3 = icmp slt i32 %51, %50 br i1 %cmp69.3, label %for.end114.split.loop.exit206, label %lor.lhs.false.3 lor.lhs.false.3: ; preds = %if.then60.3 %arrayidx75.3 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 5, i64 %indvars.iv184 %52 = load i32, ptr %arrayidx75.3, align 4, !tbaa !5 %cmp80.3 = icmp slt i32 %52, %50 br i1 %cmp80.3, label %for.end114.split.loop.exit208, label %if.end83.3 if.end83.3: ; preds = %lor.lhs.false.3 %sub93.3 = sub nsw i32 %51, %50 store i32 %sub93.3, ptr %arrayidx64.3, align 4, !tbaa !5 %sub103.3 = sub nsw i32 %52, %50 store i32 %sub103.3, ptr %arrayidx75.3, align 4, !tbaa !5 br label %for.inc105.3 for.inc105.3: ; preds = %if.end.3, %if.end83.3 %53 = phi i32 [ %sub93.3, %if.end83.3 ], [ %51, %if.end.3 ] %cmp47.4 = icmp sgt i32 %53, 2 br i1 %cmp47.4, label %if.then.4, label %if.end.4 if.then.4: ; preds = %for.inc105.3 %arrayidx46.4 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 4, i64 %indvars.iv184 %sub53.4 = add nsw i32 %53, -3 store i32 %sub53.4, ptr %arrayidx46.4, align 4, !tbaa !5 br label %if.end.4 if.end.4: ; preds = %if.then.4, %for.inc105.3 %54 = phi i32 [ %sub53.4, %if.then.4 ], [ %53, %for.inc105.3 ] %cmp58.4 = icmp sgt i32 %54, 0 %arrayidx64.4 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 5, i64 %indvars.iv184 %55 = load i32, ptr %arrayidx64.4, align 4, !tbaa !5 br i1 %cmp58.4, label %if.then60.4, label %for.inc105.4 if.then60.4: ; preds = %if.end.4 %cmp69.4 = icmp slt i32 %55, %54 br i1 %cmp69.4, label %for.end114.split.loop.exit210, label %lor.lhs.false.4 lor.lhs.false.4: ; preds = %if.then60.4 %arrayidx75.4 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 6, i64 %indvars.iv184 %56 = load i32, ptr %arrayidx75.4, align 4, !tbaa !5 %cmp80.4 = icmp slt i32 %56, %54 br i1 %cmp80.4, label %for.end114.split.loop.exit212, label %if.end83.4 if.end83.4: ; preds = %lor.lhs.false.4 %sub93.4 = sub nsw i32 %55, %54 store i32 %sub93.4, ptr %arrayidx64.4, align 4, !tbaa !5 %sub103.4 = sub nsw i32 %56, %54 store i32 %sub103.4, ptr %arrayidx75.4, align 4, !tbaa !5 br label %for.inc105.4 for.inc105.4: ; preds = %if.end.4, %if.end83.4 %57 = phi i32 [ %sub93.4, %if.end83.4 ], [ %55, %if.end.4 ] %cmp47.5 = icmp sgt i32 %57, 2 br i1 %cmp47.5, label %if.then.5, label %if.end.5 if.then.5: ; preds = %for.inc105.4 %arrayidx46.5 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 5, i64 %indvars.iv184 %sub53.5 = add nsw i32 %57, -3 store i32 %sub53.5, ptr %arrayidx46.5, align 4, !tbaa !5 br label %if.end.5 if.end.5: ; preds = %if.then.5, %for.inc105.4 %58 = phi i32 [ %sub53.5, %if.then.5 ], [ %57, %for.inc105.4 ] %cmp58.5 = icmp sgt i32 %58, 0 %arrayidx64.5 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 6, i64 %indvars.iv184 %59 = load i32, ptr %arrayidx64.5, align 4, !tbaa !5 br i1 %cmp58.5, label %if.then60.5, label %for.inc105.5 if.then60.5: ; preds = %if.end.5 %cmp69.5 = icmp slt i32 %59, %58 br i1 %cmp69.5, label %for.end114.split.loop.exit214, label %lor.lhs.false.5 lor.lhs.false.5: ; preds = %if.then60.5 %arrayidx75.5 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 7, i64 %indvars.iv184 %60 = load i32, ptr %arrayidx75.5, align 4, !tbaa !5 %cmp80.5 = icmp slt i32 %60, %58 br i1 %cmp80.5, label %for.end114.split.loop.exit216, label %if.end83.5 if.end83.5: ; preds = %lor.lhs.false.5 %sub93.5 = sub nsw i32 %59, %58 store i32 %sub93.5, ptr %arrayidx64.5, align 4, !tbaa !5 %sub103.5 = sub nsw i32 %60, %58 store i32 %sub103.5, ptr %arrayidx75.5, align 4, !tbaa !5 br label %for.inc105.5 for.inc105.5: ; preds = %if.end.5, %if.end83.5 %61 = phi i32 [ %sub93.5, %if.end83.5 ], [ %59, %if.end.5 ] %cmp47.6 = icmp sgt i32 %61, 2 br i1 %cmp47.6, label %if.then.6, label %if.end.6 if.then.6: ; preds = %for.inc105.5 %arrayidx46.6 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 6, i64 %indvars.iv184 %sub53.6 = add nsw i32 %61, -3 store i32 %sub53.6, ptr %arrayidx46.6, align 4, !tbaa !5 br label %if.end.6 if.end.6: ; preds = %if.then.6, %for.inc105.5 %62 = phi i32 [ %sub53.6, %if.then.6 ], [ %61, %for.inc105.5 ] %cmp58.6 = icmp sgt i32 %62, 0 %arrayidx64.6 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 7, i64 %indvars.iv184 %63 = load i32, ptr %arrayidx64.6, align 4, !tbaa !5 br i1 %cmp58.6, label %if.then60.6, label %for.inc105.6 if.then60.6: ; preds = %if.end.6 %cmp69.6 = icmp slt i32 %63, %62 br i1 %cmp69.6, label %for.end114.split.loop.exit218, label %lor.lhs.false.6 lor.lhs.false.6: ; preds = %if.then60.6 %arrayidx75.6 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 8, i64 %indvars.iv184 %64 = load i32, ptr %arrayidx75.6, align 4, !tbaa !5 %cmp80.6 = icmp slt i32 %64, %62 br i1 %cmp80.6, label %for.end114.split.loop.exit220, label %if.end83.6 if.end83.6: ; preds = %lor.lhs.false.6 %sub93.6 = sub nsw i32 %63, %62 store i32 %sub93.6, ptr %arrayidx64.6, align 4, !tbaa !5 %sub103.6 = sub nsw i32 %64, %62 store i32 %sub103.6, ptr %arrayidx75.6, align 4, !tbaa !5 br label %for.inc105.6 for.inc105.6: ; preds = %if.end.6, %if.end83.6 %65 = phi i32 [ %sub93.6, %if.end83.6 ], [ %63, %if.end.6 ] %cmp47.7 = icmp sgt i32 %65, 2 br i1 %cmp47.7, label %if.then.7, label %if.end.7 if.then.7: ; preds = %for.inc105.6 %arrayidx46.7 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 7, i64 %indvars.iv184 %sub53.7 = add nsw i32 %65, -3 store i32 %sub53.7, ptr %arrayidx46.7, align 4, !tbaa !5 br label %if.end.7 if.end.7: ; preds = %if.then.7, %for.inc105.6 %66 = phi i32 [ %sub53.7, %if.then.7 ], [ %65, %for.inc105.6 ] %cmp58.7 = icmp sgt i32 %66, 0 %arrayidx64.7 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 8, i64 %indvars.iv184 %67 = load i32, ptr %arrayidx64.7, align 4, !tbaa !5 br i1 %cmp58.7, label %if.then60.7, label %for.inc105.7 if.then60.7: ; preds = %if.end.7 %cmp69.7 = icmp slt i32 %67, %66 br i1 %cmp69.7, label %for.end114.split.loop.exit222, label %lor.lhs.false.7 lor.lhs.false.7: ; preds = %if.then60.7 %arrayidx75.7 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 9, i64 %indvars.iv184 %68 = load i32, ptr %arrayidx75.7, align 4, !tbaa !5 %cmp80.7 = icmp slt i32 %68, %66 br i1 %cmp80.7, label %for.end114.split.loop.exit224, label %if.end83.7 if.end83.7: ; preds = %lor.lhs.false.7 %sub93.7 = sub nsw i32 %67, %66 store i32 %sub93.7, ptr %arrayidx64.7, align 4, !tbaa !5 %sub103.7 = sub nsw i32 %68, %66 store i32 %sub103.7, ptr %arrayidx75.7, align 4, !tbaa !5 br label %for.inc105.7 for.inc105.7: ; preds = %if.end.7, %if.end83.7 %69 = phi i32 [ %sub93.7, %if.end83.7 ], [ %67, %if.end.7 ] %cmp47.8 = icmp sgt i32 %69, 2 br i1 %cmp47.8, label %if.then.8, label %if.end.8 if.then.8: ; preds = %for.inc105.7 %arrayidx46.8 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 8, i64 %indvars.iv184 %sub53.8 = add nsw i32 %69, -3 store i32 %sub53.8, ptr %arrayidx46.8, align 4, !tbaa !5 br label %if.end.8 if.end.8: ; preds = %if.then.8, %for.inc105.7 %70 = phi i32 [ %sub53.8, %if.then.8 ], [ %69, %for.inc105.7 ] %cmp58.8 = icmp sgt i32 %70, 0 br i1 %cmp58.8, label %if.then60.8, label %for.inc112 if.then60.8: ; preds = %if.end.8 %arrayidx64.8 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 9, i64 %indvars.iv184 %71 = load i32, ptr %arrayidx64.8, align 4, !tbaa !5 %cmp69.8 = icmp slt i32 %71, %70 br i1 %cmp69.8, label %for.end114.split.loop.exit226, label %lor.lhs.false.8 lor.lhs.false.8: ; preds = %if.then60.8 %arrayidx75.8 = getelementptr inbounds [20 x [20 x i32]], ptr %d, i64 0, i64 10, i64 %indvars.iv184 %72 = load i32, ptr %arrayidx75.8, align 4, !tbaa !5 %cmp80.8 = icmp slt i32 %72, %70 br i1 %cmp80.8, label %for.end114.split.loop.exit228, label %if.end83.8 if.end83.8: ; preds = %lor.lhs.false.8 %sub93.8 = sub nsw i32 %71, %70 store i32 %sub93.8, ptr %arrayidx64.8, align 4, !tbaa !5 %sub103.8 = sub nsw i32 %72, %70 store i32 %sub103.8, ptr %arrayidx75.8, align 4, !tbaa !5 br label %for.inc112 for.inc112: ; preds = %if.end.8, %if.end83.8 %indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1 %exitcond.not = icmp eq i64 %indvars.iv.next185, 3 br i1 %exitcond.not, label %for.end114, label %for.cond39.preheader, !llvm.loop !12 for.end114.split.loop.exit194: ; preds = %lor.lhs.false %73 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit196: ; preds = %if.then60 %74 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit198: ; preds = %if.then60.1 %75 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit200: ; preds = %lor.lhs.false.1 %76 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit202: ; preds = %if.then60.2 %77 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit204: ; preds = %lor.lhs.false.2 %78 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit206: ; preds = %if.then60.3 %79 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit208: ; preds = %lor.lhs.false.3 %80 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit210: ; preds = %if.then60.4 %81 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit212: ; preds = %lor.lhs.false.4 %82 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit214: ; preds = %if.then60.5 %83 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit216: ; preds = %lor.lhs.false.5 %84 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit218: ; preds = %if.then60.6 %85 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit220: ; preds = %lor.lhs.false.6 %86 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit222: ; preds = %if.then60.7 %87 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit224: ; preds = %lor.lhs.false.7 %88 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit226: ; preds = %if.then60.8 %89 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114.split.loop.exit228: ; preds = %lor.lhs.false.8 %90 = trunc i64 %indvars.iv184 to i32 br label %for.end114 for.end114: ; preds = %for.inc112, %for.end114.split.loop.exit228, %for.end114.split.loop.exit226, %for.end114.split.loop.exit224, %for.end114.split.loop.exit222, %for.end114.split.loop.exit220, %for.end114.split.loop.exit218, %for.end114.split.loop.exit216, %for.end114.split.loop.exit214, %for.end114.split.loop.exit212, %for.end114.split.loop.exit210, %for.end114.split.loop.exit208, %for.end114.split.loop.exit206, %for.end114.split.loop.exit204, %for.end114.split.loop.exit202, %for.end114.split.loop.exit200, %for.end114.split.loop.exit198, %for.end114.split.loop.exit196, %for.end114.split.loop.exit194 %j.1163 = phi i32 [ %73, %for.end114.split.loop.exit194 ], [ %74, %for.end114.split.loop.exit196 ], [ %75, %for.end114.split.loop.exit198 ], [ %76, %for.end114.split.loop.exit200 ], [ %77, %for.end114.split.loop.exit202 ], [ %78, %for.end114.split.loop.exit204 ], [ %79, %for.end114.split.loop.exit206 ], [ %80, %for.end114.split.loop.exit208 ], [ %81, %for.end114.split.loop.exit210 ], [ %82, %for.end114.split.loop.exit212 ], [ %83, %for.end114.split.loop.exit214 ], [ %84, %for.end114.split.loop.exit216 ], [ %85, %for.end114.split.loop.exit218 ], [ %86, %for.end114.split.loop.exit220 ], [ %87, %for.end114.split.loop.exit222 ], [ %88, %for.end114.split.loop.exit224 ], [ %89, %for.end114.split.loop.exit226 ], [ %90, %for.end114.split.loop.exit228 ], [ 3, %for.inc112 ] %tobool116.not = icmp eq i32 %j.1163, 3 %cond = zext i1 %tobool116.not to i32 %call117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cond) call void @llvm.lifetime.end.p0(i64 1600, ptr nonnull %d) #4 %91 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %91, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %91, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %for.end114, %entry call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 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} !13 = distinct !{!13, !11}
#include<stdio.h> int main(void) { int n,x[1000],y[1000],b[1000],p[1000],i,e[10001],r[10001],z[10001],t[10011],e1[10001],r1[10001]; int z1[10001]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&x[i],&y[i],&b[i],&p[i]); } for(i=0;i<n;i++){ if(b[i]>=5 && p[i]>=2){ e[i]=x[i]*b[i]; r[i]=y[i]*p[i]; z[i]=(e[i]+r[i])*0.8; printf("%d\n",z[i]); } else if(b[i]<5 && p[i]<2){ e[i]=x[i]*b[i]; r[i]=y[i]*p[i]; t[i]=e[i]+r[i]; e1[i]=x[i]*5; r1[i]=y[i]*2; z1[i]=(e1[i]+r1[i])*0.8; if(t[i]>z1[i]){ printf("%d\n",z1[i]); } else{ printf("%d\n",t[i]); } } else if(b[i]>=5 && p[i]<2){ e[i]=x[i]*b[i]; r[i]=y[i]*p[i]; t[i]=e[i]+r[i]; e1[i]=x[i]*b[i]; r1[i]=y[i]*2; z1[i]=(e1[i]+r1[i])*0.8; if(t[i]>z1[i]){ printf("%d\n",z1[i]); } else{ printf("%d\n",t[i]); } } else if(b[i]<5 && p[i]>=2){ e[i]=x[i]*b[i]; r[i]=y[i]*p[i]; t[i]=e[i]+r[i]; e1[i]=x[i]*5; r1[i]=y[i]*p[i]; z1[i]=(e1[i]+r1[i])*0.8; if(t[i]>z1[i]){ printf("%d\n",z1[i]); } else{ printf("%d\n",t[i]); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124837/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124837/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %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 [1000 x i32], align 16 %y = alloca [1000 x i32], align 16 %b = alloca [1000 x i32], align 16 %p = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %p) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp351 = icmp sgt i32 %0, 0 br i1 %cmp351, label %for.body, label %for.end250 for.cond8.preheader: ; preds = %for.body %1 = icmp sgt i32 %2, 0 br i1 %1, label %for.body10, label %for.end250 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv %arrayidx6 = getelementptr inbounds [1000 x i32], ptr %p, i64 0, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx6) %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.cond8.preheader, !llvm.loop !9 for.body10: ; preds = %for.cond8.preheader, %for.inc248 %indvars.iv356 = phi i64 [ %indvars.iv.next357, %for.inc248 ], [ 0, %for.cond8.preheader ] %arrayidx12 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv356 %4 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp sgt i32 %4, 4 %arrayidx15 = getelementptr inbounds [1000 x i32], ptr %p, i64 0, i64 %indvars.iv356 %5 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv356 %6 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %mul = mul nsw i32 %6, %4 %arrayidx24 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv356 %7 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %mul27 = mul nsw i32 %7, %5 %add = add nsw i32 %mul27, %mul br i1 %cmp13, label %land.lhs.true, label %land.lhs.true45 land.lhs.true: ; preds = %for.body10 %cmp16 = icmp sgt i32 %5, 1 br i1 %cmp16, label %if.then, label %if.then116 if.then: ; preds = %land.lhs.true %conv = sitofp i32 %add to double %mul34 = fmul double %conv, 8.000000e-01 %conv35 = fptosi double %mul34 to i32 br label %for.inc248 land.lhs.true45: ; preds = %for.body10 %cmp48 = icmp slt i32 %5, 2 %mul74 = mul nsw i32 %6, 5 br i1 %cmp48, label %if.then50, label %if.then185 if.then50: ; preds = %land.lhs.true45 %mul79 = shl nsw i32 %7, 1 %add86 = add nsw i32 %mul79, %mul74 %conv87 = sitofp i32 %add86 to double %mul88 = fmul double %conv87, 8.000000e-01 %conv89 = fptosi double %mul88 to i32 %conv89.add = call i32 @llvm.smin.i32(i32 %add, i32 %conv89) br label %for.inc248 if.then116: ; preds = %land.lhs.true %mul147 = shl nsw i32 %7, 1 %add154 = add nsw i32 %mul147, %mul %conv155 = sitofp i32 %add154 to double %mul156 = fmul double %conv155, 8.000000e-01 %conv157 = fptosi double %mul156 to i32 %conv157.add = call i32 @llvm.smin.i32(i32 %add, i32 %conv157) br label %for.inc248 if.then185: ; preds = %land.lhs.true45 %add223 = add nsw i32 %mul27, %mul74 %conv224 = sitofp i32 %add223 to double %mul225 = fmul double %conv224, 8.000000e-01 %conv226 = fptosi double %mul225 to i32 %conv226.add = call i32 @llvm.smin.i32(i32 %add, i32 %conv226) br label %for.inc248 for.inc248: ; preds = %if.then185, %if.then116, %if.then50, %if.then %conv35.sink = phi i32 [ %conv35, %if.then ], [ %conv89.add, %if.then50 ], [ %conv157.add, %if.then116 ], [ %conv226.add, %if.then185 ] %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv35.sink) %indvars.iv.next357 = add nuw nsw i64 %indvars.iv356, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp9 = icmp slt i64 %indvars.iv.next357, %9 br i1 %cmp9, label %for.body10, label %for.end250, !llvm.loop !11 for.end250: ; preds = %for.inc248, %entry, %for.cond8.preheader call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %p) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // 内部定数 #define D_ON 1 // 汎用フラグ - ON #define D_OFF 0 // 汎用フラグ - OFF #define D_BUILD_MAX 15 // 最大建物数 // 内部変数 static FILE *szpFpI; // 入力 static int si1Build[D_BUILD_MAX]; // 建物 static int siBCnt; // 建物数 static int siWCnt; // 見える建物数 static long long slMin; // 最小金額 // 内部変数 - テスト用 #ifdef D_TEST static int siRes; static FILE *szpFpA; #endif // 最小金額 - セット int fSetMin( int *pipWatch // <I> 見える建物 ) { int i; // 合計金額 - 取得 int liNow = si1Build[0]; long long llSum = 0; for (i = 1; i < siBCnt; i++) { if (si1Build[i] > liNow) { // 以前より大きい liNow = si1Build[i]; } else { // 以前より小さい if (pipWatch[i] == D_ON) { // 見える建物 int liUp = liNow - si1Build[i] + 1; llSum += liUp; liNow = si1Build[i] + liUp; } } } // 最小金額 - 更新 if (slMin > llSum) { slMin = llSum; } return 0; } // 見える建物 - 選択 int fSelBuild( int piBNo // <I> 建物 , int *pipWatch // <I> 見える建物 , int piWCnt // <I> 見える建物数 ) { // 終了チェック if (piWCnt == siWCnt) { fSetMin(pipWatch); return 0; } // 選択 - あり pipWatch[piBNo] = D_ON; fSelBuild(piBNo + 1, pipWatch, piWCnt + 1); pipWatch[piBNo] = D_OFF; // 選択 - なし if (siBCnt - piBNo > siWCnt - piWCnt) { // 残建物数 > 必要選択数 fSelBuild(piBNo + 1, pipWatch, piWCnt); } return 0; } // 実行メイン int fMain( int piTNo // <I> テスト番号 1~ ) { int i; char lc1Buf[1024], lc1Out[1024]; // データ - 初期化 slMin = LLONG_MAX; // 最小金額 // 入力 - セット #ifdef D_TEST sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo); szpFpI = fopen(lc1Buf, "r"); sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo); szpFpA = fopen(lc1Buf, "r"); siRes = 0; #else szpFpI = stdin; #endif // 建物数・見える建物数 - 取得 fgets(lc1Buf, sizeof(lc1Buf), szpFpI); sscanf(lc1Buf, "%d%d", &siBCnt, &siWCnt); // 建物 - 取得 for (i = 0; i < siBCnt; i++) { fscanf(szpFpI, "%d", &si1Build[i]); } fgets(lc1Buf, sizeof(lc1Buf), szpFpI); // 見える建物 - 選択 int li1Watch[D_BUILD_MAX]; memset(li1Watch, D_OFF, sizeof(li1Watch)); fSelBuild(1, li1Watch, 1); // 結果 - セット sprintf(lc1Out, "%lld\n", slMin); // 結果 - 表示 #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpA); if (strcmp(lc1Buf, lc1Out)) { siRes = -1; } #else printf("%s", lc1Out); #endif // 残データ有無 #ifdef D_TEST lc1Buf[0] = '\0'; fgets(lc1Buf, sizeof(lc1Buf), szpFpA); if (strcmp(lc1Buf, "")) { siRes = -1; } #endif // テストファイルクローズ #ifdef D_TEST fclose(szpFpI); fclose(szpFpA); #endif // テスト結果 #ifdef D_TEST if (siRes == 0) { printf("OK %d\n", piTNo); } else { printf("NG %d\n", piTNo); } #endif return 0; } int main() { #ifdef D_TEST int i; for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) { fMain(i); } #else fMain(0); #endif return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124888/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124888/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @si1Build = internal global [15 x i32] zeroinitializer, align 16 @siBCnt = internal global i32 0, align 4 @slMin = internal unnamed_addr global i64 0, align 8 @siWCnt = internal global i32 0, align 4 @stdin = external local_unnamed_addr global ptr, align 8 @szpFpI = internal unnamed_addr global ptr null, align 8 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i32 @fSetMin(ptr nocapture noundef readonly %pipWatch) local_unnamed_addr #0 { entry: %0 = load i32, ptr @siBCnt, align 4, !tbaa !5 %cmp29 = icmp sgt i32 %0, 1 br i1 %cmp29, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %1 = load i32, ptr @si1Build, align 16, !tbaa !5 %wide.trip.count = zext i32 %0 to i64 %2 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %2, 1 %3 = icmp eq i32 %0, 2 br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %2, -2 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %llSum.031 = phi i64 [ 0, %for.body.preheader.new ], [ %llSum.1.1, %for.inc.1 ] %liNow.030 = phi i32 [ %1, %for.body.preheader.new ], [ %liNow.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [15 x i32], ptr @si1Build, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %4, %liNow.030 br i1 %cmp1, label %for.inc, label %if.else if.else: ; preds = %for.body %arrayidx5 = getelementptr inbounds i32, ptr %pipWatch, i64 %indvars.iv %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %5, 1 br i1 %cmp6, label %if.then7, label %for.inc if.then7: ; preds = %if.else %sub = add i32 %liNow.030, 1 %add = sub i32 %sub, %4 %conv = sext i32 %add to i64 %add10 = add nsw i64 %llSum.031, %conv br label %for.inc for.inc: ; preds = %for.body, %if.then7, %if.else %liNow.1 = phi i32 [ %sub, %if.then7 ], [ %liNow.030, %if.else ], [ %4, %for.body ] %llSum.1 = phi i64 [ %add10, %if.then7 ], [ %llSum.031, %if.else ], [ %llSum.031, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [15 x i32], ptr @si1Build, i64 0, i64 %indvars.iv.next %6 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %cmp1.1 = icmp sgt i32 %6, %liNow.1 br i1 %cmp1.1, label %for.inc.1, label %if.else.1 if.else.1: ; preds = %for.inc %arrayidx5.1 = getelementptr inbounds i32, ptr %pipWatch, i64 %indvars.iv.next %7 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %cmp6.1 = icmp eq i32 %7, 1 br i1 %cmp6.1, label %if.then7.1, label %for.inc.1 if.then7.1: ; preds = %if.else.1 %sub.1 = add i32 %liNow.1, 1 %add.1 = sub i32 %sub.1, %6 %conv.1 = sext i32 %add.1 to i64 %add10.1 = add nsw i64 %llSum.1, %conv.1 br label %for.inc.1 for.inc.1: ; preds = %if.then7.1, %if.else.1, %for.inc %liNow.1.1 = phi i32 [ %sub.1, %if.then7.1 ], [ %liNow.1, %if.else.1 ], [ %6, %for.inc ] %llSum.1.1 = phi i64 [ %add10.1, %if.then7.1 ], [ %llSum.1, %if.else.1 ], [ %llSum.1, %for.inc ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %llSum.1.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %llSum.1.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ] %llSum.031.unr = phi i64 [ 0, %for.body.preheader ], [ %llSum.1.1, %for.inc.1 ] %liNow.030.unr = phi i32 [ %1, %for.body.preheader ], [ %liNow.1.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds [15 x i32], ptr @si1Build, i64 0, i64 %indvars.iv.unr %8 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %cmp1.epil = icmp sgt i32 %8, %liNow.030.unr br i1 %cmp1.epil, label %for.end, label %if.else.epil if.else.epil: ; preds = %for.body.epil %arrayidx5.epil = getelementptr inbounds i32, ptr %pipWatch, i64 %indvars.iv.unr %9 = load i32, ptr %arrayidx5.epil, align 4, !tbaa !5 %cmp6.epil = icmp eq i32 %9, 1 br i1 %cmp6.epil, label %if.then7.epil, label %for.end if.then7.epil: ; preds = %if.else.epil %sub.epil = add i32 %liNow.030.unr, 1 %add.epil = sub i32 %sub.epil, %8 %conv.epil = sext i32 %add.epil to i64 %add10.epil = add nsw i64 %llSum.031.unr, %conv.epil br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then7.epil, %if.else.epil, %for.body.epil, %entry %llSum.0.lcssa = phi i64 [ 0, %entry ], [ %llSum.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add10.epil, %if.then7.epil ], [ %llSum.031.unr, %if.else.epil ], [ %llSum.031.unr, %for.body.epil ] %10 = load i64, ptr @slMin, align 8, !tbaa !11 %cmp15 = icmp sgt i64 %10, %llSum.0.lcssa br i1 %cmp15, label %if.then17, label %if.end18 if.then17: ; preds = %for.end store i64 %llSum.0.lcssa, ptr @slMin, align 8, !tbaa !11 br label %if.end18 if.end18: ; preds = %if.then17, %for.end ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @fSelBuild(i32 noundef %piBNo, ptr noundef %pipWatch, i32 noundef %piWCnt) local_unnamed_addr #2 { entry: %0 = load i32, ptr @siWCnt, align 4, !tbaa !5 %cmp27.not = icmp eq i32 %0, %piWCnt br i1 %cmp27.not, label %entry.if.then_crit_edge, label %if.end.lr.ph entry.if.then_crit_edge: ; preds = %entry %.pre = load i32, ptr @siBCnt, align 4, !tbaa !5 br label %if.then if.end.lr.ph: ; preds = %entry %add1 = add nsw i32 %piWCnt, 1 %1 = sext i32 %piBNo to i64 %arrayidx.peel = getelementptr inbounds i32, ptr %pipWatch, i64 %1 store i32 1, ptr %arrayidx.peel, align 4, !tbaa !5 %indvars.iv.next.peel = add nsw i64 %1, 1 %2 = trunc i64 %indvars.iv.next.peel to i32 %call2.peel = tail call i32 @fSelBuild(i32 noundef %2, ptr noundef %pipWatch, i32 noundef %add1) store i32 0, ptr %arrayidx.peel, align 4, !tbaa !5 %3 = load i32, ptr @siBCnt, align 4, !tbaa !5 %sub.peel = sub nsw i32 %3, %piBNo %4 = load i32, ptr @siWCnt, align 4, !tbaa !5 %sub5.peel = sub nsw i32 %4, %piWCnt %cmp6.peel = icmp sgt i32 %sub.peel, %sub5.peel br i1 %cmp6.peel, label %if.then7.peel, label %return if.then7.peel: ; preds = %if.end.lr.ph %cmp.peel = icmp eq i32 %4, %piWCnt br i1 %cmp.peel, label %if.then, label %if.end if.then: ; preds = %if.then7, %if.then7.peel, %entry.if.then_crit_edge %5 = phi i32 [ %.pre, %entry.if.then_crit_edge ], [ %3, %if.then7.peel ], [ %17, %if.then7 ] %cmp29.i = icmp sgt i32 %5, 1 br i1 %cmp29.i, label %for.body.preheader.i, label %for.end.i for.body.preheader.i: ; preds = %if.then %6 = load i32, ptr @si1Build, align 16, !tbaa !5 %wide.trip.count.i = zext i32 %5 to i64 %7 = add nsw i64 %wide.trip.count.i, -1 %xtraiter = and i64 %7, 1 %8 = icmp eq i32 %5, 2 br i1 %8, label %for.end.i.loopexit.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = and i64 %7, -2 br label %for.body.i for.body.i: ; preds = %for.inc.i.1, %for.body.preheader.i.new %indvars.iv.i = phi i64 [ 1, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %llSum.031.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %llSum.1.i.1, %for.inc.i.1 ] %liNow.030.i = phi i32 [ %6, %for.body.preheader.i.new ], [ %liNow.1.i.1, %for.inc.i.1 ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.inc.i.1 ] %arrayidx.i = getelementptr inbounds [15 x i32], ptr @si1Build, i64 0, i64 %indvars.iv.i %9 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp1.i = icmp sgt i32 %9, %liNow.030.i br i1 %cmp1.i, label %for.inc.i, label %if.else.i if.else.i: ; preds = %for.body.i %arrayidx5.i = getelementptr inbounds i32, ptr %pipWatch, i64 %indvars.iv.i %10 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %10, 1 br i1 %cmp6.i, label %if.then7.i, label %for.inc.i if.then7.i: ; preds = %if.else.i %sub.i = add i32 %liNow.030.i, 1 %add.i = sub i32 %sub.i, %9 %conv.i = sext i32 %add.i to i64 %add10.i = add nsw i64 %llSum.031.i, %conv.i br label %for.inc.i for.inc.i: ; preds = %if.then7.i, %if.else.i, %for.body.i %liNow.1.i = phi i32 [ %sub.i, %if.then7.i ], [ %liNow.030.i, %if.else.i ], [ %9, %for.body.i ] %llSum.1.i = phi i64 [ %add10.i, %if.then7.i ], [ %llSum.031.i, %if.else.i ], [ %llSum.031.i, %for.body.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds [15 x i32], ptr @si1Build, i64 0, i64 %indvars.iv.next.i %11 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5 %cmp1.i.1 = icmp sgt i32 %11, %liNow.1.i br i1 %cmp1.i.1, label %for.inc.i.1, label %if.else.i.1 if.else.i.1: ; preds = %for.inc.i %arrayidx5.i.1 = getelementptr inbounds i32, ptr %pipWatch, i64 %indvars.iv.next.i %12 = load i32, ptr %arrayidx5.i.1, align 4, !tbaa !5 %cmp6.i.1 = icmp eq i32 %12, 1 br i1 %cmp6.i.1, label %if.then7.i.1, label %for.inc.i.1 if.then7.i.1: ; preds = %if.else.i.1 %sub.i.1 = add i32 %liNow.1.i, 1 %add.i.1 = sub i32 %sub.i.1, %11 %conv.i.1 = sext i32 %add.i.1 to i64 %add10.i.1 = add nsw i64 %llSum.1.i, %conv.i.1 br label %for.inc.i.1 for.inc.i.1: ; preds = %if.then7.i.1, %if.else.i.1, %for.inc.i %liNow.1.i.1 = phi i32 [ %sub.i.1, %if.then7.i.1 ], [ %liNow.1.i, %if.else.i.1 ], [ %11, %for.inc.i ] %llSum.1.i.1 = phi i64 [ %add10.i.1, %if.then7.i.1 ], [ %llSum.1.i, %if.else.i.1 ], [ %llSum.1.i, %for.inc.i ] %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.end.i.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !9 for.end.i.loopexit.unr-lcssa: ; preds = %for.inc.i.1, %for.body.preheader.i %llSum.1.i.lcssa.ph = phi i64 [ undef, %for.body.preheader.i ], [ %llSum.1.i.1, %for.inc.i.1 ] %indvars.iv.i.unr = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %llSum.031.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %llSum.1.i.1, %for.inc.i.1 ] %liNow.030.i.unr = phi i32 [ %6, %for.body.preheader.i ], [ %liNow.1.i.1, %for.inc.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end.i, label %for.body.i.epil for.body.i.epil: ; preds = %for.end.i.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds [15 x i32], ptr @si1Build, i64 0, i64 %indvars.iv.i.unr %13 = load i32, ptr %arrayidx.i.epil, align 4, !tbaa !5 %cmp1.i.epil = icmp sgt i32 %13, %liNow.030.i.unr br i1 %cmp1.i.epil, label %for.end.i, label %if.else.i.epil if.else.i.epil: ; preds = %for.body.i.epil %arrayidx5.i.epil = getelementptr inbounds i32, ptr %pipWatch, i64 %indvars.iv.i.unr %14 = load i32, ptr %arrayidx5.i.epil, align 4, !tbaa !5 %cmp6.i.epil = icmp eq i32 %14, 1 br i1 %cmp6.i.epil, label %if.then7.i.epil, label %for.end.i if.then7.i.epil: ; preds = %if.else.i.epil %sub.i.epil = add i32 %liNow.030.i.unr, 1 %add.i.epil = sub i32 %sub.i.epil, %13 %conv.i.epil = sext i32 %add.i.epil to i64 %add10.i.epil = add nsw i64 %llSum.031.i.unr, %conv.i.epil br label %for.end.i for.end.i: ; preds = %for.end.i.loopexit.unr-lcssa, %if.then7.i.epil, %if.else.i.epil, %for.body.i.epil, %if.then %llSum.0.lcssa.i = phi i64 [ 0, %if.then ], [ %llSum.1.i.lcssa.ph, %for.end.i.loopexit.unr-lcssa ], [ %add10.i.epil, %if.then7.i.epil ], [ %llSum.031.i.unr, %if.else.i.epil ], [ %llSum.031.i.unr, %for.body.i.epil ] %15 = load i64, ptr @slMin, align 8, !tbaa !11 %cmp15.i = icmp sgt i64 %15, %llSum.0.lcssa.i br i1 %cmp15.i, label %if.then17.i, label %return if.then17.i: ; preds = %for.end.i store i64 %llSum.0.lcssa.i, ptr @slMin, align 8, !tbaa !11 br label %return if.end: ; preds = %if.then7.peel, %if.then7 %indvars.iv = phi i64 [ %indvars.iv.next, %if.then7 ], [ %indvars.iv.next.peel, %if.then7.peel ] %piBNo.tr28.in = phi i32 [ %piBNo.tr28, %if.then7 ], [ %piBNo, %if.then7.peel ] %piBNo.tr28 = add nsw i32 %piBNo.tr28.in, 1 %arrayidx = getelementptr inbounds i32, ptr %pipWatch, i64 %indvars.iv store i32 1, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add i64 %indvars.iv, 1 %16 = trunc i64 %indvars.iv.next to i32 %call2 = tail call i32 @fSelBuild(i32 noundef %16, ptr noundef nonnull %pipWatch, i32 noundef %add1) store i32 0, ptr %arrayidx, align 4, !tbaa !5 %17 = load i32, ptr @siBCnt, align 4, !tbaa !5 %sub = sub nsw i32 %17, %piBNo.tr28 %18 = load i32, ptr @siWCnt, align 4, !tbaa !5 %sub5 = sub nsw i32 %18, %piWCnt %cmp6 = icmp sgt i32 %sub, %sub5 br i1 %cmp6, label %if.then7, label %return if.then7: ; preds = %if.end %cmp = icmp eq i32 %18, %piWCnt br i1 %cmp, label %if.then, label %if.end, !llvm.loop !13 return: ; preds = %if.end, %if.end.lr.ph, %if.then17.i, %for.end.i ret i32 0 } ; Function Attrs: nounwind uwtable define dso_local i32 @fMain(i32 %piTNo) local_unnamed_addr #3 { entry: %lc1Buf = alloca [1024 x i8], align 16 %lc1Out = alloca [1024 x i8], align 16 %li1Watch = alloca [15 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #7 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Out) #7 store i64 9223372036854775807, ptr @slMin, align 8, !tbaa !11 %0 = load ptr, ptr @stdin, align 8, !tbaa !15 store ptr %0, ptr @szpFpI, align 8, !tbaa !15 %call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull @siBCnt, ptr noundef nonnull @siWCnt) #7 %1 = load i32, ptr @siBCnt, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %1, 0 br i1 %cmp15, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %2 = load ptr, ptr @szpFpI, align 8, !tbaa !15 %arrayidx = getelementptr inbounds [15 x i32], ptr @si1Build, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %2, ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) #7 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @siBCnt, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !17 for.end: ; preds = %for.body, %entry %5 = load ptr, ptr @szpFpI, align 8, !tbaa !15 %call5 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %5) call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %li1Watch) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) %li1Watch, i8 0, i64 60, i1 false) %call8 = call i32 @fSelBuild(i32 noundef 1, ptr noundef nonnull %li1Watch, i32 noundef 1) %6 = load i64, ptr @slMin, align 8, !tbaa !11 %call10 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Out, ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %6) #7 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %lc1Out) call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %li1Watch) #7 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Out) #7 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4 declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 ; Function Attrs: nofree nounwind declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, 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: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %call = tail call i32 @fMain(i32 poison) ret i32 0 } attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !14} !14 = !{!"llvm.loop.peeled.count", i32 1} !15 = !{!16, !16, i64 0} !16 = !{!"any pointer", !7, i64 0} !17 = distinct !{!17, !10}
#include <stdio.h> int main(void) { int X; scanf("%d",&X); if(X >= 30){ printf("Yes"); }else{ printf("No"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124930/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124930/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <stdlib.h> #define N 200010 #define MAX 1000000000000000000 #include <stdio.h> int main (void) { int x; scanf("%d", &x); if (x >= 30) { puts("Yes"); } else { puts("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124981/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124981/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main () { int temp = 0 ; scanf("%i",&temp) ; if (temp >= 30 ) { printf("Yes"); } else { printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125023/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125023/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%i\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: %temp = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #3 store i32 0, ptr %temp, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp) %0 = load i32, ptr %temp, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <math.h> int main(void) { int X; scanf("%i", &X); printf("%s\n", X >= 30 ? "Yes" : "No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125074/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125074/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%i\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %cond = select i1 %cmp, ptr @.str.2, ptr @.str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond) 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 X; scanf("%d",&X); if(X>=-40 && X<=40) { if(X>=30) { printf("Yes"); } else { printf("No"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125124/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125124/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4 %1 = add i32 %0, 40 %or.cond = icmp ult i32 %1, 81 br i1 %or.cond, label %if.then, label %if.end6 if.then: ; preds = %entry %cmp2 = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp2, ptr @.str.1, ptr @.str.2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) br label %if.end6 if.end6: ; preds = %if.then, %entry 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)"}
#include <stdio.h> int main(void) { int x; scanf("%d",&x); if(x>=30) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125168/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125168/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %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 %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(void){ int x; scanf("%d",&x); if(x>=30){ printf("Yes"); }else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125218/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125218/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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"}
#include <stdio.h> int main(){ int a; scanf("%d", &a); if(a >= 30){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125261/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125261/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %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 %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int X; scanf("%d", &X); if (X >= 30) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125311/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125311/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %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 %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; scanf("%d",&a); if(a>=30) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125355/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125355/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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; scanf("%d",&X); if(X >= 30){ printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125399/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125399/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %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 %X) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> typedef struct { int no; int num; } place_t; int comp(const void* x,const void* y) { place_t* a=(place_t*)x; place_t* b=(place_t*)y; if(a->num<b->num)return 1; if(a->num>b->num)return -1; if(a->no>b->no)return 1; if(a->no<b->no)return -1; return 0; } int main(void) { place_t place[100]; int i,j,n,m; int one; while(1) { scanf("%d %d",&n,&m); if(n==0 && m==0)break; for(i=0;i<100;i++) { place[i].no=i; place[i].num=0; } for(i=0;i<n;i++) { for(j=0;j<m;j++) { scanf("%d",&one); if(one)place[j].num++; } } qsort(place,m,sizeof(place_t),comp); for(i=0;i<m-1;i++) { printf("%d ",place[i].no+1); } printf("%d\n",place[m-1].no+1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125470/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125470/source.c" target datalayout = "e-m:e-p270: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.place_t = type { i32, i32 } @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.3 = 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 @comp(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 { entry: %num = getelementptr inbounds %struct.place_t, ptr %x, i64 0, i32 1 %0 = load i32, ptr %num, align 4, !tbaa !5 %num1 = getelementptr inbounds %struct.place_t, ptr %y, i64 0, i32 1 %1 = load i32, ptr %num1, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i32 %0, %1 br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %2 = load i32, ptr %x, align 4, !tbaa !10 %3 = load i32, ptr %y, align 4, !tbaa !10 %cmp8 = icmp sgt i32 %2, %3 br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp slt i32 %2, %3 %. = sext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ 1, %entry ], [ -1, %if.end ], [ 1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %place = alloca [100 x %struct.place_t], align 16 %n = alloca i32, align 4 %m = alloca i32, align 4 %one = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %place) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %one) #5 %call60 = 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 !11 %cmp61 = icmp eq i32 %0, 0 %1 = load i32, ptr %m, align 4 %cmp162 = icmp eq i32 %1, 0 %or.cond63 = select i1 %cmp61, i1 %cmp162, i1 false br i1 %or.cond63, label %while.end, label %vector.ph.preheader vector.ph.preheader: ; preds = %entry %2 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 2 %3 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 4 %4 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 6 %5 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 8 %6 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 10 %7 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 12 %8 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 14 %9 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 16 %10 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 18 %11 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 20 %12 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 22 %13 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 24 %14 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 26 %15 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 28 %16 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 30 %17 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 32 %18 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 34 %19 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 36 %20 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 38 %21 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 40 %22 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 42 %23 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 44 %24 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 46 %25 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 48 %26 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 50 %27 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 52 %28 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 54 %29 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 56 %30 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 58 %31 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 60 %32 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 62 %33 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 64 %34 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 66 %35 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 68 %36 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 70 %37 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 72 %38 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 74 %39 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 76 %40 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 78 %41 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 80 %42 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 82 %43 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 84 %44 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 86 %45 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 88 %46 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 90 %47 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 92 %48 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 94 %49 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 96 %50 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 98 br label %vector.ph vector.ph: ; preds = %vector.ph.preheader, %for.end34 %51 = phi i32 [ %69, %for.end34 ], [ %1, %vector.ph.preheader ] %52 = phi i32 [ %68, %for.end34 ], [ %0, %vector.ph.preheader ] store <4 x i32> <i32 0, i32 0, i32 1, i32 0>, ptr %place, align 16, !tbaa !11 store <4 x i32> <i32 2, i32 0, i32 3, i32 0>, ptr %2, align 16, !tbaa !11 store <4 x i32> <i32 4, i32 0, i32 5, i32 0>, ptr %3, align 16, !tbaa !11 store <4 x i32> <i32 6, i32 0, i32 7, i32 0>, ptr %4, align 16, !tbaa !11 store <4 x i32> <i32 8, i32 0, i32 9, i32 0>, ptr %5, align 16, !tbaa !11 store <4 x i32> <i32 10, i32 0, i32 11, i32 0>, ptr %6, align 16, !tbaa !11 store <4 x i32> <i32 12, i32 0, i32 13, i32 0>, ptr %7, align 16, !tbaa !11 store <4 x i32> <i32 14, i32 0, i32 15, i32 0>, ptr %8, align 16, !tbaa !11 store <4 x i32> <i32 16, i32 0, i32 17, i32 0>, ptr %9, align 16, !tbaa !11 store <4 x i32> <i32 18, i32 0, i32 19, i32 0>, ptr %10, align 16, !tbaa !11 store <4 x i32> <i32 20, i32 0, i32 21, i32 0>, ptr %11, align 16, !tbaa !11 store <4 x i32> <i32 22, i32 0, i32 23, i32 0>, ptr %12, align 16, !tbaa !11 store <4 x i32> <i32 24, i32 0, i32 25, i32 0>, ptr %13, align 16, !tbaa !11 store <4 x i32> <i32 26, i32 0, i32 27, i32 0>, ptr %14, align 16, !tbaa !11 store <4 x i32> <i32 28, i32 0, i32 29, i32 0>, ptr %15, align 16, !tbaa !11 store <4 x i32> <i32 30, i32 0, i32 31, i32 0>, ptr %16, align 16, !tbaa !11 store <4 x i32> <i32 32, i32 0, i32 33, i32 0>, ptr %17, align 16, !tbaa !11 store <4 x i32> <i32 34, i32 0, i32 35, i32 0>, ptr %18, align 16, !tbaa !11 store <4 x i32> <i32 36, i32 0, i32 37, i32 0>, ptr %19, align 16, !tbaa !11 store <4 x i32> <i32 38, i32 0, i32 39, i32 0>, ptr %20, align 16, !tbaa !11 store <4 x i32> <i32 40, i32 0, i32 41, i32 0>, ptr %21, align 16, !tbaa !11 store <4 x i32> <i32 42, i32 0, i32 43, i32 0>, ptr %22, align 16, !tbaa !11 store <4 x i32> <i32 44, i32 0, i32 45, i32 0>, ptr %23, align 16, !tbaa !11 store <4 x i32> <i32 46, i32 0, i32 47, i32 0>, ptr %24, align 16, !tbaa !11 store <4 x i32> <i32 48, i32 0, i32 49, i32 0>, ptr %25, align 16, !tbaa !11 store <4 x i32> <i32 50, i32 0, i32 51, i32 0>, ptr %26, align 16, !tbaa !11 store <4 x i32> <i32 52, i32 0, i32 53, i32 0>, ptr %27, align 16, !tbaa !11 store <4 x i32> <i32 54, i32 0, i32 55, i32 0>, ptr %28, align 16, !tbaa !11 store <4 x i32> <i32 56, i32 0, i32 57, i32 0>, ptr %29, align 16, !tbaa !11 store <4 x i32> <i32 58, i32 0, i32 59, i32 0>, ptr %30, align 16, !tbaa !11 store <4 x i32> <i32 60, i32 0, i32 61, i32 0>, ptr %31, align 16, !tbaa !11 store <4 x i32> <i32 62, i32 0, i32 63, i32 0>, ptr %32, align 16, !tbaa !11 store <4 x i32> <i32 64, i32 0, i32 65, i32 0>, ptr %33, align 16, !tbaa !11 store <4 x i32> <i32 66, i32 0, i32 67, i32 0>, ptr %34, align 16, !tbaa !11 store <4 x i32> <i32 68, i32 0, i32 69, i32 0>, ptr %35, align 16, !tbaa !11 store <4 x i32> <i32 70, i32 0, i32 71, i32 0>, ptr %36, align 16, !tbaa !11 store <4 x i32> <i32 72, i32 0, i32 73, i32 0>, ptr %37, align 16, !tbaa !11 store <4 x i32> <i32 74, i32 0, i32 75, i32 0>, ptr %38, align 16, !tbaa !11 store <4 x i32> <i32 76, i32 0, i32 77, i32 0>, ptr %39, align 16, !tbaa !11 store <4 x i32> <i32 78, i32 0, i32 79, i32 0>, ptr %40, align 16, !tbaa !11 store <4 x i32> <i32 80, i32 0, i32 81, i32 0>, ptr %41, align 16, !tbaa !11 store <4 x i32> <i32 82, i32 0, i32 83, i32 0>, ptr %42, align 16, !tbaa !11 store <4 x i32> <i32 84, i32 0, i32 85, i32 0>, ptr %43, align 16, !tbaa !11 store <4 x i32> <i32 86, i32 0, i32 87, i32 0>, ptr %44, align 16, !tbaa !11 store <4 x i32> <i32 88, i32 0, i32 89, i32 0>, ptr %45, align 16, !tbaa !11 store <4 x i32> <i32 90, i32 0, i32 91, i32 0>, ptr %46, align 16, !tbaa !11 store <4 x i32> <i32 92, i32 0, i32 93, i32 0>, ptr %47, align 16, !tbaa !11 store <4 x i32> <i32 94, i32 0, i32 95, i32 0>, ptr %48, align 16, !tbaa !11 store <4 x i32> <i32 96, i32 0, i32 97, i32 0>, ptr %49, align 16, !tbaa !11 store <4 x i32> <i32 98, i32 0, i32 99, i32 0>, ptr %50, align 16, !tbaa !11 %cmp655 = icmp sgt i32 %52, 0 %53 = icmp sgt i32 %51, 0 %or.cond76 = select i1 %cmp655, i1 %53, i1 false br i1 %or.cond76, label %for.cond8.preheader, label %for.end23 for.cond8.preheader: ; preds = %vector.ph, %for.inc21 %54 = phi i32 [ %60, %for.inc21 ], [ %52, %vector.ph ] %55 = phi i32 [ %61, %for.inc21 ], [ %51, %vector.ph ] %i.156 = phi i32 [ %inc22, %for.inc21 ], [ 0, %vector.ph ] %cmp953 = icmp sgt i32 %55, 0 br i1 %cmp953, label %for.body10, label %for.inc21 for.body10: ; preds = %for.cond8.preheader, %for.inc18 %indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.inc18 ], [ 0, %for.cond8.preheader ] %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %one) %56 = load i32, ptr %one, align 4, !tbaa !11 %tobool.not = icmp eq i32 %56, 0 br i1 %tobool.not, label %for.inc18, label %if.then12 if.then12: ; preds = %for.body10 %num15 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 %indvars.iv67, i32 1 %57 = load i32, ptr %num15, align 4, !tbaa !5 %inc16 = add nsw i32 %57, 1 store i32 %inc16, ptr %num15, align 4, !tbaa !5 br label %for.inc18 for.inc18: ; preds = %for.body10, %if.then12 %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %58 = load i32, ptr %m, align 4, !tbaa !11 %59 = sext i32 %58 to i64 %cmp9 = icmp slt i64 %indvars.iv.next68, %59 br i1 %cmp9, label %for.body10, label %for.inc21.loopexit, !llvm.loop !12 for.inc21.loopexit: ; preds = %for.inc18 %.pre = load i32, ptr %n, align 4, !tbaa !11 br label %for.inc21 for.inc21: ; preds = %for.inc21.loopexit, %for.cond8.preheader %60 = phi i32 [ %.pre, %for.inc21.loopexit ], [ %54, %for.cond8.preheader ] %61 = phi i32 [ %58, %for.inc21.loopexit ], [ %55, %for.cond8.preheader ] %inc22 = add nuw nsw i32 %i.156, 1 %cmp6 = icmp slt i32 %inc22, %60 br i1 %cmp6, label %for.cond8.preheader, label %for.end23, !llvm.loop !14 for.end23: ; preds = %for.inc21, %vector.ph %62 = phi i32 [ %51, %vector.ph ], [ %61, %for.inc21 ] %conv = sext i32 %62 to i64 call void @qsort(ptr noundef nonnull %place, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @comp) #5 %63 = load i32, ptr %m, align 4, !tbaa !11 %cmp2558 = icmp sgt i32 %63, 1 br i1 %cmp2558, label %for.body27, label %for.end23.for.end34_crit_edge for.end23.for.end34_crit_edge: ; preds = %for.end23 %sub57 = add nsw i32 %63, -1 %.pre73 = sext i32 %sub57 to i64 br label %for.end34 for.body27: ; preds = %for.end23, %for.body27 %indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.body27 ], [ 0, %for.end23 ] %arrayidx29 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 %indvars.iv70 %64 = load i32, ptr %arrayidx29, align 8, !tbaa !10 %add = add nsw i32 %64, 1 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add) %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %65 = load i32, ptr %m, align 4, !tbaa !11 %sub = add nsw i32 %65, -1 %66 = sext i32 %sub to i64 %cmp25 = icmp slt i64 %indvars.iv.next71, %66 br i1 %cmp25, label %for.body27, label %for.end34, !llvm.loop !16 for.end34: ; preds = %for.body27, %for.end23.for.end34_crit_edge %idxprom36.pre-phi = phi i64 [ %.pre73, %for.end23.for.end34_crit_edge ], [ %66, %for.body27 ] %arrayidx37 = getelementptr inbounds [100 x %struct.place_t], ptr %place, i64 0, i64 %idxprom36.pre-phi %67 = load i32, ptr %arrayidx37, align 8, !tbaa !10 %add39 = add nsw i32 %67, 1 %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add39) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %68 = load i32, ptr %n, align 4, !tbaa !11 %cmp = icmp eq i32 %68, 0 %69 = load i32, ptr %m, align 4 %cmp1 = icmp eq i32 %69, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %vector.ph while.end: ; preds = %for.end34, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %one) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %place) #5 ret i32 0 } ; 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 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree "no-trapping-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, !7, i64 4} !6 = !{!"", !7, i64 0, !7, i64 4} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!6, !7, i64 0} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13, !15} !15 = !{!"llvm.loop.unswitch.partial.disable"} !16 = distinct !{!16, !13}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdint.h> // uint64_t #define max(a,b) ((a) > (b) ? (a) : (b)) #define min(a,b) ((a) > (b) ? (b) : (a)) int get_int(void) { int num; scanf("%d", &num); return num; } // <arr[0]> <arr[1]> .. <arr[size-1]> int fget_array(int *arr, int size) { int i; for(i = 0; i < size; i++) { scanf("%d", &arr[i]); } return 0; } struct flower { int height; int point; }; #define NUM_MAX 200000 // 262144 #define NUM2_MAX (1<<18) #define ROOT_NODE 1 struct range { int start; int end; }; int is_overlap(struct range r1, struct range r2) { return r1.end >= r2.start && r2.end >= r1.start; } int is_contain(struct range elem, struct range box) { return elem.start >= box.start && elem.end <= box.end; } int64_t get_max(int64_t* seg, struct range r, int node, struct range nr) { if(!is_overlap(r, nr)) return 0; if(is_contain(nr, r)) return seg[node]; struct range left = { nr.start, (nr.start + nr.end)/2 }; struct range right = {left.end+1, nr.end}; int64_t m1 = get_max(seg, r, node*2, left); int64_t m2 = get_max(seg, r, node*2+1, right); return max(m1, m2); } void update(int64_t *seg, int num, int idx, int64_t val) { int node = num + idx; seg[node] = val; while((node = node/2)) { seg[node] = max(seg[node*2], seg[node*2+1]); } #ifdef DEBUG int i; for(i = num; i < 2*num; i++) { printf(" %lld", seg[i]); } putchar('\n'); #endif return; } int main(void) { int num = get_int(); static int heights[NUM_MAX+1]; static int points[NUM_MAX+1]; static int64_t seg[NUM2_MAX*2]; int i; fget_array(heights, num); fget_array(points, num); int num2 = 1; // 1-indexed while(num >= num2) num2 *= 2; struct range whole = {0, num2-1}; for(i = 1; i <= num; i++) { int cur = heights[i-1]; int64_t point = points[i-1]; struct range r = {0, cur-1}; int64_t new = get_max(seg, r, ROOT_NODE, whole) + point; #ifdef DEBUG printf("%d: %lld\n", i, new); #endif if(new > seg[num2+cur]) { update(seg, num2, cur, new); } } printf("%lld\n", seg[ROOT_NODE]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125513/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125513/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @main.heights = internal global [200001 x i32] zeroinitializer, align 16 @main.points = internal global [200001 x i32] zeroinitializer, align 16 @main.seg = internal global [524288 x i64] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @get_int() local_unnamed_addr #0 { entry: %num = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #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 memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @fget_array(ptr noundef %arr, i32 noundef %size) local_unnamed_addr #0 { entry: %cmp3 = icmp sgt i32 %size, 0 br i1 %cmp3, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %size to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %entry ret i32 0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @is_overlap(i64 %r1.coerce, i64 %r2.coerce) local_unnamed_addr #3 { entry: %r1.sroa.0.0.extract.trunc = trunc i64 %r1.coerce to i32 %r1.sroa.2.0.extract.shift = lshr i64 %r1.coerce, 32 %r1.sroa.2.0.extract.trunc = trunc i64 %r1.sroa.2.0.extract.shift to i32 %r2.sroa.0.0.extract.trunc = trunc i64 %r2.coerce to i32 %r2.sroa.2.0.extract.shift = lshr i64 %r2.coerce, 32 %r2.sroa.2.0.extract.trunc = trunc i64 %r2.sroa.2.0.extract.shift to i32 %cmp = icmp sge i32 %r1.sroa.2.0.extract.trunc, %r2.sroa.0.0.extract.trunc %cmp3 = icmp sge i32 %r2.sroa.2.0.extract.trunc, %r1.sroa.0.0.extract.trunc %0 = select i1 %cmp, i1 %cmp3, i1 false %land.ext = zext i1 %0 to i32 ret i32 %land.ext } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @is_contain(i64 %elem.coerce, i64 %box.coerce) local_unnamed_addr #3 { entry: %elem.sroa.0.0.extract.trunc = trunc i64 %elem.coerce to i32 %elem.sroa.2.0.extract.shift = lshr i64 %elem.coerce, 32 %elem.sroa.2.0.extract.trunc = trunc i64 %elem.sroa.2.0.extract.shift to i32 %box.sroa.0.0.extract.trunc = trunc i64 %box.coerce to i32 %box.sroa.2.0.extract.shift = lshr i64 %box.coerce, 32 %box.sroa.2.0.extract.trunc = trunc i64 %box.sroa.2.0.extract.shift to i32 %cmp = icmp sge i32 %elem.sroa.0.0.extract.trunc, %box.sroa.0.0.extract.trunc %cmp3 = icmp sle i32 %elem.sroa.2.0.extract.trunc, %box.sroa.2.0.extract.trunc %0 = select i1 %cmp, i1 %cmp3, i1 false %land.ext = zext i1 %0 to i32 ret i32 %land.ext } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @get_max(ptr noundef readonly %seg, i64 %r.coerce, i32 noundef %node, i64 %nr.coerce) local_unnamed_addr #4 { entry: %nr.sroa.0.0.extract.trunc = trunc i64 %nr.coerce to i32 %nr.sroa.5.0.extract.shift = lshr i64 %nr.coerce, 32 %nr.sroa.5.0.extract.trunc = trunc i64 %nr.sroa.5.0.extract.shift to i32 %nr.sroa.5.0.insert.shift = and i64 %nr.coerce, -4294967296 %nr.sroa.0.0.insert.ext = and i64 %nr.coerce, 4294967295 %r1.sroa.0.0.extract.trunc.i = trunc i64 %r.coerce to i32 %r1.sroa.2.0.extract.shift.i = lshr i64 %r.coerce, 32 %r1.sroa.2.0.extract.trunc.i = trunc i64 %r1.sroa.2.0.extract.shift.i to i32 %cmp.i = icmp slt i32 %r1.sroa.2.0.extract.trunc.i, %nr.sroa.0.0.extract.trunc %cmp3.i = icmp slt i32 %nr.sroa.5.0.extract.trunc, %r1.sroa.0.0.extract.trunc.i %.not = or i1 %cmp.i, %cmp3.i br i1 %.not, label %common.ret42, label %if.end if.end: ; preds = %entry %cmp.i38 = icmp slt i32 %nr.sroa.0.0.extract.trunc, %r1.sroa.0.0.extract.trunc.i %cmp3.i39 = icmp sgt i32 %nr.sroa.5.0.extract.trunc, %r1.sroa.2.0.extract.trunc.i %.not41 = or i1 %cmp.i38, %cmp3.i39 br i1 %.not41, label %if.end4, label %if.then3 if.then3: ; preds = %if.end %idxprom = sext i32 %node to i64 %arrayidx = getelementptr inbounds i64, ptr %seg, i64 %idxprom %0 = load i64, ptr %arrayidx, align 8, !tbaa !11 br label %common.ret42 common.ret42: ; preds = %entry, %if.then3, %if.end4 %common.ret42.op = phi i64 [ %cond, %if.end4 ], [ %0, %if.then3 ], [ 0, %entry ] ret i64 %common.ret42.op if.end4: ; preds = %if.end %add = add nsw i32 %nr.sroa.5.0.extract.trunc, %nr.sroa.0.0.extract.trunc %div = sdiv i32 %add, 2 %add10 = add nsw i32 %div, 1 %mul = shl nsw i32 %node, 1 %left.sroa.4.0.insert.ext = zext i32 %div to i64 %left.sroa.4.0.insert.shift = shl nuw i64 %left.sroa.4.0.insert.ext, 32 %left.sroa.0.0.insert.insert = or i64 %left.sroa.4.0.insert.shift, %nr.sroa.0.0.insert.ext %call13 = tail call i64 @get_max(ptr noundef %seg, i64 %r.coerce, i32 noundef %mul, i64 %left.sroa.0.0.insert.insert) %add15 = or i32 %mul, 1 %right.sroa.0.0.insert.ext = zext i32 %add10 to i64 %right.sroa.0.0.insert.insert = or i64 %nr.sroa.5.0.insert.shift, %right.sroa.0.0.insert.ext %call16 = tail call i64 @get_max(ptr noundef %seg, i64 %r.coerce, i32 noundef %add15, i64 %right.sroa.0.0.insert.insert) %cond = tail call i64 @llvm.smax.i64(i64 %call13, i64 %call16) br label %common.ret42 } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @update(ptr nocapture noundef %seg, i32 noundef %num, i32 noundef %idx, i64 noundef %val) local_unnamed_addr #5 { entry: %add = add nsw i32 %idx, %num %idxprom = sext i32 %add to i64 %arrayidx = getelementptr inbounds i64, ptr %seg, i64 %idxprom store i64 %val, ptr %arrayidx, align 8, !tbaa !11 %node.0.off28 = add i32 %add, 1 %tobool.not29 = icmp ult i32 %node.0.off28, 3 br i1 %tobool.not29, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %node.030 = phi i32 [ %div, %while.body ], [ %add, %entry ] %div = sdiv i32 %node.030, 2 %mul = shl nsw i32 %div, 1 %idxprom1 = sext i32 %mul to i64 %arrayidx2 = getelementptr inbounds i64, ptr %seg, i64 %idxprom1 %0 = load i64, ptr %arrayidx2, align 8, !tbaa !11 %add4 = or i32 %mul, 1 %idxprom5 = sext i32 %add4 to i64 %arrayidx6 = getelementptr inbounds i64, ptr %seg, i64 %idxprom5 %1 = load i64, ptr %arrayidx6, align 8, !tbaa !11 %. = tail call i64 @llvm.smax.i64(i64 %0, i64 %1) %idxprom14 = sext i32 %div to i64 %arrayidx15 = getelementptr inbounds i64, ptr %seg, i64 %idxprom14 store i64 %., ptr %arrayidx15, align 8, !tbaa !11 %node.0.off = add nsw i32 %div, 1 %tobool.not = icmp ult i32 %node.0.off, 3 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %while.body, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num.i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num.i) #7 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num.i) %0 = load i32, ptr %num.i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num.i) #7 %cmp3.i = icmp sgt i32 %0, 0 br i1 %cmp3.i, label %for.body.preheader.i, label %while.cond.preheader for.body.preheader.i: ; preds = %entry %wide.trip.count.i = zext i32 %0 to i64 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ] %arrayidx.i = getelementptr inbounds i32, ptr @main.heights, i64 %indvars.iv.i %call.i31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.i) %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %for.body.i35, label %for.body.i, !llvm.loop !9 for.body.i35: ; preds = %for.body.i, %for.body.i35 %indvars.iv.i36 = phi i64 [ %indvars.iv.next.i39, %for.body.i35 ], [ 0, %for.body.i ] %arrayidx.i37 = getelementptr inbounds i32, ptr @main.points, i64 %indvars.iv.i36 %call.i38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.i37) %indvars.iv.next.i39 = add nuw nsw i64 %indvars.iv.i36, 1 %exitcond.not.i40 = icmp eq i64 %indvars.iv.next.i39, %wide.trip.count.i br i1 %exitcond.not.i40, label %while.cond.preheader, label %for.body.i35, !llvm.loop !9 while.cond.preheader: ; preds = %for.body.i35, %entry br label %while.cond while.cond: ; preds = %while.cond.preheader, %while.cond %num2.0 = phi i32 [ %mul, %while.cond ], [ 1, %while.cond.preheader ] %cmp.not = icmp slt i32 %0, %num2.0 %mul = shl nsw i32 %num2.0, 1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !14 while.end: ; preds = %while.cond %cmp3.not43 = icmp slt i32 %0, 1 br i1 %cmp3.not43, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %while.end %sub = add nsw i32 %num2.0, -1 %whole.sroa.4.0.insert.ext = zext i32 %sub to i64 %whole.sroa.4.0.insert.shift = shl nuw i64 %whole.sroa.4.0.insert.ext, 32 %1 = add nuw nsw i32 %0, 1 %wide.trip.count = zext i32 %1 to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %if.end %indvars.iv = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next, %if.end ] %2 = add nsw i64 %indvars.iv, -1 %arrayidx = getelementptr inbounds [200001 x i32], ptr @main.heights, i64 0, i64 %2 %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx7 = getelementptr inbounds [200001 x i32], ptr @main.points, i64 0, i64 %2 %4 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %conv = sext i32 %4 to i64 %sub10 = add nsw i32 %3, -1 %r.sroa.4.0.insert.ext = zext i32 %sub10 to i64 %r.sroa.4.0.insert.shift = shl nuw i64 %r.sroa.4.0.insert.ext, 32 %call11 = call i64 @get_max(ptr noundef nonnull @main.seg, i64 %r.sroa.4.0.insert.shift, i32 noundef 1, i64 %whole.sroa.4.0.insert.shift) %add = add nsw i64 %call11, %conv %add12 = add nsw i32 %3, %num2.0 %idxprom13 = sext i32 %add12 to i64 %arrayidx14 = getelementptr inbounds [524288 x i64], ptr @main.seg, i64 0, i64 %idxprom13 %5 = load i64, ptr %arrayidx14, align 8, !tbaa !11 %cmp15 = icmp sgt i64 %add, %5 br i1 %cmp15, label %if.then, label %if.end if.then: ; preds = %for.body store i64 %add, ptr %arrayidx14, align 8, !tbaa !11 %node.0.off28.i = add i32 %add12, 1 %tobool.not29.i = icmp ult i32 %node.0.off28.i, 3 br i1 %tobool.not29.i, label %if.end, label %while.body.i while.body.i: ; preds = %if.then, %while.body.i %node.030.i = phi i32 [ %div.i, %while.body.i ], [ %add12, %if.then ] %div.i = sdiv i32 %node.030.i, 2 %mul.i = shl nsw i32 %div.i, 1 %idxprom1.i = sext i32 %mul.i to i64 %arrayidx2.i = getelementptr inbounds i64, ptr @main.seg, i64 %idxprom1.i %6 = load i64, ptr %arrayidx2.i, align 16, !tbaa !11 %add4.i = or i32 %mul.i, 1 %idxprom5.i = sext i32 %add4.i to i64 %arrayidx6.i = getelementptr inbounds i64, ptr @main.seg, i64 %idxprom5.i %7 = load i64, ptr %arrayidx6.i, align 8, !tbaa !11 %..i = call i64 @llvm.smax.i64(i64 %6, i64 %7) %idxprom14.i = sext i32 %div.i to i64 %arrayidx15.i = getelementptr inbounds i64, ptr @main.seg, i64 %idxprom14.i store i64 %..i, ptr %arrayidx15.i, align 8, !tbaa !11 %node.0.off.i = add nsw i32 %div.i, 1 %tobool.not.i = icmp ult i32 %node.0.off.i, 3 br i1 %tobool.not.i, label %if.end, label %while.body.i, !llvm.loop !13 if.end: ; preds = %while.body.i, %if.then, %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !15 for.end: ; preds = %if.end, %while.end %8 = load i64, ptr getelementptr inbounds ([524288 x i64], ptr @main.seg, i64 0, i64 1), align 8, !tbaa !11 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %8) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree 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 #4 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"long", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include<stdio.h> int main(void) { int n,m; int i,j; int max,c,cnt[1001]; int a[1001],b[1001]; max=0; scanf("%d %d",&n,&m); for(i=0;i<n;i++){ cnt[i]=0; scanf("%d",&a[i]); } for(i=0;i<m;i++){ scanf("%d",&b[i]); } for(i=0;i<m;i++){ for(j=0;j<n;j++){ if(b[i]>=a[j]){ cnt[j]++; break; } } } for(i=0;i<n;i++){ if(max<cnt[i]){ max=cnt[i]; c=i+1; } } printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125564/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125564/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %cnt = alloca [1001 x i32], align 16 %a = alloca [1001 x i32], align 16 %b = alloca [1001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %cnt) #5 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp65 = icmp sgt i32 %0, 0 br i1 %cmp65, label %for.body, label %for.cond4.preheader for.cond4.preheader: ; preds = %for.body, %entry %.pre100 = phi i32 [ %0, %entry ], [ %2, %for.body ] %1 = load i32, ptr %m, align 4, !tbaa !5 %cmp567 = icmp sgt i32 %1, 0 br i1 %cmp567, label %for.body6, label %for.cond33.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv store i32 0, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx2) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.cond13.preheader: ; preds = %for.body6 %.pre.pre = load i32, ptr %n, align 4, !tbaa !5 %cmp1471 = icmp sgt i32 %7, 0 %cmp1769 = icmp sgt i32 %.pre.pre, 0 %or.cond = select i1 %cmp1471, i1 %cmp1769, i1 false br i1 %or.cond, label %for.cond16.preheader.us.preheader, label %for.cond33.preheader for.cond16.preheader.us.preheader: ; preds = %for.cond13.preheader %wide.trip.count92 = zext i32 %7 to i64 %wide.trip.count = zext i32 %.pre.pre to i64 br label %for.cond16.preheader.us for.cond16.preheader.us: ; preds = %for.cond16.preheader.us.preheader, %for.inc30.us %indvars.iv89 = phi i64 [ 0, %for.cond16.preheader.us.preheader ], [ %indvars.iv.next90, %for.inc30.us ] %arrayidx20.us = getelementptr inbounds [1001 x i32], ptr %b, i64 0, i64 %indvars.iv89 %4 = load i32, ptr %arrayidx20.us, align 4, !tbaa !5 br label %for.body18.us for.cond16.us: ; preds = %for.body18.us %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %exitcond.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count br i1 %exitcond.not, label %for.inc30.us, label %for.body18.us, !llvm.loop !11 for.body18.us: ; preds = %for.cond16.preheader.us, %for.cond16.us %indvars.iv86 = phi i64 [ 0, %for.cond16.preheader.us ], [ %indvars.iv.next87, %for.cond16.us ] %arrayidx22.us = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv86 %5 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5 %cmp23.not.us = icmp slt i32 %4, %5 br i1 %cmp23.not.us, label %for.cond16.us, label %if.then.us if.then.us: ; preds = %for.body18.us %arrayidx25.us = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv86 %6 = load i32, ptr %arrayidx25.us, align 4, !tbaa !5 %inc26.us = add nsw i32 %6, 1 store i32 %inc26.us, ptr %arrayidx25.us, align 4, !tbaa !5 br label %for.inc30.us for.inc30.us: ; preds = %for.cond16.us, %if.then.us %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1 %exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92 br i1 %exitcond93.not, label %for.cond33.preheader, label %for.cond16.preheader.us, !llvm.loop !12 for.body6: ; preds = %for.cond4.preheader, %for.body6 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body6 ], [ 0, %for.cond4.preheader ] %arrayidx8 = getelementptr inbounds [1001 x i32], ptr %b, i64 0, i64 %indvars.iv83 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8) %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %7 = load i32, ptr %m, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp5 = icmp slt i64 %indvars.iv.next84, %8 br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !13 for.cond33.preheader: ; preds = %for.inc30.us, %for.cond4.preheader, %for.cond13.preheader %.pre104 = phi i32 [ %.pre.pre, %for.cond13.preheader ], [ %.pre100, %for.cond4.preheader ], [ %.pre.pre, %for.inc30.us ] %cmp3474 = icmp sgt i32 %.pre104, 0 call void @llvm.assume(i1 %cmp3474) %wide.trip.count97 = zext i32 %.pre104 to i64 %xtraiter = and i64 %wide.trip.count97, 3 %9 = icmp ult i32 %.pre104, 4 br i1 %9, label %for.end45.unr-lcssa, label %for.cond33.preheader.new for.cond33.preheader.new: ; preds = %for.cond33.preheader %unroll_iter = and i64 %wide.trip.count97, 2147483644 br label %for.body35 for.body35: ; preds = %for.body35, %for.cond33.preheader.new %indvars.iv94 = phi i64 [ 0, %for.cond33.preheader.new ], [ %indvars.iv.next95.3, %for.body35 ] %c.077 = phi i32 [ undef, %for.cond33.preheader.new ], [ %spec.select64.3, %for.body35 ] %max.076 = phi i32 [ 0, %for.cond33.preheader.new ], [ %spec.select.3, %for.body35 ] %niter = phi i64 [ 0, %for.cond33.preheader.new ], [ %niter.next.3, %for.body35 ] %arrayidx37 = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv94 %10 = load i32, ptr %arrayidx37, align 16, !tbaa !5 %cmp38 = icmp slt i32 %max.076, %10 %indvars.iv.next95 = or i64 %indvars.iv94, 1 %spec.select = call i32 @llvm.smax.i32(i32 %max.076, i32 %10) %11 = trunc i64 %indvars.iv.next95 to i32 %spec.select64 = select i1 %cmp38, i32 %11, i32 %c.077 %arrayidx37.1 = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv.next95 %12 = load i32, ptr %arrayidx37.1, align 4, !tbaa !5 %cmp38.1 = icmp slt i32 %spec.select, %12 %indvars.iv.next95.1 = or i64 %indvars.iv94, 2 %spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %12) %13 = trunc i64 %indvars.iv.next95.1 to i32 %spec.select64.1 = select i1 %cmp38.1, i32 %13, i32 %spec.select64 %arrayidx37.2 = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv.next95.1 %14 = load i32, ptr %arrayidx37.2, align 8, !tbaa !5 %cmp38.2 = icmp slt i32 %spec.select.1, %14 %indvars.iv.next95.2 = or i64 %indvars.iv94, 3 %spec.select.2 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 %14) %15 = trunc i64 %indvars.iv.next95.2 to i32 %spec.select64.2 = select i1 %cmp38.2, i32 %15, i32 %spec.select64.1 %arrayidx37.3 = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv.next95.2 %16 = load i32, ptr %arrayidx37.3, align 4, !tbaa !5 %cmp38.3 = icmp slt i32 %spec.select.2, %16 %indvars.iv.next95.3 = add nuw nsw i64 %indvars.iv94, 4 %spec.select.3 = call i32 @llvm.smax.i32(i32 %spec.select.2, i32 %16) %17 = trunc i64 %indvars.iv.next95.3 to i32 %spec.select64.3 = select i1 %cmp38.3, i32 %17, i32 %spec.select64.2 %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.end45.unr-lcssa, label %for.body35, !llvm.loop !14 for.end45.unr-lcssa: ; preds = %for.body35, %for.cond33.preheader %indvars.iv94.unr = phi i64 [ 0, %for.cond33.preheader ], [ %indvars.iv.next95.3, %for.body35 ] %c.077.unr = phi i32 [ undef, %for.cond33.preheader ], [ %spec.select64.3, %for.body35 ] %max.076.unr = phi i32 [ 0, %for.cond33.preheader ], [ %spec.select.3, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end45, label %for.body35.epil for.body35.epil: ; preds = %for.end45.unr-lcssa, %for.body35.epil %indvars.iv94.epil = phi i64 [ %indvars.iv.next95.epil, %for.body35.epil ], [ %indvars.iv94.unr, %for.end45.unr-lcssa ] %c.077.epil = phi i32 [ %spec.select64.epil, %for.body35.epil ], [ %c.077.unr, %for.end45.unr-lcssa ] %max.076.epil = phi i32 [ %spec.select.epil, %for.body35.epil ], [ %max.076.unr, %for.end45.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body35.epil ], [ 0, %for.end45.unr-lcssa ] %arrayidx37.epil = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv94.epil %18 = load i32, ptr %arrayidx37.epil, align 4, !tbaa !5 %cmp38.epil = icmp slt i32 %max.076.epil, %18 %indvars.iv.next95.epil = add nuw nsw i64 %indvars.iv94.epil, 1 %spec.select.epil = call i32 @llvm.smax.i32(i32 %max.076.epil, i32 %18) %19 = trunc i64 %indvars.iv.next95.epil to i32 %spec.select64.epil = select i1 %cmp38.epil, i32 %19, i32 %c.077.epil %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.end45, label %for.body35.epil, !llvm.loop !15 for.end45: ; preds = %for.body35.epil, %for.end45.unr-lcssa %spec.select64.lcssa = phi i32 [ %c.077.unr, %for.end45.unr-lcssa ], [ %spec.select64.epil, %for.body35.epil ] %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select64.lcssa) call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %cnt) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> #include <stdbool.h> int main(void) { int i, j, tikaA, tikaB; int N, M, A[1001], B[1001], na[1001]; scanf("%d%d", &N, &M); for (i=0; i < N ;i++) { scanf("%d", &A[i]); na[i] = 0; } for (i=0; i < M ;i++) { scanf("%d", &B[i]); } for (i=0; i < M ;i++) { for (j=0; j < N ;j++) { if (B[i] >= A[j]) break; } na[j]++; } tikaA = 0, tikaB = na[0]; for (i=0; i < N ;i++) { if (tikaB < na[i]) { tikaA = i; tikaB = na[i]; } } printf("%d\n", tikaA+1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125614/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125614/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %A = alloca [1001 x i32], align 16 %B = alloca [1001 x i32], align 16 %na = alloca [1001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %B) #4 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %na) #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 %cmp66 = icmp sgt i32 %0, 0 br i1 %cmp66, label %for.body, label %for.cond4.preheader for.cond4.preheader: ; preds = %for.body, %entry %.pre100 = phi i32 [ %0, %entry ], [ %2, %for.body ] %1 = load i32, ptr %M, align 4, !tbaa !5 %cmp568 = icmp sgt i32 %1, 0 br i1 %cmp568, label %for.body6, label %for.end32 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1001 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %arrayidx3 = getelementptr inbounds [1001 x i32], ptr %na, i64 0, i64 %indvars.iv store i32 0, ptr %arrayidx3, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %N, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.cond13.preheader: ; preds = %for.body6 %.pre.pre = load i32, ptr %N, align 4, !tbaa !5 %cmp1474 = icmp sgt i32 %7, 0 br i1 %cmp1474, label %for.cond16.preheader.lr.ph, label %for.end32 for.cond16.preheader.lr.ph: ; preds = %for.cond13.preheader %cmp1770 = icmp sgt i32 %.pre.pre, 0 br i1 %cmp1770, label %for.cond16.preheader.us.preheader, label %for.end46 for.cond16.preheader.us.preheader: ; preds = %for.cond16.preheader.lr.ph %wide.trip.count92 = zext i32 %7 to i64 %wide.trip.count = zext i32 %.pre.pre to i64 br label %for.cond16.preheader.us for.cond16.preheader.us: ; preds = %for.cond16.preheader.us.preheader, %for.end26.us %indvars.iv89 = phi i64 [ 0, %for.cond16.preheader.us.preheader ], [ %indvars.iv.next90, %for.end26.us ] %arrayidx20.us = getelementptr inbounds [1001 x i32], ptr %B, i64 0, i64 %indvars.iv89 %4 = load i32, ptr %arrayidx20.us, align 4, !tbaa !5 br label %for.body18.us for.body18.us: ; preds = %for.cond16.preheader.us, %for.inc24.us %indvars.iv86 = phi i64 [ 0, %for.cond16.preheader.us ], [ %indvars.iv.next87, %for.inc24.us ] %arrayidx22.us = getelementptr inbounds [1001 x i32], ptr %A, i64 0, i64 %indvars.iv86 %5 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5 %cmp23.not.us = icmp slt i32 %4, %5 br i1 %cmp23.not.us, label %for.inc24.us, label %for.body18.us.for.end26.us_crit_edge for.body18.us.for.end26.us_crit_edge: ; preds = %for.body18.us %.pre101 = and i64 %indvars.iv86, 4294967295 br label %for.end26.us for.end26.us: ; preds = %for.inc24.us, %for.body18.us.for.end26.us_crit_edge %idxprom27.us.pre-phi = phi i64 [ %.pre101, %for.body18.us.for.end26.us_crit_edge ], [ %wide.trip.count, %for.inc24.us ] %arrayidx28.us = getelementptr inbounds [1001 x i32], ptr %na, i64 0, i64 %idxprom27.us.pre-phi %6 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5 %inc29.us = add nsw i32 %6, 1 store i32 %inc29.us, ptr %arrayidx28.us, align 4, !tbaa !5 %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1 %exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92 br i1 %exitcond93.not, label %for.end32, label %for.cond16.preheader.us, !llvm.loop !11 for.inc24.us: ; preds = %for.body18.us %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %exitcond.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count br i1 %exitcond.not, label %for.end26.us, label %for.body18.us, !llvm.loop !12 for.body6: ; preds = %for.cond4.preheader, %for.body6 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body6 ], [ 0, %for.cond4.preheader ] %arrayidx8 = getelementptr inbounds [1001 x i32], ptr %B, i64 0, i64 %indvars.iv83 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8) %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %7 = load i32, ptr %M, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp5 = icmp slt i64 %indvars.iv.next84, %8 br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !13 for.end32: ; preds = %for.end26.us, %for.cond4.preheader, %for.cond13.preheader %.pre105 = phi i32 [ %.pre.pre, %for.cond13.preheader ], [ %.pre100, %for.cond4.preheader ], [ %.pre.pre, %for.end26.us ] %cmp3576 = icmp sgt i32 %.pre105, 0 br i1 %cmp3576, label %for.body36.preheader, label %for.end46 for.body36.preheader: ; preds = %for.end32 %9 = load i32, ptr %na, align 16, !tbaa !5 %wide.trip.count97 = zext i32 %.pre105 to i64 %xtraiter = and i64 %wide.trip.count97, 3 %10 = icmp ult i32 %.pre105, 4 br i1 %10, label %for.end46.loopexit.unr-lcssa, label %for.body36.preheader.new for.body36.preheader.new: ; preds = %for.body36.preheader %unroll_iter = and i64 %wide.trip.count97, 4294967292 br label %for.body36 for.body36: ; preds = %for.body36, %for.body36.preheader.new %indvars.iv94 = phi i64 [ 0, %for.body36.preheader.new ], [ %indvars.iv.next95.3, %for.body36 ] %tikaB.079 = phi i32 [ %9, %for.body36.preheader.new ], [ %spec.select65.3, %for.body36 ] %tikaA.078 = phi i32 [ 0, %for.body36.preheader.new ], [ %spec.select.3, %for.body36 ] %niter = phi i64 [ 0, %for.body36.preheader.new ], [ %niter.next.3, %for.body36 ] %arrayidx38 = getelementptr inbounds [1001 x i32], ptr %na, i64 0, i64 %indvars.iv94 %11 = load i32, ptr %arrayidx38, align 16, !tbaa !5 %cmp39 = icmp slt i32 %tikaB.079, %11 %12 = trunc i64 %indvars.iv94 to i32 %spec.select = select i1 %cmp39, i32 %12, i32 %tikaA.078 %spec.select65 = call i32 @llvm.smax.i32(i32 %tikaB.079, i32 %11) %indvars.iv.next95 = or i64 %indvars.iv94, 1 %arrayidx38.1 = getelementptr inbounds [1001 x i32], ptr %na, i64 0, i64 %indvars.iv.next95 %13 = load i32, ptr %arrayidx38.1, align 4, !tbaa !5 %cmp39.1 = icmp slt i32 %spec.select65, %13 %14 = trunc i64 %indvars.iv.next95 to i32 %spec.select.1 = select i1 %cmp39.1, i32 %14, i32 %spec.select %spec.select65.1 = call i32 @llvm.smax.i32(i32 %spec.select65, i32 %13) %indvars.iv.next95.1 = or i64 %indvars.iv94, 2 %arrayidx38.2 = getelementptr inbounds [1001 x i32], ptr %na, i64 0, i64 %indvars.iv.next95.1 %15 = load i32, ptr %arrayidx38.2, align 8, !tbaa !5 %cmp39.2 = icmp slt i32 %spec.select65.1, %15 %16 = trunc i64 %indvars.iv.next95.1 to i32 %spec.select.2 = select i1 %cmp39.2, i32 %16, i32 %spec.select.1 %spec.select65.2 = call i32 @llvm.smax.i32(i32 %spec.select65.1, i32 %15) %indvars.iv.next95.2 = or i64 %indvars.iv94, 3 %arrayidx38.3 = getelementptr inbounds [1001 x i32], ptr %na, i64 0, i64 %indvars.iv.next95.2 %17 = load i32, ptr %arrayidx38.3, align 4, !tbaa !5 %cmp39.3 = icmp slt i32 %spec.select65.2, %17 %18 = trunc i64 %indvars.iv.next95.2 to i32 %spec.select.3 = select i1 %cmp39.3, i32 %18, i32 %spec.select.2 %spec.select65.3 = call i32 @llvm.smax.i32(i32 %spec.select65.2, i32 %17) %indvars.iv.next95.3 = add nuw nsw i64 %indvars.iv94, 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.end46.loopexit.unr-lcssa, label %for.body36, !llvm.loop !14 for.end46.loopexit.unr-lcssa: ; preds = %for.body36, %for.body36.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body36.preheader ], [ %spec.select.3, %for.body36 ] %indvars.iv94.unr = phi i64 [ 0, %for.body36.preheader ], [ %indvars.iv.next95.3, %for.body36 ] %tikaB.079.unr = phi i32 [ %9, %for.body36.preheader ], [ %spec.select65.3, %for.body36 ] %tikaA.078.unr = phi i32 [ 0, %for.body36.preheader ], [ %spec.select.3, %for.body36 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end46.loopexit, label %for.body36.epil for.body36.epil: ; preds = %for.end46.loopexit.unr-lcssa, %for.body36.epil %indvars.iv94.epil = phi i64 [ %indvars.iv.next95.epil, %for.body36.epil ], [ %indvars.iv94.unr, %for.end46.loopexit.unr-lcssa ] %tikaB.079.epil = phi i32 [ %spec.select65.epil, %for.body36.epil ], [ %tikaB.079.unr, %for.end46.loopexit.unr-lcssa ] %tikaA.078.epil = phi i32 [ %spec.select.epil, %for.body36.epil ], [ %tikaA.078.unr, %for.end46.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body36.epil ], [ 0, %for.end46.loopexit.unr-lcssa ] %arrayidx38.epil = getelementptr inbounds [1001 x i32], ptr %na, i64 0, i64 %indvars.iv94.epil %19 = load i32, ptr %arrayidx38.epil, align 4, !tbaa !5 %cmp39.epil = icmp slt i32 %tikaB.079.epil, %19 %20 = trunc i64 %indvars.iv94.epil to i32 %spec.select.epil = select i1 %cmp39.epil, i32 %20, i32 %tikaA.078.epil %spec.select65.epil = call i32 @llvm.smax.i32(i32 %tikaB.079.epil, i32 %19) %indvars.iv.next95.epil = add nuw nsw i64 %indvars.iv94.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.end46.loopexit, label %for.body36.epil, !llvm.loop !15 for.end46.loopexit: ; preds = %for.body36.epil, %for.end46.loopexit.unr-lcssa %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body36.epil ] %21 = add nsw i32 %spec.select.lcssa, 1 br label %for.end46 for.end46: ; preds = %for.cond16.preheader.lr.ph, %for.end46.loopexit, %for.end32 %tikaA.0.lcssa = phi i32 [ 1, %for.end32 ], [ %21, %for.end46.loopexit ], [ 1, %for.cond16.preheader.lr.ph ] %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %tikaA.0.lcssa) call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %na) #4 call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.unroll.disable"}
#include<stdio.h> #include<math.h> int main() { long long int n,k,x,i,j; scanf("%I64d %I64d",&n,&k); j=sqrt(k); for(i=j;i<n+1;i++) { x=(i*(i+1))/2-(n-i); if(x==k) break; } printf("%I64d\n",n-i); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12568/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12568/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%I64d %I64d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%I64d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %k = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i64, ptr %k, align 8, !tbaa !5 %conv = sitofp i64 %0 to double %call1 = call double @sqrt(double noundef %conv) #4 %conv2 = fptosi double %call1 to i64 %1 = load i64, ptr %n, align 8, !tbaa !5 %2 = load i64, ptr %k, align 8 br label %for.cond for.cond: ; preds = %for.body, %entry %i.0 = phi i64 [ %conv2, %entry ], [ %add4, %for.body ] %cmp.not = icmp sgt i64 %i.0, %1 br i1 %cmp.not, label %for.end, label %for.body for.body: ; preds = %for.cond %add4 = add nsw i64 %i.0, 1 %mul = mul nsw i64 %add4, %i.0 %div = sdiv i64 %mul, 2 %sub.neg = sub i64 %i.0, %1 %sub5 = add i64 %sub.neg, %div %cmp6 = icmp eq i64 %sub5, %2 br i1 %cmp6, label %for.end, label %for.cond, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond %sub8 = sub nsw i64 %1, %i.0 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub8) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ char a[1010]; int i; fgets(a,1001,stdin); for(i=0;a[i]!='\0';i++){ if(a[i]=='p'&&a[i+1]=='e'&&a[i+2]=='a'&&a[i+3]=='c'&&a[i+4]=='h'){ a[i]='a'; a[i+1]='p'; a[i+2]='p'; a[i+3]='l'; a[i+4]='e'; } else if(a[i]=='a'&&a[i+1]=='p'&&a[i+2]=='p'&&a[i+3]=='l'&&a[i+4]=='e'){ a[i]='p'; a[i+1]='e'; a[i+2]='a'; a[i+3]='c'; a[i+4]='h'; } } printf("%s",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125737/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125737/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [1010 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1010, ptr nonnull %a) #3 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %a, i32 noundef 1001, ptr noundef %0) br label %for.cond for.cond: ; preds = %for.cond.backedge, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.be, %for.cond.backedge ] %arrayidx = getelementptr inbounds [1010 x i8], ptr %a, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 switch i8 %1, label %for.cond.for.inc_crit_edge [ i8 0, label %for.end i8 112, label %land.lhs.true i8 97, label %land.lhs.true52 ] for.cond.for.inc_crit_edge: ; preds = %for.cond %.pre = add nuw i64 %indvars.iv, 1 br label %for.cond.backedge for.cond.backedge: ; preds = %for.cond.for.inc_crit_edge, %land.lhs.true, %land.lhs.true12, %land.lhs.true19, %land.lhs.true26, %if.then, %if.then80, %land.lhs.true73, %land.lhs.true66, %land.lhs.true59, %land.lhs.true52 %indvars.iv.be = phi i64 [ %.pre, %for.cond.for.inc_crit_edge ], [ %2, %land.lhs.true ], [ %2, %land.lhs.true12 ], [ %2, %land.lhs.true19 ], [ %2, %land.lhs.true26 ], [ %2, %if.then ], [ %10, %if.then80 ], [ %10, %land.lhs.true73 ], [ %10, %land.lhs.true66 ], [ %10, %land.lhs.true59 ], [ %10, %land.lhs.true52 ] br label %for.cond, !llvm.loop !10 land.lhs.true: ; preds = %for.cond %2 = add nuw i64 %indvars.iv, 1 %arrayidx8 = getelementptr inbounds [1010 x i8], ptr %a, i64 0, i64 %2 %3 = load i8, ptr %arrayidx8, align 1, !tbaa !9 %cmp10 = icmp eq i8 %3, 101 br i1 %cmp10, label %land.lhs.true12, label %for.cond.backedge land.lhs.true12: ; preds = %land.lhs.true %4 = add nuw nsw i64 %indvars.iv, 2 %arrayidx15 = getelementptr inbounds [1010 x i8], ptr %a, i64 0, i64 %4 %5 = load i8, ptr %arrayidx15, align 1, !tbaa !9 %cmp17 = icmp eq i8 %5, 97 br i1 %cmp17, label %land.lhs.true19, label %for.cond.backedge land.lhs.true19: ; preds = %land.lhs.true12 %6 = add nuw nsw i64 %indvars.iv, 3 %arrayidx22 = getelementptr inbounds [1010 x i8], ptr %a, i64 0, i64 %6 %7 = load i8, ptr %arrayidx22, align 1, !tbaa !9 %cmp24 = icmp eq i8 %7, 99 br i1 %cmp24, label %land.lhs.true26, label %for.cond.backedge land.lhs.true26: ; preds = %land.lhs.true19 %8 = add nuw nsw i64 %indvars.iv, 4 %arrayidx29 = getelementptr inbounds [1010 x i8], ptr %a, i64 0, i64 %8 %9 = load i8, ptr %arrayidx29, align 1, !tbaa !9 %cmp31 = icmp eq i8 %9, 104 br i1 %cmp31, label %if.then, label %for.cond.backedge if.then: ; preds = %land.lhs.true26 store <4 x i8> <i8 97, i8 112, i8 112, i8 108>, ptr %arrayidx, align 1, !tbaa !9 store i8 101, ptr %arrayidx29, align 1, !tbaa !9 br label %for.cond.backedge land.lhs.true52: ; preds = %for.cond %10 = add nuw i64 %indvars.iv, 1 %arrayidx55 = getelementptr inbounds [1010 x i8], ptr %a, i64 0, i64 %10 %11 = load i8, ptr %arrayidx55, align 1, !tbaa !9 %cmp57 = icmp eq i8 %11, 112 br i1 %cmp57, label %land.lhs.true59, label %for.cond.backedge land.lhs.true59: ; preds = %land.lhs.true52 %12 = add nuw nsw i64 %indvars.iv, 2 %arrayidx62 = getelementptr inbounds [1010 x i8], ptr %a, i64 0, i64 %12 %13 = load i8, ptr %arrayidx62, align 1, !tbaa !9 %cmp64 = icmp eq i8 %13, 112 br i1 %cmp64, label %land.lhs.true66, label %for.cond.backedge land.lhs.true66: ; preds = %land.lhs.true59 %14 = add nuw nsw i64 %indvars.iv, 3 %arrayidx69 = getelementptr inbounds [1010 x i8], ptr %a, i64 0, i64 %14 %15 = load i8, ptr %arrayidx69, align 1, !tbaa !9 %cmp71 = icmp eq i8 %15, 108 br i1 %cmp71, label %land.lhs.true73, label %for.cond.backedge land.lhs.true73: ; preds = %land.lhs.true66 %16 = add nuw nsw i64 %indvars.iv, 4 %arrayidx76 = getelementptr inbounds [1010 x i8], ptr %a, i64 0, i64 %16 %17 = load i8, ptr %arrayidx76, align 1, !tbaa !9 %cmp78 = icmp eq i8 %17, 101 br i1 %cmp78, label %if.then80, label %for.cond.backedge if.then80: ; preds = %land.lhs.true73 store <4 x i8> <i8 112, i8 101, i8 97, i8 99>, ptr %arrayidx, align 1, !tbaa !9 store i8 104, ptr %arrayidx76, align 1, !tbaa !9 br label %for.cond.backedge for.end: ; preds = %for.cond %call97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %a) call void @llvm.lifetime.end.p0(i64 1010, 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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(void){ char s[100]; scanf("%s",s); for(int i=0;s[i]!='\0';i++){ if(i%2==0){ if(s[i]!='h'){printf("No\n");return 0;} } else{ if(s[i]!='i'){printf("No\n");return 0;} } if(s[i]!='h'&&s[i]!='i'){printf("No\n");return 0;} if(s[strlen(s)-1]!='i'){printf("No\n");return 0;} } printf("Yes\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125823/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125823/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.5 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.6 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not55 = icmp eq i8 %0, 0 br i1 %cmp.not55, label %cleanup43, label %for.body for.cond: ; preds = %if.end32 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv.next %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %1, 0 br i1 %cmp.not, label %cleanup43, label %for.body, !llvm.loop !8 for.body: ; preds = %entry, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %2 = phi i8 [ %1, %for.cond ], [ %0, %entry ] %rem57 = and i64 %indvars.iv, 1 %cmp2 = icmp eq i64 %rem57, 0 br i1 %cmp2, label %if.then, label %if.else if.then: ; preds = %for.body %cmp7.not = icmp eq i8 %2, 104 br i1 %cmp7.not, label %if.end32, label %cleanup43 if.else: ; preds = %for.body %cmp14.not = icmp eq i8 %2, 105 br i1 %cmp14.not, label %if.end32, label %cleanup43 if.end32: ; preds = %if.then, %if.else %call34 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %sub = add i64 %call34, -1 %arrayidx35 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %sub %3 = load i8, ptr %arrayidx35, align 1, !tbaa !5 %cmp37.not = icmp eq i8 %3, 105 br i1 %cmp37.not, label %for.cond, label %cleanup43 cleanup43: ; preds = %for.cond, %if.end32, %if.else, %if.then, %entry %str.5.sink = phi ptr [ @str.6, %entry ], [ @str.5, %if.then ], [ @str.5, %if.else ], [ @str.5, %if.end32 ], [ @str.6, %for.cond ] %puts53 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main(){ char s[99]; scanf("%s",s); int n = strlen(s),i; int x = 1; if(n%2!=0){ printf("No"); return 0; } for(i = 0; i < n; i++){ if((i+1)%2==1 && s[i]!='h'){ x = 0; break; }else if((i+1)%2==0 && s[i]!= 'i'){ x = 0; break; } } if(x == 0){ printf("No"); }else{ printf("Yes"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125867/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125867/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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: %s = alloca [99 x i8], align 16 call void @llvm.lifetime.start.p0(i64 99, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5 %conv = trunc i64 %call2 to i32 %0 = and i32 %conv, 1 %cmp.not = icmp eq i32 %0, 0 br i1 %cmp.not, label %for.cond.preheader, label %cleanup for.cond.preheader: ; preds = %entry %cmp543 = icmp sgt i32 %conv, 0 br i1 %cmp543, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = and i64 %call2, 4294967295 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %rem746 = and i64 %indvars.iv.next, 1 %cond = icmp eq i64 %rem746, 0 %arrayidx20 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx20, align 1, !tbaa !5 br i1 %cond, label %land.lhs.true18, label %land.lhs.true land.lhs.true: ; preds = %for.body %cmp11.not = icmp eq i8 %1, 104 br i1 %cmp11.not, label %for.inc, label %cleanup land.lhs.true18: ; preds = %for.body %cmp22.not = icmp eq i8 %1, 105 br i1 %cmp22.not, label %for.inc, label %cleanup for.inc: ; preds = %land.lhs.true, %land.lhs.true18 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !8 cleanup: ; preds = %for.inc, %land.lhs.true18, %land.lhs.true, %for.cond.preheader, %entry %.str.1.sink = phi ptr [ @.str.1, %entry ], [ @.str.2, %for.cond.preheader ], [ @.str.1, %land.lhs.true ], [ @.str.1, %land.lhs.true18 ], [ @.str.2, %for.inc ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 99, 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 nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main() { char s[20]; scanf("%s", s); int i, n = strlen(s); if (n % 2 > 0) { printf("No\n"); return 0; } for (i = 0; i < n; i++) { if (i % 2 > 0) { if (s[i] != 'i') { printf("No\n"); return 0; } } else { if (s[i] != 'h') { printf("No\n"); return 0; } } } printf("Yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125924/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125924/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.5 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call2 to i32 %0 = and i32 %conv, -2147483647 %cmp = icmp eq i32 %0, 1 br i1 %cmp, label %cleanup, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp537 = icmp sgt i32 %conv, 0 br i1 %cmp537, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = and i64 %call2, 4294967295 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %rem740 = and i64 %indvars.iv, 1 %cmp8.not = icmp eq i64 %rem740, 0 %arrayidx18 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx18, align 1, !tbaa !5 br i1 %cmp8.not, label %if.else, label %if.then10 if.then10: ; preds = %for.body %cmp12.not = icmp eq i8 %1, 105 br i1 %cmp12.not, label %for.inc, label %cleanup if.else: ; preds = %for.body %cmp20.not = icmp eq i8 %1, 104 br i1 %cmp20.not, label %for.inc, label %cleanup for.inc: ; preds = %if.then10, %if.else %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !8 cleanup: ; preds = %for.inc, %if.else, %if.then10, %for.cond.preheader, %entry %str.sink = phi ptr [ @str.5, %entry ], [ @str, %for.cond.preheader ], [ @str.5, %if.then10 ], [ @str.5, %if.else ], [ @str, %for.inc ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int N,Y,SEN,GOSEN,MAN,BOOL=0,i,j,k; scanf("%d %d",&N,&Y); for(i=0;i<=N;i++) { for(j=0;j<=N;j++) { k=N-(i+j); if(k>=0&&i+j+k==N&&10000*k+5000*j+1000*i==Y) { MAN=k; GOSEN=j; SEN=i; BOOL=1; break; } } } if(BOOL==1){printf("%d %d %d",MAN,GOSEN,SEN);} else printf("-1 -1 -1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125968/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125968/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %Y = 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 %Y) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Y) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not44 = icmp slt i32 %0, 0 br i1 %cmp.not44, label %if.else, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %Y, align 4 br label %for.cond1.preheader.outer for.cond1.preheader.outer: ; preds = %for.inc14.thread, %for.cond1.preheader.lr.ph %SEN.049.ph = phi i32 [ %i.048, %for.inc14.thread ], [ undef, %for.cond1.preheader.lr.ph ] %i.048.ph = phi i32 [ %inc1566, %for.inc14.thread ], [ 0, %for.cond1.preheader.lr.ph ] %2 = phi i1 [ true, %for.inc14.thread ], [ false, %for.cond1.preheader.lr.ph ] %MAN.046.ph = phi i32 [ %sub, %for.inc14.thread ], [ undef, %for.cond1.preheader.lr.ph ] %GOSEN.045.ph = phi i32 [ %j.036, %for.inc14.thread ], [ undef, %for.cond1.preheader.lr.ph ] br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.outer, %for.inc14 %i.048 = phi i32 [ %inc15, %for.inc14 ], [ %i.048.ph, %for.cond1.preheader.outer ] %mul11 = mul nsw i32 %i.048, 1000 br label %for.body3 for.body3: ; preds = %for.cond1.preheader, %for.inc %j.036 = phi i32 [ 0, %for.cond1.preheader ], [ %inc, %for.inc ] %3 = add nuw i32 %i.048, %j.036 %sub = sub i32 %0, %3 %cmp4 = icmp sgt i32 %sub, -1 br i1 %cmp4, label %land.lhs.true8, label %for.inc land.lhs.true8: ; preds = %for.body3 %mul = mul nsw i32 %sub, 10000 %mul9 = mul nsw i32 %j.036, 5000 %add10 = add nuw i32 %mul9, %mul11 %add12 = add i32 %add10, %mul %cmp13 = icmp eq i32 %add12, %1 br i1 %cmp13, label %for.inc14.thread, label %for.inc for.inc: ; preds = %for.body3, %land.lhs.true8 %inc = add nuw i32 %j.036, 1 %exitcond.not = icmp eq i32 %j.036, %0 br i1 %exitcond.not, label %for.inc14, label %for.body3, !llvm.loop !9 for.inc14: ; preds = %for.inc %inc15 = add nuw i32 %i.048, 1 %exitcond57.not = icmp eq i32 %i.048, %0 br i1 %exitcond57.not, label %for.end16, label %for.cond1.preheader, !llvm.loop !11 for.inc14.thread: ; preds = %land.lhs.true8 %inc1566 = add nuw i32 %i.048, 1 %exitcond57.not67 = icmp eq i32 %i.048, %0 br i1 %exitcond57.not67, label %if.then18, label %for.cond1.preheader.outer, !llvm.loop !11 for.end16: ; preds = %for.inc14 br i1 %2, label %if.then18, label %if.else if.then18: ; preds = %for.inc14.thread, %for.end16 %GOSEN.16879 = phi i32 [ %GOSEN.045.ph, %for.end16 ], [ %j.036, %for.inc14.thread ] %MAN.16978 = phi i32 [ %MAN.046.ph, %for.end16 ], [ %sub, %for.inc14.thread ] %SEN.17177 = phi i32 [ %SEN.049.ph, %for.end16 ], [ %i.048, %for.inc14.thread ] %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %MAN.16978, i32 noundef %GOSEN.16879, i32 noundef %SEN.17177) br label %if.end21 if.else: ; preds = %entry, %for.end16 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end21 if.end21: ; preds = %if.else, %if.then18 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y) #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}
#include<stdio.h> #include<math.h> #include<string.h> int main(){ int N,Y; scanf("%d %d",&N,&Y); for(int i=0;i<=N && 10000*i<=Y;i++){ for(int j=0;i+j<=N && 10000*i+5000*j<=Y;j++){ if(i*10000+j*5000+(N-i-j)*1000 == Y){ printf("%d %d %d",i,j,N-i-j); goto OUT; } } } printf("-1 -1 -1"); OUT: return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126017/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126017/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %Y = 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 %Y) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Y) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = load i32, ptr %Y, align 4 %cmp55 = icmp sgt i32 %0, -1 %cmp156 = icmp sgt i32 %1, -1 %2 = select i1 %cmp55, i1 %cmp156, i1 false br i1 %2, label %for.cond2.preheader, label %for.end26 for.cond2.preheader: ; preds = %entry, %for.inc22 %mul58 = phi i32 [ %mul, %for.inc22 ], [ 0, %entry ] %i.057 = phi i32 [ %inc23, %for.inc22 ], [ 0, %entry ] br label %land.rhs4 land.rhs4: ; preds = %for.cond2.preheader, %for.inc %add54 = phi i32 [ %i.057, %for.cond2.preheader ], [ %add, %for.inc ] %j.053 = phi i32 [ 0, %for.cond2.preheader ], [ %inc, %for.inc ] %mul6 = mul nuw nsw i32 %j.053, 5000 %add7 = add nuw nsw i32 %mul6, %mul58 %cmp8.not = icmp sgt i32 %add7, %1 br i1 %cmp8.not, label %for.inc22, label %for.body11 for.body11: ; preds = %land.rhs4 %sub15 = sub i32 %0, %add54 %mul16 = mul nsw i32 %sub15, 1000 %add17 = add nsw i32 %mul16, %add7 %cmp18 = icmp eq i32 %add17, %1 br i1 %cmp18, label %cleanup24, label %for.inc for.inc: ; preds = %for.body11 %inc = add nuw nsw i32 %j.053, 1 %add = add nuw nsw i32 %inc, %i.057 %cmp3.not = icmp sgt i32 %add, %0 br i1 %cmp3.not, label %for.inc22, label %land.rhs4, !llvm.loop !9 for.inc22: ; preds = %for.inc, %land.rhs4 %inc23 = add nuw nsw i32 %i.057, 1 %cmp = icmp slt i32 %i.057, %0 %mul = mul nsw i32 %inc23, 10000 %cmp1 = icmp sle i32 %mul, %1 %3 = select i1 %cmp, i1 %cmp1, i1 false br i1 %3, label %for.cond2.preheader, label %for.end26, !llvm.loop !11 cleanup24: ; preds = %for.body11 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.057, i32 noundef %j.053, i32 noundef %sub15) br label %cleanup28 for.end26: ; preds = %for.inc22, %entry %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %cleanup28 cleanup28: ; preds = %cleanup24, %for.end26 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y) #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}
#include <stdio.h> int main(void) { long long int N,Y; scanf("%lld %lld",&N,&Y); int i,j,k,cnt=0; for(i=0;i<=N;i++){ if(cnt==1){ break; } for(j=0;j<=N;j++){ k=(N-i-j); if(cnt==1){ break; } if(Y==(i*10000)+(j*5000)+(k*1000)&&(i+j+k)==N&&k>=0){ printf("%d %d %d",i,j,k); cnt=1; break; } } } if(cnt==0){ printf("-1 -1 -1"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126060/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126060/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i64, align 8 %Y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Y) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Y) %0 = load i64, ptr %N, align 8, !tbaa !5 %cmp62 = icmp slt i64 %0, 0 br i1 %cmp62, label %if.then39, label %for.cond4.preheader.preheader for.cond4.preheader.preheader: ; preds = %entry %1 = load i64, ptr %Y, align 8 %2 = add i64 %0, 2147483648 %cmp26 = icmp ult i64 %2, 4294967296 br label %for.body8.lr.ph for.body8.lr.ph: ; preds = %for.inc34, %for.cond4.preheader.preheader %indvars.iv73 = phi i64 [ 0, %for.cond4.preheader.preheader ], [ %indvars.iv.next74, %for.inc34 ] %3 = mul nsw i64 %indvars.iv73, 10000 br label %for.body8 for.body8: ; preds = %for.body8.lr.ph, %for.inc %indvars.iv = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next, %for.inc ] %4 = add nuw nsw i64 %indvars.iv73, %indvars.iv %sub11 = sub i64 %0, %4 %conv12 = trunc i64 %sub11 to i32 %5 = mul nuw nsw i64 %indvars.iv, 5000 %6 = add nuw nsw i64 %5, %3 %sext = mul i64 %sub11, 4294967296000 %7 = ashr exact i64 %sext, 32 %8 = add nsw i64 %6, %7 %cmp21 = icmp eq i64 %1, %8 %cmp29 = icmp sgt i32 %conv12, -1 %or.cond = and i1 %cmp29, %cmp26 %or.cond86 = and i1 %cmp21, %or.cond br i1 %or.cond86, label %for.end36, label %for.inc for.inc: ; preds = %for.body8 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %cmp6.not = icmp slt i64 %0, %indvars.iv.next br i1 %cmp6.not, label %for.inc34, label %for.body8, !llvm.loop !9 for.inc34: ; preds = %for.inc %indvars.iv.next74 = add nuw i64 %indvars.iv73, 1 %cmp = icmp slt i64 %0, %indvars.iv.next74 br i1 %cmp, label %if.then39, label %for.body8.lr.ph, !llvm.loop !11 for.end36: ; preds = %for.body8 %9 = trunc i64 %indvars.iv to i32 %10 = trunc i64 %indvars.iv73 to i32 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10, i32 noundef %9, i32 noundef %conv12) br label %if.end41 if.then39: ; preds = %for.inc34, %entry %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end41 if.end41: ; preds = %for.end36, %if.then39 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Y) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define mod 1e9+7 #define ll long long int #define epsilon 1e-7 int main(void){ int n, y; scanf("%d %d", &n, &y); int ans = 0; int a, b, c; for(int i = 0;i <= n;i++){ for(int j = 0;j <= n-i;j++){ if(10000*i+5000*j+1000*(n-i-j)==y){ ans = 1; a = i; b = j; c = n-i-j; break; } } if(ans)break; } if(ans)printf("%d %d %d\n", a, b, c); else printf("-1 -1 -1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126103/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126103/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 @str = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %y) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not55 = icmp slt i32 %0, 0 br i1 %cmp.not55, label %if.else, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %y, align 4 %2 = add nuw i32 %0, 1 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc15 %indvars.iv = phi i32 [ %2, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next, %for.inc15 ] %i.056 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc16, %for.inc15 ] %sub = sub nsw i32 %0, %i.056 %cmp2.not53 = icmp slt i32 %sub, 0 br i1 %cmp2.not53, label %for.inc15, label %for.body4.lr.ph for.body4.lr.ph: ; preds = %for.cond1.preheader %mul = mul nsw i32 %i.056, 10000 br label %for.body4 for.body4: ; preds = %for.body4.lr.ph, %for.inc %j.054 = phi i32 [ 0, %for.body4.lr.ph ], [ %inc, %for.inc ] %mul5 = mul nuw nsw i32 %j.054, 5000 %add = add nuw nsw i32 %mul5, %mul %sub7 = sub nsw i32 %sub, %j.054 %mul8 = mul nsw i32 %sub7, 1000 %add9 = add nsw i32 %add, %mul8 %cmp10 = icmp eq i32 %add9, %1 br i1 %cmp10, label %if.then20, label %for.inc for.inc: ; preds = %for.body4 %inc = add nuw i32 %j.054, 1 %exitcond.not = icmp eq i32 %inc, %indvars.iv br i1 %exitcond.not, label %for.inc15, label %for.body4, !llvm.loop !9 for.inc15: ; preds = %for.inc, %for.cond1.preheader %inc16 = add nuw i32 %i.056, 1 %indvars.iv.next = add i32 %indvars.iv, -1 %exitcond60.not = icmp eq i32 %i.056, %0 br i1 %exitcond60.not, label %if.else, label %for.cond1.preheader, !llvm.loop !11 if.then20: ; preds = %for.body4 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.056, i32 noundef %j.054, i32 noundef %sub7) br label %if.end23 if.else: ; preds = %for.inc15, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end23 if.end23: ; preds = %if.else, %if.then20 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void){ int N; long long Y; scanf("%d%lld",&N,&Y); for(int i = 0;i <= N;i++){ if(i*10000 > Y) break; for(int j = 0;j <= N-i;j++){ if(i*10000+j*5000 > Y) break; int k = N-i-j; if(i*10000+j*5000+k*1000 == Y){ printf("%d %d %d\n",i,j,k); return 0; } } } printf("-1 -1 -1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126147/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126147/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%lld\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @str = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %Y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Y) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not59 = icmp slt i32 %0, 0 br i1 %cmp.not59, label %for.end34.critedge, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i64, ptr %Y, align 8, !tbaa !9 %2 = add nuw i32 %0, 1 %3 = zext i32 %0 to i64 %wide.trip.count75 = zext i32 %2 to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc30 %indvars.iv70 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next71, %for.inc30 ] %indvars.iv68 = phi i32 [ %2, %for.body.lr.ph ], [ %indvars.iv.next69, %for.inc30 ] %4 = mul nuw nsw i64 %indvars.iv70, 10000 %cmp1 = icmp slt i64 %1, %4 br i1 %cmp1, label %for.end34.critedge, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.body %5 = sub nsw i64 %3, %indvars.iv70 %cmp4.not57 = icmp slt i64 %5, 0 br i1 %cmp4.not57, label %for.inc30, label %for.body7.preheader for.body7.preheader: ; preds = %for.cond3.preheader %wide.trip.count = zext i32 %indvars.iv68 to i64 %6 = trunc i64 %5 to i32 br label %for.body7 for.body7: ; preds = %for.body7.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next, %for.inc ] %7 = mul nuw nsw i64 %indvars.iv, 5000 %8 = add nuw nsw i64 %7, %4 %cmp11 = icmp slt i64 %1, %8 br i1 %cmp11, label %for.inc30, label %if.end14 if.end14: ; preds = %for.body7 %indvars67 = trunc i64 %indvars.iv to i32 %sub16 = sub nsw i32 %6, %indvars67 %mul20 = mul nsw i32 %sub16, 1000 %9 = sext i32 %mul20 to i64 %10 = add nsw i64 %8, %9 %cmp23.not = icmp eq i64 %1, %10 br i1 %cmp23.not, label %if.then25, label %for.inc if.then25: ; preds = %if.end14 %11 = trunc i64 %indvars.iv70 to i32 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11, i32 noundef %indvars67, i32 noundef %sub16) br label %cleanup36 for.inc: ; preds = %if.end14 %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.inc30, label %for.body7, !llvm.loop !11 for.inc30: ; preds = %for.body7, %for.inc, %for.cond3.preheader %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %indvars.iv.next69 = add i32 %indvars.iv68, -1 %exitcond76.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count75 br i1 %exitcond76.not, label %for.end34.critedge, label %for.body, !llvm.loop !13 for.end34.critedge: ; preds = %for.inc30, %for.body, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup36 cleanup36: ; preds = %if.then25, %for.end34.critedge call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
#include <stdio.h> int main(void){ int n, Y; int x = -1, y = -1, z = -1; scanf("%d %d", &n, &Y); for(int a = 0; a <= n; a++){ for(int b = 0; b + a <= n; b++){ int c = n - a - b; int sum = 10000 * a + 5000 * b + 1000 * c; if(sum == Y){ x = a; y = b; z = c; } } } printf("%d %d %d", x, y, z); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126190/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126190/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %Y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %Y) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not30 = icmp slt i32 %0, 0 br i1 %cmp.not30, label %for.cond.cleanup, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %Y, align 4, !tbaa !5 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond.cleanup3 %indvars.iv = phi i32 [ 1, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next, %for.cond.cleanup3 ] %x.034 = phi i32 [ -1, %for.cond1.preheader.lr.ph ], [ %x.2.lcssa, %for.cond.cleanup3 ] %a.033 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc12, %for.cond.cleanup3 ] %z.032 = phi i32 [ -1, %for.cond1.preheader.lr.ph ], [ %z.2.lcssa, %for.cond.cleanup3 ] %y.031 = phi i32 [ -1, %for.cond1.preheader.lr.ph ], [ %y.2.lcssa, %for.cond.cleanup3 ] %smax38 = call i32 @llvm.smax.i32(i32 %0, i32 %a.033) %2 = add i32 %smax38, %indvars.iv %mul = mul nsw i32 %a.033, 10000 %xtraiter = and i32 %2, 1 %.not = icmp slt i32 %a.033, %0 br i1 %.not, label %for.cond1.preheader.new, label %for.cond.cleanup3.unr-lcssa for.cond1.preheader.new: ; preds = %for.cond1.preheader %unroll_iter = and i32 %2, -2 br label %for.body4 for.cond.cleanup: ; preds = %for.cond.cleanup3, %entry %y.0.lcssa = phi i32 [ -1, %entry ], [ %y.2.lcssa, %for.cond.cleanup3 ] %z.0.lcssa = phi i32 [ -1, %entry ], [ %z.2.lcssa, %for.cond.cleanup3 ] %x.0.lcssa = phi i32 [ -1, %entry ], [ %x.2.lcssa, %for.cond.cleanup3 ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.0.lcssa, i32 noundef %y.0.lcssa, i32 noundef %z.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.cond.cleanup3.unr-lcssa: ; preds = %for.body4, %for.cond1.preheader %y.2.lcssa.ph = phi i32 [ undef, %for.cond1.preheader ], [ %y.2.1, %for.body4 ] %z.2.lcssa.ph = phi i32 [ undef, %for.cond1.preheader ], [ %z.2.1, %for.body4 ] %x.2.lcssa.ph = phi i32 [ undef, %for.cond1.preheader ], [ %x.2.1, %for.body4 ] %add29.unr = phi i32 [ %a.033, %for.cond1.preheader ], [ %add.1, %for.body4 ] %x.128.unr = phi i32 [ %x.034, %for.cond1.preheader ], [ %x.2.1, %for.body4 ] %b.027.unr = phi i32 [ 0, %for.cond1.preheader ], [ %inc.1, %for.body4 ] %z.126.unr = phi i32 [ %z.032, %for.cond1.preheader ], [ %z.2.1, %for.body4 ] %y.125.unr = phi i32 [ %y.031, %for.cond1.preheader ], [ %y.2.1, %for.body4 ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup3, label %for.body4.epil for.body4.epil: ; preds = %for.cond.cleanup3.unr-lcssa %sub5.epil = sub i32 %0, %add29.unr %mul6.epil = mul nsw i32 %b.027.unr, 5000 %add7.epil = add nuw nsw i32 %mul6.epil, %mul %mul8.epil = mul nsw i32 %sub5.epil, 1000 %add9.epil = add nsw i32 %add7.epil, %mul8.epil %cmp10.epil = icmp eq i32 %add9.epil, %1 %y.2.epil = select i1 %cmp10.epil, i32 %b.027.unr, i32 %y.125.unr %z.2.epil = select i1 %cmp10.epil, i32 %sub5.epil, i32 %z.126.unr %x.2.epil = select i1 %cmp10.epil, i32 %a.033, i32 %x.128.unr br label %for.cond.cleanup3 for.cond.cleanup3: ; preds = %for.cond.cleanup3.unr-lcssa, %for.body4.epil %y.2.lcssa = phi i32 [ %y.2.lcssa.ph, %for.cond.cleanup3.unr-lcssa ], [ %y.2.epil, %for.body4.epil ] %z.2.lcssa = phi i32 [ %z.2.lcssa.ph, %for.cond.cleanup3.unr-lcssa ], [ %z.2.epil, %for.body4.epil ] %x.2.lcssa = phi i32 [ %x.2.lcssa.ph, %for.cond.cleanup3.unr-lcssa ], [ %x.2.epil, %for.body4.epil ] %inc12 = add i32 %a.033, 1 %indvars.iv.next = add nsw i32 %indvars.iv, -1 %exitcond37.not = icmp eq i32 %a.033, %0 br i1 %exitcond37.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !9 for.body4: ; preds = %for.body4, %for.cond1.preheader.new %add29 = phi i32 [ %a.033, %for.cond1.preheader.new ], [ %add.1, %for.body4 ] %x.128 = phi i32 [ %x.034, %for.cond1.preheader.new ], [ %x.2.1, %for.body4 ] %b.027 = phi i32 [ 0, %for.cond1.preheader.new ], [ %inc.1, %for.body4 ] %z.126 = phi i32 [ %z.032, %for.cond1.preheader.new ], [ %z.2.1, %for.body4 ] %y.125 = phi i32 [ %y.031, %for.cond1.preheader.new ], [ %y.2.1, %for.body4 ] %niter = phi i32 [ 0, %for.cond1.preheader.new ], [ %niter.next.1, %for.body4 ] %sub5 = sub i32 %0, %add29 %mul6 = mul nsw i32 %b.027, 5000 %add7 = add nuw nsw i32 %mul6, %mul %mul8 = mul nsw i32 %sub5, 1000 %add9 = add nsw i32 %add7, %mul8 %cmp10 = icmp eq i32 %add9, %1 %y.2 = select i1 %cmp10, i32 %b.027, i32 %y.125 %z.2 = select i1 %cmp10, i32 %sub5, i32 %z.126 %inc = or i32 %b.027, 1 %add = add nuw nsw i32 %inc, %a.033 %sub5.1 = sub i32 %0, %add %mul6.1 = mul nsw i32 %inc, 5000 %add7.1 = add nuw nsw i32 %mul6.1, %mul %mul8.1 = mul nsw i32 %sub5.1, 1000 %add9.1 = add nsw i32 %add7.1, %mul8.1 %cmp10.1 = icmp eq i32 %add9.1, %1 %y.2.1 = select i1 %cmp10.1, i32 %inc, i32 %y.2 %z.2.1 = select i1 %cmp10.1, i32 %sub5.1, i32 %z.2 %3 = select i1 %cmp10.1, i1 true, i1 %cmp10 %x.2.1 = select i1 %3, i32 %a.033, i32 %x.128 %inc.1 = add nuw nsw i32 %b.027, 2 %add.1 = add nuw nsw i32 %inc.1, %a.033 %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.cond.cleanup3.unr-lcssa, label %for.body4, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main() { int f=0,n,s,i,j,k; scanf("%d%d",&n,&s); for(i=0;i<=s/10000;i++) {for(j=0;j<=s/5000;j++) { k=n-i-j; if(i*10000+j*5000+k*1000==s && k>=0 && k<=s/1000) { f=1;printf("%d %d% d\n",i,j,k); break; } } if(f) break; } if(!f) printf("-1 -1 -1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126233/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126233/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d% d\0A\00", align 1 @str = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %0 = load i32, ptr %s, align 4, !tbaa !5 %div = sdiv i32 %0, 10000 %cmp.not42 = icmp slt i32 %0, -9999 br i1 %cmp.not42, label %if.then21, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %cmp3.not40 = icmp slt i32 %0, -4999 %1 = load i32, ptr %n, align 4 %div12 = sdiv i32 %0, 1000 br i1 %cmp3.not40, label %if.then21, label %for.cond1.preheader.preheader for.cond1.preheader.preheader: ; preds = %for.cond1.preheader.lr.ph %div2 = sdiv i32 %0, 5000 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.cond1.for.inc17_crit_edge %i.043 = phi i32 [ %inc18, %for.cond1.for.inc17_crit_edge ], [ 0, %for.cond1.preheader.preheader ] %mul = mul nuw nsw i32 %i.043, 10000 br label %for.body4 for.body4: ; preds = %for.cond1.preheader, %for.inc %j.041 = phi i32 [ 0, %for.cond1.preheader ], [ %inc, %for.inc ] %2 = add nuw nsw i32 %j.041, %i.043 %sub5 = sub i32 %1, %2 %mul6 = mul nuw nsw i32 %j.041, 5000 %add = add nuw nsw i32 %mul6, %mul %mul7 = mul nsw i32 %sub5, 1000 %add8 = add nsw i32 %add, %mul7 %cmp9 = icmp ne i32 %add8, %0 %cmp10 = icmp slt i32 %sub5, 0 %or.cond.not37 = or i1 %cmp10, %cmp9 %cmp13.not = icmp sgt i32 %sub5, %div12 %or.cond36 = or i1 %cmp13.not, %or.cond.not37 br i1 %or.cond36, label %for.inc, label %for.end19 for.inc: ; preds = %for.body4 %inc = add nuw nsw i32 %j.041, 1 %exitcond.not = icmp eq i32 %j.041, %div2 br i1 %exitcond.not, label %for.cond1.for.inc17_crit_edge, label %for.body4, !llvm.loop !9 for.cond1.for.inc17_crit_edge: ; preds = %for.inc %inc18 = add nuw nsw i32 %i.043, 1 %exitcond48.not = icmp eq i32 %i.043, %div br i1 %exitcond48.not, label %if.then21, label %for.cond1.preheader, !llvm.loop !11 for.end19: ; preds = %for.body4 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.043, i32 noundef %j.041, i32 noundef %sub5) br label %if.end23 if.then21: ; preds = %for.cond1.for.inc17_crit_edge, %for.cond1.preheader.lr.ph, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end23 if.end23: ; preds = %for.end19, %if.then21 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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}
// AOJ 0612 Sandcastle // 2018.2.26 bal4u #include <stdio.h> #include <ctype.h> typedef struct { short r, c; } Q; Q q[2][2000]; int top[2], tail[2]; char map[1002][1002]; char a[1002][1002]; int mv[8][2] = {{-1,0},{-1,1},{0,1},{1,1},{1,0},{1,-1},{0,-1},{-1,-1}}; int main() { int h, w, r, c, i, k1, k2, nr, nc, ans, f; char buf[15], *p; fgets(buf, 15, stdin), sscanf(buf, "%d%d", &h, &w); for (r = 0; r < h; r++) { fgets(p=map[r], 1002, stdin); while (*p > ' ') { if (isdigit(*p)) *p &= 0xf; p++; } } for (r = 1; r < h-1; r++) for (c = 1; c < w-1; c++) { if (map[r][c] == '.') continue; for (i = 0; i < 8; i++) { nr = r + mv[i][0], nc = c + mv[i][1]; if (map[nr][nc] == '.') a[r][c]++; } if (a[r][c] >= map[r][c]) { q[0][tail[0]].r = r, q[0][tail[0]++].c = c; } } ans = 0; for (k1 = 0, k2 = 1; ; k1 = k2, k2 = !k2) { f = 0; top[k2] = tail[k2] = 0; while (top[k1] < tail[k1]) { r = q[k1][top[k1]].r, c = q[k1][top[k1]++].c; for (i = 0; i < 8; i++) { nr = r + mv[i][0], nc = c + mv[i][1]; if (map[nr][nc] < 10 && ++a[nr][nc] == map[nr][nc]) { q[k2][tail[k2]].r = nr, q[k2][tail[k2]++].c = nc, f = 1; } } } ans++; if (!f) break; } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126284/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126284/source.c" target datalayout = "e-m:e-p270: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.Q = type { i16, i16 } @mv = dso_local local_unnamed_addr global [8 x [2 x i32]] [[2 x i32] [i32 -1, i32 0], [2 x i32] [i32 -1, i32 1], [2 x i32] [i32 0, i32 1], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 -1], [2 x i32] [i32 0, i32 -1], [2 x i32] [i32 -1, i32 -1]], align 16 @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @map = dso_local global [1002 x [1002 x i8]] zeroinitializer, align 16 @a = dso_local local_unnamed_addr global [1002 x [1002 x i8]] zeroinitializer, align 16 @q = dso_local local_unnamed_addr global [2 x [2000 x %struct.Q]] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global [2 x i32] zeroinitializer, align 4 @top = dso_local local_unnamed_addr global [2 x i32] zeroinitializer, 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: %h = alloca i32, align 4 %w = alloca i32, align 4 %buf = alloca [15 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %buf) #4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 15, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) #4 %1 = load i32, ptr %h, align 4, !tbaa !9 %cmp235 = icmp sgt i32 %1, 0 br i1 %cmp235, label %for.body, label %for.cond90.preheader for.cond15.preheader: ; preds = %for.inc %sub = add i32 %38, -1 %cmp16248 = icmp sgt i32 %38, 2 br i1 %cmp16248, label %for.cond19.preheader.lr.ph, label %for.cond90.preheader for.cond19.preheader.lr.ph: ; preds = %for.cond15.preheader %2 = load i32, ptr %w, align 4, !tbaa !9 %cmp21240 = icmp sgt i32 %2, 2 br i1 %cmp21240, label %for.cond19.preheader.us.preheader, label %for.cond90.preheader for.cond19.preheader.us.preheader: ; preds = %for.cond19.preheader.lr.ph %sub20 = add i32 %2, -1 %tail.promoted243 = load i32, ptr @tail, align 4, !tbaa !9 %wide.trip.count270 = zext i32 %sub to i64 %wide.trip.count = zext i32 %sub20 to i64 %3 = load i32, ptr @mv, align 16 %4 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 0, i64 1), align 4 %5 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 1), align 8 %6 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 1, i64 1), align 4 %7 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 2), align 16 %8 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 2, i64 1), align 4 %9 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 3), align 8 %10 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 3, i64 1), align 4 %11 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 4), align 16 %12 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 4, i64 1), align 4 %13 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 5), align 8 %14 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 5, i64 1), align 4 %15 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 6), align 16 %16 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 6, i64 1), align 4 %17 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 7), align 8 %18 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 7, i64 1), align 4 br label %for.cond19.preheader.us for.cond19.preheader.us: ; preds = %for.cond19.preheader.us.preheader, %for.cond19.for.inc87_crit_edge.us %indvars.iv267 = phi i64 [ 1, %for.cond19.preheader.us.preheader ], [ %indvars.iv.next268, %for.cond19.for.inc87_crit_edge.us ] %tail.promoted247249.us = phi i32 [ %tail.promoted243, %for.cond19.preheader.us.preheader ], [ %tail.promoted245.us, %for.cond19.for.inc87_crit_edge.us ] %19 = trunc i64 %indvars.iv267 to i32 %conv74.us = trunc i64 %indvars.iv267 to i16 %add.us = add nsw i32 %3, %19 %idxprom44.us = sext i32 %add.us to i64 %add.us.1 = add nsw i32 %5, %19 %idxprom44.us.1 = sext i32 %add.us.1 to i64 %add.us.2 = add nsw i32 %7, %19 %idxprom44.us.2 = sext i32 %add.us.2 to i64 %add.us.3 = add nsw i32 %9, %19 %idxprom44.us.3 = sext i32 %add.us.3 to i64 %add.us.4 = add nsw i32 %11, %19 %idxprom44.us.4 = sext i32 %add.us.4 to i64 %add.us.5 = add nsw i32 %13, %19 %idxprom44.us.5 = sext i32 %add.us.5 to i64 %add.us.6 = add nsw i32 %15, %19 %idxprom44.us.6 = sext i32 %add.us.6 to i64 %add.us.7 = add nsw i32 %17, %19 %idxprom44.us.7 = sext i32 %add.us.7 to i64 br label %for.body23.us for.body23.us: ; preds = %for.cond19.preheader.us, %for.inc84.us %indvars.iv264 = phi i64 [ 1, %for.cond19.preheader.us ], [ %indvars.iv.next265, %for.inc84.us ] %tail.promoted246.us = phi i32 [ %tail.promoted247249.us, %for.cond19.preheader.us ], [ %tail.promoted245.us, %for.inc84.us ] %inc79239241.us = phi i32 [ %tail.promoted247249.us, %for.cond19.preheader.us ], [ %inc79238.us, %for.inc84.us ] %arrayidx27.us = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %indvars.iv267, i64 %indvars.iv264 %20 = load i8, ptr %arrayidx27.us, align 1, !tbaa !11 %cmp29.us = icmp eq i8 %20, 46 br i1 %cmp29.us, label %for.inc84.us, label %for.cond33.preheader.us if.then73.us: ; preds = %for.inc58.us.7 %idxprom75.us = sext i32 %inc79239241.us to i64 %arrayidx76.us = getelementptr inbounds [2000 x %struct.Q], ptr @q, i64 0, i64 %idxprom75.us store i16 %conv74.us, ptr %arrayidx76.us, align 4, !tbaa !12 %conv78.us = trunc i64 %indvars.iv264 to i16 %inc79.us = add nsw i32 %inc79239241.us, 1 store i32 %inc79.us, ptr @tail, align 4, !tbaa !9 %c82.us = getelementptr inbounds [2000 x %struct.Q], ptr @q, i64 0, i64 %idxprom75.us, i32 1 store i16 %conv78.us, ptr %c82.us, align 2, !tbaa !15 br label %for.inc84.us if.then51.us: ; preds = %for.cond33.preheader.us %inc56.us = add i8 %.pre.pre.pre.pre.pre.pre.pre.pre, 1 store i8 %inc56.us, ptr %arrayidx55.us, align 1, !tbaa !11 br label %for.inc58.us for.inc58.us: ; preds = %if.then51.us, %for.cond33.preheader.us %.pre.pre.pre.pre.pre.pre.pre = phi i8 [ %inc56.us, %if.then51.us ], [ %.pre.pre.pre.pre.pre.pre.pre.pre, %for.cond33.preheader.us ] %add43.us.1 = add nsw i32 %6, %29 %idxprom46.us.1 = sext i32 %add43.us.1 to i64 %arrayidx47.us.1 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom44.us.1, i64 %idxprom46.us.1 %21 = load i8, ptr %arrayidx47.us.1, align 1, !tbaa !11 %cmp49.us.1 = icmp eq i8 %21, 46 br i1 %cmp49.us.1, label %if.then51.us.1, label %for.inc58.us.1 if.then51.us.1: ; preds = %for.inc58.us %inc56.us.1 = add i8 %.pre.pre.pre.pre.pre.pre.pre, 1 store i8 %inc56.us.1, ptr %arrayidx55.us, align 1, !tbaa !11 br label %for.inc58.us.1 for.inc58.us.1: ; preds = %if.then51.us.1, %for.inc58.us %.pre.pre.pre.pre.pre.pre = phi i8 [ %inc56.us.1, %if.then51.us.1 ], [ %.pre.pre.pre.pre.pre.pre.pre, %for.inc58.us ] %add43.us.2 = add nsw i32 %8, %29 %idxprom46.us.2 = sext i32 %add43.us.2 to i64 %arrayidx47.us.2 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom44.us.2, i64 %idxprom46.us.2 %22 = load i8, ptr %arrayidx47.us.2, align 1, !tbaa !11 %cmp49.us.2 = icmp eq i8 %22, 46 br i1 %cmp49.us.2, label %if.then51.us.2, label %for.inc58.us.2 if.then51.us.2: ; preds = %for.inc58.us.1 %inc56.us.2 = add i8 %.pre.pre.pre.pre.pre.pre, 1 store i8 %inc56.us.2, ptr %arrayidx55.us, align 1, !tbaa !11 br label %for.inc58.us.2 for.inc58.us.2: ; preds = %if.then51.us.2, %for.inc58.us.1 %.pre.pre.pre.pre.pre = phi i8 [ %inc56.us.2, %if.then51.us.2 ], [ %.pre.pre.pre.pre.pre.pre, %for.inc58.us.1 ] %add43.us.3 = add nsw i32 %10, %29 %idxprom46.us.3 = sext i32 %add43.us.3 to i64 %arrayidx47.us.3 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom44.us.3, i64 %idxprom46.us.3 %23 = load i8, ptr %arrayidx47.us.3, align 1, !tbaa !11 %cmp49.us.3 = icmp eq i8 %23, 46 br i1 %cmp49.us.3, label %if.then51.us.3, label %for.inc58.us.3 if.then51.us.3: ; preds = %for.inc58.us.2 %inc56.us.3 = add i8 %.pre.pre.pre.pre.pre, 1 store i8 %inc56.us.3, ptr %arrayidx55.us, align 1, !tbaa !11 br label %for.inc58.us.3 for.inc58.us.3: ; preds = %if.then51.us.3, %for.inc58.us.2 %.pre.pre.pre.pre = phi i8 [ %inc56.us.3, %if.then51.us.3 ], [ %.pre.pre.pre.pre.pre, %for.inc58.us.2 ] %add43.us.4 = add nsw i32 %12, %29 %idxprom46.us.4 = sext i32 %add43.us.4 to i64 %arrayidx47.us.4 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom44.us.4, i64 %idxprom46.us.4 %24 = load i8, ptr %arrayidx47.us.4, align 1, !tbaa !11 %cmp49.us.4 = icmp eq i8 %24, 46 br i1 %cmp49.us.4, label %if.then51.us.4, label %for.inc58.us.4 if.then51.us.4: ; preds = %for.inc58.us.3 %inc56.us.4 = add i8 %.pre.pre.pre.pre, 1 store i8 %inc56.us.4, ptr %arrayidx55.us, align 1, !tbaa !11 br label %for.inc58.us.4 for.inc58.us.4: ; preds = %if.then51.us.4, %for.inc58.us.3 %.pre.pre.pre = phi i8 [ %inc56.us.4, %if.then51.us.4 ], [ %.pre.pre.pre.pre, %for.inc58.us.3 ] %add43.us.5 = add nsw i32 %14, %29 %idxprom46.us.5 = sext i32 %add43.us.5 to i64 %arrayidx47.us.5 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom44.us.5, i64 %idxprom46.us.5 %25 = load i8, ptr %arrayidx47.us.5, align 1, !tbaa !11 %cmp49.us.5 = icmp eq i8 %25, 46 br i1 %cmp49.us.5, label %if.then51.us.5, label %for.inc58.us.5 if.then51.us.5: ; preds = %for.inc58.us.4 %inc56.us.5 = add i8 %.pre.pre.pre, 1 store i8 %inc56.us.5, ptr %arrayidx55.us, align 1, !tbaa !11 br label %for.inc58.us.5 for.inc58.us.5: ; preds = %if.then51.us.5, %for.inc58.us.4 %.pre.pre = phi i8 [ %inc56.us.5, %if.then51.us.5 ], [ %.pre.pre.pre, %for.inc58.us.4 ] %add43.us.6 = add nsw i32 %16, %29 %idxprom46.us.6 = sext i32 %add43.us.6 to i64 %arrayidx47.us.6 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom44.us.6, i64 %idxprom46.us.6 %26 = load i8, ptr %arrayidx47.us.6, align 1, !tbaa !11 %cmp49.us.6 = icmp eq i8 %26, 46 br i1 %cmp49.us.6, label %if.then51.us.6, label %for.inc58.us.6 if.then51.us.6: ; preds = %for.inc58.us.5 %inc56.us.6 = add i8 %.pre.pre, 1 store i8 %inc56.us.6, ptr %arrayidx55.us, align 1, !tbaa !11 br label %for.inc58.us.6 for.inc58.us.6: ; preds = %if.then51.us.6, %for.inc58.us.5 %.pre = phi i8 [ %inc56.us.6, %if.then51.us.6 ], [ %.pre.pre, %for.inc58.us.5 ] %add43.us.7 = add nsw i32 %18, %29 %idxprom46.us.7 = sext i32 %add43.us.7 to i64 %arrayidx47.us.7 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom44.us.7, i64 %idxprom46.us.7 %27 = load i8, ptr %arrayidx47.us.7, align 1, !tbaa !11 %cmp49.us.7 = icmp eq i8 %27, 46 br i1 %cmp49.us.7, label %if.then51.us.7, label %for.inc58.us.7 if.then51.us.7: ; preds = %for.inc58.us.6 %inc56.us.7 = add i8 %.pre, 1 store i8 %inc56.us.7, ptr %arrayidx55.us, align 1, !tbaa !11 br label %for.inc58.us.7 for.inc58.us.7: ; preds = %if.then51.us.7, %for.inc58.us.6 %28 = phi i8 [ %inc56.us.7, %if.then51.us.7 ], [ %.pre, %for.inc58.us.6 ] %cmp71.not.us = icmp slt i8 %28, %20 br i1 %cmp71.not.us, label %for.inc84.us, label %if.then73.us for.inc84.us: ; preds = %if.then73.us, %for.inc58.us.7, %for.body23.us %tail.promoted245.us = phi i32 [ %tail.promoted246.us, %for.inc58.us.7 ], [ %inc79.us, %if.then73.us ], [ %tail.promoted246.us, %for.body23.us ] %inc79238.us = phi i32 [ %inc79239241.us, %for.inc58.us.7 ], [ %inc79.us, %if.then73.us ], [ %inc79239241.us, %for.body23.us ] %indvars.iv.next265 = add nuw nsw i64 %indvars.iv264, 1 %exitcond.not = icmp eq i64 %indvars.iv.next265, %wide.trip.count br i1 %exitcond.not, label %for.cond19.for.inc87_crit_edge.us, label %for.body23.us, !llvm.loop !16 for.cond33.preheader.us: ; preds = %for.body23.us %arrayidx55.us = getelementptr inbounds [1002 x [1002 x i8]], ptr @a, i64 0, i64 %indvars.iv267, i64 %indvars.iv264 %29 = trunc i64 %indvars.iv264 to i32 %add43.us = add nsw i32 %4, %29 %idxprom46.us = sext i32 %add43.us to i64 %arrayidx47.us = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom44.us, i64 %idxprom46.us %30 = load i8, ptr %arrayidx47.us, align 1, !tbaa !11 %cmp49.us = icmp eq i8 %30, 46 %.pre.pre.pre.pre.pre.pre.pre.pre = load i8, ptr %arrayidx55.us, align 1, !tbaa !11 br i1 %cmp49.us, label %if.then51.us, label %for.inc58.us for.cond19.for.inc87_crit_edge.us: ; preds = %for.inc84.us %indvars.iv.next268 = add nuw nsw i64 %indvars.iv267, 1 %exitcond271.not = icmp eq i64 %indvars.iv.next268, %wide.trip.count270 br i1 %exitcond271.not, label %for.cond90.preheader, label %for.cond19.preheader.us, !llvm.loop !18 for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %indvars.iv %31 = load ptr, ptr @stdin, align 8, !tbaa !5 %call4 = call ptr @fgets(ptr noundef nonnull %arrayidx, i32 noundef 1002, ptr noundef %31) %32 = load i8, ptr %arrayidx, align 2, !tbaa !11 %cmp5233 = icmp sgt i8 %32, 32 br i1 %cmp5233, label %while.body.lr.ph, label %for.inc while.body.lr.ph: ; preds = %for.body %call7 = tail call ptr @__ctype_b_loc() #5 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %33 = phi i8 [ %32, %while.body.lr.ph ], [ %37, %if.end ] %p.0234 = phi ptr [ %arrayidx, %while.body.lr.ph ], [ %incdec.ptr, %if.end ] %conv = zext i8 %33 to i64 %34 = load ptr, ptr %call7, align 8, !tbaa !5 %arrayidx10 = getelementptr inbounds i16, ptr %34, i64 %conv %35 = load i16, ptr %arrayidx10, align 2, !tbaa !19 %36 = and i16 %35, 2048 %tobool.not = icmp eq i16 %36, 0 br i1 %tobool.not, label %if.end, label %if.then if.then: ; preds = %while.body %and13 = and i8 %33, 15 store i8 %and13, ptr %p.0234, align 1, !tbaa !11 br label %if.end if.end: ; preds = %if.then, %while.body %incdec.ptr = getelementptr inbounds i8, ptr %p.0234, i64 1 %37 = load i8, ptr %incdec.ptr, align 1, !tbaa !11 %cmp5 = icmp sgt i8 %37, 32 br i1 %cmp5, label %while.body, label %for.inc, !llvm.loop !20 for.inc: ; preds = %if.end, %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %38 = load i32, ptr %h, align 4, !tbaa !9 %39 = sext i32 %38 to i64 %cmp = icmp slt i64 %indvars.iv.next, %39 br i1 %cmp, label %for.body, label %for.cond15.preheader, !llvm.loop !21 for.cond90.preheader: ; preds = %for.cond19.for.inc87_crit_edge.us, %entry, %for.cond19.preheader.lr.ph, %for.cond15.preheader %.pre279 = load i32, ptr @mv, align 16 %.pre280 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 0, i64 1), align 4 %40 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 1), align 8 %41 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 1, i64 1), align 4 %42 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 2), align 16 %43 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 2, i64 1), align 4 %44 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 3), align 8 %45 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 3, i64 1), align 4 %46 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 4), align 16 %47 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 4, i64 1), align 4 %48 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 5), align 8 %49 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 5, i64 1), align 4 %50 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 6), align 16 %51 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 6, i64 1), align 4 %52 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 7), align 8 %53 = load i32, ptr getelementptr inbounds ([8 x [2 x i32]], ptr @mv, i64 0, i64 7, i64 1), align 4 br label %for.cond90 for.cond90: ; preds = %while.end174, %for.cond90.preheader %k1.0 = phi i32 [ %k2.0, %while.end174 ], [ 0, %for.cond90.preheader ] %k2.0 = phi i32 [ %lnot.ext, %while.end174 ], [ 1, %for.cond90.preheader ] %ans.0 = phi i32 [ %inc175, %while.end174 ], [ 0, %for.cond90.preheader ] %idxprom91 = zext i32 %k2.0 to i64 %arrayidx92 = getelementptr inbounds [2 x i32], ptr @tail, i64 0, i64 %idxprom91 store i32 0, ptr %arrayidx92, align 4, !tbaa !9 %arrayidx94 = getelementptr inbounds [2 x i32], ptr @top, i64 0, i64 %idxprom91 store i32 0, ptr %arrayidx94, align 4, !tbaa !9 %idxprom96 = zext i32 %k1.0 to i64 %arrayidx97 = getelementptr inbounds [2 x i32], ptr @top, i64 0, i64 %idxprom96 %arrayidx99 = getelementptr inbounds [2 x i32], ptr @tail, i64 0, i64 %idxprom96 %arrayidx97.promoted = load i32, ptr %arrayidx97, align 4, !tbaa !9 %54 = load i32, ptr %arrayidx99, align 4, !tbaa !9 %cmp100254 = icmp slt i32 %arrayidx97.promoted, %54 br i1 %cmp100254, label %while.body102.preheader, label %while.end174.thread while.end174.thread: ; preds = %for.cond90 %inc175292 = add nuw nsw i32 %ans.0, 1 br label %for.end181 while.body102.preheader: ; preds = %for.cond90 %55 = sext i32 %arrayidx97.promoted to i64 br label %while.body102 while.body102: ; preds = %while.body102.preheader, %for.inc171.7 %56 = phi i32 [ 0, %while.body102.preheader ], [ %82, %for.inc171.7 ] %indvars.iv276 = phi i64 [ %55, %while.body102.preheader ], [ %indvars.iv.next277, %for.inc171.7 ] %f.0256 = phi i32 [ 0, %while.body102.preheader ], [ %f.2.7, %for.inc171.7 ] %arrayidx108 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom96, i64 %indvars.iv276 %57 = load i16, ptr %arrayidx108, align 4, !tbaa !12 %conv110 = sext i16 %57 to i32 %c118 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom96, i64 %indvars.iv276, i32 1 %58 = load i16, ptr %c118, align 2, !tbaa !15 %conv119 = sext i16 %58 to i32 %add127 = add nsw i32 %.pre279, %conv110 %add131 = add nsw i32 %.pre280, %conv119 %idxprom132 = sext i32 %add127 to i64 %idxprom134 = sext i32 %add131 to i64 %arrayidx135 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom132, i64 %idxprom134 %59 = load i8, ptr %arrayidx135, align 1, !tbaa !11 %cmp137 = icmp slt i8 %59, 10 br i1 %cmp137, label %land.lhs.true, label %for.inc171 land.lhs.true: ; preds = %while.body102 %arrayidx142 = getelementptr inbounds [1002 x [1002 x i8]], ptr @a, i64 0, i64 %idxprom132, i64 %idxprom134 %60 = load i8, ptr %arrayidx142, align 1, !tbaa !11 %inc143 = add i8 %60, 1 store i8 %inc143, ptr %arrayidx142, align 1, !tbaa !11 %cmp150 = icmp eq i8 %inc143, %59 br i1 %cmp150, label %if.then152, label %for.inc171 if.then152: ; preds = %land.lhs.true %conv153 = trunc i32 %add127 to i16 %idxprom158 = sext i32 %56 to i64 %arrayidx159 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158 store i16 %conv153, ptr %arrayidx159, align 4, !tbaa !12 %conv161 = trunc i32 %add131 to i16 %inc166 = add nsw i32 %56, 1 store i32 %inc166, ptr %arrayidx92, align 4, !tbaa !9 %c169 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158, i32 1 store i16 %conv161, ptr %c169, align 2, !tbaa !15 br label %for.inc171 for.inc171: ; preds = %while.body102, %land.lhs.true, %if.then152 %61 = phi i32 [ %inc166, %if.then152 ], [ %56, %land.lhs.true ], [ %56, %while.body102 ] %f.2 = phi i32 [ 1, %if.then152 ], [ %f.0256, %land.lhs.true ], [ %f.0256, %while.body102 ] %add127.1 = add nsw i32 %40, %conv110 %add131.1 = add nsw i32 %41, %conv119 %idxprom132.1 = sext i32 %add127.1 to i64 %idxprom134.1 = sext i32 %add131.1 to i64 %arrayidx135.1 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom132.1, i64 %idxprom134.1 %62 = load i8, ptr %arrayidx135.1, align 1, !tbaa !11 %cmp137.1 = icmp slt i8 %62, 10 br i1 %cmp137.1, label %land.lhs.true.1, label %for.inc171.1 land.lhs.true.1: ; preds = %for.inc171 %arrayidx142.1 = getelementptr inbounds [1002 x [1002 x i8]], ptr @a, i64 0, i64 %idxprom132.1, i64 %idxprom134.1 %63 = load i8, ptr %arrayidx142.1, align 1, !tbaa !11 %inc143.1 = add i8 %63, 1 store i8 %inc143.1, ptr %arrayidx142.1, align 1, !tbaa !11 %cmp150.1 = icmp eq i8 %inc143.1, %62 br i1 %cmp150.1, label %if.then152.1, label %for.inc171.1 if.then152.1: ; preds = %land.lhs.true.1 %conv153.1 = trunc i32 %add127.1 to i16 %idxprom158.1 = sext i32 %61 to i64 %arrayidx159.1 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.1 store i16 %conv153.1, ptr %arrayidx159.1, align 4, !tbaa !12 %conv161.1 = trunc i32 %add131.1 to i16 %inc166.1 = add nsw i32 %61, 1 store i32 %inc166.1, ptr %arrayidx92, align 4, !tbaa !9 %c169.1 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.1, i32 1 store i16 %conv161.1, ptr %c169.1, align 2, !tbaa !15 br label %for.inc171.1 for.inc171.1: ; preds = %if.then152.1, %land.lhs.true.1, %for.inc171 %64 = phi i32 [ %inc166.1, %if.then152.1 ], [ %61, %land.lhs.true.1 ], [ %61, %for.inc171 ] %f.2.1 = phi i32 [ 1, %if.then152.1 ], [ %f.2, %land.lhs.true.1 ], [ %f.2, %for.inc171 ] %add127.2 = add nsw i32 %42, %conv110 %add131.2 = add nsw i32 %43, %conv119 %idxprom132.2 = sext i32 %add127.2 to i64 %idxprom134.2 = sext i32 %add131.2 to i64 %arrayidx135.2 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom132.2, i64 %idxprom134.2 %65 = load i8, ptr %arrayidx135.2, align 1, !tbaa !11 %cmp137.2 = icmp slt i8 %65, 10 br i1 %cmp137.2, label %land.lhs.true.2, label %for.inc171.2 land.lhs.true.2: ; preds = %for.inc171.1 %arrayidx142.2 = getelementptr inbounds [1002 x [1002 x i8]], ptr @a, i64 0, i64 %idxprom132.2, i64 %idxprom134.2 %66 = load i8, ptr %arrayidx142.2, align 1, !tbaa !11 %inc143.2 = add i8 %66, 1 store i8 %inc143.2, ptr %arrayidx142.2, align 1, !tbaa !11 %cmp150.2 = icmp eq i8 %inc143.2, %65 br i1 %cmp150.2, label %if.then152.2, label %for.inc171.2 if.then152.2: ; preds = %land.lhs.true.2 %conv153.2 = trunc i32 %add127.2 to i16 %idxprom158.2 = sext i32 %64 to i64 %arrayidx159.2 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.2 store i16 %conv153.2, ptr %arrayidx159.2, align 4, !tbaa !12 %conv161.2 = trunc i32 %add131.2 to i16 %inc166.2 = add nsw i32 %64, 1 store i32 %inc166.2, ptr %arrayidx92, align 4, !tbaa !9 %c169.2 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.2, i32 1 store i16 %conv161.2, ptr %c169.2, align 2, !tbaa !15 br label %for.inc171.2 for.inc171.2: ; preds = %if.then152.2, %land.lhs.true.2, %for.inc171.1 %67 = phi i32 [ %inc166.2, %if.then152.2 ], [ %64, %land.lhs.true.2 ], [ %64, %for.inc171.1 ] %f.2.2 = phi i32 [ 1, %if.then152.2 ], [ %f.2.1, %land.lhs.true.2 ], [ %f.2.1, %for.inc171.1 ] %add127.3 = add nsw i32 %44, %conv110 %add131.3 = add nsw i32 %45, %conv119 %idxprom132.3 = sext i32 %add127.3 to i64 %idxprom134.3 = sext i32 %add131.3 to i64 %arrayidx135.3 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom132.3, i64 %idxprom134.3 %68 = load i8, ptr %arrayidx135.3, align 1, !tbaa !11 %cmp137.3 = icmp slt i8 %68, 10 br i1 %cmp137.3, label %land.lhs.true.3, label %for.inc171.3 land.lhs.true.3: ; preds = %for.inc171.2 %arrayidx142.3 = getelementptr inbounds [1002 x [1002 x i8]], ptr @a, i64 0, i64 %idxprom132.3, i64 %idxprom134.3 %69 = load i8, ptr %arrayidx142.3, align 1, !tbaa !11 %inc143.3 = add i8 %69, 1 store i8 %inc143.3, ptr %arrayidx142.3, align 1, !tbaa !11 %cmp150.3 = icmp eq i8 %inc143.3, %68 br i1 %cmp150.3, label %if.then152.3, label %for.inc171.3 if.then152.3: ; preds = %land.lhs.true.3 %conv153.3 = trunc i32 %add127.3 to i16 %idxprom158.3 = sext i32 %67 to i64 %arrayidx159.3 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.3 store i16 %conv153.3, ptr %arrayidx159.3, align 4, !tbaa !12 %conv161.3 = trunc i32 %add131.3 to i16 %inc166.3 = add nsw i32 %67, 1 store i32 %inc166.3, ptr %arrayidx92, align 4, !tbaa !9 %c169.3 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.3, i32 1 store i16 %conv161.3, ptr %c169.3, align 2, !tbaa !15 br label %for.inc171.3 for.inc171.3: ; preds = %if.then152.3, %land.lhs.true.3, %for.inc171.2 %70 = phi i32 [ %inc166.3, %if.then152.3 ], [ %67, %land.lhs.true.3 ], [ %67, %for.inc171.2 ] %f.2.3 = phi i32 [ 1, %if.then152.3 ], [ %f.2.2, %land.lhs.true.3 ], [ %f.2.2, %for.inc171.2 ] %add127.4 = add nsw i32 %46, %conv110 %add131.4 = add nsw i32 %47, %conv119 %idxprom132.4 = sext i32 %add127.4 to i64 %idxprom134.4 = sext i32 %add131.4 to i64 %arrayidx135.4 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom132.4, i64 %idxprom134.4 %71 = load i8, ptr %arrayidx135.4, align 1, !tbaa !11 %cmp137.4 = icmp slt i8 %71, 10 br i1 %cmp137.4, label %land.lhs.true.4, label %for.inc171.4 land.lhs.true.4: ; preds = %for.inc171.3 %arrayidx142.4 = getelementptr inbounds [1002 x [1002 x i8]], ptr @a, i64 0, i64 %idxprom132.4, i64 %idxprom134.4 %72 = load i8, ptr %arrayidx142.4, align 1, !tbaa !11 %inc143.4 = add i8 %72, 1 store i8 %inc143.4, ptr %arrayidx142.4, align 1, !tbaa !11 %cmp150.4 = icmp eq i8 %inc143.4, %71 br i1 %cmp150.4, label %if.then152.4, label %for.inc171.4 if.then152.4: ; preds = %land.lhs.true.4 %conv153.4 = trunc i32 %add127.4 to i16 %idxprom158.4 = sext i32 %70 to i64 %arrayidx159.4 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.4 store i16 %conv153.4, ptr %arrayidx159.4, align 4, !tbaa !12 %conv161.4 = trunc i32 %add131.4 to i16 %inc166.4 = add nsw i32 %70, 1 store i32 %inc166.4, ptr %arrayidx92, align 4, !tbaa !9 %c169.4 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.4, i32 1 store i16 %conv161.4, ptr %c169.4, align 2, !tbaa !15 br label %for.inc171.4 for.inc171.4: ; preds = %if.then152.4, %land.lhs.true.4, %for.inc171.3 %73 = phi i32 [ %inc166.4, %if.then152.4 ], [ %70, %land.lhs.true.4 ], [ %70, %for.inc171.3 ] %f.2.4 = phi i32 [ 1, %if.then152.4 ], [ %f.2.3, %land.lhs.true.4 ], [ %f.2.3, %for.inc171.3 ] %add127.5 = add nsw i32 %48, %conv110 %add131.5 = add nsw i32 %49, %conv119 %idxprom132.5 = sext i32 %add127.5 to i64 %idxprom134.5 = sext i32 %add131.5 to i64 %arrayidx135.5 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom132.5, i64 %idxprom134.5 %74 = load i8, ptr %arrayidx135.5, align 1, !tbaa !11 %cmp137.5 = icmp slt i8 %74, 10 br i1 %cmp137.5, label %land.lhs.true.5, label %for.inc171.5 land.lhs.true.5: ; preds = %for.inc171.4 %arrayidx142.5 = getelementptr inbounds [1002 x [1002 x i8]], ptr @a, i64 0, i64 %idxprom132.5, i64 %idxprom134.5 %75 = load i8, ptr %arrayidx142.5, align 1, !tbaa !11 %inc143.5 = add i8 %75, 1 store i8 %inc143.5, ptr %arrayidx142.5, align 1, !tbaa !11 %cmp150.5 = icmp eq i8 %inc143.5, %74 br i1 %cmp150.5, label %if.then152.5, label %for.inc171.5 if.then152.5: ; preds = %land.lhs.true.5 %conv153.5 = trunc i32 %add127.5 to i16 %idxprom158.5 = sext i32 %73 to i64 %arrayidx159.5 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.5 store i16 %conv153.5, ptr %arrayidx159.5, align 4, !tbaa !12 %conv161.5 = trunc i32 %add131.5 to i16 %inc166.5 = add nsw i32 %73, 1 store i32 %inc166.5, ptr %arrayidx92, align 4, !tbaa !9 %c169.5 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.5, i32 1 store i16 %conv161.5, ptr %c169.5, align 2, !tbaa !15 br label %for.inc171.5 for.inc171.5: ; preds = %if.then152.5, %land.lhs.true.5, %for.inc171.4 %76 = phi i32 [ %inc166.5, %if.then152.5 ], [ %73, %land.lhs.true.5 ], [ %73, %for.inc171.4 ] %f.2.5 = phi i32 [ 1, %if.then152.5 ], [ %f.2.4, %land.lhs.true.5 ], [ %f.2.4, %for.inc171.4 ] %add127.6 = add nsw i32 %50, %conv110 %add131.6 = add nsw i32 %51, %conv119 %idxprom132.6 = sext i32 %add127.6 to i64 %idxprom134.6 = sext i32 %add131.6 to i64 %arrayidx135.6 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom132.6, i64 %idxprom134.6 %77 = load i8, ptr %arrayidx135.6, align 1, !tbaa !11 %cmp137.6 = icmp slt i8 %77, 10 br i1 %cmp137.6, label %land.lhs.true.6, label %for.inc171.6 land.lhs.true.6: ; preds = %for.inc171.5 %arrayidx142.6 = getelementptr inbounds [1002 x [1002 x i8]], ptr @a, i64 0, i64 %idxprom132.6, i64 %idxprom134.6 %78 = load i8, ptr %arrayidx142.6, align 1, !tbaa !11 %inc143.6 = add i8 %78, 1 store i8 %inc143.6, ptr %arrayidx142.6, align 1, !tbaa !11 %cmp150.6 = icmp eq i8 %inc143.6, %77 br i1 %cmp150.6, label %if.then152.6, label %for.inc171.6 if.then152.6: ; preds = %land.lhs.true.6 %conv153.6 = trunc i32 %add127.6 to i16 %idxprom158.6 = sext i32 %76 to i64 %arrayidx159.6 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.6 store i16 %conv153.6, ptr %arrayidx159.6, align 4, !tbaa !12 %conv161.6 = trunc i32 %add131.6 to i16 %inc166.6 = add nsw i32 %76, 1 store i32 %inc166.6, ptr %arrayidx92, align 4, !tbaa !9 %c169.6 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.6, i32 1 store i16 %conv161.6, ptr %c169.6, align 2, !tbaa !15 br label %for.inc171.6 for.inc171.6: ; preds = %if.then152.6, %land.lhs.true.6, %for.inc171.5 %79 = phi i32 [ %inc166.6, %if.then152.6 ], [ %76, %land.lhs.true.6 ], [ %76, %for.inc171.5 ] %f.2.6 = phi i32 [ 1, %if.then152.6 ], [ %f.2.5, %land.lhs.true.6 ], [ %f.2.5, %for.inc171.5 ] %add127.7 = add nsw i32 %52, %conv110 %add131.7 = add nsw i32 %53, %conv119 %idxprom132.7 = sext i32 %add127.7 to i64 %idxprom134.7 = sext i32 %add131.7 to i64 %arrayidx135.7 = getelementptr inbounds [1002 x [1002 x i8]], ptr @map, i64 0, i64 %idxprom132.7, i64 %idxprom134.7 %80 = load i8, ptr %arrayidx135.7, align 1, !tbaa !11 %cmp137.7 = icmp slt i8 %80, 10 br i1 %cmp137.7, label %land.lhs.true.7, label %for.inc171.7 land.lhs.true.7: ; preds = %for.inc171.6 %arrayidx142.7 = getelementptr inbounds [1002 x [1002 x i8]], ptr @a, i64 0, i64 %idxprom132.7, i64 %idxprom134.7 %81 = load i8, ptr %arrayidx142.7, align 1, !tbaa !11 %inc143.7 = add i8 %81, 1 store i8 %inc143.7, ptr %arrayidx142.7, align 1, !tbaa !11 %cmp150.7 = icmp eq i8 %inc143.7, %80 br i1 %cmp150.7, label %if.then152.7, label %for.inc171.7 if.then152.7: ; preds = %land.lhs.true.7 %conv153.7 = trunc i32 %add127.7 to i16 %idxprom158.7 = sext i32 %79 to i64 %arrayidx159.7 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.7 store i16 %conv153.7, ptr %arrayidx159.7, align 4, !tbaa !12 %conv161.7 = trunc i32 %add131.7 to i16 %inc166.7 = add nsw i32 %79, 1 store i32 %inc166.7, ptr %arrayidx92, align 4, !tbaa !9 %c169.7 = getelementptr inbounds [2 x [2000 x %struct.Q]], ptr @q, i64 0, i64 %idxprom91, i64 %idxprom158.7, i32 1 store i16 %conv161.7, ptr %c169.7, align 2, !tbaa !15 br label %for.inc171.7 for.inc171.7: ; preds = %if.then152.7, %land.lhs.true.7, %for.inc171.6 %82 = phi i32 [ %inc166.7, %if.then152.7 ], [ %79, %land.lhs.true.7 ], [ %79, %for.inc171.6 ] %f.2.7 = phi i32 [ 1, %if.then152.7 ], [ %f.2.6, %land.lhs.true.7 ], [ %f.2.6, %for.inc171.6 ] %indvars.iv.next277 = add nsw i64 %indvars.iv276, 1 %83 = load i32, ptr %arrayidx99, align 4, !tbaa !9 %84 = sext i32 %83 to i64 %cmp100 = icmp slt i64 %indvars.iv.next277, %84 br i1 %cmp100, label %while.body102, label %while.end174, !llvm.loop !22 while.end174: ; preds = %for.inc171.7 %85 = trunc i64 %indvars.iv.next277 to i32 store i32 %85, ptr %arrayidx97, align 4, !tbaa !9 %inc175 = add nuw nsw i32 %ans.0, 1 %tobool176.not = icmp eq i32 %f.2.7, 0 %lnot.ext = xor i32 %k2.0, 1 br i1 %tobool176.not, label %for.end181, label %for.cond90 for.end181: ; preds = %while.end174, %while.end174.thread %inc175295 = phi i32 [ %inc175292, %while.end174.thread ], [ %inc175, %while.end174 ] %call182 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc175295) call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %buf) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree 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 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = !{!7, !7, i64 0} !12 = !{!13, !14, i64 0} !13 = !{!"", !14, i64 0, !14, i64 2} !14 = !{!"short", !7, i64 0} !15 = !{!13, !14, i64 2} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.mustprogress"} !18 = distinct !{!18, !17} !19 = !{!14, !14, i64 0} !20 = distinct !{!20, !17} !21 = distinct !{!21, !17} !22 = distinct !{!22, !17}
#include <stdio.h> #include <string.h> int main(void) { long long ans[100][21]; int i, j; int n, num[100]; scanf("%d", &n); memset(num, 0, sizeof(num)); memset(ans, 0, sizeof(ans)); for (i = 0; i < n; i++){ scanf("%d", &num[i]); } ans[0][num[0]] = 1; for (i = 1; i < n - 1; i++){ for (j = 0; j < 21; j++){ if (0 <= j + num[i] && j + num[i] <= 20){ ans[i][j + num[i]] += ans[i - 1][j]; } if (20 >= j - num[i] && j - num[i] >= 0){ ans[i][j - num[i]] += ans[i - 1][j]; } } } printf("%lld\n", ans[n - 2][num[n - 1]]); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126341/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126341/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ans = alloca [100 x [21 x i64]], align 16 %n = alloca i32, align 4 %num = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 16800, ptr nonnull %ans) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %num) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %num, i8 0, i64 400, i1 false) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16800) %ans, i8 0, i64 16800, i1 false) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp96 = icmp sgt i32 %0, 0 br i1 %cmp96, label %for.body, label %for.end.thread for.end.thread: ; preds = %entry store i64 1, ptr %ans, align 16, !tbaa !9 %sub117 = add i32 %0, -1 br label %for.end62 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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 !11 for.end: ; preds = %for.body %.pre = load i32, ptr %num, align 16, !tbaa !5 %3 = sext i32 %.pre to i64 %arrayidx6 = getelementptr inbounds [21 x i64], ptr %ans, i64 0, i64 %3 store i64 1, ptr %arrayidx6, align 8, !tbaa !9 %sub = add i32 %1, -1 %cmp899 = icmp sgt i32 %1, 2 br i1 %cmp899, label %for.cond10.preheader.preheader, label %for.end62 for.cond10.preheader.preheader: ; preds = %for.end %wide.trip.count = zext i32 %sub to i64 br label %for.cond10.preheader for.cond10.preheader: ; preds = %for.cond10.preheader.preheader, %for.inc60 %indvars.iv108 = phi i64 [ 1, %for.cond10.preheader.preheader ], [ %indvars.iv.next109, %for.inc60 ] %arrayidx14 = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %indvars.iv108 %4 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %5 = add nsw i64 %indvars.iv108, -1 br label %for.body12 for.body12: ; preds = %for.cond10.preheader, %for.inc57 %indvars.iv104 = phi i64 [ 0, %for.cond10.preheader ], [ %indvars.iv.next105, %for.inc57 ] %6 = trunc i64 %indvars.iv104 to i32 %7 = add i32 %4, %6 %or.cond = icmp ult i32 %7, 21 br i1 %or.cond, label %if.then, label %if.end if.then: ; preds = %for.body12 %arrayidx24 = getelementptr inbounds [100 x [21 x i64]], ptr %ans, i64 0, i64 %5, i64 %indvars.iv104 %8 = load i64, ptr %arrayidx24, align 8, !tbaa !9 %idxprom30 = zext i32 %7 to i64 %arrayidx31 = getelementptr inbounds [100 x [21 x i64]], ptr %ans, i64 0, i64 %indvars.iv108, i64 %idxprom30 %9 = load i64, ptr %arrayidx31, align 8, !tbaa !9 %add32 = add nsw i64 %9, %8 store i64 %add32, ptr %arrayidx31, align 8, !tbaa !9 br label %if.end if.end: ; preds = %if.then, %for.body12 %10 = trunc i64 %indvars.iv104 to i32 %sub35 = sub nsw i32 %10, %4 %or.cond95 = icmp ult i32 %sub35, 21 br i1 %or.cond95, label %if.then42, label %for.inc57 if.then42: ; preds = %if.end %arrayidx47 = getelementptr inbounds [100 x [21 x i64]], ptr %ans, i64 0, i64 %5, i64 %indvars.iv104 %11 = load i64, ptr %arrayidx47, align 8, !tbaa !9 %idxprom53 = zext i32 %sub35 to i64 %arrayidx54 = getelementptr inbounds [100 x [21 x i64]], ptr %ans, i64 0, i64 %indvars.iv108, i64 %idxprom53 %12 = load i64, ptr %arrayidx54, align 8, !tbaa !9 %add55 = add nsw i64 %12, %11 store i64 %add55, ptr %arrayidx54, align 8, !tbaa !9 br label %for.inc57 for.inc57: ; preds = %if.end, %if.then42 %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %exitcond.not = icmp eq i64 %indvars.iv.next105, 21 br i1 %exitcond.not, label %for.inc60, label %for.body12, !llvm.loop !13 for.inc60: ; preds = %for.inc57 %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1 %exitcond113.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count br i1 %exitcond113.not, label %for.end62, label %for.cond10.preheader, !llvm.loop !14 for.end62: ; preds = %for.inc60, %for.end.thread, %for.end %sub120 = phi i32 [ %sub117, %for.end.thread ], [ %sub, %for.end ], [ %sub, %for.inc60 ] %.lcssa119 = phi i32 [ %0, %for.end.thread ], [ %1, %for.end ], [ %1, %for.inc60 ] %sub63 = add nsw i32 %.lcssa119, -2 %idxprom64 = sext i32 %sub63 to i64 %idxprom67 = sext i32 %sub120 to i64 %arrayidx68 = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %idxprom67 %13 = load i32, ptr %arrayidx68, align 4, !tbaa !5 %idxprom69 = sext i32 %13 to i64 %arrayidx70 = getelementptr inbounds [100 x [21 x i64]], ptr %ans, i64 0, i64 %idxprom64, i64 %idxprom69 %14 = load i64, ptr %arrayidx70, align 8, !tbaa !9 %call71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %14) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %num) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 16800, ptr nonnull %ans) #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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12}
#include <stdio.h> int gcd(int x,int y){ int n1,n2,k1; if(x>y){ n1=x; n2=y; } else{ n1=y; n2=x; } while((n1%n2)!=0){ k1=n1; n1=n2; n2=(k1%n2); } return n2; } void main(){ int i,j,k,n,g; long sum=0; scanf("%d",&n); for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ for(k=1;k<=n;k++){ g=gcd(i,j); g=gcd(g,k); sum+=g; } } } printf("%ld",sum); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126406/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126406/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 { entry: %y.x = tail call i32 @llvm.smin.i32(i32 %x, i32 %y) %x.y = tail call i32 @llvm.smax.i32(i32 %x, i32 %y) br label %while.cond while.cond: ; preds = %while.cond, %entry %n2.1 = phi i32 [ %y.x, %entry ], [ %rem, %while.cond ] %n1.1 = phi i32 [ %x.y, %entry ], [ %n2.1, %while.cond ] %rem = srem i32 %n1.1, %n2.1 %cmp1.not = icmp eq i32 %rem, 0 br i1 %cmp1.not, label %while.end, label %while.cond, !llvm.loop !5 while.end: ; preds = %while.cond ret i32 %n2.1 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !7 %cmp.not39 = icmp slt i32 %0, 1 br i1 %cmp.not39, label %for.end14, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.for.inc12_crit_edge.split %sum.041 = phi i64 [ %add, %for.cond1.for.inc12_crit_edge.split ], [ 0, %entry ] %i.040 = phi i32 [ %inc13, %for.cond1.for.inc12_crit_edge.split ], [ 1, %entry ] br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond1.preheader, %for.cond4.for.inc9_crit_edge %sum.137 = phi i64 [ %sum.041, %for.cond1.preheader ], [ %add, %for.cond4.for.inc9_crit_edge ] %j.036 = phi i32 [ 1, %for.cond1.preheader ], [ %inc10, %for.cond4.for.inc9_crit_edge ] %y.x.i = call i32 @llvm.smin.i32(i32 %i.040, i32 %j.036) %x.y.i = call i32 @llvm.smax.i32(i32 %i.040, i32 %j.036) br label %for.body6 for.body6: ; preds = %for.cond4.preheader, %gcd.exit31 %sum.234 = phi i64 [ %sum.137, %for.cond4.preheader ], [ %add, %gcd.exit31 ] %k.033 = phi i32 [ 1, %for.cond4.preheader ], [ %inc, %gcd.exit31 ] br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %for.body6 %n2.1.i = phi i32 [ %y.x.i, %for.body6 ], [ %rem.i, %while.cond.i ] %n1.1.i = phi i32 [ %x.y.i, %for.body6 ], [ %n2.1.i, %while.cond.i ] %rem.i = srem i32 %n1.1.i, %n2.1.i %cmp1.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp1.not.i, label %gcd.exit, label %while.cond.i, !llvm.loop !5 gcd.exit: ; preds = %while.cond.i %y.x.i24 = call i32 @llvm.smin.i32(i32 %n2.1.i, i32 %k.033) %x.y.i25 = call i32 @llvm.smax.i32(i32 %n2.1.i, i32 %k.033) br label %while.cond.i26 while.cond.i26: ; preds = %while.cond.i26, %gcd.exit %n2.1.i27 = phi i32 [ %y.x.i24, %gcd.exit ], [ %rem.i29, %while.cond.i26 ] %n1.1.i28 = phi i32 [ %x.y.i25, %gcd.exit ], [ %n2.1.i27, %while.cond.i26 ] %rem.i29 = srem i32 %n1.1.i28, %n2.1.i27 %cmp1.not.i30 = icmp eq i32 %rem.i29, 0 br i1 %cmp1.not.i30, label %gcd.exit31, label %while.cond.i26, !llvm.loop !5 gcd.exit31: ; preds = %while.cond.i26 %conv = sext i32 %n2.1.i27 to i64 %add = add nsw i64 %sum.234, %conv %inc = add nuw i32 %k.033, 1 %exitcond.not = icmp eq i32 %k.033, %0 br i1 %exitcond.not, label %for.cond4.for.inc9_crit_edge, label %for.body6, !llvm.loop !11 for.cond4.for.inc9_crit_edge: ; preds = %gcd.exit31 %inc10 = add nuw i32 %j.036, 1 %exitcond43.not = icmp eq i32 %j.036, %0 br i1 %exitcond43.not, label %for.cond1.for.inc12_crit_edge.split, label %for.cond4.preheader, !llvm.loop !12 for.cond1.for.inc12_crit_edge.split: ; preds = %for.cond4.for.inc9_crit_edge %inc13 = add nuw i32 %i.040, 1 %exitcond44.not = icmp eq i32 %i.040, %0 br i1 %exitcond44.not, label %for.end14, label %for.cond1.preheader, !llvm.loop !13 for.end14: ; preds = %for.cond1.for.inc12_crit_edge.split, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.cond1.for.inc12_crit_edge.split ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6} !13 = distinct !{!13, !6}
#include <stdio.h> int main(void) { int no,loc; scanf("%d%d", &no, &loc); int go[no], come[no]; for(int i=0;i<no;i++) scanf("%d", &go[i]); for(int i=0;i<no;i++) scanf("%d", &come[i]); if(go[0]==0) { printf("NO\n"); return 0;} if(go[loc-1]==0&&come[loc-1]==0) {printf("NO\n"); return 0;} if(go[loc-1]==1) {printf("YES\n"); return 0;} int flag=0; for(int i=loc;i<no;i++) { if(go[i]==1&&come[i]==1) flag=1; } if(flag==1) printf("YES\n"); else printf("NO\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12645/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12645/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.7 = 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: %no = alloca i32, align 4 %loc = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %no) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %loc) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %no, ptr noundef nonnull %loc) %0 = load i32, ptr %no, 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 %no, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %cmp69 = icmp sgt i32 %3, 0 br i1 %cmp69, label %for.body, label %for.cond.cleanup6 for.cond4.preheader: ; preds = %for.body %cmp571 = icmp sgt i32 %5, 0 br i1 %cmp571, label %for.body7, label %for.cond.cleanup6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %no, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.cond.cleanup6: ; preds = %for.body7, %entry, %for.cond4.preheader %.lcssa = phi i32 [ %5, %for.cond4.preheader ], [ %3, %entry ], [ %8, %for.body7 ] %7 = load i32, ptr %vla, align 16, !tbaa !5 %cmp15 = icmp eq i32 %7, 0 br i1 %cmp15, label %cleanup, label %if.end for.body7: ; preds = %for.cond4.preheader, %for.body7 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body7 ], [ 0, %for.cond4.preheader ] %arrayidx9 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv79 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %8 = load i32, ptr %no, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp5 = icmp slt i64 %indvars.iv.next80, %9 br i1 %cmp5, label %for.body7, label %for.cond.cleanup6, !llvm.loop !11 if.end: ; preds = %for.cond.cleanup6 %10 = load i32, ptr %loc, align 4, !tbaa !5 %sub = add nsw i32 %10, -1 %idxprom17 = sext i32 %sub to i64 %arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %idxprom17 %11 = load i32, ptr %arrayidx18, align 4, !tbaa !5 switch i32 %11, label %for.cond35.preheader [ i32 0, label %land.lhs.true i32 1, label %cleanup ] for.cond35.preheader: ; preds = %land.lhs.true, %if.end %cmp3673 = icmp slt i32 %10, %.lcssa br i1 %cmp3673, label %for.body38.preheader, label %if.else for.body38.preheader: ; preds = %for.cond35.preheader %12 = sext i32 %10 to i64 %wide.trip.count = sext i32 %.lcssa to i64 %13 = sub nsw i64 %wide.trip.count, %12 %xtraiter = and i64 %13, 1 %14 = sub nsw i64 0, %wide.trip.count %15 = xor i64 %12, %14 %16 = icmp eq i64 %15, -1 br i1 %16, label %for.cond.cleanup37.unr-lcssa, label %for.body38.preheader.new for.body38.preheader.new: ; preds = %for.body38.preheader %unroll_iter = and i64 %13, -2 br label %for.body38 land.lhs.true: ; preds = %if.end %arrayidx22 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom17 %17 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23 = icmp eq i32 %17, 0 br i1 %cmp23, label %cleanup, label %for.cond35.preheader for.cond.cleanup37.unr-lcssa: ; preds = %for.inc48.1, %for.body38.preheader %flag.1.lcssa.ph = phi i32 [ undef, %for.body38.preheader ], [ %flag.1.1, %for.inc48.1 ] %indvars.iv82.unr = phi i64 [ %12, %for.body38.preheader ], [ %indvars.iv.next83.1, %for.inc48.1 ] %flag.074.unr = phi i32 [ 0, %for.body38.preheader ], [ %flag.1.1, %for.inc48.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup37, label %for.body38.epil for.body38.epil: ; preds = %for.cond.cleanup37.unr-lcssa %arrayidx40.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv82.unr %18 = load i32, ptr %arrayidx40.epil, align 4, !tbaa !5 %cmp41.epil = icmp eq i32 %18, 1 br i1 %cmp41.epil, label %land.lhs.true42.epil, label %for.cond.cleanup37 land.lhs.true42.epil: ; preds = %for.body38.epil %arrayidx44.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv82.unr %19 = load i32, ptr %arrayidx44.epil, align 4, !tbaa !5 %cmp45.epil = icmp eq i32 %19, 1 %spec.select.epil = select i1 %cmp45.epil, i32 1, i32 %flag.074.unr br label %for.cond.cleanup37 for.cond.cleanup37: ; preds = %for.body38.epil, %land.lhs.true42.epil, %for.cond.cleanup37.unr-lcssa %flag.1.lcssa = phi i32 [ %flag.1.lcssa.ph, %for.cond.cleanup37.unr-lcssa ], [ %flag.074.unr, %for.body38.epil ], [ %spec.select.epil, %land.lhs.true42.epil ] %20 = icmp eq i32 %flag.1.lcssa, 1 br i1 %20, label %cleanup, label %if.else for.body38: ; preds = %for.inc48.1, %for.body38.preheader.new %indvars.iv82 = phi i64 [ %12, %for.body38.preheader.new ], [ %indvars.iv.next83.1, %for.inc48.1 ] %flag.074 = phi i32 [ 0, %for.body38.preheader.new ], [ %flag.1.1, %for.inc48.1 ] %niter = phi i64 [ 0, %for.body38.preheader.new ], [ %niter.next.1, %for.inc48.1 ] %arrayidx40 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv82 %21 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp41 = icmp eq i32 %21, 1 br i1 %cmp41, label %land.lhs.true42, label %for.inc48 land.lhs.true42: ; preds = %for.body38 %arrayidx44 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv82 %22 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %cmp45 = icmp eq i32 %22, 1 %spec.select = select i1 %cmp45, i32 1, i32 %flag.074 br label %for.inc48 for.inc48: ; preds = %land.lhs.true42, %for.body38 %flag.1 = phi i32 [ %flag.074, %for.body38 ], [ %spec.select, %land.lhs.true42 ] %indvars.iv.next83 = add nsw i64 %indvars.iv82, 1 %arrayidx40.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next83 %23 = load i32, ptr %arrayidx40.1, align 4, !tbaa !5 %cmp41.1 = icmp eq i32 %23, 1 br i1 %cmp41.1, label %land.lhs.true42.1, label %for.inc48.1 land.lhs.true42.1: ; preds = %for.inc48 %arrayidx44.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next83 %24 = load i32, ptr %arrayidx44.1, align 4, !tbaa !5 %cmp45.1 = icmp eq i32 %24, 1 %spec.select.1 = select i1 %cmp45.1, i32 1, i32 %flag.1 br label %for.inc48.1 for.inc48.1: ; preds = %land.lhs.true42.1, %for.inc48 %flag.1.1 = phi i32 [ %flag.1, %for.inc48 ], [ %spec.select.1, %land.lhs.true42.1 ] %indvars.iv.next83.1 = add nsw i64 %indvars.iv82, 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.cond.cleanup37.unr-lcssa, label %for.body38, !llvm.loop !12 if.else: ; preds = %for.cond35.preheader, %for.cond.cleanup37 br label %cleanup cleanup: ; preds = %for.cond.cleanup37, %if.end, %land.lhs.true, %for.cond.cleanup6, %if.else %str.4.sink = phi ptr [ @str.7, %if.else ], [ @str.7, %for.cond.cleanup6 ], [ @str.7, %land.lhs.true ], [ @str.5, %if.end ], [ @str.5, %for.cond.cleanup37 ] %puts65 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %loc) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %no) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <math.h> int main(){ int k, ans=0, r1, r2, l, m, n, a=1, b=1, c=1; scanf("%d", &k); while(a <= k){ while(b <= k){ while(c <= k){ if(a==c){ ans += a; } else{ l = a, m = b, n = c;//aとcの最大公約数r1 r1 = n % l; while(r1!=0){ n = l; l = r1; r1 = n % l; } if(a==b || b==c){ ans = ans + l*3; } else{ r2 = m % l; while(r2!=0){//r1とbの最大公約数r2 m = l; l = r2; r2 = m % l; } ans = ans + l*6; } } //printf("(%d,%d,%d), l = %d, ans = %d\n", a, b, c, l, ans); c++; } b++; c = b; } a++; b = a; c = a; } printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126493/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126493/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp.not73 = icmp slt i32 %0, 1 br i1 %cmp.not73, label %while.end30, label %while.cond1.preheader while.cond1.preheader: ; preds = %entry, %while.end28 %c.075 = phi i32 [ %inc29, %while.end28 ], [ 1, %entry ] %ans.074 = phi i32 [ %.us-phi, %while.end28 ], [ 0, %entry ] br label %while.cond4.preheader while.cond4.preheader: ; preds = %while.cond1.preheader, %while.end26 %c.172 = phi i32 [ %c.075, %while.cond1.preheader ], [ %inc27, %while.end26 ] %ans.171 = phi i32 [ %ans.074, %while.cond1.preheader ], [ %.us-phi, %while.end26 ] %cmp12 = icmp eq i32 %c.075, %c.172 %cmp12.fr = freeze i1 %cmp12 br i1 %cmp12.fr, label %while.body6.us, label %while.body6 while.body6.us: ; preds = %while.cond4.preheader, %if.end25.us %c.270.us = phi i32 [ %inc.us, %if.end25.us ], [ %c.172, %while.cond4.preheader ] %ans.269.us = phi i32 [ %ans.3.us, %if.end25.us ], [ %ans.171, %while.cond4.preheader ] %cmp7.us = icmp eq i32 %c.075, %c.270.us br i1 %cmp7.us, label %if.end25.us, label %if.else.us if.else.us: ; preds = %while.body6.us %rem.us = urem i32 %c.270.us, %c.075 %cmp9.not62.us = icmp eq i32 %rem.us, 0 br i1 %cmp9.not62.us, label %while.end.us, label %while.body10.us while.body10.us: ; preds = %if.else.us, %while.body10.us %l.064.us = phi i32 [ %r1.063.us, %while.body10.us ], [ %c.075, %if.else.us ] %r1.063.us = phi i32 [ %rem11.us, %while.body10.us ], [ %rem.us, %if.else.us ] %rem11.us = srem i32 %l.064.us, %r1.063.us %cmp9.not.us = icmp eq i32 %rem11.us, 0 br i1 %cmp9.not.us, label %while.end.us, label %while.body10.us, !llvm.loop !9 while.end.us: ; preds = %while.body10.us, %if.else.us %l.0.lcssa.us = phi i32 [ %c.075, %if.else.us ], [ %r1.063.us, %while.body10.us ] %mul.us = mul nsw i32 %l.0.lcssa.us, 3 br label %if.end25.us if.end25.us: ; preds = %while.end.us, %while.body6.us %c.0.pn.us = phi i32 [ %mul.us, %while.end.us ], [ %c.075, %while.body6.us ] %ans.3.us = add nsw i32 %c.0.pn.us, %ans.269.us %inc.us = add nuw nsw i32 %c.270.us, 1 %cmp5.not.us.not = icmp slt i32 %c.270.us, %0 br i1 %cmp5.not.us.not, label %while.body6.us, label %while.end26, !llvm.loop !11 while.body6: ; preds = %while.cond4.preheader, %if.end25 %c.270 = phi i32 [ %inc, %if.end25 ], [ %c.172, %while.cond4.preheader ] %ans.269 = phi i32 [ %ans.3, %if.end25 ], [ %ans.171, %while.cond4.preheader ] %cmp7 = icmp eq i32 %c.075, %c.270 br i1 %cmp7, label %if.end25, label %if.else if.else: ; preds = %while.body6 %rem = urem i32 %c.270, %c.075 %cmp9.not62 = icmp eq i32 %rem, 0 br i1 %cmp9.not62, label %while.end, label %while.body10 while.body10: ; preds = %if.else, %while.body10 %l.064 = phi i32 [ %r1.063, %while.body10 ], [ %c.075, %if.else ] %r1.063 = phi i32 [ %rem11, %while.body10 ], [ %rem, %if.else ] %rem11 = srem i32 %l.064, %r1.063 %cmp9.not = icmp eq i32 %rem11, 0 br i1 %cmp9.not, label %while.end, label %while.body10, !llvm.loop !9 while.end: ; preds = %while.body10, %if.else %l.0.lcssa = phi i32 [ %c.075, %if.else ], [ %r1.063, %while.body10 ] %cmp13 = icmp eq i32 %c.172, %c.270 br i1 %cmp13, label %if.then14, label %if.else16 if.then14: ; preds = %while.end %mul = mul nsw i32 %l.0.lcssa, 3 br label %if.end25 if.else16: ; preds = %while.end %rem17 = srem i32 %c.172, %l.0.lcssa %cmp19.not65 = icmp eq i32 %rem17, 0 br i1 %cmp19.not65, label %while.end22, label %while.body20 while.body20: ; preds = %if.else16, %while.body20 %l.167 = phi i32 [ %r2.066, %while.body20 ], [ %l.0.lcssa, %if.else16 ] %r2.066 = phi i32 [ %rem21, %while.body20 ], [ %rem17, %if.else16 ] %rem21 = srem i32 %l.167, %r2.066 %cmp19.not = icmp eq i32 %rem21, 0 br i1 %cmp19.not, label %while.end22, label %while.body20, !llvm.loop !12 while.end22: ; preds = %while.body20, %if.else16 %l.1.lcssa = phi i32 [ %l.0.lcssa, %if.else16 ], [ %r2.066, %while.body20 ] %mul23 = mul nsw i32 %l.1.lcssa, 6 br label %if.end25 if.end25: ; preds = %while.body6, %if.then14, %while.end22 %c.0.pn = phi i32 [ %mul, %if.then14 ], [ %mul23, %while.end22 ], [ %c.075, %while.body6 ] %ans.3 = add nsw i32 %c.0.pn, %ans.269 %inc = add nuw nsw i32 %c.270, 1 %cmp5.not.not = icmp slt i32 %c.270, %0 br i1 %cmp5.not.not, label %while.body6, label %while.end26, !llvm.loop !11 while.end26: ; preds = %if.end25, %if.end25.us %.us-phi = phi i32 [ %ans.3.us, %if.end25.us ], [ %ans.3, %if.end25 ] %inc27 = add nuw nsw i32 %c.172, 1 %cmp2.not.not = icmp slt i32 %c.172, %0 br i1 %cmp2.not.not, label %while.cond4.preheader, label %while.end28, !llvm.loop !13 while.end28: ; preds = %while.end26 %inc29 = add nuw i32 %c.075, 1 %exitcond.not = icmp eq i32 %c.075, %0 br i1 %exitcond.not, label %while.end30, label %while.cond1.preheader, !llvm.loop !14 while.end30: ; preds = %while.end28, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %.us-phi, %while.end28 ] %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa) 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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> #define rep(i, n) for(int i=1; i<(int)(n);i++) int main(){ int a, b, c, k, ans=0; int gcd_3(int ,int ,int ); scanf("%d",&k); rep(a,k+1){ rep(b,k+1){ rep(c,k+1){ ans += gcd_3(a,b,c); } } } printf("%d",ans); } int gcd_3(int a,int b,int c){ int gcd(int ,int ); return gcd(gcd(a,b),c); } int gcd(int a, int b) { return b?gcd(b,a%b):a;}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126543/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126543/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp.not37 = icmp slt i32 %0, 1 br i1 %cmp.not37, label %for.cond.cleanup, label %for.cond3.preheader for.cond3.preheader: ; preds = %entry, %for.cond3.for.cond.cleanup6_crit_edge.split %a1.039 = phi i32 [ %inc20, %for.cond3.for.cond.cleanup6_crit_edge.split ], [ 1, %entry ] %ans.038 = phi i32 [ %add15, %for.cond3.for.cond.cleanup6_crit_edge.split ], [ 0, %entry ] br label %for.cond9.preheader for.cond.cleanup: ; preds = %for.cond3.for.cond.cleanup6_crit_edge.split, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %add15, %for.cond3.for.cond.cleanup6_crit_edge.split ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 ret i32 0 for.cond9.preheader: ; preds = %for.cond3.preheader, %for.cond9.for.cond.cleanup12_crit_edge %b2.035 = phi i32 [ 1, %for.cond3.preheader ], [ %inc17, %for.cond9.for.cond.cleanup12_crit_edge ] %ans.134 = phi i32 [ %ans.038, %for.cond3.preheader ], [ %add15, %for.cond9.for.cond.cleanup12_crit_edge ] br label %cond.true.i.i.preheader for.cond3.for.cond.cleanup6_crit_edge.split: ; preds = %for.cond9.for.cond.cleanup12_crit_edge %inc20 = add nuw i32 %a1.039, 1 %exitcond42.not = icmp eq i32 %a1.039, %0 br i1 %exitcond42.not, label %for.cond.cleanup, label %for.cond3.preheader, !llvm.loop !9 cond.true.i.i.preheader: ; preds = %for.cond9.preheader, %gcd_3.exit %c8.032 = phi i32 [ 1, %for.cond9.preheader ], [ %inc, %gcd_3.exit ] %ans.231 = phi i32 [ %ans.134, %for.cond9.preheader ], [ %add15, %gcd_3.exit ] br label %cond.true.i.i for.cond9.for.cond.cleanup12_crit_edge: ; preds = %gcd_3.exit %inc17 = add nuw i32 %b2.035, 1 %exitcond41.not = icmp eq i32 %b2.035, %0 br i1 %exitcond41.not, label %for.cond3.for.cond.cleanup6_crit_edge.split, label %for.cond9.preheader, !llvm.loop !11 cond.true.i.i: ; preds = %cond.true.i.i.preheader, %cond.true.i.i %b.tr6.i.i = phi i32 [ %rem.i.i, %cond.true.i.i ], [ %b2.035, %cond.true.i.i.preheader ] %a.tr5.i.i = phi i32 [ %b.tr6.i.i, %cond.true.i.i ], [ %a1.039, %cond.true.i.i.preheader ] %rem.i.i = srem i32 %a.tr5.i.i, %b.tr6.i.i %tobool.not.i.i = icmp eq i32 %rem.i.i, 0 br i1 %tobool.not.i.i, label %cond.true.i3.i, label %cond.true.i.i cond.true.i3.i: ; preds = %cond.true.i.i, %cond.true.i3.i %b.tr6.i4.i = phi i32 [ %rem.i6.i, %cond.true.i3.i ], [ %c8.032, %cond.true.i.i ] %a.tr5.i5.i = phi i32 [ %b.tr6.i4.i, %cond.true.i3.i ], [ %b.tr6.i.i, %cond.true.i.i ] %rem.i6.i = srem i32 %a.tr5.i5.i, %b.tr6.i4.i %tobool.not.i7.i = icmp eq i32 %rem.i6.i, 0 br i1 %tobool.not.i7.i, label %gcd_3.exit, label %cond.true.i3.i gcd_3.exit: ; preds = %cond.true.i3.i %add15 = add nsw i32 %b.tr6.i4.i, %ans.231 %inc = add nuw i32 %c8.032, 1 %exitcond.not = icmp eq i32 %c8.032, %0 br i1 %exitcond.not, label %for.cond9.for.cond.cleanup12_crit_edge, label %cond.true.i.i.preheader, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd_3(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #3 { entry: %tobool.not4.i = icmp eq i32 %b, 0 br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i cond.true.i: ; preds = %entry, %cond.true.i %b.tr6.i = phi i32 [ %rem.i, %cond.true.i ], [ %b, %entry ] %a.tr5.i = phi i32 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ] %rem.i = srem i32 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i32 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i gcd.exit: ; preds = %cond.true.i, %entry %a.tr.lcssa.i = phi i32 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ] %tobool.not4.i2 = icmp eq i32 %c, 0 br i1 %tobool.not4.i2, label %gcd.exit9, label %cond.true.i3 cond.true.i3: ; preds = %gcd.exit, %cond.true.i3 %b.tr6.i4 = phi i32 [ %rem.i6, %cond.true.i3 ], [ %c, %gcd.exit ] %a.tr5.i5 = phi i32 [ %b.tr6.i4, %cond.true.i3 ], [ %a.tr.lcssa.i, %gcd.exit ] %rem.i6 = srem i32 %a.tr5.i5, %b.tr6.i4 %tobool.not.i7 = icmp eq i32 %rem.i6, 0 br i1 %tobool.not.i7, label %gcd.exit9, label %cond.true.i3 gcd.exit9: ; preds = %cond.true.i3, %gcd.exit %a.tr.lcssa.i8 = phi i32 [ %a.tr.lcssa.i, %gcd.exit ], [ %b.tr6.i4, %cond.true.i3 ] ret i32 %a.tr.lcssa.i8 } ; 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 norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %tobool.not4 = icmp eq i32 %b, 0 br i1 %tobool.not4, label %cond.end, label %cond.true cond.true: ; preds = %entry, %cond.true %b.tr6 = phi i32 [ %rem, %cond.true ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %cond.true ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.end: ; preds = %cond.true, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %cond.true ] ret i32 %a.tr.lcssa } attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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> #include <stdlib.h> int gcd(int a, int b, int c) { int i=c,max; if(a>=b && a>=c) { i=a; } if(b>=a,b>=c) { i=b; } while(i>0) { if(a%i==0 && b%i==0 && c%i==0) { max=i; break; } i--; } return max; } int main(void) { int K,i,r,t; int sum1=0,sum2=0,sum3=0,sum4=0; long sum; scanf("%d",&K); for(i=1;i<=K;i++) { for(r=1;r<i;r++) { for(t=1;t<r;t++) { sum1+=gcd(i,r,t); } } } for(i=1;i<=K;i++) { for(r=1;r<i;r++) { sum2+=gcd(i,r,r); } } for(i=1;i<=K;i++) { for(r=1;r<i;r++) { sum3+=gcd(i,i,r); } } for(i=0;i<=K;i++) { sum4+=i; } sum=sum1*6+sum2*3+sum3*3+sum4; // printf("%d %d %d %d %d",sum1,sum2,sum3,sum4,sum); printf("%ld",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126600/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126600/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 { entry: %cmp.not = icmp slt i32 %a, %b %cmp1.not = icmp slt i32 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %i.0 = select i1 %or.cond, i32 %c, i32 %a %cmp3.not = icmp slt i32 %b, %c %i.1 = select i1 %cmp3.not, i32 %i.0, i32 %b %cmp737 = icmp sgt i32 %i.1, 0 br i1 %cmp737, label %while.body, label %while.end while.body: ; preds = %entry, %if.end20 %i.238 = phi i32 [ %dec, %if.end20 ], [ %i.1, %entry ] %rem = srem i32 %a, %i.238 %cmp9 = icmp eq i32 %rem, 0 br i1 %cmp9, label %land.lhs.true11, label %if.end20 land.lhs.true11: ; preds = %while.body %rem12 = srem i32 %b, %i.238 %cmp13 = icmp eq i32 %rem12, 0 br i1 %cmp13, label %land.lhs.true15, label %if.end20 land.lhs.true15: ; preds = %land.lhs.true11 %rem16 = srem i32 %c, %i.238 %cmp17 = icmp eq i32 %rem16, 0 br i1 %cmp17, label %while.end, label %if.end20 if.end20: ; preds = %land.lhs.true15, %land.lhs.true11, %while.body %dec = add nsw i32 %i.238, -1 %cmp7 = icmp sgt i32 %i.238, 1 br i1 %cmp7, label %while.body, label %while.end, !llvm.loop !5 while.end: ; preds = %if.end20, %land.lhs.true15, %entry %i.2.lcssa = phi i32 [ %i.1, %entry ], [ %i.238, %land.lhs.true15 ], [ 0, %if.end20 ] ret i32 %i.2.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K) %0 = load i32, ptr %K, align 4, !tbaa !7 %cmp.not130 = icmp slt i32 %0, 1 br i1 %cmp.not130, label %for.cond42.preheader, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc11 %i.0132 = phi i32 [ %inc12, %for.inc11 ], [ 1, %entry ] %sum1.0131 = phi i32 [ %sum1.1.lcssa, %for.inc11 ], [ 0, %entry ] %cmp2126 = icmp ugt i32 %i.0132, 1 br i1 %cmp2126, label %for.cond4.preheader, label %for.inc11 for.cond14.preheader: ; preds = %for.inc11 %1 = mul nsw i32 %sum1.1.lcssa, 6 br i1 %cmp.not130, label %for.cond42.preheader, label %for.cond17.preheader for.cond4.preheader: ; preds = %for.cond1.preheader, %for.inc8 %sum1.1128 = phi i32 [ %sum1.2.lcssa, %for.inc8 ], [ %sum1.0131, %for.cond1.preheader ] %r.0127 = phi i32 [ %inc9, %for.inc8 ], [ 1, %for.cond1.preheader ] %cmp5123 = icmp ugt i32 %r.0127, 1 br i1 %cmp5123, label %while.body.i.preheader, label %for.inc8 while.body.i.preheader: ; preds = %for.cond4.preheader, %gcd.exit %sum1.2125 = phi i32 [ %add, %gcd.exit ], [ %sum1.1128, %for.cond4.preheader ] %t.0124 = phi i32 [ %inc, %gcd.exit ], [ 1, %for.cond4.preheader ] br label %while.body.i while.body.i: ; preds = %while.body.i.preheader, %if.end20.i %i.238.i = phi i32 [ %dec.i, %if.end20.i ], [ %r.0127, %while.body.i.preheader ] %rem.i = srem i32 %i.0132, %i.238.i %cmp9.i = icmp eq i32 %rem.i, 0 br i1 %cmp9.i, label %land.lhs.true11.i, label %if.end20.i land.lhs.true11.i: ; preds = %while.body.i %rem12.i = srem i32 %r.0127, %i.238.i %cmp13.i = icmp eq i32 %rem12.i, 0 br i1 %cmp13.i, label %land.lhs.true15.i, label %if.end20.i land.lhs.true15.i: ; preds = %land.lhs.true11.i %rem16.i = srem i32 %t.0124, %i.238.i %cmp17.i = icmp eq i32 %rem16.i, 0 br i1 %cmp17.i, label %gcd.exit, label %if.end20.i if.end20.i: ; preds = %land.lhs.true15.i, %land.lhs.true11.i, %while.body.i %dec.i = add nsw i32 %i.238.i, -1 %cmp7.i = icmp sgt i32 %i.238.i, 1 br i1 %cmp7.i, label %while.body.i, label %gcd.exit, !llvm.loop !5 gcd.exit: ; preds = %land.lhs.true15.i, %if.end20.i %i.2.lcssa.i = phi i32 [ %i.238.i, %land.lhs.true15.i ], [ 0, %if.end20.i ] %add = add nsw i32 %i.2.lcssa.i, %sum1.2125 %inc = add nuw nsw i32 %t.0124, 1 %exitcond.not = icmp eq i32 %inc, %r.0127 br i1 %exitcond.not, label %for.inc8, label %while.body.i.preheader, !llvm.loop !11 for.inc8: ; preds = %gcd.exit, %for.cond4.preheader %sum1.2.lcssa = phi i32 [ %sum1.1128, %for.cond4.preheader ], [ %add, %gcd.exit ] %inc9 = add nuw nsw i32 %r.0127, 1 %exitcond155.not = icmp eq i32 %inc9, %i.0132 br i1 %exitcond155.not, label %for.inc11, label %for.cond4.preheader, !llvm.loop !12 for.inc11: ; preds = %for.inc8, %for.cond1.preheader %sum1.1.lcssa = phi i32 [ %sum1.0131, %for.cond1.preheader ], [ %sum1.2.lcssa, %for.inc8 ] %inc12 = add nuw i32 %i.0132, 1 %exitcond156.not = icmp eq i32 %i.0132, %0 br i1 %exitcond156.not, label %for.cond14.preheader, label %for.cond1.preheader, !llvm.loop !13 for.cond17.preheader: ; preds = %for.cond14.preheader, %for.inc25 %i.1141 = phi i32 [ %inc26, %for.inc25 ], [ 1, %for.cond14.preheader ] %sum2.0140 = phi i32 [ %sum2.1.lcssa, %for.inc25 ], [ 0, %for.cond14.preheader ] %cmp18135 = icmp ugt i32 %i.1141, 1 br i1 %cmp18135, label %while.body.i89.preheader, label %for.inc25 for.cond28.preheader: ; preds = %for.inc25 br i1 %cmp.not130, label %for.cond42.preheader, label %for.cond31.preheader while.body.i89.preheader: ; preds = %for.cond17.preheader, %gcd.exit103 %sum2.1137 = phi i32 [ %add21, %gcd.exit103 ], [ %sum2.0140, %for.cond17.preheader ] %r.1136 = phi i32 [ %inc23, %gcd.exit103 ], [ 1, %for.cond17.preheader ] br label %while.body.i89 while.body.i89: ; preds = %while.body.i89.preheader, %if.end20.i93 %i.238.i90 = phi i32 [ %dec.i94, %if.end20.i93 ], [ %r.1136, %while.body.i89.preheader ] %rem.i91 = srem i32 %i.1141, %i.238.i90 %cmp9.i92 = icmp eq i32 %rem.i91, 0 br i1 %cmp9.i92, label %land.lhs.true11.i97, label %if.end20.i93 land.lhs.true11.i97: ; preds = %while.body.i89 %rem12.i98 = srem i32 %r.1136, %i.238.i90 %cmp13.i99 = icmp eq i32 %rem12.i98, 0 br i1 %cmp13.i99, label %gcd.exit103, label %if.end20.i93 if.end20.i93: ; preds = %land.lhs.true11.i97, %while.body.i89 %dec.i94 = add nsw i32 %i.238.i90, -1 %cmp7.i95 = icmp sgt i32 %i.238.i90, 1 br i1 %cmp7.i95, label %while.body.i89, label %gcd.exit103, !llvm.loop !5 gcd.exit103: ; preds = %land.lhs.true11.i97, %if.end20.i93 %i.2.lcssa.i96 = phi i32 [ 0, %if.end20.i93 ], [ %i.238.i90, %land.lhs.true11.i97 ] %add21 = add nsw i32 %i.2.lcssa.i96, %sum2.1137 %inc23 = add nuw nsw i32 %r.1136, 1 %exitcond157.not = icmp eq i32 %inc23, %i.1141 br i1 %exitcond157.not, label %for.inc25, label %while.body.i89.preheader, !llvm.loop !14 for.inc25: ; preds = %gcd.exit103, %for.cond17.preheader %sum2.1.lcssa = phi i32 [ %sum2.0140, %for.cond17.preheader ], [ %add21, %gcd.exit103 ] %inc26 = add nuw i32 %i.1141, 1 %exitcond158.not = icmp eq i32 %i.1141, %0 br i1 %exitcond158.not, label %for.cond28.preheader, label %for.cond17.preheader, !llvm.loop !15 for.cond31.preheader: ; preds = %for.cond28.preheader, %for.inc39 %i.2149 = phi i32 [ %inc40, %for.inc39 ], [ 1, %for.cond28.preheader ] %sum3.0148 = phi i32 [ %sum3.1.lcssa, %for.inc39 ], [ 0, %for.cond28.preheader ] %cmp32143 = icmp ugt i32 %i.2149, 1 br i1 %cmp32143, label %while.body.i108.preheader, label %for.inc39 for.cond42.preheader: ; preds = %for.inc39, %entry, %for.cond14.preheader, %for.cond28.preheader %sum2.0.lcssa166 = phi i32 [ %sum2.1.lcssa, %for.cond28.preheader ], [ 0, %for.cond14.preheader ], [ 0, %entry ], [ %sum2.1.lcssa, %for.inc39 ] %sum1.0.lcssa162165 = phi i32 [ %1, %for.cond28.preheader ], [ %1, %for.cond14.preheader ], [ 0, %entry ], [ %1, %for.inc39 ] %sum3.0.lcssa = phi i32 [ 0, %for.cond28.preheader ], [ 0, %for.cond14.preheader ], [ 0, %entry ], [ %sum3.1.lcssa, %for.inc39 ] %cmp43.not151 = icmp slt i32 %0, 0 br i1 %cmp43.not151, label %for.end48, label %for.body44.preheader for.body44.preheader: ; preds = %for.cond42.preheader %2 = zext i32 %0 to i33 %3 = add nsw i32 %0, -1 %4 = zext i32 %3 to i33 %5 = mul i33 %2, %4 %6 = lshr i33 %5, 1 %7 = trunc i33 %6 to i32 %8 = add i32 %0, %7 br label %for.end48 while.body.i108.preheader: ; preds = %for.cond31.preheader, %gcd.exit122 %sum3.1145 = phi i32 [ %add35, %gcd.exit122 ], [ %sum3.0148, %for.cond31.preheader ] %r.2144 = phi i32 [ %inc37, %gcd.exit122 ], [ 1, %for.cond31.preheader ] br label %while.body.i108 while.body.i108: ; preds = %while.body.i108.preheader, %if.end20.i112 %i.238.i109 = phi i32 [ %dec.i113, %if.end20.i112 ], [ %i.2149, %while.body.i108.preheader ] %rem.i110 = srem i32 %i.2149, %i.238.i109 %cmp9.i111 = icmp eq i32 %rem.i110, 0 br i1 %cmp9.i111, label %land.lhs.true15.i119, label %if.end20.i112 land.lhs.true15.i119: ; preds = %while.body.i108 %rem16.i120 = srem i32 %r.2144, %i.238.i109 %cmp17.i121 = icmp eq i32 %rem16.i120, 0 br i1 %cmp17.i121, label %gcd.exit122, label %if.end20.i112 if.end20.i112: ; preds = %land.lhs.true15.i119, %while.body.i108 %dec.i113 = add nsw i32 %i.238.i109, -1 %cmp7.i114 = icmp sgt i32 %i.238.i109, 1 br i1 %cmp7.i114, label %while.body.i108, label %gcd.exit122, !llvm.loop !5 gcd.exit122: ; preds = %land.lhs.true15.i119, %if.end20.i112 %i.2.lcssa.i115 = phi i32 [ %i.238.i109, %land.lhs.true15.i119 ], [ 0, %if.end20.i112 ] %add35 = add nsw i32 %i.2.lcssa.i115, %sum3.1145 %inc37 = add nuw nsw i32 %r.2144, 1 %exitcond159.not = icmp eq i32 %inc37, %i.2149 br i1 %exitcond159.not, label %for.inc39, label %while.body.i108.preheader, !llvm.loop !16 for.inc39: ; preds = %gcd.exit122, %for.cond31.preheader %sum3.1.lcssa = phi i32 [ %sum3.0148, %for.cond31.preheader ], [ %add35, %gcd.exit122 ] %inc40 = add nuw i32 %i.2149, 1 %exitcond160.not = icmp eq i32 %i.2149, %0 br i1 %exitcond160.not, label %for.cond42.preheader, label %for.cond31.preheader, !llvm.loop !17 for.end48: ; preds = %for.body44.preheader, %for.cond42.preheader %sum4.0.lcssa = phi i32 [ 0, %for.cond42.preheader ], [ %8, %for.body44.preheader ] %reass.add = add i32 %sum3.0.lcssa, %sum2.0.lcssa166 %reass.mul = mul i32 %reass.add, 3 %add52 = add i32 %reass.mul, %sum1.0.lcssa162165 %add53 = add i32 %add52, %sum4.0.lcssa %conv = sext i32 %add53 to i64 %call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %conv) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6} !13 = distinct !{!13, !6} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6}
#include <stdio.h> #include <stdlib.h> #include <math.h> int gcd(int x, int y); int main() { int a, b, c, N; int sum=0; scanf("%d", &N); for(c=1;c<=N;c++){ for(b=1;b<=N;b++){ for(a=1;a<=N;a++){ sum += gcd(gcd(a,b),c); } } } printf("%d", sum); return 0; } int gcd(int x, int y) { int r; while((r = x % y) != 0) { x = y; y = r; } return y; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126644/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126644/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 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 %cmp.not36 = icmp slt i32 %0, 1 br i1 %cmp.not36, label %for.end14, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.for.inc12_crit_edge.split %sum.038 = phi i32 [ %add, %for.cond1.for.inc12_crit_edge.split ], [ 0, %entry ] %c.037 = phi i32 [ %inc13, %for.cond1.for.inc12_crit_edge.split ], [ 1, %entry ] br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond1.preheader, %for.cond4.for.inc9_crit_edge %sum.134 = phi i32 [ %sum.038, %for.cond1.preheader ], [ %add, %for.cond4.for.inc9_crit_edge ] %b.033 = phi i32 [ 1, %for.cond1.preheader ], [ %inc10, %for.cond4.for.inc9_crit_edge ] br label %while.cond.i.preheader while.cond.i.preheader: ; preds = %for.cond4.preheader, %gcd.exit28 %sum.231 = phi i32 [ %sum.134, %for.cond4.preheader ], [ %add, %gcd.exit28 ] %a.030 = phi i32 [ 1, %for.cond4.preheader ], [ %inc, %gcd.exit28 ] br label %while.cond.i while.cond.i: ; preds = %while.cond.i.preheader, %while.cond.i %y.addr.0.i = phi i32 [ %rem.i, %while.cond.i ], [ %b.033, %while.cond.i.preheader ] %x.addr.0.i = phi i32 [ %y.addr.0.i, %while.cond.i ], [ %a.030, %while.cond.i.preheader ] %rem.i = srem i32 %x.addr.0.i, %y.addr.0.i %cmp.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp.not.i, label %while.cond.i23, label %while.cond.i, !llvm.loop !9 while.cond.i23: ; preds = %while.cond.i, %while.cond.i23 %y.addr.0.i24 = phi i32 [ %rem.i26, %while.cond.i23 ], [ %c.037, %while.cond.i ] %x.addr.0.i25 = phi i32 [ %y.addr.0.i24, %while.cond.i23 ], [ %y.addr.0.i, %while.cond.i ] %rem.i26 = srem i32 %x.addr.0.i25, %y.addr.0.i24 %cmp.not.i27 = icmp eq i32 %rem.i26, 0 br i1 %cmp.not.i27, label %gcd.exit28, label %while.cond.i23, !llvm.loop !9 gcd.exit28: ; preds = %while.cond.i23 %add = add nsw i32 %y.addr.0.i24, %sum.231 %inc = add nuw i32 %a.030, 1 %exitcond.not = icmp eq i32 %a.030, %0 br i1 %exitcond.not, label %for.cond4.for.inc9_crit_edge, label %while.cond.i.preheader, !llvm.loop !11 for.cond4.for.inc9_crit_edge: ; preds = %gcd.exit28 %inc10 = add nuw i32 %b.033, 1 %exitcond40.not = icmp eq i32 %b.033, %0 br i1 %exitcond40.not, label %for.cond1.for.inc12_crit_edge.split, label %for.cond4.preheader, !llvm.loop !12 for.cond1.for.inc12_crit_edge.split: ; preds = %for.cond4.for.inc9_crit_edge %inc13 = add nuw i32 %c.037, 1 %exitcond41.not = icmp eq i32 %c.037, %0 br i1 %exitcond41.not, label %for.end14, label %for.cond1.preheader, !llvm.loop !13 for.end14: ; preds = %for.cond1.for.inc12_crit_edge.split, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.cond1.for.inc12_crit_edge.split ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0.lcssa) 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 norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 { entry: br label %while.cond while.cond: ; preds = %while.cond, %entry %y.addr.0 = phi i32 [ %y, %entry ], [ %rem, %while.cond ] %x.addr.0 = phi i32 [ %x, %entry ], [ %y.addr.0, %while.cond ] %rem = srem i32 %x.addr.0, %y.addr.0 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9 while.end: ; preds = %while.cond ret i32 %y.addr.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 gcb(int a,int b,int c){ int d,X,i; if(a<=b && a<=c){ d=a; } if(b<=a && b<=c){ d=b; } if(c<=a && c<=b){ d=c; } for(i=1;i<d+1;i++){ if(a%i==0 && b%i==0 && c%i==0){ X=i; } } return X; } int main(){ int N,a,b,c; long int S=0; scanf("%d",&N); for(a=1;a<N+1;a++){ for(b=1;b<N+1;b++){ for(c=1;c<N+1;c++){ S+=gcb(a,b,c); } } } printf("%ld\n",S); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126688/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126688/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcb(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 { entry: %cmp2.not = icmp sgt i32 %b, %a %cmp4.not = icmp sgt i32 %b, %c %or.cond42 = or i1 %cmp2.not, %cmp4.not %d.1 = select i1 %or.cond42, i32 %a, i32 %b %cmp7.not = icmp sgt i32 %c, %a %cmp9.not = icmp sgt i32 %c, %b %or.cond43 = or i1 %cmp7.not, %cmp9.not %d.2 = select i1 %or.cond43, i32 %d.1, i32 %c %cmp12.not44 = icmp slt i32 %d.2, 1 br i1 %cmp12.not44, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %i.046 = phi i32 [ %inc, %for.inc ], [ 1, %entry ] %X.045 = phi i32 [ %X.1, %for.inc ], [ undef, %entry ] %rem = srem i32 %a, %i.046 %cmp13 = icmp eq i32 %rem, 0 br i1 %cmp13, label %land.lhs.true14, label %for.inc land.lhs.true14: ; preds = %for.body %rem15 = srem i32 %b, %i.046 %cmp16 = icmp eq i32 %rem15, 0 br i1 %cmp16, label %land.lhs.true17, label %for.inc land.lhs.true17: ; preds = %land.lhs.true14 %rem18 = srem i32 %c, %i.046 %cmp19 = icmp eq i32 %rem18, 0 %spec.select = select i1 %cmp19, i32 %i.046, i32 %X.045 br label %for.inc for.inc: ; preds = %land.lhs.true17, %for.body, %land.lhs.true14 %X.1 = phi i32 [ %X.045, %land.lhs.true14 ], [ %X.045, %for.body ], [ %spec.select, %land.lhs.true17 ] %inc = add nuw i32 %i.046, 1 %exitcond.not = icmp eq i32 %i.046, %d.2 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !5 for.end: ; preds = %for.inc, %entry %X.0.lcssa = phi i32 [ undef, %entry ], [ %X.1, %for.inc ] ret i32 %X.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %N = alloca i32, align 4 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 !7 %cmp.not34 = icmp slt i32 %0, 1 br i1 %cmp.not34, label %for.end16, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.for.inc14_crit_edge.split %S.036 = phi i64 [ %.us-phi, %for.cond1.for.inc14_crit_edge.split ], [ 0, %entry ] %a.035 = phi i32 [ %inc15, %for.cond1.for.inc14_crit_edge.split ], [ 1, %entry ] br label %for.cond5.preheader for.cond5.preheader: ; preds = %for.cond1.preheader, %for.cond5.for.inc11_crit_edge %S.131 = phi i64 [ %S.036, %for.cond1.preheader ], [ %.us-phi, %for.cond5.for.inc11_crit_edge ] %b.029 = phi i32 [ 1, %for.cond1.preheader ], [ %inc12, %for.cond5.for.inc11_crit_edge ] %invariant.umin = call i32 @llvm.umin.i32(i32 %a.035, i32 %b.029) %cmp2.not.i = icmp ugt i32 %b.029, %a.035 %cmp2.not.i.fr = freeze i1 %cmp2.not.i br i1 %cmp2.not.i.fr, label %for.body8.us, label %for.body8 for.body8.us: ; preds = %for.cond5.preheader, %gcb.exit.us %S.227.us = phi i64 [ %add10.us, %gcb.exit.us ], [ %S.131, %for.cond5.preheader ] %c.026.us = phi i32 [ %inc.us, %gcb.exit.us ], [ 1, %for.cond5.preheader ] %or.cond43.i.us = icmp ugt i32 %c.026.us, %invariant.umin %d.2.i.us = select i1 %or.cond43.i.us, i32 %a.035, i32 %c.026.us br label %for.body.i.us for.body.i.us: ; preds = %for.body8.us, %for.inc.i.us %i.046.i.us = phi i32 [ %inc.i.us, %for.inc.i.us ], [ 1, %for.body8.us ] %X.045.i.us = phi i32 [ %X.1.i.us, %for.inc.i.us ], [ undef, %for.body8.us ] %rem.i.us = srem i32 %a.035, %i.046.i.us %cmp13.i.us = icmp eq i32 %rem.i.us, 0 br i1 %cmp13.i.us, label %land.lhs.true14.i.us, label %for.inc.i.us land.lhs.true14.i.us: ; preds = %for.body.i.us %rem15.i.us = srem i32 %b.029, %i.046.i.us %cmp16.i.us = icmp eq i32 %rem15.i.us, 0 br i1 %cmp16.i.us, label %land.lhs.true17.i.us, label %for.inc.i.us land.lhs.true17.i.us: ; preds = %land.lhs.true14.i.us %rem18.i.us = srem i32 %c.026.us, %i.046.i.us %cmp19.i.us = icmp eq i32 %rem18.i.us, 0 %spec.select.i.us = select i1 %cmp19.i.us, i32 %i.046.i.us, i32 %X.045.i.us br label %for.inc.i.us for.inc.i.us: ; preds = %land.lhs.true17.i.us, %land.lhs.true14.i.us, %for.body.i.us %X.1.i.us = phi i32 [ %X.045.i.us, %land.lhs.true14.i.us ], [ %X.045.i.us, %for.body.i.us ], [ %spec.select.i.us, %land.lhs.true17.i.us ] %inc.i.us = add nuw i32 %i.046.i.us, 1 %exitcond.not.i.us = icmp eq i32 %i.046.i.us, %d.2.i.us br i1 %exitcond.not.i.us, label %gcb.exit.us, label %for.body.i.us, !llvm.loop !5 gcb.exit.us: ; preds = %for.inc.i.us %conv.us = sext i32 %X.1.i.us to i64 %add10.us = add nsw i64 %S.227.us, %conv.us %inc.us = add nuw i32 %c.026.us, 1 %exitcond40.not = icmp eq i32 %c.026.us, %0 br i1 %exitcond40.not, label %for.cond5.for.inc11_crit_edge, label %for.body8.us, !llvm.loop !11 for.body8: ; preds = %for.cond5.preheader, %gcb.exit %S.227 = phi i64 [ %add10, %gcb.exit ], [ %S.131, %for.cond5.preheader ] %c.026 = phi i32 [ %inc, %gcb.exit ], [ 1, %for.cond5.preheader ] %cmp4.not.i = icmp ugt i32 %b.029, %c.026 %spec.select = select i1 %cmp4.not.i, i32 %a.035, i32 %b.029 %or.cond43.i = icmp ugt i32 %c.026, %invariant.umin %d.2.i = select i1 %or.cond43.i, i32 %spec.select, i32 %c.026 br label %for.body.i for.body.i: ; preds = %for.body8, %for.inc.i %i.046.i = phi i32 [ %inc.i, %for.inc.i ], [ 1, %for.body8 ] %X.045.i = phi i32 [ %X.1.i, %for.inc.i ], [ undef, %for.body8 ] %rem.i = srem i32 %a.035, %i.046.i %cmp13.i = icmp eq i32 %rem.i, 0 br i1 %cmp13.i, label %land.lhs.true14.i, label %for.inc.i land.lhs.true14.i: ; preds = %for.body.i %rem15.i = srem i32 %b.029, %i.046.i %cmp16.i = icmp eq i32 %rem15.i, 0 br i1 %cmp16.i, label %land.lhs.true17.i, label %for.inc.i land.lhs.true17.i: ; preds = %land.lhs.true14.i %rem18.i = srem i32 %c.026, %i.046.i %cmp19.i = icmp eq i32 %rem18.i, 0 %spec.select.i = select i1 %cmp19.i, i32 %i.046.i, i32 %X.045.i br label %for.inc.i for.inc.i: ; preds = %land.lhs.true17.i, %land.lhs.true14.i, %for.body.i %X.1.i = phi i32 [ %X.045.i, %land.lhs.true14.i ], [ %X.045.i, %for.body.i ], [ %spec.select.i, %land.lhs.true17.i ] %inc.i = add nuw i32 %i.046.i, 1 %exitcond.not.i = icmp eq i32 %i.046.i, %d.2.i br i1 %exitcond.not.i, label %gcb.exit, label %for.body.i, !llvm.loop !5 gcb.exit: ; preds = %for.inc.i %conv = sext i32 %X.1.i to i64 %add10 = add nsw i64 %S.227, %conv %inc = add nuw i32 %c.026, 1 %exitcond.not = icmp eq i32 %c.026, %0 br i1 %exitcond.not, label %for.cond5.for.inc11_crit_edge, label %for.body8, !llvm.loop !11 for.cond5.for.inc11_crit_edge: ; preds = %gcb.exit, %gcb.exit.us %.us-phi = phi i64 [ %add10.us, %gcb.exit.us ], [ %add10, %gcb.exit ] %inc12 = add nuw i32 %b.029, 1 %exitcond41.not = icmp eq i32 %b.029, %0 br i1 %exitcond41.not, label %for.cond1.for.inc14_crit_edge.split, label %for.cond5.preheader, !llvm.loop !12 for.cond1.for.inc14_crit_edge.split: ; preds = %for.cond5.for.inc11_crit_edge %inc15 = add nuw i32 %a.035, 1 %exitcond42.not = icmp eq i32 %a.035, %0 br i1 %exitcond42.not, label %for.end16, label %for.cond1.preheader, !llvm.loop !13 for.end16: ; preds = %for.cond1.for.inc14_crit_edge.split, %entry %S.0.lcssa = phi i64 [ 0, %entry ], [ %.us-phi, %for.cond1.for.inc14_crit_edge.split ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %S.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umin.i32(i32, i32) #4 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6} !13 = distinct !{!13, !6}
#include <stdio.h> #include <stdlib.h> int gcd( int a, int b ) { if( b == 0 ) return( a ); return( gcd( b, a % b ) ); } int main( int argc, char *argv[] ) { int n; long long tot = 0; scanf( "%d", &n ); for( int i=1; i<=n; i++ ) for( int j=1; j<=n; j++ ) for( int k=1; k<=n; k++ ) { int g = gcd( gcd( i, j ), k ); tot += g; } printf( "%lld\n", tot ); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126730/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126730/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp4 = icmp eq i32 %b, 0 br i1 %cmp4, label %return, label %if.end if.end: ; preds = %entry, %if.end %b.tr6 = phi i32 [ %rem, %if.end ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %if.end ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.end ] ret i32 %a.tr.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #1 { 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 %cmp.not38 = icmp slt i32 %0, 1 br i1 %cmp.not38, label %for.cond.cleanup, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.for.cond.cleanup3_crit_edge.split %tot.040 = phi i64 [ %add, %for.cond1.for.cond.cleanup3_crit_edge.split ], [ 0, %entry ] %i.039 = phi i32 [ %inc15, %for.cond1.for.cond.cleanup3_crit_edge.split ], [ 1, %entry ] br label %for.cond5.preheader for.cond.cleanup: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.split, %entry %tot.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.cond1.for.cond.cleanup3_crit_edge.split ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %tot.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.cond5.preheader: ; preds = %for.cond1.preheader, %for.cond5.for.cond.cleanup7_crit_edge %tot.136 = phi i64 [ %tot.040, %for.cond1.preheader ], [ %add, %for.cond5.for.cond.cleanup7_crit_edge ] %j.035 = phi i32 [ 1, %for.cond1.preheader ], [ %inc12, %for.cond5.for.cond.cleanup7_crit_edge ] br label %if.end.i.preheader for.cond1.for.cond.cleanup3_crit_edge.split: ; preds = %for.cond5.for.cond.cleanup7_crit_edge %inc15 = add nuw i32 %i.039, 1 %exitcond43.not = icmp eq i32 %i.039, %0 br i1 %exitcond43.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !9 if.end.i.preheader: ; preds = %for.cond5.preheader, %gcd.exit30 %tot.233 = phi i64 [ %tot.136, %for.cond5.preheader ], [ %add, %gcd.exit30 ] %k.032 = phi i32 [ 1, %for.cond5.preheader ], [ %inc, %gcd.exit30 ] br label %if.end.i for.cond5.for.cond.cleanup7_crit_edge: ; preds = %gcd.exit30 %inc12 = add nuw i32 %j.035, 1 %exitcond42.not = icmp eq i32 %j.035, %0 br i1 %exitcond42.not, label %for.cond1.for.cond.cleanup3_crit_edge.split, label %for.cond5.preheader, !llvm.loop !11 if.end.i: ; preds = %if.end.i.preheader, %if.end.i %b.tr6.i = phi i32 [ %rem.i, %if.end.i ], [ %j.035, %if.end.i.preheader ] %a.tr5.i = phi i32 [ %b.tr6.i, %if.end.i ], [ %i.039, %if.end.i.preheader ] %rem.i = srem i32 %a.tr5.i, %b.tr6.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %if.end.i25, label %if.end.i if.end.i25: ; preds = %if.end.i, %if.end.i25 %b.tr6.i26 = phi i32 [ %rem.i28, %if.end.i25 ], [ %k.032, %if.end.i ] %a.tr5.i27 = phi i32 [ %b.tr6.i26, %if.end.i25 ], [ %b.tr6.i, %if.end.i ] %rem.i28 = srem i32 %a.tr5.i27, %b.tr6.i26 %cmp.i29 = icmp eq i32 %rem.i28, 0 br i1 %cmp.i29, label %gcd.exit30, label %if.end.i25 gcd.exit30: ; preds = %if.end.i25 %conv = sext i32 %b.tr6.i26 to i64 %add = add nsw i64 %tot.233, %conv %inc = add nuw i32 %k.032, 1 %exitcond.not = icmp eq i32 %k.032, %0 br i1 %exitcond.not, label %for.cond5.for.cond.cleanup7_crit_edge, label %if.end.i.preheader, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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<stdlib.h> #include<stdint.h> #include<inttypes.h> typedef int32_t i32; typedef int64_t i64; const i32 mod = 1000000007; i32 mod_pow (i32 r, i32 n) { i32 t = 1; i32 s = r; while (n > 0) { if (n & 1) t = (i64) t * s % mod; s = (i64) s * s % mod; n >>= 1; } return t; } i32 inv (i32 a) { return mod_pow (a, mod - 2); } void run (void) { i32 n, a, b, c; scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32 "%" SCNi32, &n, &a, &b, &c); i32 p = (i64) a * inv (a + b) % mod; i32 q = (1 + mod - p) % mod; i32 *inverse = (i32 *) calloc (n + 1, sizeof (i32)); inverse[1] = 1; for (i32 i = 2; i <= n; ++i) { inverse[i] = (i64) (mod - mod / i) * inverse[mod % i] % mod; } i64 ans = 0; i32 comb = 1; for (i32 i = 0, t = 1, x = mod_pow (p, n), y = mod_pow (q, n); i < n; ++i, x = (i64) x * q % mod, y = (i64) y * p % mod) { i64 prob = (i64) comb * (x + y); t = (t + (i64) 2 * mod * mod - prob) % mod; ans += t; comb = (i64) comb * (n + i) % mod * inverse[i + 1] % mod; } ans = (ans + n) % mod * 100 % mod * inv (100 - c) % mod; printf ("%" PRIi64 "\n", ans); } int main (void) { run(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126774/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126774/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @mod = dso_local local_unnamed_addr constant i32 1000000007, align 4 @.str = private unnamed_addr constant [9 x i8] c"%i%i%i%i\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%li\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @mod_pow(i32 noundef %r, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp13 = icmp sgt i32 %n, 0 br i1 %cmp13, label %while.body, label %while.end while.body: ; preds = %entry, %if.end %s.016 = phi i32 [ %conv7, %if.end ], [ %r, %entry ] %t.015 = phi i32 [ %t.1, %if.end ], [ 1, %entry ] %n.addr.014 = phi i32 [ %shr, %if.end ], [ %n, %entry ] %and = and i32 %n.addr.014, 1 %tobool.not = icmp eq i32 %and, 0 br i1 %tobool.not, label %while.body.if.end_crit_edge, label %if.then while.body.if.end_crit_edge: ; preds = %while.body %.pre = sext i32 %s.016 to i64 br label %if.end if.then: ; preds = %while.body %conv = sext i32 %t.015 to i64 %conv1 = sext i32 %s.016 to i64 %mul = mul nsw i64 %conv1, %conv %rem = srem i64 %mul, 1000000007 %conv2 = trunc i64 %rem to i32 br label %if.end if.end: ; preds = %while.body.if.end_crit_edge, %if.then %conv3.pre-phi = phi i64 [ %.pre, %while.body.if.end_crit_edge ], [ %conv1, %if.then ] %t.1 = phi i32 [ %t.015, %while.body.if.end_crit_edge ], [ %conv2, %if.then ] %mul5 = mul nsw i64 %conv3.pre-phi, %conv3.pre-phi %rem6 = urem i64 %mul5, 1000000007 %conv7 = trunc i64 %rem6 to i32 %shr = lshr i32 %n.addr.014, 1 %cmp.not = icmp ult i32 %n.addr.014, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %if.end, %entry %t.0.lcssa = phi i32 [ 1, %entry ], [ %t.1, %if.end ] ret i32 %t.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @inv(i32 noundef %a) local_unnamed_addr #0 { entry: br label %while.body.i while.body.i: ; preds = %if.end.i, %entry %s.016.i = phi i32 [ %conv7.i, %if.end.i ], [ %a, %entry ] %t.015.i = phi i32 [ %t.1.i, %if.end.i ], [ 1, %entry ] %n.addr.014.i = phi i32 [ %shr.i, %if.end.i ], [ 1000000005, %entry ] %and.i = and i32 %n.addr.014.i, 1 %tobool.not.i = icmp eq i32 %and.i, 0 br i1 %tobool.not.i, label %while.body.if.end_crit_edge.i, label %if.then.i while.body.if.end_crit_edge.i: ; preds = %while.body.i %.pre.i = sext i32 %s.016.i to i64 br label %if.end.i if.then.i: ; preds = %while.body.i %conv.i = sext i32 %t.015.i to i64 %conv1.i = sext i32 %s.016.i to i64 %mul.i = mul nsw i64 %conv.i, %conv1.i %rem.i = srem i64 %mul.i, 1000000007 %conv2.i = trunc i64 %rem.i to i32 br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.if.end_crit_edge.i %conv3.pre-phi.i = phi i64 [ %.pre.i, %while.body.if.end_crit_edge.i ], [ %conv1.i, %if.then.i ] %t.1.i = phi i32 [ %t.015.i, %while.body.if.end_crit_edge.i ], [ %conv2.i, %if.then.i ] %mul5.i = mul nsw i64 %conv3.pre-phi.i, %conv3.pre-phi.i %rem6.i = urem i64 %mul5.i, 1000000007 %conv7.i = trunc i64 %rem6.i to i32 %shr.i = lshr i32 %n.addr.014.i, 1 %cmp.not.i = icmp ult i32 %n.addr.014.i, 2 br i1 %cmp.not.i, label %mod_pow.exit, label %while.body.i, !llvm.loop !5 mod_pow.exit: ; preds = %if.end.i ret i32 %t.1.i } ; Function Attrs: nofree nounwind uwtable define dso_local void @run() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !7 %1 = load i32, ptr %b, align 4, !tbaa !7 %add = add nsw i32 %1, %0 br label %while.body.i.i while.body.i.i: ; preds = %if.end.i.i, %entry %s.016.i.i = phi i32 [ %conv7.i.i, %if.end.i.i ], [ %add, %entry ] %t.015.i.i = phi i32 [ %t.1.i.i, %if.end.i.i ], [ 1, %entry ] %n.addr.014.i.i = phi i32 [ %shr.i.i, %if.end.i.i ], [ 1000000005, %entry ] %and.i.i = and i32 %n.addr.014.i.i, 1 %tobool.not.i.i = icmp eq i32 %and.i.i, 0 br i1 %tobool.not.i.i, label %while.body.if.end_crit_edge.i.i, label %if.then.i.i while.body.if.end_crit_edge.i.i: ; preds = %while.body.i.i %.pre.i.i = sext i32 %s.016.i.i to i64 br label %if.end.i.i if.then.i.i: ; preds = %while.body.i.i %conv.i.i = sext i32 %t.015.i.i to i64 %conv1.i.i = sext i32 %s.016.i.i to i64 %mul.i.i = mul nsw i64 %conv.i.i, %conv1.i.i %rem.i.i = srem i64 %mul.i.i, 1000000007 %conv2.i.i = trunc i64 %rem.i.i to i32 br label %if.end.i.i if.end.i.i: ; preds = %if.then.i.i, %while.body.if.end_crit_edge.i.i %conv3.pre-phi.i.i = phi i64 [ %.pre.i.i, %while.body.if.end_crit_edge.i.i ], [ %conv1.i.i, %if.then.i.i ] %t.1.i.i = phi i32 [ %t.015.i.i, %while.body.if.end_crit_edge.i.i ], [ %conv2.i.i, %if.then.i.i ] %mul5.i.i = mul nsw i64 %conv3.pre-phi.i.i, %conv3.pre-phi.i.i %rem6.i.i = urem i64 %mul5.i.i, 1000000007 %conv7.i.i = trunc i64 %rem6.i.i to i32 %shr.i.i = lshr i32 %n.addr.014.i.i, 1 %cmp.not.i.i = icmp ult i32 %n.addr.014.i.i, 2 br i1 %cmp.not.i.i, label %inv.exit, label %while.body.i.i, !llvm.loop !5 inv.exit: ; preds = %if.end.i.i %conv = sext i32 %0 to i64 %conv2 = sext i32 %t.1.i.i to i64 %mul = mul nsw i64 %conv2, %conv %rem = srem i64 %mul, 1000000007 %conv3 = trunc i64 %rem to i32 %sub = sub nsw i32 1000000008, %conv3 %rem4 = urem i32 %sub, 1000000007 %2 = load i32, ptr %n, align 4, !tbaa !7 %add5 = add i32 %2, 1 %conv6 = sext i32 %add5 to i64 %call7 = call noalias ptr @calloc(i64 noundef %conv6, i64 noundef 4) #6 %arrayidx = getelementptr inbounds i32, ptr %call7, i64 1 store i32 1, ptr %arrayidx, align 4, !tbaa !7 %cmp.not144 = icmp slt i32 %2, 2 br i1 %cmp.not144, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %inv.exit %wide.trip.count = zext i32 %add5 to i64 br label %for.body for.cond.cleanup: ; preds = %for.body, %inv.exit %cmp13.i = icmp sgt i32 %2, 0 br i1 %cmp13.i, label %while.body.i, label %for.cond.cleanup25 while.body.i: ; preds = %for.cond.cleanup, %if.end.i %s.016.i = phi i32 [ %conv7.i, %if.end.i ], [ %conv3, %for.cond.cleanup ] %t.015.i = phi i32 [ %t.1.i, %if.end.i ], [ 1, %for.cond.cleanup ] %n.addr.014.i = phi i32 [ %shr.i, %if.end.i ], [ %2, %for.cond.cleanup ] %and.i = and i32 %n.addr.014.i, 1 %tobool.not.i = icmp eq i32 %and.i, 0 br i1 %tobool.not.i, label %while.body.if.end_crit_edge.i, label %if.then.i while.body.if.end_crit_edge.i: ; preds = %while.body.i %.pre.i = sext i32 %s.016.i to i64 br label %if.end.i if.then.i: ; preds = %while.body.i %conv.i = sext i32 %t.015.i to i64 %conv1.i = sext i32 %s.016.i to i64 %mul.i = mul nsw i64 %conv.i, %conv1.i %rem.i = srem i64 %mul.i, 1000000007 %conv2.i = trunc i64 %rem.i to i32 br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.if.end_crit_edge.i %conv3.pre-phi.i = phi i64 [ %.pre.i, %while.body.if.end_crit_edge.i ], [ %conv1.i, %if.then.i ] %t.1.i = phi i32 [ %t.015.i, %while.body.if.end_crit_edge.i ], [ %conv2.i, %if.then.i ] %mul5.i = mul nsw i64 %conv3.pre-phi.i, %conv3.pre-phi.i %rem6.i = urem i64 %mul5.i, 1000000007 %conv7.i = trunc i64 %rem6.i to i32 %shr.i = lshr i32 %n.addr.014.i, 1 %cmp.not.i = icmp ult i32 %n.addr.014.i, 2 br i1 %cmp.not.i, label %while.body.i96, label %while.body.i, !llvm.loop !5 while.body.i96: ; preds = %if.end.i, %if.end.i108 %s.016.i97 = phi i32 [ %conv7.i113, %if.end.i108 ], [ %rem4, %if.end.i ] %t.015.i98 = phi i32 [ %t.1.i110, %if.end.i108 ], [ 1, %if.end.i ] %n.addr.014.i99 = phi i32 [ %shr.i114, %if.end.i108 ], [ %2, %if.end.i ] %and.i100 = and i32 %n.addr.014.i99, 1 %tobool.not.i101 = icmp eq i32 %and.i100, 0 br i1 %tobool.not.i101, label %while.body.if.end_crit_edge.i116, label %if.then.i102 while.body.if.end_crit_edge.i116: ; preds = %while.body.i96 %.pre.i117 = zext i32 %s.016.i97 to i64 br label %if.end.i108 if.then.i102: ; preds = %while.body.i96 %conv.i103 = zext i32 %t.015.i98 to i64 %conv1.i104 = zext i32 %s.016.i97 to i64 %mul.i105 = mul nuw nsw i64 %conv.i103, %conv1.i104 %rem.i106 = urem i64 %mul.i105, 1000000007 %conv2.i107 = trunc i64 %rem.i106 to i32 br label %if.end.i108 if.end.i108: ; preds = %if.then.i102, %while.body.if.end_crit_edge.i116 %conv3.pre-phi.i109 = phi i64 [ %.pre.i117, %while.body.if.end_crit_edge.i116 ], [ %conv1.i104, %if.then.i102 ] %t.1.i110 = phi i32 [ %t.015.i98, %while.body.if.end_crit_edge.i116 ], [ %conv2.i107, %if.then.i102 ] %mul5.i111 = mul nuw nsw i64 %conv3.pre-phi.i109, %conv3.pre-phi.i109 %rem6.i112 = urem i64 %mul5.i111, 1000000007 %conv7.i113 = trunc i64 %rem6.i112 to i32 %shr.i114 = lshr i32 %n.addr.014.i99, 1 %cmp.not.i115 = icmp ult i32 %n.addr.014.i99, 2 br i1 %cmp.not.i115, label %mod_pow.exit118, label %while.body.i96, !llvm.loop !5 mod_pow.exit118: ; preds = %if.end.i108 br i1 %cmp13.i, label %for.body26.lr.ph, label %for.cond.cleanup25 for.body26.lr.ph: ; preds = %mod_pow.exit118 %conv53 = zext i32 %rem4 to i64 %3 = zext i32 %2 to i64 %wide.trip.count158 = zext i32 %2 to i64 br label %for.body26 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %4 = trunc i64 %indvars.iv to i32 %div = udiv i32 1000000007, %4 %sub9 = sub nuw nsw i32 1000000007, %div %conv10 = zext i32 %sub9 to i64 %rem11 = urem i32 1000000007, %4 %idxprom = zext i32 %rem11 to i64 %arrayidx12 = getelementptr inbounds i32, ptr %call7, i64 %idxprom %5 = load i32, ptr %arrayidx12, align 4, !tbaa !7 %conv13 = sext i32 %5 to i64 %mul14 = mul nsw i64 %conv13, %conv10 %rem15 = srem i64 %mul14, 1000000007 %conv16 = trunc i64 %rem15 to i32 %arrayidx18 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv store i32 %conv16, ptr %arrayidx18, align 4, !tbaa !7 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !11 for.cond.cleanup25: ; preds = %for.body26, %for.cond.cleanup, %mod_pow.exit118 %ans.0.lcssa = phi i64 [ 0, %mod_pow.exit118 ], [ 0, %for.cond.cleanup ], [ %add37, %for.body26 ] %6 = load i32, ptr %c, align 4, !tbaa !7 %sub68 = sub nsw i32 100, %6 br label %while.body.i.i119 while.body.i.i119: ; preds = %if.end.i.i131, %for.cond.cleanup25 %s.016.i.i120 = phi i32 [ %conv7.i.i136, %if.end.i.i131 ], [ %sub68, %for.cond.cleanup25 ] %t.015.i.i121 = phi i32 [ %t.1.i.i133, %if.end.i.i131 ], [ 1, %for.cond.cleanup25 ] %n.addr.014.i.i122 = phi i32 [ %shr.i.i137, %if.end.i.i131 ], [ 1000000005, %for.cond.cleanup25 ] %and.i.i123 = and i32 %n.addr.014.i.i122, 1 %tobool.not.i.i124 = icmp eq i32 %and.i.i123, 0 br i1 %tobool.not.i.i124, label %while.body.if.end_crit_edge.i.i139, label %if.then.i.i125 while.body.if.end_crit_edge.i.i139: ; preds = %while.body.i.i119 %.pre.i.i140 = sext i32 %s.016.i.i120 to i64 br label %if.end.i.i131 if.then.i.i125: ; preds = %while.body.i.i119 %conv.i.i126 = sext i32 %t.015.i.i121 to i64 %conv1.i.i127 = sext i32 %s.016.i.i120 to i64 %mul.i.i128 = mul nsw i64 %conv.i.i126, %conv1.i.i127 %rem.i.i129 = srem i64 %mul.i.i128, 1000000007 %conv2.i.i130 = trunc i64 %rem.i.i129 to i32 br label %if.end.i.i131 if.end.i.i131: ; preds = %if.then.i.i125, %while.body.if.end_crit_edge.i.i139 %conv3.pre-phi.i.i132 = phi i64 [ %.pre.i.i140, %while.body.if.end_crit_edge.i.i139 ], [ %conv1.i.i127, %if.then.i.i125 ] %t.1.i.i133 = phi i32 [ %t.015.i.i121, %while.body.if.end_crit_edge.i.i139 ], [ %conv2.i.i130, %if.then.i.i125 ] %mul5.i.i134 = mul nsw i64 %conv3.pre-phi.i.i132, %conv3.pre-phi.i.i132 %rem6.i.i135 = urem i64 %mul5.i.i134, 1000000007 %conv7.i.i136 = trunc i64 %rem6.i.i135 to i32 %shr.i.i137 = lshr i32 %n.addr.014.i.i122, 1 %cmp.not.i.i138 = icmp ult i32 %n.addr.014.i.i122, 2 br i1 %cmp.not.i.i138, label %inv.exit141, label %while.body.i.i119, !llvm.loop !5 inv.exit141: ; preds = %if.end.i.i131 %conv63 = sext i32 %2 to i64 %add64 = add nsw i64 %ans.0.lcssa, %conv63 %rem65 = srem i64 %add64, 1000000007 %mul66 = mul nsw i64 %rem65, 100 %rem67 = srem i64 %mul66, 1000000007 %conv70 = sext i32 %t.1.i.i133 to i64 %mul71 = mul nsw i64 %rem67, %conv70 %rem72 = srem i64 %mul71, 1000000007 %call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %rem72) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret void for.body26: ; preds = %for.body26.lr.ph, %for.body26 %indvars.iv154 = phi i64 [ 0, %for.body26.lr.ph ], [ %indvars.iv.next155, %for.body26 ] %y.0152 = phi i32 [ %t.1.i110, %for.body26.lr.ph ], [ %conv61, %for.body26 ] %x.0151 = phi i32 [ %t.1.i, %for.body26.lr.ph ], [ %conv56, %for.body26 ] %t.0150 = phi i64 [ 1, %for.body26.lr.ph ], [ %rem34, %for.body26 ] %comb.0148 = phi i64 [ 1, %for.body26.lr.ph ], [ %rem48, %for.body26 ] %ans.0147 = phi i64 [ 0, %for.body26.lr.ph ], [ %add37, %for.body26 ] %add28 = add nsw i32 %y.0152, %x.0151 %conv29 = sext i32 %add28 to i64 %mul30 = mul nsw i64 %comb.0148, %conv29 %add32 = add nuw nsw i64 %t.0150, 2000000028000000098 %sub33 = sub nsw i64 %add32, %mul30 %rem34 = urem i64 %sub33, 1000000007 %add37 = add nuw nsw i64 %rem34, %ans.0147 %7 = add nuw nsw i64 %indvars.iv154, %3 %mul41 = mul nsw i64 %comb.0148, %7 %rem42 = srem i64 %mul41, 1000000007 %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1 %arrayidx45 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv.next155 %8 = load i32, ptr %arrayidx45, align 4, !tbaa !7 %conv46 = sext i32 %8 to i64 %mul47 = mul nsw i64 %rem42, %conv46 %rem48 = srem i64 %mul47, 1000000007 %conv52 = sext i32 %x.0151 to i64 %mul54 = mul nsw i64 %conv52, %conv53 %rem55 = srem i64 %mul54, 1000000007 %conv56 = trunc i64 %rem55 to i32 %conv57 = sext i32 %y.0152 to i64 %mul59 = mul nsw i64 %rem, %conv57 %rem60 = srem i64 %mul59, 1000000007 %conv61 = trunc i64 %rem60 to i32 %exitcond159.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count158 br i1 %exitcond159.not, label %for.cond.cleanup25, label %for.body26, !llvm.loop !12 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: tail call void @run() ret i32 0 } attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind allocsize(0,1) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6}
#include<stdio.h> int main(){ int k=0,a[10010],n,i,j,b[65]; long int ans=0; while(1){ scanf("%d\n",&n); if(n==0){ break; } for(i=0;i<61;i++){ b[i]=0; } for(i=0;i<n;i++){ scanf("%d\n",&a[i]); b[a[i]]++; } for(i=0;i<61;i++){ for(j=0;j<b[i];j++){ a[k]=i; k++; } } k=0; for(i=0;i<n;i++){ ans=ans+a[i]*(n-i-1); } printf("%ld\n",ans); ans=0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126824/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126824/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [10010 x i32], align 16 %n = alloca i32, align 4 %b = alloca [65 x i32], align 16 call void @llvm.lifetime.start.p0(i64 40040, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 260, ptr nonnull %b) #5 %call73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp74 = icmp eq i32 %0, 0 br i1 %cmp74, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end41 %1 = phi i32 [ %29, %for.end41 ], [ %0, %entry ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(244) %b, i8 0, i64 244, i1 false), !tbaa !5 %cmp361 = icmp sgt i32 %1, 0 br i1 %cmp361, label %for.body4, label %for.cond16.preheader for.cond16.preheader: ; preds = %for.body4, %for.cond.preheader %.lcssa = phi i32 [ %1, %for.cond.preheader ], [ %4, %for.body4 ] br label %for.cond19.preheader for.body4: ; preds = %for.cond.preheader, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond.preheader ] %arrayidx6 = getelementptr inbounds [10010 x i32], ptr %a, i64 0, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6) %2 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %idxprom10 = sext i32 %2 to i64 %arrayidx11 = getelementptr inbounds [65 x i32], ptr %b, i64 0, i64 %idxprom10 %3 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %inc12 = add nsw i32 %3, 1 store i32 %inc12, ptr %arrayidx11, align 4, !tbaa !5 %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 %cmp3 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp3, label %for.body4, label %for.cond16.preheader, !llvm.loop !9 for.cond33.preheader: ; preds = %for.inc30 %cmp3469 = icmp sgt i32 %.lcssa, 0 br i1 %cmp3469, label %for.body35.preheader, label %for.end41 for.body35.preheader: ; preds = %for.cond33.preheader %wide.trip.count = zext i32 %.lcssa to i64 %min.iters.check = icmp ult i32 %.lcssa, 4 br i1 %min.iters.check, label %for.body35.preheader110, label %vector.ph vector.ph: ; preds = %for.body35.preheader %n.vec = and i64 %wide.trip.count, 4294967292 %broadcast.splatinsert = insertelement <2 x i32> poison, i32 %.lcssa, 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> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %vec.phi91 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %6 = getelementptr inbounds [10010 x i32], ptr %a, i64 0, i64 %index %wide.load = load <2 x i32>, ptr %6, align 16, !tbaa !5 %7 = getelementptr inbounds i32, ptr %6, i64 2 %wide.load93 = load <2 x i32>, ptr %7, align 8, !tbaa !5 %8 = xor <2 x i32> %vec.ind, <i32 -1, i32 -1> %9 = add <2 x i32> %broadcast.splat, %8 %reass.sub = sub <2 x i32> %broadcast.splat, %vec.ind %10 = add <2 x i32> %reass.sub, <i32 -3, i32 -3> %11 = mul nsw <2 x i32> %wide.load, %9 %12 = mul nsw <2 x i32> %wide.load93, %10 %13 = sext <2 x i32> %11 to <2 x i64> %14 = sext <2 x i32> %12 to <2 x i64> %15 = add <2 x i64> %vec.phi, %13 %16 = add <2 x i64> %vec.phi91, %14 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4> %17 = icmp eq i64 %index.next, %n.vec br i1 %17, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %16, %15 %18 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end41, label %for.body35.preheader110 for.body35.preheader110: ; preds = %for.body35.preheader, %middle.block %indvars.iv85.ph = phi i64 [ 0, %for.body35.preheader ], [ %n.vec, %middle.block ] %ans.171.ph = phi i64 [ 0, %for.body35.preheader ], [ %18, %middle.block ] br label %for.body35 for.cond19.preheader: ; preds = %for.cond16.preheader, %for.inc30 %indvars.iv81 = phi i64 [ 0, %for.cond16.preheader ], [ %indvars.iv.next82, %for.inc30 ] %k.167 = phi i32 [ 0, %for.cond16.preheader ], [ %k.2.lcssa, %for.inc30 ] %arrayidx21 = getelementptr inbounds [65 x i32], ptr %b, i64 0, i64 %indvars.iv81 %19 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp2263 = icmp sgt i32 %19, 0 br i1 %cmp2263, label %for.body23.preheader, label %for.inc30 for.body23.preheader: ; preds = %for.cond19.preheader %20 = sext i32 %k.167 to i64 %21 = trunc i64 %indvars.iv81 to i32 %22 = zext i32 %19 to i64 %min.iters.check96 = icmp ult i32 %19, 8 br i1 %min.iters.check96, label %for.body23.preheader109, label %vector.ph97 vector.ph97: ; preds = %for.body23.preheader %n.vec99 = and i64 %22, 4294967288 %ind.end = add nsw i64 %n.vec99, %20 %ind.end101 = trunc i64 %n.vec99 to i32 %broadcast.splatinsert106 = insertelement <4 x i32> poison, i32 %21, i64 0 %broadcast.splat107 = shufflevector <4 x i32> %broadcast.splatinsert106, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body104 vector.body104: ; preds = %vector.body104, %vector.ph97 %index105 = phi i64 [ 0, %vector.ph97 ], [ %index.next108, %vector.body104 ] %offset.idx = add i64 %index105, %20 %23 = getelementptr inbounds [10010 x i32], ptr %a, i64 0, i64 %offset.idx store <4 x i32> %broadcast.splat107, ptr %23, align 4, !tbaa !5 %24 = getelementptr inbounds i32, ptr %23, i64 4 store <4 x i32> %broadcast.splat107, ptr %24, align 4, !tbaa !5 %index.next108 = add nuw i64 %index105, 8 %25 = icmp eq i64 %index.next108, %n.vec99 br i1 %25, label %middle.block94, label %vector.body104, !llvm.loop !14 middle.block94: ; preds = %vector.body104 %cmp.n103 = icmp eq i64 %n.vec99, %22 br i1 %cmp.n103, label %for.inc30.loopexit, label %for.body23.preheader109 for.body23.preheader109: ; preds = %for.body23.preheader, %middle.block94 %indvars.iv78.ph = phi i64 [ %20, %for.body23.preheader ], [ %ind.end, %middle.block94 ] %j.065.ph = phi i32 [ 0, %for.body23.preheader ], [ %ind.end101, %middle.block94 ] br label %for.body23 for.body23: ; preds = %for.body23.preheader109, %for.body23 %indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.body23 ], [ %indvars.iv78.ph, %for.body23.preheader109 ] %j.065 = phi i32 [ %inc28, %for.body23 ], [ %j.065.ph, %for.body23.preheader109 ] %arrayidx25 = getelementptr inbounds [10010 x i32], ptr %a, i64 0, i64 %indvars.iv78 store i32 %21, ptr %arrayidx25, align 4, !tbaa !5 %indvars.iv.next79 = add nsw i64 %indvars.iv78, 1 %inc28 = add nuw nsw i32 %j.065, 1 %exitcond.not = icmp eq i32 %inc28, %19 br i1 %exitcond.not, label %for.inc30.loopexit, label %for.body23, !llvm.loop !15 for.inc30.loopexit: ; preds = %for.body23, %middle.block94 %indvars.iv.next79.lcssa = phi i64 [ %ind.end, %middle.block94 ], [ %indvars.iv.next79, %for.body23 ] %26 = trunc i64 %indvars.iv.next79.lcssa to i32 br label %for.inc30 for.inc30: ; preds = %for.inc30.loopexit, %for.cond19.preheader %k.2.lcssa = phi i32 [ %k.167, %for.cond19.preheader ], [ %26, %for.inc30.loopexit ] %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1 %exitcond84.not = icmp eq i64 %indvars.iv.next82, 61 br i1 %exitcond84.not, label %for.cond33.preheader, label %for.cond19.preheader, !llvm.loop !16 for.body35: ; preds = %for.body35.preheader110, %for.body35 %indvars.iv85 = phi i64 [ %indvars.iv.next86, %for.body35 ], [ %indvars.iv85.ph, %for.body35.preheader110 ] %ans.171 = phi i64 [ %add, %for.body35 ], [ %ans.171.ph, %for.body35.preheader110 ] %indvars87 = trunc i64 %indvars.iv85 to i32 %arrayidx37 = getelementptr inbounds [10010 x i32], ptr %a, i64 0, i64 %indvars.iv85 %27 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %28 = xor i32 %indvars87, -1 %sub38 = add i32 %.lcssa, %28 %mul = mul nsw i32 %27, %sub38 %conv = sext i32 %mul to i64 %add = add nsw i64 %ans.171, %conv %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1 %exitcond88.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count br i1 %exitcond88.not, label %for.end41, label %for.body35, !llvm.loop !17 for.end41: ; preds = %for.body35, %middle.block, %for.cond33.preheader %ans.1.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %18, %middle.block ], [ %add, %for.body35 ] %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.1.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %29 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %29, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end41, %entry call void @llvm.lifetime.end.p0(i64 260, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 40040, 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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !12, !13} !15 = distinct !{!15, !10, !13, !12} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !13, !12}
#include<stdio.h> int main() { int n,m,a,b,i; scanf("%d%d",&n,&m); int road[1010]={0}; for(i=1;i<=m;i++) { scanf("%d%d",&a,&b); road[a]=1; road[b]=1; } for(i=1;i<=n;i++) { if(road[i]==0) break; } int ans=i; printf("%d\n",n-1); for(i=1;i<=n;i++) { if(ans!=i) printf("%d %d\n",i,ans); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12694/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12694/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %road = alloca [1010 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) call void @llvm.lifetime.start.p0(i64 4040, ptr nonnull %road) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4040) %road, i8 0, i64 4040, i1 false) %0 = load i32, ptr %m, align 4, !tbaa !5 %cmp.not34 = icmp slt i32 %0, 1 br i1 %cmp.not34, label %for.cond4.preheader, label %for.body for.cond4.preheader: ; preds = %for.body, %entry %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp5.not36 = icmp slt i32 %1, 1 br i1 %cmp5.not36, label %for.end12, label %for.body6.preheader for.body6.preheader: ; preds = %for.cond4.preheader %2 = add nuw i32 %1, 1 %wide.trip.count = zext i32 %2 to i64 br label %for.body6 for.body: ; preds = %entry, %for.body %i.035 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %3 = load i32, ptr %a, align 4, !tbaa !5 %idxprom = sext i32 %3 to i64 %arrayidx = getelementptr inbounds [1010 x i32], ptr %road, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %4 = load i32, ptr %b, align 4, !tbaa !5 %idxprom2 = sext i32 %4 to i64 %arrayidx3 = getelementptr inbounds [1010 x i32], ptr %road, i64 0, i64 %idxprom2 store i32 1, ptr %arrayidx3, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.035, 1 %5 = load i32, ptr %m, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.035, %5 br i1 %cmp.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.body6: ; preds = %for.body6.preheader, %for.inc10 %indvars.iv = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next, %for.inc10 ] %arrayidx8 = getelementptr inbounds [1010 x i32], ptr %road, i64 0, i64 %indvars.iv %6 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9 = icmp eq i32 %6, 0 br i1 %cmp9, label %for.end12.loopexit.split.loop.exit, label %for.inc10 for.inc10: ; preds = %for.body6 %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.end12, label %for.body6, !llvm.loop !11 for.end12.loopexit.split.loop.exit: ; preds = %for.body6 %7 = trunc i64 %indvars.iv to i32 br label %for.end12 for.end12: ; preds = %for.inc10, %for.end12.loopexit.split.loop.exit, %for.cond4.preheader %i.1.lcssa = phi i32 [ 1, %for.cond4.preheader ], [ %7, %for.end12.loopexit.split.loop.exit ], [ %2, %for.inc10 ] %sub = add nsw i32 %1, -1 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp15.not41 = icmp slt i32 %8, 1 br i1 %cmp15.not41, label %for.end23, label %for.body16 for.body16: ; preds = %for.end12, %for.inc21 %9 = phi i32 [ %10, %for.inc21 ], [ %8, %for.end12 ] %i.242 = phi i32 [ %inc22, %for.inc21 ], [ 1, %for.end12 ] %cmp17.not = icmp eq i32 %i.1.lcssa, %i.242 br i1 %cmp17.not, label %for.inc21, label %if.then18 if.then18: ; preds = %for.body16 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.242, i32 noundef %i.1.lcssa) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.body16, %if.then18 %10 = phi i32 [ %9, %for.body16 ], [ %.pre, %if.then18 ] %inc22 = add nuw nsw i32 %i.242, 1 %cmp15.not.not = icmp slt i32 %i.242, %10 br i1 %cmp15.not.not, label %for.body16, label %for.end23, !llvm.loop !12 for.end23: ; preds = %for.inc21, %for.end12 call void @llvm.lifetime.end.p0(i64 4040, ptr nonnull %road) #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 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 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 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main(void){ char s[100000]; int i; scanf("%s", s); for(i = 0;s[i];i++){ if(i % 2 == 0) printf("%c", s[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126983/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126983/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %tobool.not7 = icmp eq i8 %0, 0 br i1 %tobool.not7, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %1 = phi i8 [ %2, %for.inc ], [ %0, %entry ] %rem9 = and i64 %indvars.iv, 1 %cmp = icmp eq i64 %rem9, 0 br i1 %cmp, label %if.then, label %for.inc if.then: ; preds = %for.body %conv = sext i8 %1 to i32 %putchar = call i32 @putchar(i32 %conv) br label %for.inc for.inc: ; preds = %for.body, %if.then %indvars.iv.next = add nuw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %2, 0 br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void){ char s[100000]; scanf("%s", s); int n = strlen(s); for (int i = 0; i < n - 2; i += 2){ printf("%c",s[i]); } if (n % 2 == 1){ printf("%c\n", s[n - 1]); } else { printf("%c\n", s[n - 2]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127025/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127025/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call2 to i32 %sub = add nsw i32 %conv, -2 %cmp23 = icmp sgt i32 %conv, 2 br i1 %cmp23, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %0 = and i32 %conv, -2147483647 %cmp6 = icmp eq i32 %0, 1 %idxprom14 = sext i32 %sub to i64 %sub8 = shl i64 %call2, 32 %sext = add i64 %sub8, -4294967296 %idxprom9 = ashr exact i64 %sext, 32 %idxprom14.sink = select i1 %cmp6, i64 %idxprom9, i64 %idxprom14 %arrayidx15 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %idxprom14.sink %1 = load i8, ptr %arrayidx15, align 1, !tbaa !5 %conv16 = sext i8 %1 to i32 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv16) call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %s) #5 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 2, !tbaa !5 %conv4 = sext i8 %2 to i32 %putchar = call i32 @putchar(i32 %conv4) %indvars.iv.next = add nuw i64 %indvars.iv, 2 %3 = trunc i64 %indvars.iv.next to i32 %cmp = icmp sgt i32 %sub, %3 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !8 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> int main() { char s[100001]; scanf("%s", s); int i; int len = strlen(s); for (i=0; i<len; i+=2) { printf("%c", s[i]); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127090/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127090/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call2 to i32 %cmp10 = icmp sgt i32 %conv, 0 br i1 %cmp10, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 2, !tbaa !5 %conv4 = sext i8 %0 to i32 %putchar9 = call i32 @putchar(i32 %conv4) %indvars.iv.next = add nuw i64 %indvars.iv, 2 %1 = trunc i64 %indvars.iv.next to i32 %cmp = icmp slt i32 %1, %conv br i1 %cmp, label %for.body, label %for.end, !llvm.loop !8 for.end: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(){ char s[100000]; int i,j; scanf("%s",s); //printf("%c\n",s[1]); for(i=0;i<strlen(s);i+=2){ printf("%c",s[i]); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127148/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127148/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %char0 = load i8, ptr %s, align 16 %cmp11.not = icmp eq i8 %char0, 0 br i1 %cmp11.not, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 2, !tbaa !5 %conv4 = sext i8 %0 to i32 %putchar9 = call i32 @putchar(i32 %conv4) %indvars.iv.next = add nuw i64 %indvars.iv, 2 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !8 for.end: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> int cmpAsc(const void * n1, const void * n2) { if (*(long *)n1 > *(long *)n2) { return 1; } else if (*(long *)n1 < *(long *)n2) { return -1; } else { return 0; } } int cmpDes(const void * n1, const void * n2) { if (*(long *)n1 > *(long *)n2) { return -1; } else if (*(long *)n1 < *(long *)n2) { return 1; } else { return 0; } } int main(void) { long n; scanf("%ld", &n); long first[n],second[n],third[n]; for (long i = 0; i < n; i++) { scanf("%ld", &first[i]); } for (long i = 0; i < n; i++) { scanf("%ld", &second[i]); } for (long i = 0; i < n; i++) { scanf("%ld", &third[i]); } qsort(first, n, sizeof(long), cmpAsc); qsort(third, n, sizeof(long), cmpDes); long first_sum[n+1],third_sum[n+1]; first_sum[0] = 0; third_sum[0] = 0; for (long i = 0; i < n; i++) { first_sum[0] += first[i]; third_sum[0] += third[i]; } long cur,child,child1,parent; for (long i = 0; i < n; i++) { first_sum[i+1] = first_sum[i]; if (second[i] > first[0]) { first_sum[i+1] += second[i]-first[0]; first[0] = first[n-1]; cur = 0; while (1) { child = cur*2+1; if (child >= n-1) { break; } if (child < n-2) { child1 = child+1; if (first[child1] < first[child]) { child = child1; } } if (first[n-1] > first[child]) { first[cur] = first[child]; first[child] = first[n-1]; cur = child; } else { break; } } first[n-1] = second[i]; cur = n-1; while (cur > 0) { parent = (cur-1)/2; if (second[i] < first[parent]) { first[cur] = first[parent]; first[parent] = second[i]; cur = parent; } else { break; } } } } for (long i = n-1; i >= 0; i--) { third_sum[n-i] = third_sum[n-i-1]; if (second[i] < third[0]) { third_sum[n-i] += second[i]-third[0]; third[0] = third[n-1]; cur = 0; while (1) { child = cur*2+1; if (child >= n-1) { break; } if (child < n-2) { child1 = child+1; if (third[child1] > third[child]) { child = child1; } } if (third[n-1] < third[child]) { third[cur] = third[child]; third[child] = third[n-1]; cur = child; } else { break; } } third[n-1] = second[i]; cur = n-1; while (cur > 0) { parent = (cur-1)/2; if (second[i] > third[parent]) { third[cur] = third[parent]; third[parent] = second[i]; cur = parent; } else { break; } } } } long score; long max = first_sum[0]-third_sum[0]; for (long i = 0; i <= n; i++) { score = first_sum[i]-third_sum[n-i]; if (score > max) { max = score; } } printf("%ld\n", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127199/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127199/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmpAsc(ptr nocapture noundef readonly %n1, ptr nocapture noundef readonly %n2) #0 { entry: %0 = load i64, ptr %n1, align 8, !tbaa !5 %1 = load i64, ptr %n2, align 8, !tbaa !5 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp slt 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 @cmpDes(ptr nocapture noundef readonly %n1, ptr nocapture noundef readonly %n2) #0 { entry: %0 = load i64, ptr %n1, align 8, !tbaa !5 %1 = load i64, ptr %n2, align 8, !tbaa !5 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp slt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #7 %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 %cmp288 = icmp sgt i64 %2, 0 br i1 %cmp288, label %for.body, label %for.cond.cleanup17 for.cond5.preheader: ; preds = %for.body %cmp6290 = icmp sgt i64 %3, 0 br i1 %cmp6290, label %for.body8, label %for.cond.cleanup17 for.body: ; preds = %entry, %for.body %i.0289 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.0289 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.0289, 1 %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %3 br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !9 for.cond15.preheader: ; preds = %for.body8 %cmp16292 = icmp sgt i64 %4, 0 br i1 %cmp16292, label %for.body18, label %for.cond.cleanup17 for.body8: ; preds = %for.cond5.preheader, %for.body8 %i4.0291 = phi i64 [ %inc12, %for.body8 ], [ 0, %for.cond5.preheader ] %arrayidx9 = getelementptr inbounds i64, ptr %vla1, i64 %i4.0291 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9) %inc12 = add nuw nsw i64 %i4.0291, 1 %4 = load i64, ptr %n, align 8, !tbaa !5 %cmp6 = icmp slt i64 %inc12, %4 br i1 %cmp6, label %for.body8, label %for.cond15.preheader, !llvm.loop !11 for.cond.cleanup17: ; preds = %for.body18, %entry, %for.cond5.preheader, %for.cond15.preheader %.lcssa = phi i64 [ %4, %for.cond15.preheader ], [ %3, %for.cond5.preheader ], [ %2, %entry ], [ %18, %for.body18 ] call void @qsort(ptr noundef nonnull %vla, i64 noundef %.lcssa, i64 noundef 8, ptr noundef nonnull @cmpAsc) #7 %5 = load i64, ptr %n, align 8, !tbaa !5 call void @qsort(ptr noundef nonnull %vla2, i64 noundef %5, i64 noundef 8, ptr noundef nonnull @cmpDes) #7 %6 = load i64, ptr %n, align 8, !tbaa !5 %add = add i64 %6, 1 %vla24 = alloca i64, i64 %add, align 16 %vla26 = alloca i64, i64 %add, align 16 store i64 0, ptr %vla24, align 16, !tbaa !5 store i64 0, ptr %vla26, align 16, !tbaa !5 %cmp31294 = icmp sgt i64 %6, 0 br i1 %cmp31294, label %for.body33.preheader, label %for.cond.cleanup114 for.body33.preheader: ; preds = %for.cond.cleanup17 %min.iters.check = icmp ult i64 %6, 4 br i1 %min.iters.check, label %for.body33.preheader363, label %vector.ph vector.ph: ; preds = %for.body33.preheader %n.vec = and i64 %6, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ] %vec.phi333 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ] %vec.phi334 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %vec.phi335 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %7 = getelementptr inbounds i64, ptr %vla, i64 %index %wide.load = load <2 x i64>, ptr %7, align 16, !tbaa !5 %8 = getelementptr inbounds i64, ptr %7, i64 2 %wide.load336 = load <2 x i64>, ptr %8, align 16, !tbaa !5 %9 = add <2 x i64> %vec.phi334, %wide.load %10 = add <2 x i64> %vec.phi335, %wide.load336 %11 = getelementptr inbounds i64, ptr %vla2, i64 %index %wide.load337 = load <2 x i64>, ptr %11, align 16, !tbaa !5 %12 = getelementptr inbounds i64, ptr %11, i64 2 %wide.load338 = load <2 x i64>, ptr %12, align 16, !tbaa !5 %13 = add <2 x i64> %vec.phi, %wide.load337 %14 = add <2 x i64> %vec.phi333, %wide.load338 %index.next = add nuw i64 %index, 4 %15 = icmp eq i64 %index.next, %n.vec br i1 %15, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx339 = add <2 x i64> %10, %9 %16 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx339) %bin.rdx = add <2 x i64> %14, %13 %17 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %6, %n.vec br i1 %cmp.n, label %for.cond44.preheader, label %for.body33.preheader363 for.body33.preheader363: ; preds = %for.body33.preheader, %middle.block %.ph = phi i64 [ 0, %for.body33.preheader ], [ %17, %middle.block ] %.ph364 = phi i64 [ 0, %for.body33.preheader ], [ %16, %middle.block ] %i29.0295.ph = phi i64 [ 0, %for.body33.preheader ], [ %n.vec, %middle.block ] br label %for.body33 for.body18: ; preds = %for.cond15.preheader, %for.body18 %i14.0293 = phi i64 [ %inc22, %for.body18 ], [ 0, %for.cond15.preheader ] %arrayidx19 = getelementptr inbounds i64, ptr %vla2, i64 %i14.0293 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19) %inc22 = add nuw nsw i64 %i14.0293, 1 %18 = load i64, ptr %n, align 8, !tbaa !5 %cmp16 = icmp slt i64 %inc22, %18 br i1 %cmp16, label %for.body18, label %for.cond.cleanup17, !llvm.loop !15 for.cond44.preheader: ; preds = %for.body33, %middle.block %add36.lcssa = phi i64 [ %16, %middle.block ], [ %add36, %for.body33 ] %add39.lcssa = phi i64 [ %17, %middle.block ], [ %add39, %for.body33 ] store i64 %add36.lcssa, ptr %vla24, align 16, !tbaa !5 store i64 %add39.lcssa, ptr %vla26, align 16, !tbaa !5 br i1 %cmp31294, label %for.body47.lr.ph, label %for.cond.cleanup114 for.body47.lr.ph: ; preds = %for.cond44.preheader %19 = getelementptr i64, ptr %vla, i64 %6 %arrayidx60 = getelementptr i64, ptr %19, i64 -1 %sub63 = add nsw i64 %6, -1 %cmp64.not296 = icmp ugt i64 %6, 2 %sub66 = add nsw i64 %6, -2 %cmp92302.not = icmp eq i64 %6, 1 br label %for.body47 for.body33: ; preds = %for.body33.preheader363, %for.body33 %20 = phi i64 [ %add39, %for.body33 ], [ %.ph, %for.body33.preheader363 ] %21 = phi i64 [ %add36, %for.body33 ], [ %.ph364, %for.body33.preheader363 ] %i29.0295 = phi i64 [ %inc41, %for.body33 ], [ %i29.0295.ph, %for.body33.preheader363 ] %arrayidx34 = getelementptr inbounds i64, ptr %vla, i64 %i29.0295 %22 = load i64, ptr %arrayidx34, align 8, !tbaa !5 %add36 = add nsw i64 %21, %22 %arrayidx37 = getelementptr inbounds i64, ptr %vla2, i64 %i29.0295 %23 = load i64, ptr %arrayidx37, align 8, !tbaa !5 %add39 = add nsw i64 %20, %23 %inc41 = add nuw nsw i64 %i29.0295, 1 %exitcond.not = icmp eq i64 %inc41, %6 br i1 %exitcond.not, label %for.cond44.preheader, label %for.body33, !llvm.loop !16 for.cond112.preheader: ; preds = %for.inc107 br i1 %cmp31294, label %for.body115.lr.ph, label %for.cond.cleanup114 for.body115.lr.ph: ; preds = %for.cond112.preheader %24 = getelementptr i64, ptr %vla2, i64 %6 %arrayidx132 = getelementptr i64, ptr %24, i64 -1 %sub138 = add nsw i64 %6, -1 %cmp139.not306 = icmp ugt i64 %6, 2 %sub142 = add nsw i64 %6, -2 %cmp170312.not = icmp eq i64 %6, 1 br label %for.body115 for.body47: ; preds = %for.body47.lr.ph, %for.inc107 %25 = phi i64 [ %add36.lcssa, %for.body47.lr.ph ], [ %35, %for.inc107 ] %i43.0305 = phi i64 [ 0, %for.body47.lr.ph ], [ %add49, %for.inc107 ] %add49 = add nuw nsw i64 %i43.0305, 1 %arrayidx50 = getelementptr inbounds i64, ptr %vla24, i64 %add49 store i64 %25, ptr %arrayidx50, align 8, !tbaa !5 %arrayidx51 = getelementptr inbounds i64, ptr %vla1, i64 %i43.0305 %26 = load i64, ptr %arrayidx51, align 8, !tbaa !5 %27 = load i64, ptr %vla, align 16, !tbaa !5 %cmp53 = icmp sgt i64 %26, %27 br i1 %cmp53, label %if.then, label %for.inc107 if.then: ; preds = %for.body47 %sub = add i64 %26, %25 %add58 = sub i64 %sub, %27 store i64 %add58, ptr %arrayidx50, align 8, !tbaa !5 %28 = load i64, ptr %arrayidx60, align 8, !tbaa !5 store i64 %28, ptr %vla, align 16, !tbaa !5 br i1 %cmp64.not296, label %if.end, label %while.end if.end: ; preds = %if.then, %if.then80 %add62299 = phi i64 [ %add62, %if.then80 ], [ 1, %if.then ] %mul298 = phi i64 [ %mul, %if.then80 ], [ 0, %if.then ] %cur.0297 = phi i64 [ %child.0, %if.then80 ], [ 0, %if.then ] %cmp67 = icmp slt i64 %add62299, %sub66 br i1 %cmp67, label %if.then68, label %if.end75 if.then68: ; preds = %if.end %add69 = add i64 %mul298, 2 %arrayidx70 = getelementptr inbounds i64, ptr %vla, i64 %add69 %29 = load i64, ptr %arrayidx70, align 16, !tbaa !5 %arrayidx71 = getelementptr inbounds i64, ptr %vla, i64 %add62299 %30 = load i64, ptr %arrayidx71, align 8, !tbaa !5 %cmp72 = icmp slt i64 %29, %30 %spec.select = select i1 %cmp72, i64 %add69, i64 %add62299 br label %if.end75 if.end75: ; preds = %if.then68, %if.end %child.0 = phi i64 [ %add62299, %if.end ], [ %spec.select, %if.then68 ] %31 = load i64, ptr %arrayidx60, align 8, !tbaa !5 %arrayidx78 = getelementptr inbounds i64, ptr %vla, i64 %child.0 %32 = load i64, ptr %arrayidx78, align 8, !tbaa !5 %cmp79 = icmp sgt i64 %31, %32 br i1 %cmp79, label %if.then80, label %while.end if.then80: ; preds = %if.end75 %arrayidx82 = getelementptr inbounds i64, ptr %vla, i64 %cur.0297 store i64 %32, ptr %arrayidx82, align 8, !tbaa !5 %33 = load i64, ptr %arrayidx60, align 8, !tbaa !5 store i64 %33, ptr %arrayidx78, align 8, !tbaa !5 %mul = shl nsw i64 %child.0, 1 %add62 = or i64 %mul, 1 %cmp64.not = icmp slt i64 %add62, %sub63 br i1 %cmp64.not, label %if.end, label %while.end while.end: ; preds = %if.then80, %if.end75, %if.then store i64 %26, ptr %arrayidx60, align 8, !tbaa !5 br i1 %cmp92302.not, label %for.inc107, label %while.body93 while.body93: ; preds = %while.end, %if.then98 %cur.1303 = phi i64 [ %div284, %if.then98 ], [ %sub63, %while.end ] %sub94 = add nsw i64 %cur.1303, -1 %div284 = lshr i64 %sub94, 1 %arrayidx96 = getelementptr inbounds i64, ptr %vla, i64 %div284 %34 = load i64, ptr %arrayidx96, align 8, !tbaa !5 %cmp97 = icmp slt i64 %26, %34 br i1 %cmp97, label %if.then98, label %for.inc107 if.then98: ; preds = %while.body93 %arrayidx100 = getelementptr inbounds i64, ptr %vla, i64 %cur.1303 store i64 %34, ptr %arrayidx100, align 8, !tbaa !5 store i64 %26, ptr %arrayidx96, align 8, !tbaa !5 %cmp92.not = icmp ult i64 %sub94, 2 br i1 %cmp92.not, label %for.inc107, label %while.body93, !llvm.loop !17 for.inc107: ; preds = %if.then98, %while.body93, %while.end, %for.body47 %35 = phi i64 [ %add58, %while.end ], [ %25, %for.body47 ], [ %add58, %while.body93 ], [ %add58, %if.then98 ] %exitcond322.not = icmp eq i64 %add49, %6 br i1 %exitcond322.not, label %for.cond112.preheader, label %for.body47, !llvm.loop !18 for.cond.cleanup114.loopexit: ; preds = %for.inc186 %.pre = load i64, ptr %vla26, align 16, !tbaa !5 br label %for.cond.cleanup114 for.cond.cleanup114: ; preds = %for.cond.cleanup17, %for.cond44.preheader, %for.cond.cleanup114.loopexit, %for.cond112.preheader %36 = phi i64 [ %.pre, %for.cond.cleanup114.loopexit ], [ %add39.lcssa, %for.cond112.preheader ], [ %add39.lcssa, %for.cond44.preheader ], [ 0, %for.cond.cleanup17 ] %37 = load i64, ptr %vla24, align 16, !tbaa !5 %sub190 = sub nsw i64 %37, %36 %cmp193.not317 = icmp slt i64 %6, 0 br i1 %cmp193.not317, label %for.cond.cleanup194, label %for.body195.preheader for.body195.preheader: ; preds = %for.cond.cleanup114 %38 = add i64 %6, 1 %min.iters.check343 = icmp ult i64 %38, 4 br i1 %min.iters.check343, label %for.body195.preheader360, label %vector.ph344 vector.ph344: ; preds = %for.body195.preheader %n.vec346 = and i64 %38, -4 %minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %sub190, i64 0 %minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body349 vector.body349: ; preds = %vector.body349, %vector.ph344 %index350 = phi i64 [ 0, %vector.ph344 ], [ %index.next358, %vector.body349 ] %vec.phi351 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph344 ], [ %47, %vector.body349 ] %vec.phi352 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph344 ], [ %48, %vector.body349 ] %39 = getelementptr inbounds i64, ptr %vla24, i64 %index350 %wide.load353 = load <2 x i64>, ptr %39, align 16, !tbaa !5 %40 = getelementptr inbounds i64, ptr %39, i64 2 %wide.load354 = load <2 x i64>, ptr %40, align 16, !tbaa !5 %41 = sub nsw i64 %6, %index350 %42 = getelementptr inbounds i64, ptr %vla26, i64 %41 %43 = getelementptr inbounds i64, ptr %42, i64 -1 %wide.load355 = load <2 x i64>, ptr %43, align 8, !tbaa !5 %reverse = shufflevector <2 x i64> %wide.load355, <2 x i64> poison, <2 x i32> <i32 1, i32 0> %44 = getelementptr inbounds i64, ptr %42, i64 -3 %wide.load356 = load <2 x i64>, ptr %44, align 8, !tbaa !5 %reverse357 = shufflevector <2 x i64> %wide.load356, <2 x i64> poison, <2 x i32> <i32 1, i32 0> %45 = sub nsw <2 x i64> %wide.load353, %reverse %46 = sub nsw <2 x i64> %wide.load354, %reverse357 %47 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %45, <2 x i64> %vec.phi351) %48 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %46, <2 x i64> %vec.phi352) %index.next358 = add nuw i64 %index350, 4 %49 = icmp eq i64 %index.next358, %n.vec346 br i1 %49, label %middle.block341, label %vector.body349, !llvm.loop !19 middle.block341: ; preds = %vector.body349 %rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %47, <2 x i64> %48) %50 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n348 = icmp eq i64 %38, %n.vec346 br i1 %cmp.n348, label %for.cond.cleanup194, label %for.body195.preheader360 for.body195.preheader360: ; preds = %for.body195.preheader, %middle.block341 %i191.0319.ph = phi i64 [ 0, %for.body195.preheader ], [ %n.vec346, %middle.block341 ] %max.0318.ph = phi i64 [ %sub190, %for.body195.preheader ], [ %50, %middle.block341 ] br label %for.body195 for.body115: ; preds = %for.body115.lr.ph, %for.inc186 %i110.0316.in = phi i64 [ %6, %for.body115.lr.ph ], [ %i110.0316, %for.inc186 ] %i110.0316 = add nsw i64 %i110.0316.in, -1 %sub116 = sub nsw i64 %6, %i110.0316 %51 = getelementptr i64, ptr %vla26, i64 %sub116 %arrayidx118 = getelementptr i64, ptr %51, i64 -1 %52 = load i64, ptr %arrayidx118, align 8, !tbaa !5 store i64 %52, ptr %51, align 8, !tbaa !5 %arrayidx121 = getelementptr inbounds i64, ptr %vla1, i64 %i110.0316 %53 = load i64, ptr %arrayidx121, align 8, !tbaa !5 %54 = load i64, ptr %vla2, align 16, !tbaa !5 %cmp123 = icmp slt i64 %53, %54 br i1 %cmp123, label %if.then124, label %for.inc186 if.then124: ; preds = %for.body115 %sub127 = add i64 %53, %52 %add130 = sub i64 %sub127, %54 store i64 %add130, ptr %51, align 8, !tbaa !5 %55 = load i64, ptr %arrayidx132, align 8, !tbaa !5 store i64 %55, ptr %vla2, align 16, !tbaa !5 br i1 %cmp139.not306, label %if.end141, label %while.end164 if.end141: ; preds = %if.then124, %if.then156 %add137309 = phi i64 [ %add137, %if.then156 ], [ 1, %if.then124 ] %mul136308 = phi i64 [ %mul136, %if.then156 ], [ 0, %if.then124 ] %cur.2307 = phi i64 [ %child.1, %if.then156 ], [ 0, %if.then124 ] %cmp143 = icmp slt i64 %add137309, %sub142 br i1 %cmp143, label %if.then144, label %if.end151 if.then144: ; preds = %if.end141 %add145 = add i64 %mul136308, 2 %arrayidx146 = getelementptr inbounds i64, ptr %vla2, i64 %add145 %56 = load i64, ptr %arrayidx146, align 16, !tbaa !5 %arrayidx147 = getelementptr inbounds i64, ptr %vla2, i64 %add137309 %57 = load i64, ptr %arrayidx147, align 8, !tbaa !5 %cmp148 = icmp sgt i64 %56, %57 %spec.select285 = select i1 %cmp148, i64 %add145, i64 %add137309 br label %if.end151 if.end151: ; preds = %if.then144, %if.end141 %child.1 = phi i64 [ %add137309, %if.end141 ], [ %spec.select285, %if.then144 ] %58 = load i64, ptr %arrayidx132, align 8, !tbaa !5 %arrayidx154 = getelementptr inbounds i64, ptr %vla2, i64 %child.1 %59 = load i64, ptr %arrayidx154, align 8, !tbaa !5 %cmp155 = icmp slt i64 %58, %59 br i1 %cmp155, label %if.then156, label %while.end164 if.then156: ; preds = %if.end151 %arrayidx158 = getelementptr inbounds i64, ptr %vla2, i64 %cur.2307 store i64 %59, ptr %arrayidx158, align 8, !tbaa !5 %60 = load i64, ptr %arrayidx132, align 8, !tbaa !5 store i64 %60, ptr %arrayidx154, align 8, !tbaa !5 %mul136 = shl nsw i64 %child.1, 1 %add137 = or i64 %mul136, 1 %cmp139.not = icmp slt i64 %add137, %sub138 br i1 %cmp139.not, label %if.end141, label %while.end164 while.end164: ; preds = %if.then156, %if.end151, %if.then124 store i64 %53, ptr %arrayidx132, align 8, !tbaa !5 br i1 %cmp170312.not, label %for.inc186, label %while.body171 while.body171: ; preds = %while.end164, %if.then177 %cur.3313 = phi i64 [ %div173283, %if.then177 ], [ %sub138, %while.end164 ] %sub172 = add nsw i64 %cur.3313, -1 %div173283 = lshr i64 %sub172, 1 %arrayidx175 = getelementptr inbounds i64, ptr %vla2, i64 %div173283 %61 = load i64, ptr %arrayidx175, align 8, !tbaa !5 %cmp176 = icmp sgt i64 %53, %61 br i1 %cmp176, label %if.then177, label %for.inc186 if.then177: ; preds = %while.body171 %arrayidx179 = getelementptr inbounds i64, ptr %vla2, i64 %cur.3313 store i64 %61, ptr %arrayidx179, align 8, !tbaa !5 store i64 %53, ptr %arrayidx175, align 8, !tbaa !5 %cmp170.not = icmp ult i64 %sub172, 2 br i1 %cmp170.not, label %for.inc186, label %while.body171, !llvm.loop !20 for.inc186: ; preds = %if.then177, %while.body171, %while.end164, %for.body115 %cmp113 = icmp sgt i64 %i110.0316.in, 1 br i1 %cmp113, label %for.body115, label %for.cond.cleanup114.loopexit, !llvm.loop !21 for.cond.cleanup194: ; preds = %for.body195, %middle.block341, %for.cond.cleanup114 %max.0.lcssa = phi i64 [ %sub190, %for.cond.cleanup114 ], [ %50, %middle.block341 ], [ %spec.select286, %for.body195 ] %call206 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %max.0.lcssa) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #7 ret i32 0 for.body195: ; preds = %for.body195.preheader360, %for.body195 %i191.0319 = phi i64 [ %inc204, %for.body195 ], [ %i191.0319.ph, %for.body195.preheader360 ] %max.0318 = phi i64 [ %spec.select286, %for.body195 ], [ %max.0318.ph, %for.body195.preheader360 ] %arrayidx196 = getelementptr inbounds i64, ptr %vla24, i64 %i191.0319 %62 = load i64, ptr %arrayidx196, align 8, !tbaa !5 %sub197 = sub nsw i64 %6, %i191.0319 %arrayidx198 = getelementptr inbounds i64, ptr %vla26, i64 %sub197 %63 = load i64, ptr %arrayidx198, align 8, !tbaa !5 %sub199 = sub nsw i64 %62, %63 %spec.select286 = call i64 @llvm.smax.i64(i64 %sub199, i64 %max.0318) %inc204 = add nuw i64 %i191.0319, 1 %exitcond323.not = icmp eq i64 %i191.0319, %6 br i1 %exitcond323.not, label %for.cond.cleanup194, label %for.body195, !llvm.loop !22 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #6 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 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !14, !13} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !13, !14} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10, !14, !13}
#include<stdio.h> int main(){ int N; scanf("%d",&N); long long A[N],B[N],C[N]; for(int i=0;i<N;i++){ scanf("%lld%lld",&A[i],&B[i]); C[i]=A[i]+B[i]; } //sort int h=N; int swapped=0; while(h>1 || swapped==1){ if(h>1)h=h*10/13; swapped=0; for(int i=0;i+h<N;i++){ if(C[i]<C[i+h]){ long long tmp=C[i]; C[i]=C[i+h]; C[i+h]=tmp; tmp=B[i]; B[i]=B[i+h]; B[i+h]=tmp; tmp=A[i]; A[i]=A[i+h]; A[i+h]=tmp; swapped=1; } } } long long ans=0; for(int i=0;i<N;i++){ if(i%2==0)ans+=A[i]; else ans-=B[i]; } printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127241/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127241/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %1, align 16 %3 = load i32, ptr %N, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla1 = alloca i64, i64 %4, align 16 %vla2 = alloca i64, i64 %4, align 16 %cmp120 = icmp sgt i32 %3, 0 br i1 %cmp120, label %for.body, label %for.cond.cleanup65 while.cond.preheader: ; preds = %for.body %cmp12127 = icmp sgt i32 %7, 1 br i1 %cmp12127, label %while.body, label %for.cond63.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv %arrayidx4 = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4) %5 = load i64, ptr %arrayidx, align 8, !tbaa !9 %6 = load i64, ptr %arrayidx4, align 8, !tbaa !9 %add = add nsw i64 %6, %5 %arrayidx11 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv store i64 %add, ptr %arrayidx11, align 8, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i32, ptr %N, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !11 while.cond.loopexit: ; preds = %for.inc59, %if.end %swapped.1.lcssa = phi i32 [ 0, %if.end ], [ %swapped.2, %for.inc59 ] %cmp12 = icmp sgt i32 %h.1, 1 %cmp13 = icmp eq i32 %swapped.1.lcssa, 1 %9 = select i1 %cmp12, i1 true, i1 %cmp13 br i1 %9, label %while.body, label %for.cond63.preheader, !llvm.loop !13 for.cond63.preheader: ; preds = %while.cond.loopexit, %while.cond.preheader %cmp64130 = icmp sgt i32 %7, 0 br i1 %cmp64130, label %for.body66.preheader, label %for.cond.cleanup65 for.body66.preheader: ; preds = %for.cond63.preheader %wide.trip.count147 = zext i32 %7 to i64 %xtraiter = and i64 %wide.trip.count147, 1 %10 = icmp eq i32 %7, 1 br i1 %10, label %for.cond.cleanup65.loopexit.unr-lcssa, label %for.body66.preheader.new for.body66.preheader.new: ; preds = %for.body66.preheader %unroll_iter = and i64 %wide.trip.count147, 4294967294 br label %for.body66 while.body: ; preds = %while.cond.preheader, %while.cond.loopexit %cmp12129 = phi i1 [ %cmp12, %while.cond.loopexit ], [ true, %while.cond.preheader ] %h.0128 = phi i32 [ %h.1, %while.cond.loopexit ], [ %7, %while.cond.preheader ] br i1 %cmp12129, label %if.then, label %if.end if.then: ; preds = %while.body %mul = mul nsw i32 %h.0128, 10 %div = sdiv i32 %mul, 13 br label %if.end if.end: ; preds = %if.then, %while.body %h.1 = phi i32 [ %div, %if.then ], [ %h.0128, %while.body ] %cmp18122 = icmp slt i32 %h.1, %7 br i1 %cmp18122, label %for.body20.preheader, label %while.cond.loopexit for.body20.preheader: ; preds = %if.end %11 = sext i32 %h.1 to i64 %12 = sub i32 %7, %h.1 %wide.trip.count = zext i32 %12 to i64 br label %for.body20 for.body20: ; preds = %for.body20.preheader, %for.inc59 %indvars.iv138 = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next139, %for.inc59 ] %indvars.iv136 = phi i64 [ %11, %for.body20.preheader ], [ %indvars.iv.next137, %for.inc59 ] %swapped.1123 = phi i32 [ 0, %for.body20.preheader ], [ %swapped.2, %for.inc59 ] %arrayidx22 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv138 %13 = load i64, ptr %arrayidx22, align 8, !tbaa !9 %arrayidx25 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv136 %14 = load i64, ptr %arrayidx25, align 8, !tbaa !9 %cmp26 = icmp slt i64 %13, %14 br i1 %cmp26, label %if.then27, label %for.inc59 if.then27: ; preds = %for.body20 store i64 %14, ptr %arrayidx22, align 8, !tbaa !9 store i64 %13, ptr %arrayidx25, align 8, !tbaa !9 %arrayidx39 = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv138 %15 = load i64, ptr %arrayidx39, align 8, !tbaa !9 %arrayidx42 = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv136 %16 = load i64, ptr %arrayidx42, align 8, !tbaa !9 store i64 %16, ptr %arrayidx39, align 8, !tbaa !9 store i64 %15, ptr %arrayidx42, align 8, !tbaa !9 %arrayidx49 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv138 %17 = load i64, ptr %arrayidx49, align 8, !tbaa !9 %arrayidx52 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv136 %18 = load i64, ptr %arrayidx52, align 8, !tbaa !9 store i64 %18, ptr %arrayidx49, align 8, !tbaa !9 store i64 %17, ptr %arrayidx52, align 8, !tbaa !9 br label %for.inc59 for.inc59: ; preds = %for.body20, %if.then27 %swapped.2 = phi i32 [ 1, %if.then27 ], [ %swapped.1123, %for.body20 ] %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1 %indvars.iv.next137 = add nsw i64 %indvars.iv136, 1 %exitcond.not = icmp eq i64 %indvars.iv.next139, %wide.trip.count br i1 %exitcond.not, label %while.cond.loopexit, label %for.body20, !llvm.loop !14 for.cond.cleanup65.loopexit.unr-lcssa: ; preds = %for.body66, %for.body66.preheader %ans.1.lcssa.ph = phi i64 [ undef, %for.body66.preheader ], [ %sub.1, %for.body66 ] %indvars.iv144.unr = phi i64 [ 0, %for.body66.preheader ], [ %indvars.iv.next145.1, %for.body66 ] %ans.0131.unr = phi i64 [ 0, %for.body66.preheader ], [ %sub.1, %for.body66 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup65, label %for.body66.epil for.body66.epil: ; preds = %for.cond.cleanup65.loopexit.unr-lcssa %rem149.epil = and i64 %indvars.iv144.unr, 1 %cmp67.epil = icmp eq i64 %rem149.epil, 0 br i1 %cmp67.epil, label %if.then68.epil, label %if.else.epil if.else.epil: ; preds = %for.body66.epil %arrayidx73.epil = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv144.unr %19 = load i64, ptr %arrayidx73.epil, align 8, !tbaa !9 %sub.epil = sub nsw i64 %ans.0131.unr, %19 br label %for.cond.cleanup65 if.then68.epil: ; preds = %for.body66.epil %arrayidx70.epil = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv144.unr %20 = load i64, ptr %arrayidx70.epil, align 8, !tbaa !9 %add71.epil = add nsw i64 %20, %ans.0131.unr br label %for.cond.cleanup65 for.cond.cleanup65: ; preds = %for.cond.cleanup65.loopexit.unr-lcssa, %if.then68.epil, %if.else.epil, %entry, %for.cond63.preheader %ans.0.lcssa = phi i64 [ 0, %for.cond63.preheader ], [ 0, %entry ], [ %ans.1.lcssa.ph, %for.cond.cleanup65.loopexit.unr-lcssa ], [ %add71.epil, %if.then68.epil ], [ %sub.epil, %if.else.epil ] %call78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 for.body66: ; preds = %for.body66, %for.body66.preheader.new %indvars.iv144 = phi i64 [ 0, %for.body66.preheader.new ], [ %indvars.iv.next145.1, %for.body66 ] %ans.0131 = phi i64 [ 0, %for.body66.preheader.new ], [ %sub.1, %for.body66 ] %niter = phi i64 [ 0, %for.body66.preheader.new ], [ %niter.next.1, %for.body66 ] %arrayidx70 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv144 %21 = load i64, ptr %arrayidx70, align 16, !tbaa !9 %add71 = add nsw i64 %21, %ans.0131 %indvars.iv.next145 = or i64 %indvars.iv144, 1 %arrayidx73.1 = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv.next145 %22 = load i64, ptr %arrayidx73.1, align 8, !tbaa !9 %sub.1 = sub nsw i64 %add71, %22 %indvars.iv.next145.1 = add nuw nsw i64 %indvars.iv144, 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.cond.cleanup65.loopexit.unr-lcssa, label %for.body66, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12} !15 = distinct !{!15, !12}
#include<stdio.h> #define MAX 10000 int main(){ char x[MAX]; int i, j; int sum1 = 0; int sum2[MAX] = {}; for(i = 0; i < MAX; i++){ scanf("%s", x); if(x[0] == '0') break; for(j = 0; x[j] != '\0'; j++){ sum1 += x[j] - '0'; } sum2[i] = sum1; sum1 = 0; } for(i = 0; i < MAX; i++){ if(sum2[i] == 0) break; printf("%d\n", sum2[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127285/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127285/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca [10000 x i8], align 16 %sum2 = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %sum2) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %sum2, i8 0, i64 40000, i1 false) br label %for.body for.body: ; preds = %entry, %for.end %indvars.iv47 = phi i64 [ 0, %entry ], [ %indvars.iv.next48, %for.end ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i8, ptr %x, align 16, !tbaa !5 switch i8 %0, label %for.body8 [ i8 48, label %for.body20.preheader i8 0, label %for.end ] for.body8: ; preds = %for.body, %for.body8 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body8 ], [ 0, %for.body ] %1 = phi i8 [ %2, %for.body8 ], [ %0, %for.body ] %sum1.144 = phi i32 [ %add, %for.body8 ], [ 0, %for.body ] %conv5 = sext i8 %1 to i32 %sub = add i32 %sum1.144, -48 %add = add i32 %sub, %conv5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx4 = getelementptr inbounds [10000 x i8], ptr %x, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx4, align 1, !tbaa !5 %cmp6.not = icmp eq i8 %2, 0 br i1 %cmp6.not, label %for.end, label %for.body8, !llvm.loop !8 for.end: ; preds = %for.body8, %for.body %sum1.1.lcssa = phi i32 [ 0, %for.body ], [ %add, %for.body8 ] %arrayidx13 = getelementptr inbounds [10000 x i32], ptr %sum2, i64 0, i64 %indvars.iv47 store i32 %sum1.1.lcssa, ptr %arrayidx13, align 4, !tbaa !10 %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1 %exitcond.not = icmp eq i64 %indvars.iv.next48, 10000 br i1 %exitcond.not, label %for.body20.preheader, label %for.body, !llvm.loop !12 for.body20.preheader: ; preds = %for.body, %for.end br label %for.body20 for.body20: ; preds = %for.body20.preheader, %if.end26 %indvars.iv50 = phi i64 [ %indvars.iv.next51, %if.end26 ], [ 0, %for.body20.preheader ] %arrayidx22 = getelementptr inbounds [10000 x i32], ptr %sum2, i64 0, i64 %indvars.iv50 %3 = load i32, ptr %arrayidx22, align 4, !tbaa !10 %cmp23 = icmp eq i32 %3, 0 br i1 %cmp23, label %for.end32, label %if.end26 if.end26: ; preds = %for.body20 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1 %exitcond53.not = icmp eq i64 %indvars.iv.next51, 10000 br i1 %exitcond53.not, label %for.end32, label %for.body20, !llvm.loop !13 for.end32: ; preds = %for.body20, %if.end26 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %sum2) #4 call void @llvm.lifetime.end.p0(i64 10000, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!11, !11, i64 0} !11 = !{!"int", !6, i64 0} !12 = distinct !{!12, !9} !13 = distinct !{!13, !9}
#include<stdio.h> int main(){ char num[1000]; int sum,i,j; while(1){ for(i = 0; ;i++){ scanf("%c",&num[i]); if(num[i]=='\n')break; } sum = 0; for(j = 0; j < i; j++){ sum += num[j] - '0'; } if(sum==0)break; printf("%d\n",sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127335/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127335/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %num) #4 br label %for.cond for.cond: ; preds = %for.cond.backedge, %entry %indvars.iv32 = phi i32 [ 0, %entry ], [ %indvars.iv32.be, %for.cond.backedge ] %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.be, %for.cond.backedge ] %arrayidx = getelementptr inbounds [1000 x i8], ptr %num, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 10 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next33 = add nuw i32 %indvars.iv32, 1 br i1 %cmp, label %for.cond4.preheader, label %for.cond.backedge for.cond.backedge: ; preds = %for.cond, %if.end16 %indvars.iv32.be = phi i32 [ %indvars.iv.next33, %for.cond ], [ 0, %if.end16 ] %indvars.iv.be = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %if.end16 ] br label %for.cond for.cond4.preheader: ; preds = %for.cond %1 = and i64 %indvars.iv, 4294967295 %cmp525.not = icmp eq i64 %1, 0 br i1 %cmp525.not, label %while.end, label %for.body.preheader for.body.preheader: ; preds = %for.cond4.preheader %wide.trip.count = zext i32 %indvars.iv32 to i64 %min.iters.check = icmp ult i32 %indvars.iv32, 8 br i1 %min.iters.check, label %for.body.preheader38, 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.phi36 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %2 = getelementptr inbounds [1000 x i8], ptr %num, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %2, align 8, !tbaa !5 %3 = getelementptr inbounds i8, ptr %2, i64 4 %wide.load37 = load <4 x i8>, ptr %3, align 4, !tbaa !5 %4 = sext <4 x i8> %wide.load to <4 x i32> %5 = sext <4 x i8> %wide.load37 to <4 x i32> %6 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48> %7 = add <4 x i32> %vec.phi36, <i32 -48, i32 -48, i32 -48, i32 -48> %8 = add <4 x i32> %6, %4 %9 = add <4 x i32> %7, %5 %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 !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %9, %8 %11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end12, label %for.body.preheader38 for.body.preheader38: ; preds = %for.body.preheader, %middle.block %indvars.iv29.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %sum.026.ph = phi i32 [ 0, %for.body.preheader ], [ %11, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader38, %for.body %indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.body ], [ %indvars.iv29.ph, %for.body.preheader38 ] %sum.026 = phi i32 [ %add, %for.body ], [ %sum.026.ph, %for.body.preheader38 ] %arrayidx8 = getelementptr inbounds [1000 x i8], ptr %num, i64 0, i64 %indvars.iv29 %12 = load i8, ptr %arrayidx8, align 1, !tbaa !5 %conv9 = sext i8 %12 to i32 %sub = add i32 %sum.026, -48 %add = add i32 %sub, %conv9 %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1 %exitcond.not = icmp eq i64 %indvars.iv.next30, %wide.trip.count br i1 %exitcond.not, label %for.end12, label %for.body, !llvm.loop !12 for.end12: ; preds = %for.body, %middle.block %add.lcssa = phi i32 [ %11, %middle.block ], [ %add, %for.body ] %cmp13 = icmp eq i32 %add.lcssa, 0 br i1 %cmp13, label %while.end, label %if.end16 if.end16: ; preds = %for.end12 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.lcssa) br label %for.cond.backedge while.end: ; preds = %for.cond4.preheader, %for.end12 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %num) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10}
#include<stdio.h> int main(void) { char num[1000]; int count,sum; while(1){ scanf("%s", num); if(num[0]=='0') break; count=0; sum=0; while(1){ if(num[count]=='\0') break; sum+=(int)num[count++]-48; } printf("%d\n",sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127379/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127379/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %num) #3 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i8, ptr %num, align 16, !tbaa !5 %cmp21 = icmp eq i8 %0, 48 br i1 %cmp21, label %while.end14, label %while.cond2.preheader while.cond2.preheader: ; preds = %entry, %while.end %1 = phi i8 [ %4, %while.end ], [ %0, %entry ] %cmp617 = icmp eq i8 %1, 0 br i1 %cmp617, label %while.end, label %if.end9 if.end9: ; preds = %while.cond2.preheader, %if.end9 %indvars.iv = phi i64 [ %indvars.iv.next, %if.end9 ], [ 0, %while.cond2.preheader ] %2 = phi i8 [ %3, %if.end9 ], [ %1, %while.cond2.preheader ] %sum.019 = phi i32 [ %add, %if.end9 ], [ 0, %while.cond2.preheader ] %conv5 = sext i8 %2 to i32 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %sub = add i32 %sum.019, -48 %add = add i32 %sub, %conv5 %arrayidx4 = getelementptr inbounds [1000 x i8], ptr %num, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx4, align 1, !tbaa !5 %cmp6 = icmp eq i8 %3, 0 br i1 %cmp6, label %while.end, label %if.end9 while.end: ; preds = %if.end9, %while.cond2.preheader %sum.0.lcssa = phi i32 [ 0, %while.cond2.preheader ], [ %add, %if.end9 ] %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %4 = load i8, ptr %num, align 16, !tbaa !5 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end14, label %while.cond2.preheader while.end14: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 1000, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(void){ char num_str[1002]; int num; long sum = 0; int i; char tmp; while(1){ fgets(num_str, sizeof(num_str), stdin); if(num_str[0] == '0') break; for(i=0;i<strlen(num_str)-1;i++){ tmp=num_str[i]; num=atoi(&tmp); sum=sum+num; } printf("%ld\n",sum); sum=0; memset(num_str, 1002, 0); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127429/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127429/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num_str = alloca [1002 x i8], align 16 %tmp = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1002, ptr nonnull %num_str) #5 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %tmp) #5 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call21 = call ptr @fgets(ptr noundef nonnull %num_str, i32 noundef 1002, ptr noundef %0) %1 = load i8, ptr %num_str, align 16, !tbaa !9 %cmp22 = icmp eq i8 %1, 48 br i1 %cmp22, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %call415 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %num_str) #6 %cmp517.not = icmp eq i64 %call415, 1 br i1 %cmp517.not, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %sum.118 = phi i64 [ %add, %for.body ], [ 0, %for.cond.preheader ] %arrayidx7 = getelementptr inbounds [1002 x i8], ptr %num_str, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx7, align 1, !tbaa !9 store i8 %2, ptr %tmp, align 1, !tbaa !9 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %tmp, ptr noundef null, i32 noundef 10) #5 %sext = shl i64 %call.i, 32 %conv9 = ashr exact i64 %sext, 32 %add = add nsw i64 %conv9, %sum.118 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %num_str) #6 %sub = add i64 %call4, -1 %cmp5 = icmp ugt i64 %sub, %indvars.iv.next br i1 %cmp5, label %for.body, label %for.end, !llvm.loop !10 for.end: ; preds = %for.body, %for.cond.preheader %sum.1.lcssa = phi i64 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sum.1.lcssa) %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %num_str, i32 noundef 1002, ptr noundef %3) %4 = load i8, ptr %num_str, align 16, !tbaa !9 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %tmp) #5 call void @llvm.lifetime.end.p0(i64 1002, ptr nonnull %num_str) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { char c; int a; while(scanf("%c", &c), c != '0'){ a=0; a += c%48; while(scanf("%c", &c), c != '\n'){ a += c%48; } printf("%d\n", a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127487/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127487/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3 %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !5 %cmp.not22 = icmp eq i8 %0, 48 br i1 %cmp.not22, label %while.end13, label %while.body while.body: ; preds = %entry, %while.end %1 = phi i8 [ %5, %while.end ], [ %0, %entry ] %rem16 = srem i8 %1, 48 %rem.sext = sext i8 %rem16 to i32 %call418 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %2 = load i8, ptr %c, align 1, !tbaa !5 %cmp6.not19 = icmp eq i8 %2, 10 br i1 %cmp6.not19, label %while.end, label %while.body8 while.body8: ; preds = %while.body, %while.body8 %3 = phi i8 [ %4, %while.body8 ], [ %2, %while.body ] %a.020 = phi i32 [ %add11, %while.body8 ], [ %rem.sext, %while.body ] %rem1017 = srem i8 %3, 48 %rem10.sext = sext i8 %rem1017 to i32 %add11 = add nsw i32 %a.020, %rem10.sext %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %4 = load i8, ptr %c, align 1, !tbaa !5 %cmp6.not = icmp eq i8 %4, 10 br i1 %cmp6.not, label %while.end, label %while.body8, !llvm.loop !8 while.end: ; preds = %while.body8, %while.body %a.0.lcssa = phi i32 [ %rem.sext, %while.body ], [ %add11, %while.body8 ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %5 = load i8, ptr %c, align 1, !tbaa !5 %cmp.not = icmp eq i8 %5, 48 br i1 %cmp.not, label %while.end13, label %while.body, !llvm.loop !10 while.end13: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}