Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include<stdio.h> int main(){ int x; scanf("%d", &x); printf("%d\n",x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_108666/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_108666/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 x; scanf("%d",&x); printf("%d\n",x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_108716/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_108716/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 n; scanf("%d",&n); int res=0; while(n--){ int en; scanf("%d",&en); res|=en; } if(res){ printf("HARD\n"); } else{ printf("EASY\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_10876/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_10876/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"EASY\00", align 1 @str.3 = private unnamed_addr constant [5 x i8] c"HARD\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %en = 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 %dec7 = add nsw i32 %0, -1 store i32 %dec7, ptr %n, align 4, !tbaa !5 %tobool.not8 = icmp eq i32 %0, 0 br i1 %tobool.not8, label %if.else, label %while.body while.body: ; preds = %entry, %while.body %res.09 = phi i32 [ %or, %while.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %en) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %en) %1 = load i32, ptr %en, align 4, !tbaa !5 %or = or i32 %1, %res.09 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %en) #4 %2 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body %3 = icmp eq i32 %or, 0 br i1 %3, label %if.else, label %if.end if.else: ; preds = %entry, %while.end br label %if.end if.end: ; preds = %while.end, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %while.end ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int n; scanf("%d",&n); printf("%d\n",n*n*n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_108817/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_108817/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int i=0; scanf("%d",&i); printf("%d\n",i*i*i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_108860/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_108860/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3 store i32 0, ptr %i, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %0 = load i32, ptr %i, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !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); printf("%d\n",x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_108903/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_108903/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 x; scanf("%d" , &x); x = x * x * x; printf("%d\n" , x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_108954/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_108954/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 store i32 %mul1, ptr %x, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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; scanf("%d", &a); printf("%d\n", a*a*a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_108998/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_108998/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 n,d,m,i; scanf("%d %d",&n,&d); scanf("%d",&m); int a[m][2]; int l1,l2,l3,l4; for(i=0;i<m;i++) scanf("%d %d",&a[i][0],&a[i][1]); for(i=0;i<m;i++) { l1=a[i][0]+d; l2=-(a[i][0])+d; l3=-(a[i][0])+(2*n)-d; l4=a[i][0]-d; if(a[i][1]<=l1 && a[i][1]>=l4 && a[i][1]>=l2 && a[i][1]<=l3) printf("YES\n"); else printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_10904/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_10904/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %d = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca [2 x i32], i64 %1, align 16 %3 = load i32, ptr %m, align 4, !tbaa !5 %cmp66 = icmp sgt i32 %3, 0 br i1 %cmp66, label %for.body, label %for.end49 for.cond7.preheader: ; preds = %for.body %4 = icmp sgt i32 %5, 0 br i1 %4, label %for.body9, label %for.end49 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv %arrayidx5 = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv, i64 1 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %m, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond7.preheader, !llvm.loop !9 for.body9: ; preds = %for.cond7.preheader, %for.body9 %indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body9 ], [ 0, %for.cond7.preheader ] %arrayidx11 = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv71 %7 = load i32, ptr %arrayidx11, align 8, !tbaa !5 %8 = load i32, ptr %d, align 4, !tbaa !5 %add = add nsw i32 %8, %7 %add16 = sub i32 %8, %7 %9 = load i32, ptr %n, align 4, !tbaa !5 %mul = shl nsw i32 %9, 1 %sub22 = sub i32 %mul, %add %arrayidx29 = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv71, i64 1 %10 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %cmp30.not = icmp sgt i32 %10, %add %sub26 = sub nsw i32 %7, %8 %cmp34.not = icmp slt i32 %10, %sub26 %or.cond = select i1 %cmp30.not, i1 true, i1 %cmp34.not %cmp39.not = icmp slt i32 %10, %add16 %or.cond64 = or i1 %cmp39.not, %or.cond %cmp44.not = icmp sgt i32 %10, %sub22 %or.cond65 = select i1 %or.cond64, i1 true, i1 %cmp44.not %str.str.4 = select i1 %or.cond65, ptr @str, ptr @str.4 %puts63 = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4) %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %11 = load i32, ptr %m, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp8 = icmp slt i64 %indvars.iv.next72, %12 br i1 %cmp8, label %for.body9, label %for.end49, !llvm.loop !11 for.end49: ; preds = %for.body9, %entry, %for.cond7.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int x; scanf("%d",&x); x = x*x*x; printf("%d\n",x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109083/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109083/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 store i32 %mul1, ptr %x, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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"}
/* * main.c * * Created on: 2020/07/27 * Author: 113896 */ #include <stdio.h> int main() { int x; scanf("%d", &x); printf("%d\n", x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109133/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109133/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 x; scanf("%d", &x); printf("%d\n", x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109177/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109177/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 <stdbool.h> bool in_cornfield(int x, int y, int n, int d); int main(){ int n, d; int m; int x, y; scanf("%d%d", &n, &d); scanf("%d", &m); while(m--){ scanf("%d%d", &x, &y); printf("%s\n", in_cornfield(x, y, n, d) ? "YES" : "NO"); } return 0; } bool in_cornfield(int x, int y, int n, int d){ // check if (x,y) is out of square {(0,0), (0,n), (n,n), (n,0)} if( x<0 || x>n || y<0 || y>n ) return false; // check if (x,y) is in inside of the triangles // { {(0,0), (d,0), (0,d)}, // {(d,0), (n,0), (n,n-d)}, // {(0,d), (0,n), (n-d, n)}, // {(n-d,n), (n,n), (n,n-d))} } if( ( x<d && y<d && (double)(d-y)/x > 1.0 ) || ( x>d && y<n-d && (double)((n-d)-y)/(n-x) > 1.0 ) || ( x<n-d && y>d && (double)((n-d)-x)/(n-y) > 1.0) || ( x>n-d && y>n-d && (double)(y-(n-d))/(n-x) > 1.0 ) ) return false; // if it is not in previous conditions, (x,y) is in inside or // on the border of the cornfield return true; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_10922/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_10922/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @.str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %d = alloca i32, align 4 %m = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !5 %dec6 = add nsw i32 %0, -1 store i32 %dec6, ptr %m, align 4, !tbaa !5 %tobool.not7 = icmp eq i32 %0, 0 br i1 %tobool.not7, label %while.end, label %while.body while.body: ; preds = %entry, %in_cornfield.exit %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %1 = load i32, ptr %x, align 4, !tbaa !5 %2 = load i32, ptr %y, align 4, !tbaa !5 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = load i32, ptr %d, align 4, !tbaa !5 %cmp.i = icmp slt i32 %1, 0 br i1 %cmp.i, label %in_cornfield.exit.thread, label %lor.lhs.false.i lor.lhs.false.i: ; preds = %while.body %cmp1.i = icmp sgt i32 %1, %3 %cmp3.i = icmp slt i32 %2, 0 %or.cond.i = or i1 %cmp3.i, %cmp1.i %cmp5.i = icmp sgt i32 %2, %3 %or.cond103.i = or i1 %cmp5.i, %or.cond.i br i1 %or.cond103.i, label %in_cornfield.exit.thread, label %if.end.i if.end.i: ; preds = %lor.lhs.false.i %cmp6.i = icmp slt i32 %1, %4 %cmp7.i = icmp slt i32 %2, %4 %or.cond104.i = and i1 %cmp6.i, %cmp7.i br i1 %or.cond104.i, label %land.lhs.true8.i, label %lor.lhs.false12.i land.lhs.true8.i: ; preds = %if.end.i %sub.i = sub nsw i32 %4, %2 %conv.i = sitofp i32 %sub.i to double %conv9.i = sitofp i32 %1 to double %div.i = fdiv double %conv.i, %conv9.i %cmp10.i = fcmp ogt double %div.i, 1.000000e+00 br i1 %cmp10.i, label %in_cornfield.exit.thread, label %lor.lhs.false12.i lor.lhs.false12.i: ; preds = %land.lhs.true8.i, %if.end.i %cmp13.i = icmp sgt i32 %1, %4 %sub16.i = sub nsw i32 %3, %4 %cmp17.i = icmp sgt i32 %sub16.i, %2 %or.cond107.i = select i1 %cmp13.i, i1 %cmp17.i, i1 false br i1 %or.cond107.i, label %land.lhs.true19.i, label %lor.lhs.false28.i land.lhs.true19.i: ; preds = %lor.lhs.false12.i %sub21.i = sub nsw i32 %sub16.i, %2 %conv22.i = sitofp i32 %sub21.i to double %sub23.i = sub nsw i32 %3, %1 %conv24.i = sitofp i32 %sub23.i to double %div25.i = fdiv double %conv22.i, %conv24.i %cmp26.i = fcmp ogt double %div25.i, 1.000000e+00 br i1 %cmp26.i, label %in_cornfield.exit.thread, label %lor.lhs.false28.i lor.lhs.false28.i: ; preds = %land.lhs.true19.i, %lor.lhs.false12.i %cmp30.i = icmp sgt i32 %sub16.i, %1 %cmp33.i = icmp sgt i32 %2, %4 %or.cond105.i = and i1 %cmp33.i, %cmp30.i br i1 %or.cond105.i, label %land.lhs.true35.i, label %lor.lhs.false44.i land.lhs.true35.i: ; preds = %lor.lhs.false28.i %sub37.i = sub nsw i32 %sub16.i, %1 %conv38.i = sitofp i32 %sub37.i to double %sub39.i = sub nsw i32 %3, %2 %conv40.i = sitofp i32 %sub39.i to double %div41.i = fdiv double %conv38.i, %conv40.i %cmp42.i = fcmp ogt double %div41.i, 1.000000e+00 br i1 %cmp42.i, label %in_cornfield.exit.thread, label %lor.lhs.false44.i lor.lhs.false44.i: ; preds = %land.lhs.true35.i, %lor.lhs.false28.i %cmp46.i = icmp slt i32 %sub16.i, %1 %cmp50.i = icmp slt i32 %sub16.i, %2 %or.cond106.i = and i1 %cmp46.i, %cmp50.i br i1 %or.cond106.i, label %land.lhs.true52.i, label %in_cornfield.exit land.lhs.true52.i: ; preds = %lor.lhs.false44.i %sub54.i = sub nsw i32 %2, %sub16.i %conv55.i = sitofp i32 %sub54.i to double %sub56.i = sub nsw i32 %3, %1 %conv57.i = sitofp i32 %sub56.i to double %div58.i = fdiv double %conv55.i, %conv57.i %cmp59.i = fcmp ogt double %div58.i, 1.000000e+00 br i1 %cmp59.i, label %in_cornfield.exit.thread, label %in_cornfield.exit in_cornfield.exit.thread: ; preds = %lor.lhs.false.i, %while.body, %land.lhs.true52.i, %land.lhs.true35.i, %land.lhs.true19.i, %land.lhs.true8.i br label %in_cornfield.exit in_cornfield.exit: ; preds = %lor.lhs.false44.i, %land.lhs.true52.i, %in_cornfield.exit.thread %5 = phi ptr [ @.str.4, %in_cornfield.exit.thread ], [ @.str.3, %land.lhs.true52.i ], [ @.str.3, %lor.lhs.false44.i ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %5) %6 = load i32, ptr %m, align 4, !tbaa !5 %dec = add nsw i32 %6, -1 store i32 %dec, ptr %m, align 4, !tbaa !5 %tobool.not = icmp eq i32 %6, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %in_cornfield.exit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local zeroext i1 @in_cornfield(i32 noundef %x, i32 noundef %y, i32 noundef %n, i32 noundef %d) local_unnamed_addr #3 { entry: %cmp = icmp slt i32 %x, 0 br i1 %cmp, label %return, label %lor.lhs.false lor.lhs.false: ; preds = %entry %cmp1 = icmp sgt i32 %x, %n %cmp3 = icmp slt i32 %y, 0 %or.cond = or i1 %cmp3, %cmp1 %cmp5 = icmp sgt i32 %y, %n %or.cond103 = or i1 %cmp5, %or.cond br i1 %or.cond103, label %return, label %if.end if.end: ; preds = %lor.lhs.false %cmp6 = icmp slt i32 %x, %d %cmp7 = icmp slt i32 %y, %d %or.cond104 = and i1 %cmp6, %cmp7 br i1 %or.cond104, label %land.lhs.true8, label %lor.lhs.false12 land.lhs.true8: ; preds = %if.end %sub = sub nsw i32 %d, %y %conv = sitofp i32 %sub to double %conv9 = sitofp i32 %x to double %div = fdiv double %conv, %conv9 %cmp10 = fcmp ogt double %div, 1.000000e+00 br i1 %cmp10, label %return, label %lor.lhs.false12 lor.lhs.false12: ; preds = %land.lhs.true8, %if.end %cmp13 = icmp sgt i32 %x, %d %sub16 = sub nsw i32 %n, %d %cmp17 = icmp sgt i32 %sub16, %y %or.cond107 = select i1 %cmp13, i1 %cmp17, i1 false br i1 %or.cond107, label %land.lhs.true19, label %lor.lhs.false28 land.lhs.true19: ; preds = %lor.lhs.false12 %sub21 = sub nsw i32 %sub16, %y %conv22 = sitofp i32 %sub21 to double %sub23 = sub nsw i32 %n, %x %conv24 = sitofp i32 %sub23 to double %div25 = fdiv double %conv22, %conv24 %cmp26 = fcmp ogt double %div25, 1.000000e+00 br i1 %cmp26, label %return, label %lor.lhs.false28 lor.lhs.false28: ; preds = %lor.lhs.false12, %land.lhs.true19 %cmp30 = icmp sgt i32 %sub16, %x %cmp33 = icmp sgt i32 %y, %d %or.cond105 = and i1 %cmp33, %cmp30 br i1 %or.cond105, label %land.lhs.true35, label %lor.lhs.false44 land.lhs.true35: ; preds = %lor.lhs.false28 %sub37 = sub nsw i32 %sub16, %x %conv38 = sitofp i32 %sub37 to double %sub39 = sub nsw i32 %n, %y %conv40 = sitofp i32 %sub39 to double %div41 = fdiv double %conv38, %conv40 %cmp42 = fcmp ogt double %div41, 1.000000e+00 br i1 %cmp42, label %return, label %lor.lhs.false44 lor.lhs.false44: ; preds = %land.lhs.true35, %lor.lhs.false28 %cmp46 = icmp slt i32 %sub16, %x %cmp50 = icmp slt i32 %sub16, %y %or.cond106 = and i1 %cmp46, %cmp50 br i1 %or.cond106, label %land.lhs.true52, label %if.end62 land.lhs.true52: ; preds = %lor.lhs.false44 %sub54 = sub nsw i32 %y, %sub16 %conv55 = sitofp i32 %sub54 to double %sub56 = sub nsw i32 %n, %x %conv57 = sitofp i32 %sub56 to double %div58 = fdiv double %conv55, %conv57 %cmp59 = fcmp ogt double %div58, 1.000000e+00 br i1 %cmp59, label %return, label %if.end62 if.end62: ; preds = %land.lhs.true52, %lor.lhs.false44 br label %return return: ; preds = %land.lhs.true8, %land.lhs.true19, %land.lhs.true35, %land.lhs.true52, %entry, %lor.lhs.false, %if.end62 %retval.0 = phi i1 [ true, %if.end62 ], [ false, %lor.lhs.false ], [ false, %entry ], [ false, %land.lhs.true52 ], [ false, %land.lhs.true35 ], [ false, %land.lhs.true19 ], [ false, %land.lhs.true8 ] ret i1 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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 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 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"}
#include<stdio.h> int main(void) { int x; scanf("%d",&x); printf("%d\n",x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109263/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109263/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 x; scanf("%d",&x); printf("%d\n",x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109306/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109306/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 i=0; scanf("%d",&i); int m[i]; int check=0; for (int j=0;j<i;j++) { scanf("%d", &m[i]); if (m[i]==1) { check=1; } } if (check==1) printf("Hard"); else printf("Easy"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_10935/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_10935/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Hard\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Easy\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4 store i32 0, ptr %i, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %0 = load i32, ptr %i, 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 %i, align 4, !tbaa !5 %cmp11 = icmp sgt i32 %3, 0 br i1 %cmp11, label %for.body, label %if.else for.cond.cleanup: ; preds = %for.body %4 = icmp eq i32 %spec.select, 1 br i1 %4, label %if.end9, label %if.else for.body: ; preds = %entry, %for.body %5 = phi i32 [ %6, %for.body ], [ %3, %entry ] %j.013 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %check.012 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %idxprom = sext i32 %5 to i64 %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %idxprom %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %6 = load i32, ptr %i, align 4, !tbaa !5 %idxprom2 = sext i32 %6 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %vla, i64 %idxprom2 %7 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp eq i32 %7, 1 %spec.select = select i1 %cmp4, i32 1, i32 %check.012 %inc = add nuw nsw i32 %j.013, 1 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 if.else: ; preds = %entry, %for.cond.cleanup br label %if.end9 if.end9: ; preds = %for.cond.cleanup, %if.else %.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %for.cond.cleanup ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: 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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int x; scanf("%d",&x); printf("%d\n",x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109393/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109393/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 x; scanf("%d", &x); printf("%d\n",x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109443/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109443/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 ss(int); /*3乗を求める関数*/ int main(void) { int x; int t; scanf("%d",&x); t=ss(x); printf("%d\n",t); } int ss(int a){ int y=a*a*a; return y; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109494/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109494/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul.i = mul nsw i32 %0, %0 %mul1.i = mul nsw i32 %mul.i, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1.i) 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 nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ss(i32 noundef %a) local_unnamed_addr #3 { entry: %mul = mul nsw i32 %a, %a %mul1 = mul nsw i32 %mul, %a ret i32 %mul1 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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); printf("%d\n", x * x * x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109537/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109537/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 x; int result; result=0; scanf("%d",&x); if(1<=x&&x<=100){ result=x*x*x; } printf("%d\n",result); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109580/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109580/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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, -1 %or.cond = icmp ult i32 %1, 100 %mul = mul nuw nsw i32 %0, %0 %mul2 = mul nuw nsw i32 %mul, %0 %result.0 = select i1 %or.cond, i32 %mul2, i32 0 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %result.0) 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() { int x = 0; scanf("%d",&x); printf("%d\n",x*x*x); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109638/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109638/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 store i32 0, ptr %x, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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){ // Youprir code here! int n; scanf("%d",&n); printf("%d\n",n*n*n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109681/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109681/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int x; scanf("%d", &x); printf("%d\n", x * x * x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109731/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109731/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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"}
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main() { int x; scanf("%d", &x); printf("%d\n", x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109775/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109775/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 x; scanf("%d" , &x); printf("%d\n",x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109818/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109818/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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; scanf("%d",&a); printf("%d\n",a*a*a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109861/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109861/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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; scanf ("%d",&x); printf("%d\n",x*x*x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109904/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109904/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 x,y; scanf("%d",&x); y = x*x*x; printf("%d\n", y); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109955/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109955/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) 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 i; scanf("%d",&i); i=i*i*i; printf("%d\n",i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_109999/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_109999/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %0 = load i32, ptr %i, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 store i32 %mul1, ptr %i, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !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<ctype.h> int main() { char a[27],b[27],c[1010]; while(scanf("%s\n%s\n%s",a,b,c)==3) { unsigned int d[26],i; for(i=0;i<26;i++)d[a[i]-'a']=i; for(i=0;c[i]!='\0';i++) { if(c[i]>='0' && c[i]<='9') { printf("%c",c[i]); } else { if(c[i]>='A' && c[i]<='Z') { printf("%c",toupper(b[d[c[i]-'A']])); } else { printf("%c",b[d[c[i]-'a']]); } } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11004/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11004/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%s\0A%s\0A%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [27 x i8], align 16 %b = alloca [27 x i8], align 16 %c = alloca [1010 x i8], align 16 %d = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 27, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 27, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 1010, ptr nonnull %c) #5 %call89 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %cmp90 = icmp eq i32 %call89, 3 br i1 %cmp90, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %entry %arrayidx.1 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 1 %arrayidx.2 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 2 %arrayidx.3 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 3 %arrayidx.4 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 4 %arrayidx.5 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 5 %arrayidx.6 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 6 %arrayidx.7 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 7 %arrayidx.8 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 8 %arrayidx.9 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 9 %arrayidx.10 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 10 %arrayidx.11 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 11 %arrayidx.12 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 12 %arrayidx.13 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 13 %arrayidx.14 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 14 %arrayidx.15 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 15 %arrayidx.16 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 16 %arrayidx.17 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 17 %arrayidx.18 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 18 %arrayidx.19 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 19 %arrayidx.20 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 20 %arrayidx.21 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 21 %arrayidx.22 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 22 %arrayidx.23 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 23 %arrayidx.24 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 24 %arrayidx.25 = getelementptr inbounds [27 x i8], ptr %a, i64 0, i64 25 br label %while.body while.body: ; preds = %while.body.preheader, %for.end66 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %d) #5 %0 = load i8, ptr %a, align 16, !tbaa !5 %conv = sext i8 %0 to i64 %sub = add nsw i64 %conv, -97 %arrayidx5 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub store i32 0, ptr %arrayidx5, align 4, !tbaa !8 %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %conv.1 = sext i8 %1 to i64 %sub.1 = add nsw i64 %conv.1, -97 %arrayidx5.1 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.1 store i32 1, ptr %arrayidx5.1, align 4, !tbaa !8 %2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5 %conv.2 = sext i8 %2 to i64 %sub.2 = add nsw i64 %conv.2, -97 %arrayidx5.2 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.2 store i32 2, ptr %arrayidx5.2, align 4, !tbaa !8 %3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %conv.3 = sext i8 %3 to i64 %sub.3 = add nsw i64 %conv.3, -97 %arrayidx5.3 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.3 store i32 3, ptr %arrayidx5.3, align 4, !tbaa !8 %4 = load i8, ptr %arrayidx.4, align 4, !tbaa !5 %conv.4 = sext i8 %4 to i64 %sub.4 = add nsw i64 %conv.4, -97 %arrayidx5.4 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.4 store i32 4, ptr %arrayidx5.4, align 4, !tbaa !8 %5 = load i8, ptr %arrayidx.5, align 1, !tbaa !5 %conv.5 = sext i8 %5 to i64 %sub.5 = add nsw i64 %conv.5, -97 %arrayidx5.5 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.5 store i32 5, ptr %arrayidx5.5, align 4, !tbaa !8 %6 = load i8, ptr %arrayidx.6, align 2, !tbaa !5 %conv.6 = sext i8 %6 to i64 %sub.6 = add nsw i64 %conv.6, -97 %arrayidx5.6 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.6 store i32 6, ptr %arrayidx5.6, align 4, !tbaa !8 %7 = load i8, ptr %arrayidx.7, align 1, !tbaa !5 %conv.7 = sext i8 %7 to i64 %sub.7 = add nsw i64 %conv.7, -97 %arrayidx5.7 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.7 store i32 7, ptr %arrayidx5.7, align 4, !tbaa !8 %8 = load i8, ptr %arrayidx.8, align 8, !tbaa !5 %conv.8 = sext i8 %8 to i64 %sub.8 = add nsw i64 %conv.8, -97 %arrayidx5.8 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.8 store i32 8, ptr %arrayidx5.8, align 4, !tbaa !8 %9 = load i8, ptr %arrayidx.9, align 1, !tbaa !5 %conv.9 = sext i8 %9 to i64 %sub.9 = add nsw i64 %conv.9, -97 %arrayidx5.9 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.9 store i32 9, ptr %arrayidx5.9, align 4, !tbaa !8 %10 = load i8, ptr %arrayidx.10, align 2, !tbaa !5 %conv.10 = sext i8 %10 to i64 %sub.10 = add nsw i64 %conv.10, -97 %arrayidx5.10 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.10 store i32 10, ptr %arrayidx5.10, align 4, !tbaa !8 %11 = load i8, ptr %arrayidx.11, align 1, !tbaa !5 %conv.11 = sext i8 %11 to i64 %sub.11 = add nsw i64 %conv.11, -97 %arrayidx5.11 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.11 store i32 11, ptr %arrayidx5.11, align 4, !tbaa !8 %12 = load i8, ptr %arrayidx.12, align 4, !tbaa !5 %conv.12 = sext i8 %12 to i64 %sub.12 = add nsw i64 %conv.12, -97 %arrayidx5.12 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.12 store i32 12, ptr %arrayidx5.12, align 4, !tbaa !8 %13 = load i8, ptr %arrayidx.13, align 1, !tbaa !5 %conv.13 = sext i8 %13 to i64 %sub.13 = add nsw i64 %conv.13, -97 %arrayidx5.13 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.13 store i32 13, ptr %arrayidx5.13, align 4, !tbaa !8 %14 = load i8, ptr %arrayidx.14, align 2, !tbaa !5 %conv.14 = sext i8 %14 to i64 %sub.14 = add nsw i64 %conv.14, -97 %arrayidx5.14 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.14 store i32 14, ptr %arrayidx5.14, align 4, !tbaa !8 %15 = load i8, ptr %arrayidx.15, align 1, !tbaa !5 %conv.15 = sext i8 %15 to i64 %sub.15 = add nsw i64 %conv.15, -97 %arrayidx5.15 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.15 store i32 15, ptr %arrayidx5.15, align 4, !tbaa !8 %16 = load i8, ptr %arrayidx.16, align 16, !tbaa !5 %conv.16 = sext i8 %16 to i64 %sub.16 = add nsw i64 %conv.16, -97 %arrayidx5.16 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.16 store i32 16, ptr %arrayidx5.16, align 4, !tbaa !8 %17 = load i8, ptr %arrayidx.17, align 1, !tbaa !5 %conv.17 = sext i8 %17 to i64 %sub.17 = add nsw i64 %conv.17, -97 %arrayidx5.17 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.17 store i32 17, ptr %arrayidx5.17, align 4, !tbaa !8 %18 = load i8, ptr %arrayidx.18, align 2, !tbaa !5 %conv.18 = sext i8 %18 to i64 %sub.18 = add nsw i64 %conv.18, -97 %arrayidx5.18 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.18 store i32 18, ptr %arrayidx5.18, align 4, !tbaa !8 %19 = load i8, ptr %arrayidx.19, align 1, !tbaa !5 %conv.19 = sext i8 %19 to i64 %sub.19 = add nsw i64 %conv.19, -97 %arrayidx5.19 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.19 store i32 19, ptr %arrayidx5.19, align 4, !tbaa !8 %20 = load i8, ptr %arrayidx.20, align 4, !tbaa !5 %conv.20 = sext i8 %20 to i64 %sub.20 = add nsw i64 %conv.20, -97 %arrayidx5.20 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.20 store i32 20, ptr %arrayidx5.20, align 4, !tbaa !8 %21 = load i8, ptr %arrayidx.21, align 1, !tbaa !5 %conv.21 = sext i8 %21 to i64 %sub.21 = add nsw i64 %conv.21, -97 %arrayidx5.21 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.21 store i32 21, ptr %arrayidx5.21, align 4, !tbaa !8 %22 = load i8, ptr %arrayidx.22, align 2, !tbaa !5 %conv.22 = sext i8 %22 to i64 %sub.22 = add nsw i64 %conv.22, -97 %arrayidx5.22 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.22 store i32 22, ptr %arrayidx5.22, align 4, !tbaa !8 %23 = load i8, ptr %arrayidx.23, align 1, !tbaa !5 %conv.23 = sext i8 %23 to i64 %sub.23 = add nsw i64 %conv.23, -97 %arrayidx5.23 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.23 store i32 23, ptr %arrayidx5.23, align 4, !tbaa !8 %24 = load i8, ptr %arrayidx.24, align 8, !tbaa !5 %conv.24 = sext i8 %24 to i64 %sub.24 = add nsw i64 %conv.24, -97 %arrayidx5.24 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.24 store i32 24, ptr %arrayidx5.24, align 4, !tbaa !8 %25 = load i8, ptr %arrayidx.25, align 1, !tbaa !5 %conv.25 = sext i8 %25 to i64 %sub.25 = add nsw i64 %conv.25, -97 %arrayidx5.25 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub.25 store i32 25, ptr %arrayidx5.25, align 4, !tbaa !8 %26 = load i8, ptr %c, align 16, !tbaa !5 %cmp10.not86 = icmp eq i8 %26, 0 br i1 %cmp10.not86, label %for.end66, label %for.body12 for.body12: ; preds = %while.body, %for.inc64 %27 = phi i8 [ %36, %for.inc64 ], [ %26, %while.body ] %i.187 = phi i32 [ %inc65, %for.inc64 ], [ 0, %while.body ] %28 = add i8 %27, -48 %or.cond = icmp ult i8 %28, 10 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %for.body12 %conv988 = zext i8 %27 to i32 br label %for.inc64 if.else: ; preds = %for.body12 %conv29 = sext i8 %27 to i64 %29 = add i8 %27, -65 %or.cond83 = icmp ult i8 %29, 26 br i1 %or.cond83, label %if.then38, label %if.else52 if.then38: ; preds = %if.else %call39 = tail call ptr @__ctype_toupper_loc() #6 %30 = load ptr, ptr %call39, align 8, !tbaa !10 %sub43 = add nsw i64 %conv29, 4294967231 %idxprom44 = and i64 %sub43, 4294967295 %arrayidx45 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %idxprom44 %31 = load i32, ptr %arrayidx45, align 4, !tbaa !8 %idxprom46 = zext i32 %31 to i64 %arrayidx47 = getelementptr inbounds [27 x i8], ptr %b, i64 0, i64 %idxprom46 %32 = load i8, ptr %arrayidx47, align 1, !tbaa !5 %idxprom49 = sext i8 %32 to i64 %arrayidx50 = getelementptr inbounds i32, ptr %30, i64 %idxprom49 %33 = load i32, ptr %arrayidx50, align 4, !tbaa !8 br label %for.inc64 if.else52: ; preds = %if.else %sub56 = add nsw i64 %conv29, -97 %arrayidx58 = getelementptr inbounds [26 x i32], ptr %d, i64 0, i64 %sub56 %34 = load i32, ptr %arrayidx58, align 4, !tbaa !8 %idxprom59 = zext i32 %34 to i64 %arrayidx60 = getelementptr inbounds [27 x i8], ptr %b, i64 0, i64 %idxprom59 %35 = load i8, ptr %arrayidx60, align 1, !tbaa !5 %conv61 = sext i8 %35 to i32 br label %for.inc64 for.inc64: ; preds = %if.then, %if.else52, %if.then38 %conv988.sink = phi i32 [ %conv988, %if.then ], [ %conv61, %if.else52 ], [ %33, %if.then38 ] %putchar82 = call i32 @putchar(i32 %conv988.sink) %inc65 = add i32 %i.187, 1 %idxprom7 = zext i32 %inc65 to i64 %arrayidx8 = getelementptr inbounds [1010 x i8], ptr %c, i64 0, i64 %idxprom7 %36 = load i8, ptr %arrayidx8, align 1, !tbaa !5 %cmp10.not = icmp eq i8 %36, 0 br i1 %cmp10.not, label %for.end66, label %for.body12, !llvm.loop !12 for.end66: ; preds = %for.inc64, %while.body %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %d) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %cmp = icmp eq i32 %call, 3 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !14 while.end: ; preds = %for.end66, %entry call void @llvm.lifetime.end.p0(i64 1010, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 27, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 27, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_toupper_loc() local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"any pointer", !6, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13}
#include <stdio.h> int main(){ int num; scanf("%d", &num); printf("%d\n", num*num*num); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110083/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110083/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %num = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 cube(int x) { return (x*x*x); } int main() { int x; scanf("%d",&x); printf("%d\n",cube(x)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110126/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110126/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cube(i32 noundef %x) local_unnamed_addr #0 { entry: %mul = mul nsw i32 %x, %x %mul1 = mul nsw i32 %mul, %x ret i32 %mul1 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { 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 %mul.i = mul nsw i32 %0, %0 %mul1.i = mul nsw i32 %mul.i, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1.i) 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) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { 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 #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"}
#include<stdio.h> int main() { int a[100],b[100]; int i,j,k,n,d=1; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<(n-1);i++) { if(a[i+1]>a[i]) { b[i]=1; } else if(a[i+1]==a[i]) { b[i]=2; } else if(a[i+1]<a[i]) { b[i]=3; } } for(i=0;i<(n-2);i++) { if(b[i+1]<b[i]) { d=0; break; } } if(d==1) printf("YES"); else printf("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11017/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11017/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100 x i32], align 16 %b = alloca [100 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %b) #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 %cmp75 = icmp sgt i32 %0, 0 br i1 %cmp75, label %for.body, label %for.cond36.preheader for.cond2.preheader: ; preds = %for.body %cmp377 = icmp sgt i32 %2, 1 br i1 %cmp377, label %for.body4.preheader, label %for.cond36.preheader for.body4.preheader: ; preds = %for.cond2.preheader %sub = add i32 %2, -1 %wide.trip.count = zext i32 %sub to i64 %.pre = load i32, ptr %a, align 16, !tbaa !5 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %sub, 1 br i1 %1, label %for.cond36.preheader.loopexit.unr-lcssa, label %for.body4.preheader.new for.body4.preheader.new: ; preds = %for.body4.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond36.preheader.loopexit.unr-lcssa: ; preds = %for.inc33.1, %for.body4.preheader %.unr = phi i32 [ %.pre, %for.body4.preheader ], [ %8, %for.inc33.1 ] %indvars.iv81.unr = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next82.1, %for.inc33.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond36.preheader, label %for.body4.epil for.body4.epil: ; preds = %for.cond36.preheader.loopexit.unr-lcssa %indvars.iv.next82.epil = add nuw nsw i64 %indvars.iv81.unr, 1 %arrayidx6.epil = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next82.epil %4 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5 %cmp9.epil = icmp sgt i32 %4, %.unr br i1 %cmp9.epil, label %for.inc33.sink.split.epil, label %if.else.epil if.else.epil: ; preds = %for.body4.epil %cmp17.epil = icmp eq i32 %4, %.unr br i1 %cmp17.epil, label %for.inc33.sink.split.epil, label %if.else21.epil if.else21.epil: ; preds = %if.else.epil %cmp27.epil = icmp slt i32 %4, %.unr br i1 %cmp27.epil, label %for.inc33.sink.split.epil, label %for.cond36.preheader for.inc33.sink.split.epil: ; preds = %if.else21.epil, %if.else.epil, %for.body4.epil %.sink.epil = phi i32 [ 1, %for.body4.epil ], [ 2, %if.else.epil ], [ 3, %if.else21.epil ] %arrayidx11.epil = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv81.unr store i32 %.sink.epil, ptr %arrayidx11.epil, align 4, !tbaa !5 br label %for.cond36.preheader for.cond36.preheader: ; preds = %for.cond36.preheader.loopexit.unr-lcssa, %for.inc33.sink.split.epil, %if.else21.epil, %entry, %for.cond2.preheader %.lcssa91 = phi i32 [ %2, %for.cond2.preheader ], [ %0, %entry ], [ %2, %if.else21.epil ], [ %2, %for.inc33.sink.split.epil ], [ %2, %for.cond36.preheader.loopexit.unr-lcssa ] %5 = call i32 @llvm.smax.i32(i32 %.lcssa91, i32 2) %smax = add nsw i32 %5, -2 %wide.trip.count87 = zext i32 %smax to i64 br label %for.cond36 for.body4: ; preds = %for.inc33.1, %for.body4.preheader.new %6 = phi i32 [ %.pre, %for.body4.preheader.new ], [ %8, %for.inc33.1 ] %indvars.iv81 = phi i64 [ 0, %for.body4.preheader.new ], [ %indvars.iv.next82.1, %for.inc33.1 ] %niter = phi i64 [ 0, %for.body4.preheader.new ], [ %niter.next.1, %for.inc33.1 ] %indvars.iv.next82 = or i64 %indvars.iv81, 1 %arrayidx6 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next82 %7 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %7, %6 %cmp17 = icmp eq i32 %7, %6 %spec.select = select i1 %cmp17, i32 2, i32 3 %.sink = select i1 %cmp9, i32 1, i32 %spec.select %arrayidx11 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv81 store i32 %.sink, ptr %arrayidx11, align 8, !tbaa !5 %indvars.iv.next82.1 = add nuw nsw i64 %indvars.iv81, 2 %arrayidx6.1 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next82.1 %8 = load i32, ptr %arrayidx6.1, align 8, !tbaa !5 %cmp9.1 = icmp sgt i32 %8, %7 br i1 %cmp9.1, label %for.inc33.sink.split.1, label %if.else.1 if.else.1: ; preds = %for.body4 %cmp17.1 = icmp eq i32 %8, %7 br i1 %cmp17.1, label %for.inc33.sink.split.1, label %if.else21.1 if.else21.1: ; preds = %if.else.1 %cmp27.1 = icmp slt i32 %8, %7 br i1 %cmp27.1, label %for.inc33.sink.split.1, label %for.inc33.1 for.inc33.sink.split.1: ; preds = %if.else21.1, %if.else.1, %for.body4 %.sink.1 = phi i32 [ 1, %for.body4 ], [ 2, %if.else.1 ], [ 3, %if.else21.1 ] %arrayidx11.1 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv.next82 store i32 %.sink.1, ptr %arrayidx11.1, align 4, !tbaa !5 br label %for.inc33.1 for.inc33.1: ; preds = %for.inc33.sink.split.1, %if.else21.1 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond36.preheader.loopexit.unr-lcssa, label %for.body4, !llvm.loop !11 for.cond36: ; preds = %for.cond36.preheader, %for.body39 %indvars.iv84 = phi i64 [ 0, %for.cond36.preheader ], [ %indvars.iv.next85, %for.body39 ] %exitcond88.not = icmp eq i64 %indvars.iv84, %wide.trip.count87 br i1 %exitcond88.not, label %if.end56, label %for.body39 for.body39: ; preds = %for.cond36 %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %arrayidx42 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv.next85 %9 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %arrayidx44 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv84 %10 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %cmp45 = icmp slt i32 %9, %10 br i1 %cmp45, label %if.end56, label %for.cond36, !llvm.loop !12 if.end56: ; preds = %for.body39, %for.cond36 %.str.2.sink = phi ptr [ @.str.1, %for.cond36 ], [ @.str.2, %for.body39 ] %call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<stdbool.h> #include<math.h> #define MAX 2001 typedef long long ll; ll N, A[MAX]; ll hash[MAX]; ll DP[MAX][MAX]; ll max(ll x, ll y) { if (x > y) return x; else return y; } void swap(ll * a, ll * b) { ll buf = *a; *a = *b; *b = buf; } void solve(ll x, ll y) { //枝刈り N + 1以上は詰められない if (x + y >= N + 1) return; //枝刈り 下のDPができてなければやる意味ない if (DP[x][y - 1] < 0 || DP[x - 1][y] < 0) return; DP[x][y] = max(DP[x][y - 1] + A[x + y] * (hash[x + y] - y), DP[x - 1][y] + A[x + y] * (N + 1 - x - hash[x + y])); //とりま累乗で生成 solve(x, y + 1); solve(x + 1, y); } ll main() { scanf("%lld", &N); for (ll i = 1; i <= N; i++) { scanf("%lld", A + i); hash[i] = i; } for (ll i = 1; i <= N; i++) { for (ll j = 1; j < i; j++) { if (A[j] < A[i]) { swap(A + i, A + j); swap(hash + i, hash + j); } } } memset(DP, -1, sizeof(DP)); DP[0][0] = 0; for (ll i = 1; i <= N; i++) { DP[0][i] = DP[0][i - 1] + A[i] * (hash[i] - i); DP[i][0] = DP[i - 1][0] + A[i] * (N + 1 - i - hash[i]); } solve(1, 1); ll ans = 0; for (ll i = 0; i <= N; i++) ans = max(ans, DP[i][N - i]); printf("%lld", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110227/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110227/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @N = dso_local global i64 0, align 8 @DP = dso_local local_unnamed_addr global [2001 x [2001 x i64]] zeroinitializer, align 16 @A = dso_local global [2001 x i64] zeroinitializer, align 16 @hash = dso_local local_unnamed_addr global [2001 x i64] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %x.y = tail call i64 @llvm.smax.i64(i64 %x, i64 %y) ret i64 %x.y } ; 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 #1 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 store i64 %1, ptr %a, align 8, !tbaa !5 store i64 %0, ptr %b, align 8, !tbaa !5 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @solve(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 { entry: %sub = add nsw i64 %y, -1 %add61 = add nsw i64 %x, %y %0 = load i64, ptr @N, align 8, !tbaa !5 %cmp.not.not62 = icmp sgt i64 %add61, %0 br i1 %cmp.not.not62, label %return, label %if.end.lr.ph if.end.lr.ph: ; preds = %entry %add33 = add nsw i64 %y, 1 br label %if.end if.end: ; preds = %if.end.lr.ph, %if.end9 %1 = phi i64 [ %0, %if.end.lr.ph ], [ %8, %if.end9 ] %add64 = phi i64 [ %add61, %if.end.lr.ph ], [ %add, %if.end9 ] %x.tr63 = phi i64 [ %x, %if.end.lr.ph ], [ %add34, %if.end9 ] %arrayidx2 = getelementptr inbounds [2001 x [2001 x i64]], ptr @DP, i64 0, i64 %x.tr63, i64 %sub %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 %cmp3 = icmp slt i64 %2, 0 br i1 %cmp3, label %return, label %lor.lhs.false lor.lhs.false: ; preds = %if.end %sub4 = add nsw i64 %x.tr63, -1 %arrayidx6 = getelementptr inbounds [2001 x [2001 x i64]], ptr @DP, i64 0, i64 %sub4, i64 %y %3 = load i64, ptr %arrayidx6, align 8, !tbaa !5 %cmp7 = icmp slt i64 %3, 0 br i1 %cmp7, label %return, label %if.end9 if.end9: ; preds = %lor.lhs.false %arrayidx14 = getelementptr inbounds [2001 x i64], ptr @A, i64 0, i64 %add64 %4 = load i64, ptr %arrayidx14, align 8, !tbaa !5 %arrayidx16 = getelementptr inbounds [2001 x i64], ptr @hash, i64 0, i64 %add64 %5 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %sub17 = sub nsw i64 %5, %y %mul = mul nsw i64 %sub17, %4 %add18 = add nsw i64 %mul, %2 %6 = add i64 %1, 1 %7 = add i64 %x.tr63, %5 %sub28 = sub i64 %6, %7 %mul29 = mul nsw i64 %sub28, %4 %add30 = add nsw i64 %mul29, %3 %x.y.i = tail call i64 @llvm.smax.i64(i64 %add18, i64 %add30) %arrayidx32 = getelementptr inbounds [2001 x [2001 x i64]], ptr @DP, i64 0, i64 %x.tr63, i64 %y store i64 %x.y.i, ptr %arrayidx32, align 8, !tbaa !5 tail call void @solve(i64 noundef %x.tr63, i64 noundef %add33) %add34 = add nsw i64 %x.tr63, 1 %add = add nsw i64 %add34, %y %8 = load i64, ptr @N, align 8, !tbaa !5 %cmp.not.not = icmp sgt i64 %add, %8 br i1 %cmp.not.not, label %return, label %if.end return: ; preds = %if.end9, %lor.lhs.false, %if.end, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @main() local_unnamed_addr #3 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N) %0 = load i64, ptr @N, align 8, !tbaa !5 %cmp.not91 = icmp slt i64 %0, 1 br i1 %cmp.not91, label %for.cond.cleanup5.thread, label %for.body for.cond3.preheader: ; preds = %for.body %cmp4.not95 = icmp slt i64 %1, 1 br i1 %cmp4.not95, label %for.cond.cleanup5.thread, label %for.cond7.preheader for.body: ; preds = %entry, %for.body %i.092 = phi i64 [ %inc, %for.body ], [ 1, %entry ] %add.ptr = getelementptr inbounds i64, ptr @A, i64 %i.092 %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr) %arrayidx = getelementptr inbounds [2001 x i64], ptr @hash, i64 0, i64 %i.092 store i64 %i.092, ptr %arrayidx, align 8, !tbaa !5 %inc = add nuw nsw i64 %i.092, 1 %1 = load i64, ptr @N, align 8, !tbaa !5 %cmp.not.not = icmp slt i64 %i.092, %1 br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond7.preheader: ; preds = %for.cond3.preheader, %for.cond.cleanup9 %i2.096 = phi i64 [ %inc22, %for.cond.cleanup9 ], [ 1, %for.cond3.preheader ] %cmp893 = icmp ugt i64 %i2.096, 1 br i1 %cmp893, label %for.body10.lr.ph, label %for.cond.cleanup9 for.body10.lr.ph: ; preds = %for.cond7.preheader %arrayidx12 = getelementptr inbounds [2001 x i64], ptr @A, i64 0, i64 %i2.096 %add.ptr16 = getelementptr inbounds i64, ptr @hash, i64 %i2.096 br label %for.body10 for.cond.cleanup5.thread: ; preds = %for.cond3.preheader, %entry tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32032008) @DP, i8 -1, i64 32032008, i1 false) store i64 0, ptr @DP, align 16, !tbaa !5 br label %for.cond.cleanup27 for.cond.cleanup5: ; preds = %for.cond.cleanup9 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32032008) @DP, i8 -1, i64 32032008, i1 false) store i64 0, ptr @DP, align 16, !tbaa !5 br i1 %cmp4.not95, label %for.cond.cleanup27, label %for.body28.lr.ph for.body28.lr.ph: ; preds = %for.cond.cleanup5 %.neg90 = add nuw i64 %1, 1 br label %for.body28 for.cond.cleanup9: ; preds = %for.inc18, %for.cond7.preheader %inc22 = add nuw i64 %i2.096, 1 %exitcond104.not = icmp eq i64 %i2.096, %1 br i1 %exitcond104.not, label %for.cond.cleanup5, label %for.cond7.preheader, !llvm.loop !11 for.body10: ; preds = %for.body10.lr.ph, %for.inc18 %j.094 = phi i64 [ 1, %for.body10.lr.ph ], [ %inc19, %for.inc18 ] %arrayidx11 = getelementptr inbounds [2001 x i64], ptr @A, i64 0, i64 %j.094 %2 = load i64, ptr %arrayidx11, align 8, !tbaa !5 %3 = load i64, ptr %arrayidx12, align 8, !tbaa !5 %cmp13 = icmp slt i64 %2, %3 br i1 %cmp13, label %if.then, label %for.inc18 if.then: ; preds = %for.body10 store i64 %2, ptr %arrayidx12, align 8, !tbaa !5 store i64 %3, ptr %arrayidx11, align 8, !tbaa !5 %add.ptr17 = getelementptr inbounds i64, ptr @hash, i64 %j.094 %4 = load i64, ptr %add.ptr16, align 8, !tbaa !5 %5 = load i64, ptr %add.ptr17, align 8, !tbaa !5 store i64 %5, ptr %add.ptr16, align 8, !tbaa !5 store i64 %4, ptr %add.ptr17, align 8, !tbaa !5 br label %for.inc18 for.inc18: ; preds = %for.body10, %if.then %inc19 = add nuw nsw i64 %j.094, 1 %exitcond.not = icmp eq i64 %inc19, %i2.096 br i1 %exitcond.not, label %for.cond.cleanup9, label %for.body10, !llvm.loop !12 for.cond.cleanup27: ; preds = %for.body28, %for.cond.cleanup5.thread, %for.cond.cleanup5 tail call void @solve(i64 noundef 1, i64 noundef 1) %6 = load i64, ptr @N, align 8, !tbaa !5 %cmp51.not99 = icmp slt i64 %6, 0 br i1 %cmp51.not99, label %for.cond.cleanup52, label %for.body53.preheader for.body53.preheader: ; preds = %for.cond.cleanup27 %7 = add i64 %6, 1 %xtraiter = and i64 %7, 3 %8 = icmp ult i64 %6, 3 br i1 %8, label %for.cond.cleanup52.loopexit.unr-lcssa, label %for.body53.preheader.new for.body53.preheader.new: ; preds = %for.body53.preheader %unroll_iter = and i64 %7, -4 br label %for.body53 for.body28: ; preds = %for.body28.lr.ph, %for.body28 %9 = phi i64 [ 0, %for.body28.lr.ph ], [ %add43, %for.body28 ] %i24.098 = phi i64 [ 1, %for.body28.lr.ph ], [ %inc47, %for.body28 ] %sub = add nsw i64 %i24.098, -1 %arrayidx29 = getelementptr inbounds [2001 x i64], ptr @DP, i64 0, i64 %sub %10 = load i64, ptr %arrayidx29, align 8, !tbaa !5 %arrayidx30 = getelementptr inbounds [2001 x i64], ptr @A, i64 0, i64 %i24.098 %11 = load i64, ptr %arrayidx30, align 8, !tbaa !5 %arrayidx31 = getelementptr inbounds [2001 x i64], ptr @hash, i64 0, i64 %i24.098 %12 = load i64, ptr %arrayidx31, align 8, !tbaa !5 %sub32 = sub nsw i64 %12, %i24.098 %mul = mul nsw i64 %sub32, %11 %add = add nsw i64 %mul, %10 %arrayidx33 = getelementptr inbounds [2001 x i64], ptr @DP, i64 0, i64 %i24.098 store i64 %add, ptr %arrayidx33, align 8, !tbaa !5 %13 = add i64 %i24.098, %12 %sub41 = sub i64 %.neg90, %13 %mul42 = mul nsw i64 %sub41, %11 %add43 = add nsw i64 %9, %mul42 %arrayidx44 = getelementptr inbounds [2001 x [2001 x i64]], ptr @DP, i64 0, i64 %i24.098 store i64 %add43, ptr %arrayidx44, align 8, !tbaa !5 %inc47 = add nuw i64 %i24.098, 1 %exitcond105.not = icmp eq i64 %i24.098, %1 br i1 %exitcond105.not, label %for.cond.cleanup27, label %for.body28, !llvm.loop !13 for.cond.cleanup52.loopexit.unr-lcssa: ; preds = %for.body53, %for.body53.preheader %x.y.i.lcssa.ph = phi i64 [ undef, %for.body53.preheader ], [ %x.y.i.3, %for.body53 ] %i49.0101.unr = phi i64 [ 0, %for.body53.preheader ], [ %inc59.3, %for.body53 ] %ans.0100.unr = phi i64 [ 0, %for.body53.preheader ], [ %x.y.i.3, %for.body53 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup52, label %for.body53.epil for.body53.epil: ; preds = %for.cond.cleanup52.loopexit.unr-lcssa, %for.body53.epil %i49.0101.epil = phi i64 [ %inc59.epil, %for.body53.epil ], [ %i49.0101.unr, %for.cond.cleanup52.loopexit.unr-lcssa ] %ans.0100.epil = phi i64 [ %x.y.i.epil, %for.body53.epil ], [ %ans.0100.unr, %for.cond.cleanup52.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body53.epil ], [ 0, %for.cond.cleanup52.loopexit.unr-lcssa ] %sub55.epil = sub nsw i64 %6, %i49.0101.epil %arrayidx56.epil = getelementptr inbounds [2001 x [2001 x i64]], ptr @DP, i64 0, i64 %i49.0101.epil, i64 %sub55.epil %14 = load i64, ptr %arrayidx56.epil, align 8, !tbaa !5 %x.y.i.epil = tail call i64 @llvm.smax.i64(i64 %ans.0100.epil, i64 %14) %inc59.epil = add nuw i64 %i49.0101.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup52, label %for.body53.epil, !llvm.loop !14 for.cond.cleanup52: ; preds = %for.cond.cleanup52.loopexit.unr-lcssa, %for.body53.epil, %for.cond.cleanup27 %ans.0.lcssa = phi i64 [ 0, %for.cond.cleanup27 ], [ %x.y.i.lcssa.ph, %for.cond.cleanup52.loopexit.unr-lcssa ], [ %x.y.i.epil, %for.body53.epil ] %call61 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa) ret i64 undef for.body53: ; preds = %for.body53, %for.body53.preheader.new %i49.0101 = phi i64 [ 0, %for.body53.preheader.new ], [ %inc59.3, %for.body53 ] %ans.0100 = phi i64 [ 0, %for.body53.preheader.new ], [ %x.y.i.3, %for.body53 ] %niter = phi i64 [ 0, %for.body53.preheader.new ], [ %niter.next.3, %for.body53 ] %sub55 = sub nsw i64 %6, %i49.0101 %arrayidx56 = getelementptr inbounds [2001 x [2001 x i64]], ptr @DP, i64 0, i64 %i49.0101, i64 %sub55 %15 = load i64, ptr %arrayidx56, align 8, !tbaa !5 %x.y.i = tail call i64 @llvm.smax.i64(i64 %ans.0100, i64 %15) %inc59 = or i64 %i49.0101, 1 %sub55.1 = sub nsw i64 %6, %inc59 %arrayidx56.1 = getelementptr inbounds [2001 x [2001 x i64]], ptr @DP, i64 0, i64 %inc59, i64 %sub55.1 %16 = load i64, ptr %arrayidx56.1, align 8, !tbaa !5 %x.y.i.1 = tail call i64 @llvm.smax.i64(i64 %x.y.i, i64 %16) %inc59.1 = or i64 %i49.0101, 2 %sub55.2 = sub nsw i64 %6, %inc59.1 %arrayidx56.2 = getelementptr inbounds [2001 x [2001 x i64]], ptr @DP, i64 0, i64 %inc59.1, i64 %sub55.2 %17 = load i64, ptr %arrayidx56.2, align 8, !tbaa !5 %x.y.i.2 = tail call i64 @llvm.smax.i64(i64 %x.y.i.1, i64 %17) %inc59.2 = or i64 %i49.0101, 3 %sub55.3 = sub nsw i64 %6, %inc59.2 %arrayidx56.3 = getelementptr inbounds [2001 x [2001 x i64]], ptr @DP, i64 0, i64 %inc59.2, i64 %sub55.3 %18 = load i64, ptr %arrayidx56.3, align 8, !tbaa !5 %x.y.i.3 = tail call i64 @llvm.smax.i64(i64 %x.y.i.2, i64 %18) %inc59.3 = add nuw i64 %i49.0101, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond.cleanup52.loopexit.unr-lcssa, label %for.body53, !llvm.loop !16 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 #2 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !10}
#include <stdio.h> int main(void){ int N,A[10],i,odd=0,even=0,total=1,kisu=1; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&A[i]); if(A[i]%2==0){ even++; kisu=kisu*2; }else odd++; total=total*3; } printf("%d\n",total-kisu); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110270/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110270/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [10 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %A) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp14 = icmp sgt i32 %0, 0 br i1 %cmp14, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %kisu.017 = phi i32 [ %kisu.1, %for.body ], [ 1, %entry ] %total.016 = phi i32 [ %mul6, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [10 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = and i32 %1, 1 %3 = xor i32 %2, 1 %kisu.1 = shl i32 %kisu.017, %3 %mul6 = mul nsw i32 %total.016, 3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.body %6 = sub nsw i32 %mul6, %kisu.1 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %sub = phi i32 [ 0, %entry ], [ %6, %for.end.loopexit ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %A) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int A, B, X, ans, a = 0, b = 0; scanf("%d %d %d", &A, &B, &X); if ( X % 500 != 0 ) X += 500 - X%500; if ( A < B ) { a = X/1000 + ((X%1000>0)?1:0); } else if ( A > 2*B ){ b = X/500; } else { a = X/1000; X %= 1000; b = X/500; } printf("%d\n", A*a + B*b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110313/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110313/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %rem = srem i32 %0, 500 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %reass.sub = add i32 %0, 500 %add = sub i32 %reass.sub, %rem store i32 %add, ptr %X, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %1 = phi i32 [ %add, %if.then ], [ %0, %entry ] %2 = load i32, ptr %A, align 4, !tbaa !5 %3 = load i32, ptr %B, align 4, !tbaa !5 %cmp2 = icmp slt i32 %2, %3 br i1 %cmp2, label %if.then3, label %if.else if.then3: ; preds = %if.end %div = sdiv i32 %1, 1000 %rem4 = srem i32 %1, 1000 %cmp5 = icmp sgt i32 %rem4, 0 %cond = zext i1 %cmp5 to i32 %add6 = add nsw i32 %div, %cond br label %if.end15 if.else: ; preds = %if.end %mul = shl nsw i32 %3, 1 %cmp7 = icmp sgt i32 %2, %mul br i1 %cmp7, label %if.then8, label %if.else10 if.then8: ; preds = %if.else %div9 = sdiv i32 %1, 500 br label %if.end15 if.else10: ; preds = %if.else %div11 = sdiv i32 %1, 1000 %rem12 = srem i32 %1, 1000 store i32 %rem12, ptr %X, align 4, !tbaa !5 %div13.lhs.trunc = trunc i32 %rem12 to i16 %div1321 = sdiv i16 %div13.lhs.trunc, 500 %div13.sext = sext i16 %div1321 to i32 br label %if.end15 if.end15: ; preds = %if.then8, %if.else10, %if.then3 %a.0 = phi i32 [ %add6, %if.then3 ], [ 0, %if.then8 ], [ %div11, %if.else10 ] %b.0 = phi i32 [ 0, %if.then3 ], [ %div9, %if.then8 ], [ %div13.sext, %if.else10 ] %mul16 = mul nsw i32 %a.0, %2 %mul17 = mul nsw i32 %b.0, %3 %add18 = add nsw i32 %mul17, %mul16 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add18) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main(void) { int i; double positions[1001][2], x, y, rad; positions[1][0] = 1.0; positions[1][1] = 0.0; for (i = 2; i < 1001; i++) { x = positions[i-1][0]; y = positions[i-1][1]; rad = atan2(y, x) + M_PI_2; positions[i][0] = x + cos(rad); positions[i][1] = y + sin(rad); } while (1) { scanf("%d ", &i); if (i == -1) break; printf("%0.2lf\n%0.2lf\n", positions[i][0], positions[i][1]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110386/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110386/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1 @.str.1 = private unnamed_addr constant [15 x i8] c"%0.2lf\0A%0.2lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %i = alloca i32, align 4 %positions = alloca [1001 x [2 x double]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4 call void @llvm.lifetime.start.p0(i64 16016, ptr nonnull %positions) #4 %arrayidx = getelementptr inbounds [1001 x [2 x double]], ptr %positions, i64 0, i64 1 store <2 x double> <double 1.000000e+00, double 0.000000e+00>, ptr %arrayidx, align 16, !tbaa !5 br label %for.body while.cond.preheader: ; preds = %for.body store i32 1001, ptr %i, align 4, !tbaa !9 %call2034 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %0 = load i32, ptr %i, align 4, !tbaa !9 %cmp2135 = icmp eq i32 %0, -1 br i1 %cmp2135, label %while.end, label %if.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next, %for.body ] %1 = phi <2 x double> [ <double 1.000000e+00, double 0.000000e+00>, %entry ], [ %6, %for.body ] %2 = extractelement <2 x double> %1, i64 0 %3 = extractelement <2 x double> %1, i64 1 %call = tail call double @atan2(double noundef %3, double noundef %2) #4 %add = fadd double %call, 0x3FF921FB54442D18 %call10 = tail call double @cos(double noundef %add) #4 %arrayidx13 = getelementptr inbounds [1001 x [2 x double]], ptr %positions, i64 0, i64 %indvars.iv %call15 = tail call double @sin(double noundef %add) #4 %4 = insertelement <2 x double> poison, double %call10, i64 0 %5 = insertelement <2 x double> %4, double %call15, i64 1 %6 = fadd <2 x double> %1, %5 store <2 x double> %6, ptr %arrayidx13, align 16, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 1001 br i1 %exitcond.not, label %while.cond.preheader, label %for.body, !llvm.loop !11 if.end: ; preds = %while.cond.preheader, %if.end %7 = phi i32 [ %10, %if.end ], [ %0, %while.cond.preheader ] %idxprom22 = sext i32 %7 to i64 %arrayidx23 = getelementptr inbounds [1001 x [2 x double]], ptr %positions, i64 0, i64 %idxprom22 %8 = load double, ptr %arrayidx23, align 16, !tbaa !5 %arrayidx27 = getelementptr inbounds [1001 x [2 x double]], ptr %positions, i64 0, i64 %idxprom22, i64 1 %9 = load double, ptr %arrayidx27, align 8, !tbaa !5 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %8, double noundef %9) %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %10 = load i32, ptr %i, align 4, !tbaa !9 %cmp21 = icmp eq i32 %10, -1 br i1 %cmp21, label %while.end, label %if.end while.end: ; preds = %if.end, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 16016, ptr nonnull %positions) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #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 nofree nounwind willreturn memory(write) declare double @atan2(double noundef, double noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @cos(double noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sin(double noundef) local_unnamed_addr #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 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 "no-trapping-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 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main(){ int i,flag[26]={},j,flag1=0,k; char s[26],ss[26]; scanf("%s",s); for(i=0;i<strlen(s);i++){ flag[s[i]-'a']=1; } if(strlen(s)!=26){ for(i=0;i<26;i++){ if(!flag[i]){ printf("%s%c\n",s,i+'a'); break; } } } else{ for(i=0;i<strlen(s);i++){ flag[s[i]-'a']=i; } for(i=24;i>=0;i--){ for(k=s[i]-'a'+1;k<26;k++){ if(flag[k]>=i){ for(j=0;j<i;j++) printf("%c",s[j]); printf("%c\n",k+'a'); flag1=1; break; } if(flag1) break; } if(flag1) break; } if(!flag1) printf("-1\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110436/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110436/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%s%c\0A\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %flag = alloca [26 x i32], align 16 %s = alloca [26 x i8], align 16 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %flag) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %flag, i8 0, i64 104, i1 false) call void @llvm.lifetime.start.p0(i64 26, ptr nonnull %s) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7 %cmp112.not = icmp eq i64 %call2, 0 br i1 %cmp112.not, label %if.then17, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call2, 3 %0 = icmp ult i64 %call2, 4 br i1 %0, label %for.end.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %call2, -4 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 4, !tbaa !5 %conv4 = sext i8 %1 to i64 %sub = add nsw i64 %conv4, -97 %arrayidx6 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub store i32 1, ptr %arrayidx6, align 4, !tbaa !8 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %conv4.1 = sext i8 %2 to i64 %sub.1 = add nsw i64 %conv4.1, -97 %arrayidx6.1 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub.1 store i32 1, ptr %arrayidx6.1, align 4, !tbaa !8 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 %indvars.iv.next.1 %3 = load i8, ptr %arrayidx.2, align 2, !tbaa !5 %conv4.2 = sext i8 %3 to i64 %sub.2 = add nsw i64 %conv4.2, -97 %arrayidx6.2 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub.2 store i32 1, ptr %arrayidx6.2, align 4, !tbaa !8 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 %indvars.iv.next.2 %4 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %conv4.3 = sext i8 %4 to i64 %sub.3 = add nsw i64 %conv4.3, -97 %arrayidx6.3 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub.3 store i32 1, ptr %arrayidx6.3, align 4, !tbaa !8 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.end.unr-lcssa, label %for.body, !llvm.loop !10 for.end.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.unr-lcssa ] %arrayidx.epil = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 %indvars.iv.epil %5 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 %conv4.epil = sext i8 %5 to i64 %sub.epil = add nsw i64 %conv4.epil, -97 %arrayidx6.epil = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub.epil store i32 1, ptr %arrayidx6.epil, align 4, !tbaa !8 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !12 for.end: ; preds = %for.body.epil, %for.end.unr-lcssa %cmp9.not = icmp eq i64 %call2, 26 br i1 %cmp9.not, label %for.body29, label %for.body14.preheader for.body14.preheader: ; preds = %for.end %.pr = load i32, ptr %flag, align 16, !tbaa !8 %tobool.not = icmp eq i32 %.pr, 0 br i1 %tobool.not, label %if.then17, label %for.inc20 if.then17: ; preds = %entry, %for.inc20.24, %for.inc20.23, %for.inc20.22, %for.inc20.21, %for.inc20.20, %for.inc20.19, %for.inc20.18, %for.inc20.17, %for.inc20.16, %for.inc20.15, %for.inc20.14, %for.inc20.13, %for.inc20.12, %for.inc20.11, %for.inc20.10, %for.inc20.9, %for.inc20.8, %for.inc20.7, %for.inc20.6, %for.inc20.5, %for.inc20.4, %for.inc20.3, %for.inc20.2, %for.inc20.1, %for.inc20, %for.body14.preheader %i.1115.lcssa.wide = phi i32 [ 97, %for.body14.preheader ], [ 98, %for.inc20 ], [ 99, %for.inc20.1 ], [ 100, %for.inc20.2 ], [ 101, %for.inc20.3 ], [ 102, %for.inc20.4 ], [ 103, %for.inc20.5 ], [ 104, %for.inc20.6 ], [ 105, %for.inc20.7 ], [ 106, %for.inc20.8 ], [ 107, %for.inc20.9 ], [ 108, %for.inc20.10 ], [ 109, %for.inc20.11 ], [ 110, %for.inc20.12 ], [ 111, %for.inc20.13 ], [ 112, %for.inc20.14 ], [ 113, %for.inc20.15 ], [ 114, %for.inc20.16 ], [ 115, %for.inc20.17 ], [ 116, %for.inc20.18 ], [ 117, %for.inc20.19 ], [ 118, %for.inc20.20 ], [ 119, %for.inc20.21 ], [ 120, %for.inc20.22 ], [ 121, %for.inc20.23 ], [ 122, %for.inc20.24 ], [ 97, %entry ] %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s, i32 noundef %i.1115.lcssa.wide) br label %if.end86 for.inc20: ; preds = %for.body14.preheader %arrayidx16.1 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 1 %6 = load i32, ptr %arrayidx16.1, align 4, !tbaa !8 %tobool.not.1 = icmp eq i32 %6, 0 br i1 %tobool.not.1, label %if.then17, label %for.inc20.1 for.inc20.1: ; preds = %for.inc20 %arrayidx16.2 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 2 %7 = load i32, ptr %arrayidx16.2, align 8, !tbaa !8 %tobool.not.2 = icmp eq i32 %7, 0 br i1 %tobool.not.2, label %if.then17, label %for.inc20.2 for.inc20.2: ; preds = %for.inc20.1 %arrayidx16.3 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 3 %8 = load i32, ptr %arrayidx16.3, align 4, !tbaa !8 %tobool.not.3 = icmp eq i32 %8, 0 br i1 %tobool.not.3, label %if.then17, label %for.inc20.3 for.inc20.3: ; preds = %for.inc20.2 %arrayidx16.4 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 4 %9 = load i32, ptr %arrayidx16.4, align 16, !tbaa !8 %tobool.not.4 = icmp eq i32 %9, 0 br i1 %tobool.not.4, label %if.then17, label %for.inc20.4 for.inc20.4: ; preds = %for.inc20.3 %arrayidx16.5 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 5 %10 = load i32, ptr %arrayidx16.5, align 4, !tbaa !8 %tobool.not.5 = icmp eq i32 %10, 0 br i1 %tobool.not.5, label %if.then17, label %for.inc20.5 for.inc20.5: ; preds = %for.inc20.4 %arrayidx16.6 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 6 %11 = load i32, ptr %arrayidx16.6, align 8, !tbaa !8 %tobool.not.6 = icmp eq i32 %11, 0 br i1 %tobool.not.6, label %if.then17, label %for.inc20.6 for.inc20.6: ; preds = %for.inc20.5 %arrayidx16.7 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 7 %12 = load i32, ptr %arrayidx16.7, align 4, !tbaa !8 %tobool.not.7 = icmp eq i32 %12, 0 br i1 %tobool.not.7, label %if.then17, label %for.inc20.7 for.inc20.7: ; preds = %for.inc20.6 %arrayidx16.8 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 8 %13 = load i32, ptr %arrayidx16.8, align 16, !tbaa !8 %tobool.not.8 = icmp eq i32 %13, 0 br i1 %tobool.not.8, label %if.then17, label %for.inc20.8 for.inc20.8: ; preds = %for.inc20.7 %arrayidx16.9 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 9 %14 = load i32, ptr %arrayidx16.9, align 4, !tbaa !8 %tobool.not.9 = icmp eq i32 %14, 0 br i1 %tobool.not.9, label %if.then17, label %for.inc20.9 for.inc20.9: ; preds = %for.inc20.8 %arrayidx16.10 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 10 %15 = load i32, ptr %arrayidx16.10, align 8, !tbaa !8 %tobool.not.10 = icmp eq i32 %15, 0 br i1 %tobool.not.10, label %if.then17, label %for.inc20.10 for.inc20.10: ; preds = %for.inc20.9 %arrayidx16.11 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 11 %16 = load i32, ptr %arrayidx16.11, align 4, !tbaa !8 %tobool.not.11 = icmp eq i32 %16, 0 br i1 %tobool.not.11, label %if.then17, label %for.inc20.11 for.inc20.11: ; preds = %for.inc20.10 %arrayidx16.12 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 12 %17 = load i32, ptr %arrayidx16.12, align 16, !tbaa !8 %tobool.not.12 = icmp eq i32 %17, 0 br i1 %tobool.not.12, label %if.then17, label %for.inc20.12 for.inc20.12: ; preds = %for.inc20.11 %arrayidx16.13 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 13 %18 = load i32, ptr %arrayidx16.13, align 4, !tbaa !8 %tobool.not.13 = icmp eq i32 %18, 0 br i1 %tobool.not.13, label %if.then17, label %for.inc20.13 for.inc20.13: ; preds = %for.inc20.12 %arrayidx16.14 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 14 %19 = load i32, ptr %arrayidx16.14, align 8, !tbaa !8 %tobool.not.14 = icmp eq i32 %19, 0 br i1 %tobool.not.14, label %if.then17, label %for.inc20.14 for.inc20.14: ; preds = %for.inc20.13 %arrayidx16.15 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 15 %20 = load i32, ptr %arrayidx16.15, align 4, !tbaa !8 %tobool.not.15 = icmp eq i32 %20, 0 br i1 %tobool.not.15, label %if.then17, label %for.inc20.15 for.inc20.15: ; preds = %for.inc20.14 %arrayidx16.16 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 16 %21 = load i32, ptr %arrayidx16.16, align 16, !tbaa !8 %tobool.not.16 = icmp eq i32 %21, 0 br i1 %tobool.not.16, label %if.then17, label %for.inc20.16 for.inc20.16: ; preds = %for.inc20.15 %arrayidx16.17 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 17 %22 = load i32, ptr %arrayidx16.17, align 4, !tbaa !8 %tobool.not.17 = icmp eq i32 %22, 0 br i1 %tobool.not.17, label %if.then17, label %for.inc20.17 for.inc20.17: ; preds = %for.inc20.16 %arrayidx16.18 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 18 %23 = load i32, ptr %arrayidx16.18, align 8, !tbaa !8 %tobool.not.18 = icmp eq i32 %23, 0 br i1 %tobool.not.18, label %if.then17, label %for.inc20.18 for.inc20.18: ; preds = %for.inc20.17 %arrayidx16.19 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 19 %24 = load i32, ptr %arrayidx16.19, align 4, !tbaa !8 %tobool.not.19 = icmp eq i32 %24, 0 br i1 %tobool.not.19, label %if.then17, label %for.inc20.19 for.inc20.19: ; preds = %for.inc20.18 %arrayidx16.20 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 20 %25 = load i32, ptr %arrayidx16.20, align 16, !tbaa !8 %tobool.not.20 = icmp eq i32 %25, 0 br i1 %tobool.not.20, label %if.then17, label %for.inc20.20 for.inc20.20: ; preds = %for.inc20.19 %arrayidx16.21 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 21 %26 = load i32, ptr %arrayidx16.21, align 4, !tbaa !8 %tobool.not.21 = icmp eq i32 %26, 0 br i1 %tobool.not.21, label %if.then17, label %for.inc20.21 for.inc20.21: ; preds = %for.inc20.20 %arrayidx16.22 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 22 %27 = load i32, ptr %arrayidx16.22, align 8, !tbaa !8 %tobool.not.22 = icmp eq i32 %27, 0 br i1 %tobool.not.22, label %if.then17, label %for.inc20.22 for.inc20.22: ; preds = %for.inc20.21 %arrayidx16.23 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 23 %28 = load i32, ptr %arrayidx16.23, align 4, !tbaa !8 %tobool.not.23 = icmp eq i32 %28, 0 br i1 %tobool.not.23, label %if.then17, label %for.inc20.23 for.inc20.23: ; preds = %for.inc20.22 %arrayidx16.24 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 24 %29 = load i32, ptr %arrayidx16.24, align 16, !tbaa !8 %tobool.not.24 = icmp eq i32 %29, 0 br i1 %tobool.not.24, label %if.then17, label %for.inc20.24 for.inc20.24: ; preds = %for.inc20.23 %arrayidx16.25 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 25 %30 = load i32, ptr %arrayidx16.25, align 4, !tbaa !8 %tobool.not.25 = icmp eq i32 %30, 0 br i1 %tobool.not.25, label %if.then17, label %if.end86 for.body29: ; preds = %for.end %31 = load i8, ptr %s, align 16, !tbaa !5 %conv32 = sext i8 %31 to i64 %sub33 = add nsw i64 %conv32, -97 %arrayidx35 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33 store i32 0, ptr %arrayidx35, align 4, !tbaa !8 %arrayidx31.1 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 1 %32 = load i8, ptr %arrayidx31.1, align 1, !tbaa !5 %conv32.1 = sext i8 %32 to i64 %sub33.1 = add nsw i64 %conv32.1, -97 %arrayidx35.1 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.1 store i32 1, ptr %arrayidx35.1, align 4, !tbaa !8 %arrayidx31.2 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 2 %33 = load i8, ptr %arrayidx31.2, align 2, !tbaa !5 %conv32.2 = sext i8 %33 to i64 %sub33.2 = add nsw i64 %conv32.2, -97 %arrayidx35.2 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.2 store i32 2, ptr %arrayidx35.2, align 4, !tbaa !8 %arrayidx31.3 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 3 %34 = load i8, ptr %arrayidx31.3, align 1, !tbaa !5 %conv32.3 = sext i8 %34 to i64 %sub33.3 = add nsw i64 %conv32.3, -97 %arrayidx35.3 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.3 store i32 3, ptr %arrayidx35.3, align 4, !tbaa !8 %arrayidx31.4 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 4 %35 = load i8, ptr %arrayidx31.4, align 4, !tbaa !5 %conv32.4 = sext i8 %35 to i64 %sub33.4 = add nsw i64 %conv32.4, -97 %arrayidx35.4 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.4 store i32 4, ptr %arrayidx35.4, align 4, !tbaa !8 %arrayidx31.5 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 5 %36 = load i8, ptr %arrayidx31.5, align 1, !tbaa !5 %conv32.5 = sext i8 %36 to i64 %sub33.5 = add nsw i64 %conv32.5, -97 %arrayidx35.5 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.5 store i32 5, ptr %arrayidx35.5, align 4, !tbaa !8 %arrayidx31.6 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 6 %37 = load i8, ptr %arrayidx31.6, align 2, !tbaa !5 %conv32.6 = sext i8 %37 to i64 %sub33.6 = add nsw i64 %conv32.6, -97 %arrayidx35.6 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.6 store i32 6, ptr %arrayidx35.6, align 4, !tbaa !8 %arrayidx31.7 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 7 %38 = load i8, ptr %arrayidx31.7, align 1, !tbaa !5 %conv32.7 = sext i8 %38 to i64 %sub33.7 = add nsw i64 %conv32.7, -97 %arrayidx35.7 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.7 store i32 7, ptr %arrayidx35.7, align 4, !tbaa !8 %arrayidx31.8 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 8 %39 = load i8, ptr %arrayidx31.8, align 8, !tbaa !5 %conv32.8 = sext i8 %39 to i64 %sub33.8 = add nsw i64 %conv32.8, -97 %arrayidx35.8 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.8 store i32 8, ptr %arrayidx35.8, align 4, !tbaa !8 %arrayidx31.9 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 9 %40 = load i8, ptr %arrayidx31.9, align 1, !tbaa !5 %conv32.9 = sext i8 %40 to i64 %sub33.9 = add nsw i64 %conv32.9, -97 %arrayidx35.9 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.9 store i32 9, ptr %arrayidx35.9, align 4, !tbaa !8 %arrayidx31.10 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 10 %41 = load i8, ptr %arrayidx31.10, align 2, !tbaa !5 %conv32.10 = sext i8 %41 to i64 %sub33.10 = add nsw i64 %conv32.10, -97 %arrayidx35.10 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.10 store i32 10, ptr %arrayidx35.10, align 4, !tbaa !8 %arrayidx31.11 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 11 %42 = load i8, ptr %arrayidx31.11, align 1, !tbaa !5 %conv32.11 = sext i8 %42 to i64 %sub33.11 = add nsw i64 %conv32.11, -97 %arrayidx35.11 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.11 store i32 11, ptr %arrayidx35.11, align 4, !tbaa !8 %arrayidx31.12 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 12 %43 = load i8, ptr %arrayidx31.12, align 4, !tbaa !5 %conv32.12 = sext i8 %43 to i64 %sub33.12 = add nsw i64 %conv32.12, -97 %arrayidx35.12 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.12 store i32 12, ptr %arrayidx35.12, align 4, !tbaa !8 %arrayidx31.13 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 13 %44 = load i8, ptr %arrayidx31.13, align 1, !tbaa !5 %conv32.13 = sext i8 %44 to i64 %sub33.13 = add nsw i64 %conv32.13, -97 %arrayidx35.13 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.13 store i32 13, ptr %arrayidx35.13, align 4, !tbaa !8 %arrayidx31.14 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 14 %45 = load i8, ptr %arrayidx31.14, align 2, !tbaa !5 %conv32.14 = sext i8 %45 to i64 %sub33.14 = add nsw i64 %conv32.14, -97 %arrayidx35.14 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.14 store i32 14, ptr %arrayidx35.14, align 4, !tbaa !8 %arrayidx31.15 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 15 %46 = load i8, ptr %arrayidx31.15, align 1, !tbaa !5 %conv32.15 = sext i8 %46 to i64 %sub33.15 = add nsw i64 %conv32.15, -97 %arrayidx35.15 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.15 store i32 15, ptr %arrayidx35.15, align 4, !tbaa !8 %arrayidx31.16 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 16 %47 = load i8, ptr %arrayidx31.16, align 16, !tbaa !5 %conv32.16 = sext i8 %47 to i64 %sub33.16 = add nsw i64 %conv32.16, -97 %arrayidx35.16 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.16 store i32 16, ptr %arrayidx35.16, align 4, !tbaa !8 %arrayidx31.17 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 17 %48 = load i8, ptr %arrayidx31.17, align 1, !tbaa !5 %conv32.17 = sext i8 %48 to i64 %sub33.17 = add nsw i64 %conv32.17, -97 %arrayidx35.17 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.17 store i32 17, ptr %arrayidx35.17, align 4, !tbaa !8 %arrayidx31.18 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 18 %49 = load i8, ptr %arrayidx31.18, align 2, !tbaa !5 %conv32.18 = sext i8 %49 to i64 %sub33.18 = add nsw i64 %conv32.18, -97 %arrayidx35.18 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.18 store i32 18, ptr %arrayidx35.18, align 4, !tbaa !8 %arrayidx31.19 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 19 %50 = load i8, ptr %arrayidx31.19, align 1, !tbaa !5 %conv32.19 = sext i8 %50 to i64 %sub33.19 = add nsw i64 %conv32.19, -97 %arrayidx35.19 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.19 store i32 19, ptr %arrayidx35.19, align 4, !tbaa !8 %arrayidx31.20 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 20 %51 = load i8, ptr %arrayidx31.20, align 4, !tbaa !5 %conv32.20 = sext i8 %51 to i64 %sub33.20 = add nsw i64 %conv32.20, -97 %arrayidx35.20 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.20 store i32 20, ptr %arrayidx35.20, align 4, !tbaa !8 %arrayidx31.21 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 21 %52 = load i8, ptr %arrayidx31.21, align 1, !tbaa !5 %conv32.21 = sext i8 %52 to i64 %sub33.21 = add nsw i64 %conv32.21, -97 %arrayidx35.21 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.21 store i32 21, ptr %arrayidx35.21, align 4, !tbaa !8 %arrayidx31.22 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 22 %53 = load i8, ptr %arrayidx31.22, align 2, !tbaa !5 %conv32.22 = sext i8 %53 to i64 %sub33.22 = add nsw i64 %conv32.22, -97 %arrayidx35.22 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.22 store i32 22, ptr %arrayidx35.22, align 4, !tbaa !8 %arrayidx31.23 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 23 %54 = load i8, ptr %arrayidx31.23, align 1, !tbaa !5 %conv32.23 = sext i8 %54 to i64 %sub33.23 = add nsw i64 %conv32.23, -97 %arrayidx35.23 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.23 store i32 23, ptr %arrayidx35.23, align 4, !tbaa !8 %arrayidx31.24 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 24 %55 = load i8, ptr %arrayidx31.24, align 8, !tbaa !5 %conv32.24 = sext i8 %55 to i64 %sub33.24 = add nsw i64 %conv32.24, -97 %arrayidx35.24 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.24 store i32 24, ptr %arrayidx35.24, align 4, !tbaa !8 %arrayidx31.25 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 25 %56 = load i8, ptr %arrayidx31.25, align 1, !tbaa !5 %conv32.25 = sext i8 %56 to i64 %sub33.25 = add nsw i64 %conv32.25, -97 %arrayidx35.25 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %sub33.25 store i32 25, ptr %arrayidx35.25, align 4, !tbaa !8 br label %for.body42 for.body42: ; preds = %for.body29, %for.inc80 %indvars.iv144 = phi i32 [ %indvars.iv.next145, %for.inc80 ], [ 24, %for.body29 ] %indvars.iv138 = phi i64 [ %indvars.iv.next139, %for.inc80 ], [ 24, %for.body29 ] %arrayidx44 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 %indvars.iv138 %57 = load i8, ptr %arrayidx44, align 1, !tbaa !5 %cmp49118 = icmp sgt i8 %57, 121 br i1 %cmp49118, label %for.inc80, label %for.body51.preheader for.body51.preheader: ; preds = %for.body42 %58 = sext i8 %57 to i64 %59 = add nsw i64 %58, -96 br label %for.body51 for.body51: ; preds = %for.body51.preheader, %for.inc74 %indvars.iv135 = phi i64 [ %59, %for.body51.preheader ], [ %indvars.iv.next136, %for.inc74 ] %arrayidx53 = getelementptr inbounds [26 x i32], ptr %flag, i64 0, i64 %indvars.iv135 %60 = load i32, ptr %arrayidx53, align 4, !tbaa !8 %61 = sext i32 %60 to i64 %cmp54.not = icmp sgt i64 %indvars.iv138, %61 br i1 %cmp54.not, label %for.inc74, label %for.cond57.preheader for.cond57.preheader: ; preds = %for.body51 %62 = trunc i64 %indvars.iv138 to i32 %63 = trunc i64 %indvars.iv135 to i32 %cmp58121 = icmp sgt i32 %62, 0 br i1 %cmp58121, label %for.body60.preheader, label %for.end81 for.body60.preheader: ; preds = %for.cond57.preheader %wide.trip.count = zext i32 %indvars.iv144 to i64 br label %for.body60 for.body60: ; preds = %for.body60.preheader, %for.body60 %indvars.iv141 = phi i64 [ 0, %for.body60.preheader ], [ %indvars.iv.next142, %for.body60 ] %arrayidx62 = getelementptr inbounds [26 x i8], ptr %s, i64 0, i64 %indvars.iv141 %64 = load i8, ptr %arrayidx62, align 1, !tbaa !5 %conv63 = sext i8 %64 to i32 %putchar = call i32 @putchar(i32 %conv63) %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1 %exitcond147.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count br i1 %exitcond147.not, label %for.end81, label %for.body60, !llvm.loop !14 for.inc74: ; preds = %for.body51 %indvars.iv.next136 = add nsw i64 %indvars.iv135, 1 %cmp49 = icmp sgt i64 %indvars.iv135, 24 br i1 %cmp49, label %for.inc80, label %for.body51, !llvm.loop !15 for.inc80: ; preds = %for.inc74, %for.body42 %indvars.iv.next139 = add nsw i64 %indvars.iv138, -1 %cmp40 = icmp eq i64 %indvars.iv138, 0 %indvars.iv.next145 = add nsw i32 %indvars.iv144, -1 br i1 %cmp40, label %if.then83, label %for.body42, !llvm.loop !16 for.end81: ; preds = %for.body60, %for.cond57.preheader %add68 = add nsw i32 %63, 97 %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add68) br label %if.end86 if.then83: ; preds = %for.inc80 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end86 if.end86: ; preds = %for.inc20.24, %for.end81, %if.then83, %if.then17 call void @llvm.lifetime.end.p0(i64 26, ptr nonnull %s) #6 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %flag) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11} !16 = distinct !{!16, !11}
#include <stdio.h> #include <string.h> #define REP(i, a, b) for (i=(a); i<(b); ++i) #define rep(i, n) REP(i, 0, n) int main(void) { int i, j, n; int a[100][100], b[100][100]; while (scanf("%d", &n), n) { memset(b, 0, sizeof(b)); rep(i, n) rep(j, n) scanf("%d", &a[i][j]); rep(i, n) { int m = (1 << 30); rep(j, n) if (a[i][j] < a[i][m]) m = j; rep(j, n) if (a[i][j] == a[i][m]) b[i][j]++; } rep(j, n) { int m = 0; rep(i, n) if (a[i][j] > a[m][j]) m = i; rep(i, n) if (a[i][j] == a[m][j]) b[i][j]++; } int res = 0; rep(i, n) rep(j, n) if (b[i][j] == 2) res = a[i][j]; printf("%d\n", res); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110487/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110487/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #4 %call197 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not198 = icmp eq i32 %0, 0 br i1 %tobool.not198, label %while.end, label %while.body while.body: ; preds = %entry, %for.end121 %1 = phi i32 [ %50, %for.end121 ], [ %0, %entry ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %b, i8 0, i64 40000, i1 false) %cmp170 = icmp sgt i32 %1, 0 br i1 %cmp170, label %for.cond1.preheader, label %for.end121 for.cond10.preheader: ; preds = %for.inc7 %cmp11178 = icmp sgt i32 %8, 0 br i1 %cmp11178, label %for.cond13.preheader.preheader, label %for.end121 for.cond13.preheader.preheader: ; preds = %for.cond10.preheader %wide.trip.count216 = zext i32 %8 to i64 %2 = add nsw i64 %wide.trip.count216, -1 %xtraiter = and i64 %wide.trip.count216, 1 %3 = icmp eq i64 %2, 0 %unroll_iter = and i64 %wide.trip.count216, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %xtraiter260 = and i64 %wide.trip.count216, 1 %4 = icmp eq i64 %2, 0 %unroll_iter262 = and i64 %wide.trip.count216, 4294967294 %lcmp.mod261.not = icmp eq i64 %xtraiter260, 0 br label %for.cond13.preheader for.cond1.preheader: ; preds = %while.body, %for.inc7 %5 = phi i32 [ %8, %for.inc7 ], [ %1, %while.body ] %indvars.iv202 = phi i64 [ %indvars.iv.next203, %for.inc7 ], [ 0, %while.body ] %cmp2168 = icmp sgt i32 %5, 0 br i1 %cmp2168, label %for.body3, label %for.cond1.preheader.for.inc7_crit_edge for.cond1.preheader.for.inc7_crit_edge: ; preds = %for.cond1.preheader %.pre = sext i32 %5 to i64 br label %for.inc7 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv202, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !9 for.inc7: ; preds = %for.body3, %for.cond1.preheader.for.inc7_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc7_crit_edge ], [ %7, %for.body3 ] %8 = phi i32 [ %5, %for.cond1.preheader.for.inc7_crit_edge ], [ %6, %for.body3 ] %indvars.iv.next203 = add nuw nsw i64 %indvars.iv202, 1 %cmp = icmp slt i64 %indvars.iv.next203, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond53.preheader: ; preds = %for.end49 br i1 %cmp11178, label %for.cond57.preheader.preheader, label %for.end121 for.cond57.preheader.preheader: ; preds = %for.cond53.preheader %wide.trip.count231 = zext i32 %8 to i64 %xtraiter264 = and i64 %wide.trip.count216, 1 %9 = icmp eq i64 %2, 0 %unroll_iter267 = and i64 %wide.trip.count216, 4294967294 %lcmp.mod265.not = icmp eq i64 %xtraiter264, 0 %xtraiter269 = and i64 %wide.trip.count216, 1 %10 = icmp eq i64 %2, 0 %unroll_iter271 = and i64 %wide.trip.count216, 4294967294 %lcmp.mod270.not = icmp eq i64 %xtraiter269, 0 br label %for.cond57.preheader for.cond13.preheader: ; preds = %for.cond13.preheader.preheader, %for.end49 %indvars.iv213 = phi i64 [ 0, %for.cond13.preheader.preheader ], [ %indvars.iv.next214, %for.end49 ] br i1 %3, label %for.body30.lr.ph.unr-lcssa, label %for.body15 for.body30.lr.ph.unr-lcssa: ; preds = %for.body15, %for.cond13.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.cond13.preheader ], [ %spec.select.1, %for.body15 ] %indvars.iv205.unr = phi i64 [ 0, %for.cond13.preheader ], [ %indvars.iv.next206.1, %for.body15 ] %m.0174.unr = phi i32 [ 1073741824, %for.cond13.preheader ], [ %spec.select.1, %for.body15 ] br i1 %lcmp.mod.not, label %for.body30.lr.ph, label %for.body15.epil for.body15.epil: ; preds = %for.body30.lr.ph.unr-lcssa %arrayidx19.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv213, i64 %indvars.iv205.unr %11 = load i32, ptr %arrayidx19.epil, align 4, !tbaa !5 %idxprom22.epil = sext i32 %m.0174.unr to i64 %arrayidx23.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv213, i64 %idxprom22.epil %12 = load i32, ptr %arrayidx23.epil, align 4, !tbaa !5 %cmp24.epil = icmp slt i32 %11, %12 %13 = trunc i64 %indvars.iv205.unr to i32 %spec.select.epil = select i1 %cmp24.epil, i32 %13, i32 %m.0174.unr br label %for.body30.lr.ph for.body30.lr.ph: ; preds = %for.body30.lr.ph.unr-lcssa, %for.body15.epil %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.body30.lr.ph.unr-lcssa ], [ %spec.select.epil, %for.body15.epil ] %idxprom37 = sext i32 %spec.select.lcssa to i64 %arrayidx38 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv213, i64 %idxprom37 %14 = load i32, ptr %arrayidx38, align 4, !tbaa !5 br i1 %4, label %for.end49.unr-lcssa, label %for.body30 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv205 = phi i64 [ %indvars.iv.next206.1, %for.body15 ], [ 0, %for.cond13.preheader ] %m.0174 = phi i32 [ %spec.select.1, %for.body15 ], [ 1073741824, %for.cond13.preheader ] %niter = phi i64 [ %niter.next.1, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv213, i64 %indvars.iv205 %15 = load i32, ptr %arrayidx19, align 8, !tbaa !5 %idxprom22 = sext i32 %m.0174 to i64 %arrayidx23 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv213, i64 %idxprom22 %16 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %cmp24 = icmp slt i32 %15, %16 %17 = trunc i64 %indvars.iv205 to i32 %spec.select = select i1 %cmp24, i32 %17, i32 %m.0174 %indvars.iv.next206 = or i64 %indvars.iv205, 1 %arrayidx19.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv213, i64 %indvars.iv.next206 %18 = load i32, ptr %arrayidx19.1, align 4, !tbaa !5 %idxprom22.1 = sext i32 %spec.select to i64 %arrayidx23.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv213, i64 %idxprom22.1 %19 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5 %cmp24.1 = icmp slt i32 %18, %19 %20 = trunc i64 %indvars.iv.next206 to i32 %spec.select.1 = select i1 %cmp24.1, i32 %20, i32 %spec.select %indvars.iv.next206.1 = add nuw nsw i64 %indvars.iv205, 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.body30.lr.ph.unr-lcssa, label %for.body15, !llvm.loop !13 for.body30: ; preds = %for.body30.lr.ph, %for.inc47.1 %indvars.iv208 = phi i64 [ %indvars.iv.next209.1, %for.inc47.1 ], [ 0, %for.body30.lr.ph ] %niter263 = phi i64 [ %niter263.next.1, %for.inc47.1 ], [ 0, %for.body30.lr.ph ] %arrayidx34 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv213, i64 %indvars.iv208 %21 = load i32, ptr %arrayidx34, align 8, !tbaa !5 %cmp39 = icmp eq i32 %21, %14 br i1 %cmp39, label %if.then40, label %for.inc47 if.then40: ; preds = %for.body30 %arrayidx44 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv213, i64 %indvars.iv208 %22 = load i32, ptr %arrayidx44, align 8, !tbaa !5 %inc45 = add nsw i32 %22, 1 store i32 %inc45, ptr %arrayidx44, align 8, !tbaa !5 br label %for.inc47 for.inc47: ; preds = %for.body30, %if.then40 %indvars.iv.next209 = or i64 %indvars.iv208, 1 %arrayidx34.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv213, i64 %indvars.iv.next209 %23 = load i32, ptr %arrayidx34.1, align 4, !tbaa !5 %cmp39.1 = icmp eq i32 %23, %14 br i1 %cmp39.1, label %if.then40.1, label %for.inc47.1 if.then40.1: ; preds = %for.inc47 %arrayidx44.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv213, i64 %indvars.iv.next209 %24 = load i32, ptr %arrayidx44.1, align 4, !tbaa !5 %inc45.1 = add nsw i32 %24, 1 store i32 %inc45.1, ptr %arrayidx44.1, align 4, !tbaa !5 br label %for.inc47.1 for.inc47.1: ; preds = %if.then40.1, %for.inc47 %indvars.iv.next209.1 = add nuw nsw i64 %indvars.iv208, 2 %niter263.next.1 = add i64 %niter263, 2 %niter263.ncmp.1 = icmp eq i64 %niter263.next.1, %unroll_iter262 br i1 %niter263.ncmp.1, label %for.end49.unr-lcssa, label %for.body30, !llvm.loop !14 for.end49.unr-lcssa: ; preds = %for.inc47.1, %for.body30.lr.ph %indvars.iv208.unr = phi i64 [ 0, %for.body30.lr.ph ], [ %indvars.iv.next209.1, %for.inc47.1 ] br i1 %lcmp.mod261.not, label %for.end49, label %for.body30.epil for.body30.epil: ; preds = %for.end49.unr-lcssa %arrayidx34.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv213, i64 %indvars.iv208.unr %25 = load i32, ptr %arrayidx34.epil, align 4, !tbaa !5 %cmp39.epil = icmp eq i32 %25, %14 br i1 %cmp39.epil, label %if.then40.epil, label %for.end49 if.then40.epil: ; preds = %for.body30.epil %arrayidx44.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv213, i64 %indvars.iv208.unr %26 = load i32, ptr %arrayidx44.epil, align 4, !tbaa !5 %inc45.epil = add nsw i32 %26, 1 store i32 %inc45.epil, ptr %arrayidx44.epil, align 4, !tbaa !5 br label %for.end49 for.end49: ; preds = %for.body30.epil, %if.then40.epil, %for.end49.unr-lcssa %indvars.iv.next214 = add nuw nsw i64 %indvars.iv213, 1 %exitcond217.not = icmp eq i64 %indvars.iv.next214, %wide.trip.count216 br i1 %exitcond217.not, label %for.cond53.preheader, label %for.cond13.preheader, !llvm.loop !15 for.cond99.preheader: ; preds = %for.end95 br i1 %cmp11178, label %for.cond102.preheader.us.preheader, label %for.end121 for.cond102.preheader.us.preheader: ; preds = %for.cond99.preheader %wide.trip.count241 = zext i32 %8 to i64 %xtraiter273 = and i64 %wide.trip.count216, 1 %27 = icmp eq i64 %2, 0 %unroll_iter276 = and i64 %wide.trip.count216, 4294967294 %lcmp.mod274.not = icmp eq i64 %xtraiter273, 0 br label %for.cond102.preheader.us for.cond102.preheader.us: ; preds = %for.cond102.preheader.us.preheader, %for.cond102.for.inc119_crit_edge.us %indvars.iv238 = phi i64 [ 0, %for.cond102.preheader.us.preheader ], [ %indvars.iv.next239, %for.cond102.for.inc119_crit_edge.us ] %res.0194.us = phi i32 [ 0, %for.cond102.preheader.us.preheader ], [ %res.2.us.lcssa, %for.cond102.for.inc119_crit_edge.us ] br i1 %27, label %for.cond102.for.inc119_crit_edge.us.unr-lcssa, label %for.body104.us for.body104.us: ; preds = %for.cond102.preheader.us, %for.inc116.us.1 %indvars.iv233 = phi i64 [ %indvars.iv.next234.1, %for.inc116.us.1 ], [ 0, %for.cond102.preheader.us ] %res.1190.us = phi i32 [ %res.2.us.1, %for.inc116.us.1 ], [ %res.0194.us, %for.cond102.preheader.us ] %niter277 = phi i64 [ %niter277.next.1, %for.inc116.us.1 ], [ 0, %for.cond102.preheader.us ] %arrayidx108.us = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv238, i64 %indvars.iv233 %28 = load i32, ptr %arrayidx108.us, align 8, !tbaa !5 %cmp109.us = icmp eq i32 %28, 2 br i1 %cmp109.us, label %if.then110.us, label %for.inc116.us if.then110.us: ; preds = %for.body104.us %arrayidx114.us = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv238, i64 %indvars.iv233 %29 = load i32, ptr %arrayidx114.us, align 8, !tbaa !5 br label %for.inc116.us for.inc116.us: ; preds = %if.then110.us, %for.body104.us %res.2.us = phi i32 [ %29, %if.then110.us ], [ %res.1190.us, %for.body104.us ] %indvars.iv.next234 = or i64 %indvars.iv233, 1 %arrayidx108.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv238, i64 %indvars.iv.next234 %30 = load i32, ptr %arrayidx108.us.1, align 4, !tbaa !5 %cmp109.us.1 = icmp eq i32 %30, 2 br i1 %cmp109.us.1, label %if.then110.us.1, label %for.inc116.us.1 if.then110.us.1: ; preds = %for.inc116.us %arrayidx114.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv238, i64 %indvars.iv.next234 %31 = load i32, ptr %arrayidx114.us.1, align 4, !tbaa !5 br label %for.inc116.us.1 for.inc116.us.1: ; preds = %if.then110.us.1, %for.inc116.us %res.2.us.1 = phi i32 [ %31, %if.then110.us.1 ], [ %res.2.us, %for.inc116.us ] %indvars.iv.next234.1 = add nuw nsw i64 %indvars.iv233, 2 %niter277.next.1 = add i64 %niter277, 2 %niter277.ncmp.1 = icmp eq i64 %niter277.next.1, %unroll_iter276 br i1 %niter277.ncmp.1, label %for.cond102.for.inc119_crit_edge.us.unr-lcssa, label %for.body104.us, !llvm.loop !16 for.cond102.for.inc119_crit_edge.us.unr-lcssa: ; preds = %for.inc116.us.1, %for.cond102.preheader.us %res.2.us.lcssa.ph = phi i32 [ undef, %for.cond102.preheader.us ], [ %res.2.us.1, %for.inc116.us.1 ] %indvars.iv233.unr = phi i64 [ 0, %for.cond102.preheader.us ], [ %indvars.iv.next234.1, %for.inc116.us.1 ] %res.1190.us.unr = phi i32 [ %res.0194.us, %for.cond102.preheader.us ], [ %res.2.us.1, %for.inc116.us.1 ] br i1 %lcmp.mod274.not, label %for.cond102.for.inc119_crit_edge.us, label %for.body104.us.epil for.body104.us.epil: ; preds = %for.cond102.for.inc119_crit_edge.us.unr-lcssa %arrayidx108.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv238, i64 %indvars.iv233.unr %32 = load i32, ptr %arrayidx108.us.epil, align 4, !tbaa !5 %cmp109.us.epil = icmp eq i32 %32, 2 br i1 %cmp109.us.epil, label %if.then110.us.epil, label %for.cond102.for.inc119_crit_edge.us if.then110.us.epil: ; preds = %for.body104.us.epil %arrayidx114.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv238, i64 %indvars.iv233.unr %33 = load i32, ptr %arrayidx114.us.epil, align 4, !tbaa !5 br label %for.cond102.for.inc119_crit_edge.us for.cond102.for.inc119_crit_edge.us: ; preds = %for.body104.us.epil, %if.then110.us.epil, %for.cond102.for.inc119_crit_edge.us.unr-lcssa %res.2.us.lcssa = phi i32 [ %res.2.us.lcssa.ph, %for.cond102.for.inc119_crit_edge.us.unr-lcssa ], [ %33, %if.then110.us.epil ], [ %res.1190.us.unr, %for.body104.us.epil ] %indvars.iv.next239 = add nuw nsw i64 %indvars.iv238, 1 %exitcond242.not = icmp eq i64 %indvars.iv.next239, %wide.trip.count241 br i1 %exitcond242.not, label %for.end121, label %for.cond102.preheader.us, !llvm.loop !17 for.cond57.preheader: ; preds = %for.cond57.preheader.preheader, %for.end95 %indvars.iv228 = phi i64 [ 0, %for.cond57.preheader.preheader ], [ %indvars.iv.next229, %for.end95 ] br i1 %9, label %for.body76.lr.ph.unr-lcssa, label %for.body59 for.body76.lr.ph.unr-lcssa: ; preds = %for.body59, %for.cond57.preheader %spec.select167.lcssa.ph = phi i32 [ undef, %for.cond57.preheader ], [ %spec.select167.1, %for.body59 ] %indvars.iv218.unr = phi i64 [ 0, %for.cond57.preheader ], [ %indvars.iv.next219.1, %for.body59 ] %m56.0182.unr = phi i32 [ 0, %for.cond57.preheader ], [ %spec.select167.1, %for.body59 ] br i1 %lcmp.mod265.not, label %for.body76.lr.ph, label %for.body59.epil for.body59.epil: ; preds = %for.body76.lr.ph.unr-lcssa %arrayidx63.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv218.unr, i64 %indvars.iv228 %34 = load i32, ptr %arrayidx63.epil, align 4, !tbaa !5 %idxprom64.epil = sext i32 %m56.0182.unr to i64 %arrayidx67.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %idxprom64.epil, i64 %indvars.iv228 %35 = load i32, ptr %arrayidx67.epil, align 4, !tbaa !5 %cmp68.epil = icmp sgt i32 %34, %35 %36 = trunc i64 %indvars.iv218.unr to i32 %spec.select167.epil = select i1 %cmp68.epil, i32 %36, i32 %m56.0182.unr br label %for.body76.lr.ph for.body76.lr.ph: ; preds = %for.body76.lr.ph.unr-lcssa, %for.body59.epil %spec.select167.lcssa = phi i32 [ %spec.select167.lcssa.ph, %for.body76.lr.ph.unr-lcssa ], [ %spec.select167.epil, %for.body59.epil ] %idxprom81 = sext i32 %spec.select167.lcssa to i64 %arrayidx84 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %idxprom81, i64 %indvars.iv228 %37 = load i32, ptr %arrayidx84, align 4, !tbaa !5 br i1 %10, label %for.end95.unr-lcssa, label %for.body76 for.body59: ; preds = %for.cond57.preheader, %for.body59 %indvars.iv218 = phi i64 [ %indvars.iv.next219.1, %for.body59 ], [ 0, %for.cond57.preheader ] %m56.0182 = phi i32 [ %spec.select167.1, %for.body59 ], [ 0, %for.cond57.preheader ] %niter268 = phi i64 [ %niter268.next.1, %for.body59 ], [ 0, %for.cond57.preheader ] %arrayidx63 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv218, i64 %indvars.iv228 %38 = load i32, ptr %arrayidx63, align 4, !tbaa !5 %idxprom64 = sext i32 %m56.0182 to i64 %arrayidx67 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %idxprom64, i64 %indvars.iv228 %39 = load i32, ptr %arrayidx67, align 4, !tbaa !5 %cmp68 = icmp sgt i32 %38, %39 %40 = trunc i64 %indvars.iv218 to i32 %spec.select167 = select i1 %cmp68, i32 %40, i32 %m56.0182 %indvars.iv.next219 = or i64 %indvars.iv218, 1 %arrayidx63.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv.next219, i64 %indvars.iv228 %41 = load i32, ptr %arrayidx63.1, align 4, !tbaa !5 %idxprom64.1 = sext i32 %spec.select167 to i64 %arrayidx67.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %idxprom64.1, i64 %indvars.iv228 %42 = load i32, ptr %arrayidx67.1, align 4, !tbaa !5 %cmp68.1 = icmp sgt i32 %41, %42 %43 = trunc i64 %indvars.iv.next219 to i32 %spec.select167.1 = select i1 %cmp68.1, i32 %43, i32 %spec.select167 %indvars.iv.next219.1 = add nuw nsw i64 %indvars.iv218, 2 %niter268.next.1 = add i64 %niter268, 2 %niter268.ncmp.1 = icmp eq i64 %niter268.next.1, %unroll_iter267 br i1 %niter268.ncmp.1, label %for.body76.lr.ph.unr-lcssa, label %for.body59, !llvm.loop !18 for.body76: ; preds = %for.body76.lr.ph, %for.inc93.1 %indvars.iv223 = phi i64 [ %indvars.iv.next224.1, %for.inc93.1 ], [ 0, %for.body76.lr.ph ] %niter272 = phi i64 [ %niter272.next.1, %for.inc93.1 ], [ 0, %for.body76.lr.ph ] %arrayidx80 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv223, i64 %indvars.iv228 %44 = load i32, ptr %arrayidx80, align 4, !tbaa !5 %cmp85 = icmp eq i32 %44, %37 br i1 %cmp85, label %if.then86, label %for.inc93 if.then86: ; preds = %for.body76 %arrayidx90 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv223, i64 %indvars.iv228 %45 = load i32, ptr %arrayidx90, align 4, !tbaa !5 %inc91 = add nsw i32 %45, 1 store i32 %inc91, ptr %arrayidx90, align 4, !tbaa !5 br label %for.inc93 for.inc93: ; preds = %for.body76, %if.then86 %indvars.iv.next224 = or i64 %indvars.iv223, 1 %arrayidx80.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv.next224, i64 %indvars.iv228 %46 = load i32, ptr %arrayidx80.1, align 4, !tbaa !5 %cmp85.1 = icmp eq i32 %46, %37 br i1 %cmp85.1, label %if.then86.1, label %for.inc93.1 if.then86.1: ; preds = %for.inc93 %arrayidx90.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next224, i64 %indvars.iv228 %47 = load i32, ptr %arrayidx90.1, align 4, !tbaa !5 %inc91.1 = add nsw i32 %47, 1 store i32 %inc91.1, ptr %arrayidx90.1, align 4, !tbaa !5 br label %for.inc93.1 for.inc93.1: ; preds = %if.then86.1, %for.inc93 %indvars.iv.next224.1 = add nuw nsw i64 %indvars.iv223, 2 %niter272.next.1 = add i64 %niter272, 2 %niter272.ncmp.1 = icmp eq i64 %niter272.next.1, %unroll_iter271 br i1 %niter272.ncmp.1, label %for.end95.unr-lcssa, label %for.body76, !llvm.loop !19 for.end95.unr-lcssa: ; preds = %for.inc93.1, %for.body76.lr.ph %indvars.iv223.unr = phi i64 [ 0, %for.body76.lr.ph ], [ %indvars.iv.next224.1, %for.inc93.1 ] br i1 %lcmp.mod270.not, label %for.end95, label %for.body76.epil for.body76.epil: ; preds = %for.end95.unr-lcssa %arrayidx80.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv223.unr, i64 %indvars.iv228 %48 = load i32, ptr %arrayidx80.epil, align 4, !tbaa !5 %cmp85.epil = icmp eq i32 %48, %37 br i1 %cmp85.epil, label %if.then86.epil, label %for.end95 if.then86.epil: ; preds = %for.body76.epil %arrayidx90.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv223.unr, i64 %indvars.iv228 %49 = load i32, ptr %arrayidx90.epil, align 4, !tbaa !5 %inc91.epil = add nsw i32 %49, 1 store i32 %inc91.epil, ptr %arrayidx90.epil, align 4, !tbaa !5 br label %for.end95 for.end95: ; preds = %for.body76.epil, %if.then86.epil, %for.end95.unr-lcssa %indvars.iv.next229 = add nuw nsw i64 %indvars.iv228, 1 %exitcond232.not = icmp eq i64 %indvars.iv.next229, %wide.trip.count231 br i1 %exitcond232.not, label %for.cond99.preheader, label %for.cond57.preheader, !llvm.loop !20 for.end121: ; preds = %for.cond102.for.inc119_crit_edge.us, %while.body, %for.cond10.preheader, %for.cond53.preheader, %for.cond99.preheader %res.0.lcssa = phi i32 [ 0, %for.cond99.preheader ], [ 0, %for.cond53.preheader ], [ 0, %for.cond10.preheader ], [ 0, %while.body ], [ %res.2.us.lcssa, %for.cond102.for.inc119_crit_edge.us ] %call122 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %res.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %50 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %50, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !21 while.end: ; preds = %for.end121, %entry call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #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 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10}
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <limits.h> #include <stdbool.h> #define rep(i, n) for(int i=0; i<(n); ++i) #define max 200001 //qsort(str, n, sizeof(int), up_comp); int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;} int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;} int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );} int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;} int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);} int main(void){ int a, b, c; scanf("%d%d%d", &a, &b, &c); if (c>=a&&c<=b) { printf("Yes"); } else { printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110537/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110537/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @up_comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @down_comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @int_sort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #9 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @count_digit(i32 noundef %a) local_unnamed_addr #3 { entry: %cmp.not3 = icmp eq i32 %a, 0 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %i.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %a.addr.04 = phi i32 [ %div, %while.body ], [ %a, %entry ] %div = sdiv i32 %a.addr.04, 10 %inc = add nuw nsw i32 %i.05, 1 %a.addr.04.off = add i32 %a.addr.04, 9 %cmp.not = icmp ult i32 %a.addr.04.off, 19 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %i.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ] ret i32 %i.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @euclid(i32 noundef %a, i32 noundef %b) local_unnamed_addr #5 { entry: br label %tailrecurse tailrecurse: ; preds = %if.end3, %entry %a.tr = phi i32 [ %a, %entry ], [ %spec.select17, %if.end3 ] %b.tr = phi i32 [ %b, %entry ], [ %rem, %if.end3 ] %spec.select17 = tail call i32 @llvm.smin.i32(i32 %a.tr, i32 %b.tr) %cmp1 = icmp slt i32 %spec.select17, 1 br i1 %cmp1, label %cleanup, label %if.end3 if.end3: ; preds = %tailrecurse %spec.select = tail call i32 @llvm.smax.i32(i32 %a.tr, i32 %b.tr) %rem = srem i32 %spec.select, %spec.select17 %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %cleanup, label %tailrecurse cleanup: ; preds = %if.end3, %tailrecurse %retval.0 = phi i32 [ -1, %tailrecurse ], [ %spec.select17, %if.end3 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %c, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1.not = icmp sgt i32 %0, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not %.str.2..str.1 = select i1 %or.cond, ptr @.str.2, ptr @.str.1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #8 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 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 #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { 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 #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nounwind willreturn memory(read) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a<=c && c<=b) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110588/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110588/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1.not = icmp sgt i32 %1, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not %str.str.3 = select i1 %or.cond, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a, &b, &c); if(c>=a && c<=b) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110638/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110638/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %c, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1.not = icmp sgt i32 %0, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not %str.str.3 = select i1 %or.cond, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a<=c&&c<=b) puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110681/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110681/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1.not = icmp sgt i32 %1, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not %.str.2..str.1 = select i1 %or.cond, ptr @.str.2, ptr @.str.1 %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); if(c>=a&&c<=b) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110724/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110724/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %c, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1.not = icmp sgt i32 %0, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not %str.str.3 = select i1 %or.cond, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); puts(a <= c && c <= b ? "Yes" : "No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110768/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110768/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %c, align 4 %cmp = icmp sle i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1 = icmp sle i32 %1, %2 %3 = select i1 %cmp, i1 %cmp1, i1 false %cond = select i1 %3, ptr @.str.1, ptr @.str.2 %call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int A, B, C; scanf("%d", &A); scanf("%d", &B); scanf("%d", &C); if (C >= A && C <= B) puts("Yes"); else puts("No"); //else printf("%d\n", A + B); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110810/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110810/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %B = alloca i32, align 4 %C = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C) %0 = load i32, ptr %C, align 4, !tbaa !5 %1 = load i32, ptr %A, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %2 = load i32, ptr %B, align 4 %cmp3.not = icmp sgt i32 %0, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp3.not %.str.2..str.1 = select i1 %or.cond, ptr @.str.2, ptr @.str.1 %call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a, b, c; scanf("%d %d %d", & a, &b, &c); if(c>=a&&c<=b)puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110854/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110854/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %c, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1.not = icmp sgt i32 %0, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not %.str.2..str.1 = select i1 %or.cond, ptr @.str.2, ptr @.str.1 %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int x,y,z; scanf("%d", &x); scanf("%d", &y); scanf("%d", &z); if (z >=x&&z <= y) { printf("Yes\n"); } else { puts("No"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110904/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110904/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 %z = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %z) %0 = load i32, ptr %z, align 4, !tbaa !5 %1 = load i32, ptr %x, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %2 = load i32, ptr %y, align 4 %cmp3.not = icmp sgt i32 %0, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp3.not br i1 %or.cond, label %if.else, label %if.then if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.else: ; preds = %entry %call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @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> #include <string.h> #include <ctype.h> #include <math.h> int cmpfunc(const void *a, const void *b){ return *(int*)a - *(int*)b; } int cmpstr(const void* a, const void* b) { const char* aa = (const char*)a; const char* bb = (const char*)b; return strcmp(aa, bb); } int main(void){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if(c>=a && b>=c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110948/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110948/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmpfunc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmpstr(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #7 ret i32 %call } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, 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) #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %c, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1.not = icmp slt i32 %2, %0 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not %str.str.3 = select i1 %or.cond, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #8 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind } attributes #7 = { nounwind willreturn memory(read) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #define ll long long #define rep(i,l,r)for(ll i=(l);i<(r);i++) char a[10][5]={ {}, {'.',',','!','?',' '}, {'a','b','c'}, {'d','e','f'}, {'g','h','i'}, {'j','k','l'}, {'m','n','o'}, {'p','q','r','s'}, {'t','u','v'}, {'w','x','y','z'} }; int c[10]={0,5,3,3,3,3,3,4,3,4}; char in[1100],out[99]; int main(){ ll q; scanf("%lld",&q); while(q--){ scanf("%s",in); ll n=strlen(in); int outlen=0; int cnt=0; rep(i,0,n){ if(in[i]==in[i+1])cnt++; else{ int ch=in[i]-'0'; if(ch)out[outlen++]=a[ch][cnt%c[ch]]; cnt=0; } } out[outlen]=0; puts(out); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_110991/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_110991/source.c" target datalayout = "e-m:e-p270: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 local_unnamed_addr global [10 x [5 x i8]] [[5 x i8] zeroinitializer, [5 x i8] c".,!? ", [5 x i8] c"abc\00\00", [5 x i8] c"def\00\00", [5 x i8] c"ghi\00\00", [5 x i8] c"jkl\00\00", [5 x i8] c"mno\00\00", [5 x i8] c"pqrs\00", [5 x i8] c"tuv\00\00", [5 x i8] c"wxyz\00"], align 16 @c = dso_local local_unnamed_addr global [10 x i32] [i32 0, i32 5, i32 3, i32 3, i32 3, i32 3, i32 3, i32 4, i32 3, i32 4], align 16 @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @in = dso_local global [1100 x i8] zeroinitializer, align 16 @out = dso_local global [99 x i8] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %q = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %0 = load i64, ptr %q, align 8, !tbaa !5 %dec36 = add nsw i64 %0, -1 store i64 %dec36, ptr %q, align 8, !tbaa !5 %tobool.not37 = icmp eq i64 %0, 0 br i1 %tobool.not37, label %while.end, label %while.body while.body: ; preds = %entry, %for.cond.cleanup %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @in) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @in) #5 %cmp32 = icmp sgt i64 %call2, 0 br i1 %cmp32, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %while.body %.pre = load i8, ptr @in, align 16, !tbaa !9 br label %for.body for.cond.cleanup: ; preds = %for.inc, %while.body %outlen.0.lcssa = phi i32 [ 0, %while.body ], [ %outlen.2, %for.inc ] %idxprom21 = sext i32 %outlen.0.lcssa to i64 %arrayidx22 = getelementptr inbounds [99 x i8], ptr @out, i64 0, i64 %idxprom21 store i8 0, ptr %arrayidx22, align 1, !tbaa !9 %call23 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @out) %1 = load i64, ptr %q, align 8, !tbaa !5 %dec = add nsw i64 %1, -1 store i64 %dec, ptr %q, align 8, !tbaa !5 %tobool.not = icmp eq i64 %1, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !10 for.body: ; preds = %for.body.preheader, %for.inc %2 = phi i8 [ %3, %for.inc ], [ %.pre, %for.body.preheader ] %outlen.035 = phi i32 [ %outlen.2, %for.inc ], [ 0, %for.body.preheader ] %i.034 = phi i64 [ %add, %for.inc ], [ 0, %for.body.preheader ] %cnt.033 = phi i32 [ %cnt.1, %for.inc ], [ 0, %for.body.preheader ] %add = add nuw nsw i64 %i.034, 1 %arrayidx3 = getelementptr inbounds [1100 x i8], ptr @in, i64 0, i64 %add %3 = load i8, ptr %arrayidx3, align 1, !tbaa !9 %cmp5 = icmp eq i8 %2, %3 br i1 %cmp5, label %if.then, label %if.else if.then: ; preds = %for.body %inc = add nsw i32 %cnt.033, 1 br label %for.inc if.else: ; preds = %for.body %conv = sext i8 %2 to i32 %sub = add nsw i32 %conv, -48 %tobool9.not = icmp eq i32 %sub, 0 br i1 %tobool9.not, label %for.inc, label %if.then10 if.then10: ; preds = %if.else %idxprom = sext i32 %sub to i64 %arrayidx13 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %idxprom %4 = load i32, ptr %arrayidx13, align 4, !tbaa !12 %rem = srem i32 %cnt.033, %4 %idxprom14 = sext i32 %rem to i64 %arrayidx15 = getelementptr inbounds [10 x [5 x i8]], ptr @a, i64 0, i64 %idxprom, i64 %idxprom14 %5 = load i8, ptr %arrayidx15, align 1, !tbaa !9 %inc16 = add nsw i32 %outlen.035, 1 %idxprom17 = sext i32 %outlen.035 to i64 %arrayidx18 = getelementptr inbounds [99 x i8], ptr @out, i64 0, i64 %idxprom17 store i8 %5, ptr %arrayidx18, align 1, !tbaa !9 br label %for.inc for.inc: ; preds = %if.else, %if.then10, %if.then %cnt.1 = phi i32 [ %inc, %if.then ], [ 0, %if.then10 ], [ 0, %if.else ] %outlen.2 = phi i32 [ %outlen.035, %if.then ], [ %inc16, %if.then10 ], [ %outlen.035, %if.else ] %exitcond.not = icmp eq i64 %add, %call2 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14 while.end: ; preds = %for.cond.cleanup, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn 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 = !{!"long long", !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 = !{!13, !13, i64 0} !13 = !{!"int", !7, i64 0} !14 = distinct !{!14, !11}
#include <stdio.h> #include <string.h> int main( void ) { int n, sum; char ch[ 9 ][ 6 ] = { ".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz" }, key, tmp; for ( scanf( "%d ", &n ); n--; putchar( '\n' ) ) while ( ( key = getchar() ) != '\n' ) { if ( key == '0' ) continue; for ( sum = 0; ( tmp = getchar() ) != '0'; sum++ ) ; putchar( ch[ key - '1' ][ sum % strlen( ch[ key - '1' ] ) ] ); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111048/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111048/source.c" target datalayout = "e-m:e-p270: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.ch = private unnamed_addr constant [9 x [6 x i8]] [[6 x i8] c".,!? \00", [6 x i8] c"abc\00\00\00", [6 x i8] c"def\00\00\00", [6 x i8] c"ghi\00\00\00", [6 x i8] c"jkl\00\00\00", [6 x i8] c"mno\00\00\00", [6 x i8] c"pqrs\00\00", [6 x i8] c"tuv\00\00\00", [6 x i8] c"wxyz\00\00"], align 16 @.str = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %dec34 = add nsw i32 %0, -1 store i32 %dec34, ptr %n, align 4, !tbaa !5 %tobool.not35 = icmp eq i32 %0, 0 br i1 %tobool.not35, label %for.end26, label %while.cond while.cond: ; preds = %entry, %while.cond.backedge %1 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i = call i32 @getc(ptr noundef %1) %sext = shl i32 %call.i, 24 %conv2 = ashr exact i32 %sext, 24 switch i32 %sext, label %for.cond7 [ i32 167772160, label %for.inc24 i32 805306368, label %while.cond.backedge ] for.cond7: ; preds = %while.cond, %for.cond7 %sum.0 = phi i32 [ %inc, %for.cond7 ], [ 0, %while.cond ] %2 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i31 = call i32 @getc(ptr noundef %2) %sext30.mask = and i32 %call.i31, 255 %cmp11.not = icmp eq i32 %sext30.mask, 48 %inc = add nuw nsw i32 %sum.0, 1 br i1 %cmp11.not, label %for.end, label %for.cond7, !llvm.loop !11 for.end: ; preds = %for.cond7 %sub = add nsw i32 %conv2, -49 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds [9 x [6 x i8]], ptr @__const.main.ch, i64 0, i64 %idxprom %conv15 = zext i32 %sum.0 to i64 %call20 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx) #5 %rem = urem i64 %conv15, %call20 %arrayidx21 = getelementptr inbounds [9 x [6 x i8]], ptr @__const.main.ch, i64 0, i64 %idxprom, i64 %rem %3 = load i8, ptr %arrayidx21, align 1, !tbaa !13 %conv22 = sext i8 %3 to i32 %4 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i32 = call i32 @putc(i32 noundef %conv22, ptr noundef %4) br label %while.cond.backedge for.inc24: ; preds = %while.cond %5 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i33 = call i32 @putc(i32 noundef 10, ptr noundef %5) %6 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %6, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %6, 0 br i1 %tobool.not, label %for.end26, label %while.cond.backedge while.cond.backedge: ; preds = %for.inc24, %for.end, %while.cond br label %while.cond, !llvm.loop !14 for.end26: ; preds = %for.inc24, %entry 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 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 @getc(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!7, !7, i64 0} !14 = distinct !{!14, !12}
#include<stdio.h> #include<stdbool.h> #include<string.h> #include<math.h> #define rep(i,n) for(int i=0; i <(n); i++) int main(){ int a,b,c,k; scanf("%d%d%d",&a,&b,&c); scanf("%d",&k); int total=0; total = a+b+c; int max=a; if(a<b){ max=b; }else if(a<c){ max=c; } if(b<c){ max=c; } total=total-max; rep(i,k){ max=max*2; } printf("%d\n",total+max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111091/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111091/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %2) %max.0 = select i1 %cmp, i32 %1, i32 %spec.select %cmp6 = icmp slt i32 %1, %2 %spec.select19 = select i1 %cmp6, i32 %2, i32 %max.0 %3 = load i32, ptr %k, align 4, !tbaa !5 %cmp920 = icmp sgt i32 %3, 0 br i1 %cmp920, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i32 %3, 7 %4 = icmp ult i32 %3, 8 br i1 %4, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %3, -8 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %mul, %for.body ] %max.221.unr = phi i32 [ %spec.select19, %for.body.preheader ], [ %mul, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %max.221.epil = phi i32 [ %mul.epil, %for.body.epil ], [ %max.221.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = shl nsw i32 %max.221.epil, 1 %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.cond.cleanup, label %for.body.epil, !llvm.loop !9 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %max.2.lcssa = phi i32 [ %spec.select19, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] %add = add nsw i32 %1, %0 %add2 = add nsw i32 %add, %2 %sub = sub i32 %add2, %spec.select19 %add10 = add nsw i32 %sub, %max.2.lcssa %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 for.body: ; preds = %for.body, %for.body.preheader.new %max.221 = phi i32 [ %spec.select19, %for.body.preheader.new ], [ %mul, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = shl i32 %max.221, 8 %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.cond.cleanup.loopexit.unr-lcssa, label %for.body, !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.unroll.disable"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <math.h> int main(){ int a, b, c, ans; double k,l; scanf("%d%d%d%lf",&a,&b,&c,&k); l = pow((double)2,k); if (a >= b && a >= c) ans = a*l + b + c; else if(b >= a && b >= c) ans = a + b*l + c; else ans = a + b + c*l; printf("%d",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111141/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111141/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%d%d%d%lf\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %k = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %k) %0 = load double, ptr %k, align 8, !tbaa !5 %exp2 = call double @exp2(double %0) #4 %1 = load i32, ptr %a, align 4, !tbaa !9 %2 = load i32, ptr %b, align 4, !tbaa !9 %cmp.not = icmp slt i32 %1, %2 %.pre.pre = load i32, ptr %c, align 4, !tbaa !9 %cmp2.not = icmp slt i32 %1, %.pre.pre %or.cond = select i1 %cmp.not, i1 true, i1 %cmp2.not br i1 %or.cond, label %if.else, label %if.then if.then: ; preds = %entry %conv = sitofp i32 %1 to double %conv3 = sitofp i32 %2 to double %3 = call double @llvm.fmuladd.f64(double %conv, double %exp2, double %conv3) %conv4 = sitofp i32 %.pre.pre to double %add = fadd double %3, %conv4 br label %if.end22 if.else: ; preds = %entry %cmp6.not = icmp slt i32 %2, %1 %cmp9.not = icmp slt i32 %2, %.pre.pre %or.cond31 = select i1 %cmp6.not, i1 true, i1 %cmp9.not br i1 %or.cond31, label %if.else17, label %if.then11 if.then11: ; preds = %if.else %conv12 = sitofp i32 %1 to double %conv13 = sitofp i32 %2 to double %4 = call double @llvm.fmuladd.f64(double %conv13, double %exp2, double %conv12) %conv14 = sitofp i32 %.pre.pre to double %add15 = fadd double %4, %conv14 br label %if.end22 if.else17: ; preds = %if.else %add18 = add nsw i32 %2, %1 %conv19 = sitofp i32 %add18 to double %conv20 = sitofp i32 %.pre.pre to double %5 = call double @llvm.fmuladd.f64(double %conv20, double %exp2, double %conv19) br label %if.end22 if.end22: ; preds = %if.then11, %if.else17, %if.then %ans.0.in = phi double [ %add, %if.then ], [ %add15, %if.then11 ], [ %5, %if.else17 ] %ans.0 = fptosi double %ans.0.in to i32 %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 declare double @exp2(double) local_unnamed_addr attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0}
#include <stdio.h> int main (void){ int a[3]; int i, j; for(i = 0; i < 3; i++){ scanf("%d", &a[i]); } int K; scanf("%d", &K); int temp = 0; for(i = 0; i < 2; i++){ for(j = 1; j < 3; j++){ if(a[i] > a[j]){ temp = a[i]; a[i] = a[j]; a[j] = temp; } } } int count = 0; while(count != K){ a[2] = a[2] * 2; count++; } int ans = 0; ans = a[0] + a[1] + a[2]; printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111185/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111185/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i32], align 4 %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %arrayidx.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %0, %1 br i1 %cmp12, label %if.then, label %for.inc21 if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %entry, %if.then %2 = phi i32 [ %1, %entry ], [ %0, %if.then ] %3 = phi i32 [ %0, %entry ], [ %1, %if.then ] %4 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %cmp12.1 = icmp sgt i32 %3, %4 br i1 %cmp12.1, label %if.then.1, label %for.inc21.161 if.then.1: ; preds = %for.inc21 store i32 %4, ptr %a, align 4, !tbaa !5 store i32 %3, ptr %arrayidx.2, align 4, !tbaa !5 br label %for.inc21.161 for.inc21.161: ; preds = %for.inc21, %if.then.1 %5 = phi i32 [ %4, %if.then.1 ], [ %3, %for.inc21 ] %6 = phi i32 [ %3, %if.then.1 ], [ %4, %for.inc21 ] %cmp12.1.1 = icmp sgt i32 %2, %6 br i1 %cmp12.1.1, label %if.then.1.1, label %for.inc21.1.1 if.then.1.1: ; preds = %for.inc21.161 store i32 %6, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %2, ptr %arrayidx.2, align 4, !tbaa !5 br label %for.inc21.1.1 for.inc21.1.1: ; preds = %if.then.1.1, %for.inc21.161 %7 = phi i32 [ %6, %if.then.1.1 ], [ %2, %for.inc21.161 ] %arrayidx28.promoted = phi i32 [ %2, %if.then.1.1 ], [ %6, %for.inc21.161 ] %8 = load i32, ptr %K, align 4, !tbaa !5 %cmp27.not52 = icmp eq i32 %8, 0 br i1 %cmp27.not52, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %for.inc21.1.1 %xtraiter = and i32 %8, 7 %9 = icmp ult i32 %8, 8 br i1 %9, label %while.cond.while.end_crit_edge.unr-lcssa, label %while.body.preheader.new while.body.preheader.new: ; preds = %while.body.preheader %unroll_iter = and i32 %8, -8 br label %while.body while.body: ; preds = %while.body, %while.body.preheader.new %mul54 = phi i32 [ %arrayidx28.promoted, %while.body.preheader.new ], [ %mul, %while.body ] %niter = phi i32 [ 0, %while.body.preheader.new ], [ %niter.next.7, %while.body ] %mul = shl i32 %mul54, 8 %niter.next.7 = add i32 %niter, 8 %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %while.cond.while.end_crit_edge.unr-lcssa, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge.unr-lcssa: ; preds = %while.body, %while.body.preheader %mul.lcssa.ph = phi i32 [ undef, %while.body.preheader ], [ %mul, %while.body ] %mul54.unr = phi i32 [ %arrayidx28.promoted, %while.body.preheader ], [ %mul, %while.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.cond.while.end_crit_edge, label %while.body.epil while.body.epil: ; preds = %while.cond.while.end_crit_edge.unr-lcssa, %while.body.epil %mul54.epil = phi i32 [ %mul.epil, %while.body.epil ], [ %mul54.unr, %while.cond.while.end_crit_edge.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %while.body.epil ], [ 0, %while.cond.while.end_crit_edge.unr-lcssa ] %mul.epil = shl nsw i32 %mul54.epil, 1 %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 %while.cond.while.end_crit_edge, label %while.body.epil, !llvm.loop !11 while.cond.while.end_crit_edge: ; preds = %while.body.epil, %while.cond.while.end_crit_edge.unr-lcssa %mul.lcssa = phi i32 [ %mul.lcssa.ph, %while.cond.while.end_crit_edge.unr-lcssa ], [ %mul.epil, %while.body.epil ] store i32 %mul.lcssa, ptr %arrayidx.2, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %for.inc21.1.1 %10 = phi i32 [ %mul.lcssa, %while.cond.while.end_crit_edge ], [ %arrayidx28.promoted, %for.inc21.1.1 ] %add = add nsw i32 %7, %5 %add34 = add nsw i32 %add, %10 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add34) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> int main(){ int A, B, C, K, i; scanf("%d %d %d", &A, &B, &C); scanf("%d",&K); int max=A; if(max<B) max=B; if(max<C) max=C; int sum=A+B+C; for(i=0;i<K;i++){ sum+=max; max*=2; } printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111228/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111228/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %C = alloca i32, align 4 %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %K) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %2 = load i32, ptr %C, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %add5 = add nsw i32 %add, %2 %3 = load i32, ptr %K, align 4, !tbaa !5 %cmp616 = icmp sgt i32 %3, 0 br i1 %cmp616, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1) %max.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %2) %xtraiter = and i32 %3, 7 %4 = icmp ult i32 %3, 8 br i1 %4, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %3, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %sum.019 = phi i32 [ %add5, %for.body.preheader.new ], [ %add7.7, %for.body ] %max.218 = phi i32 [ %max.1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %add7 = add nsw i32 %sum.019, %max.218 %mul = shl nsw i32 %max.218, 1 %add7.1 = add nsw i32 %add7, %mul %mul.1 = shl nsw i32 %max.218, 2 %add7.2 = add nsw i32 %add7.1, %mul.1 %mul.2 = shl nsw i32 %max.218, 3 %add7.3 = add nsw i32 %add7.2, %mul.2 %mul.3 = shl nsw i32 %max.218, 4 %add7.4 = add nsw i32 %add7.3, %mul.3 %mul.4 = shl nsw i32 %max.218, 5 %add7.5 = add nsw i32 %add7.4, %mul.4 %mul.5 = shl nsw i32 %max.218, 6 %add7.6 = add nsw i32 %add7.5, %mul.5 %mul.6 = shl nsw i32 %max.218, 7 %add7.7 = add nsw i32 %add7.6, %mul.6 %mul.7 = shl nsw i32 %max.218, 8 %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.body, !llvm.loop !9 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %add7.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %add7.7, %for.body ] %sum.019.unr = phi i32 [ %add5, %for.body.preheader ], [ %add7.7, %for.body ] %max.218.unr = phi i32 [ %max.1, %for.body.preheader ], [ %mul.7, %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, %for.body.epil %sum.019.epil = phi i32 [ %add7.epil, %for.body.epil ], [ %sum.019.unr, %for.end.loopexit.unr-lcssa ] %max.218.epil = phi i32 [ %mul.epil, %for.body.epil ], [ %max.218.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %add7.epil = add nsw i32 %sum.019.epil, %max.218.epil %mul.epil = shl nsw i32 %max.218.epil, 1 %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.body.epil, !llvm.loop !11 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %sum.0.lcssa = phi i32 [ %add5, %entry ], [ %add7.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add7.epil, %for.body.epil ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"}
/* AtCoder Beginner Contest 096 B - Maximum Sum 結果: */ //#include<stdio.h> //#include<string.h> //#include<math.h> //#include<stdlib.h> //#define DEBUG1 //#define DEBUG2 //#define DEBUGF // //#ifdef DEBUG1 //#ifdef DEBUG2 //#ifdef DEBUGF //#endif //#define int long long #include<stdio.h> #include<math.h> #include<stdlib.h> int desc(const void *a, const void *b) { return *(int *)b - *(int *)a; } int main(void) { int num[3]; int k; scanf("%d %d %d", &num[0], &num[1], &num[2]); scanf("%d", &k); qsort(num, 3, sizeof(int), desc); int a = pow(2, k); printf("%d\n", num[0] * a + num[1] + num[2]); #ifdef DEBUGF getch(); #endif return 0; } //a = (int)sqrt((double)n) + 1; //int ngflg = 0; //scanf("%d", &n); //scanf("%lld", &N); // //#define int long long //signed main() { //int *x = (int *)malloc(sizeof(int) * N); //int *y = (int *)malloc(sizeof(int) * N); //int desc(const void *a, const void *b) {return *(int *)b - *(int *)a;} //qsort(num, 3, sizeof(int), desc); //int d = pow(2, k);
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111271/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111271/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %num = alloca [3 x i32], align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %num) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 %arrayidx1 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2) %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) call void @qsort(ptr noundef nonnull %num, i64 noundef 3, i64 noundef 4, ptr noundef nonnull @desc) #6 %0 = load i32, ptr %k, align 4, !tbaa !5 %ldexp = call double @ldexp(double 1.000000e+00, i32 %0) #6 %conv5 = fptosi double %ldexp to i32 %1 = load i32, ptr %num, align 4, !tbaa !5 %mul = mul nsw i32 %1, %conv5 %2 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %add = add nsw i32 %mul, %2 %3 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %add9 = add nsw i32 %add, %3 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add9) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 12, 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) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree willreturn declare double @ldexp(double, i32) local_unnamed_addr #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree willreturn } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b,c,k,i,t; scanf("%d %d %d %d",&a,&b,&c,&k); if(a<b) { t=b;b=a;a=t; } if(a<c) { t=c;c=a;a=t; } for(i=0;i<k;i++) { a=2*a; } printf("%d\n",a+b+c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111321/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111321/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %k) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %0, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %1, %if.then ], [ %0, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp slt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %3, ptr %c, align 4, !tbaa !5 store i32 %4, ptr %a, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %a.promoted = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %6 = load i32, ptr %k, align 4, !tbaa !5 %cmp413 = icmp sgt i32 %6, 0 br i1 %cmp413, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %if.end3 %xtraiter = and i32 %6, 7 %7 = icmp ult i32 %6, 8 br i1 %7, label %for.cond.for.end_crit_edge.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %6, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %mul1214 = phi i32 [ %a.promoted, %for.body.preheader.new ], [ %mul, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = shl i32 %mul1214, 8 %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.cond.for.end_crit_edge.unr-lcssa, label %for.body, !llvm.loop !9 for.cond.for.end_crit_edge.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %mul, %for.body ] %mul1214.unr = phi i32 [ %a.promoted, %for.body.preheader ], [ %mul, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.for.end_crit_edge, label %for.body.epil for.body.epil: ; preds = %for.cond.for.end_crit_edge.unr-lcssa, %for.body.epil %mul1214.epil = phi i32 [ %mul.epil, %for.body.epil ], [ %mul1214.unr, %for.cond.for.end_crit_edge.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.for.end_crit_edge.unr-lcssa ] %mul.epil = shl nsw i32 %mul1214.epil, 1 %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.cond.for.end_crit_edge, label %for.body.epil, !llvm.loop !11 for.cond.for.end_crit_edge: ; preds = %for.body.epil, %for.cond.for.end_crit_edge.unr-lcssa %mul.lcssa = phi i32 [ %mul.lcssa.ph, %for.cond.for.end_crit_edge.unr-lcssa ], [ %mul.epil, %for.body.epil ] store i32 %mul.lcssa, ptr %a, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.cond.for.end_crit_edge, %if.end3 %8 = phi i32 [ %mul.lcssa, %for.cond.for.end_crit_edge ], [ %a.promoted, %if.end3 ] %add = add nsw i32 %2, %8 %add5 = add nsw i32 %add, %5 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"}
#include<stdio.h> int main() { int i,n,m,a,b,error,mex; error = -1; scanf("%d",&n); scanf("%d",&m); mex = m; for(i=0;i<n;i++) { scanf("%d %d",&a,&b); m += (a-b); if(m < 0) error = 0; if(mex < m) mex = m; } error != -1?printf("0\n"):printf("%d\n",mex); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111365/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111365/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !5 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %1, 0 br i1 %cmp12, label %for.body, label %cond.false for.body: ; preds = %entry, %for.body %mex.015 = phi i32 [ %mex.1, %for.body ], [ %0, %entry ] %error.014 = phi i32 [ %spec.select, %for.body ], [ -1, %entry ] %i.013 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %2 = load i32, ptr %a, align 4, !tbaa !5 %3 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %2, %3 %4 = load i32, ptr %m, align 4, !tbaa !5 %add = add nsw i32 %4, %sub store i32 %add, ptr %m, align 4, !tbaa !5 %cmp3 = icmp slt i32 %add, 0 %spec.select = select i1 %cmp3, i32 0, i32 %error.014 %mex.1 = call i32 @llvm.smax.i32(i32 %mex.015, i32 %add) %inc = add nuw nsw i32 %i.013, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %5 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %6 = icmp eq i32 %spec.select, -1 br i1 %6, label %cond.false, label %cond.true cond.true: ; preds = %for.end %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cond.end cond.false: ; preds = %entry, %for.end %mex.0.lcssa19 = phi i32 [ %mex.1, %for.end ], [ %0, %entry ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %mex.0.lcssa19) br label %cond.end cond.end: ; preds = %cond.false, %cond.true 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 %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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.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 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int acs(const void *a, const void *b) { return *(int*)a - *(int*)b; } /* 1,2,3,4.. */ int des(const void *a, const void *b) { return *(int*)b - *(int*)a; } /* 8,7,6,5.. */ int cmp_char(const void *a, const void *b) { return *(char*)a - *(char*)b; } /* a,b,c,d.. */ int cmp_str(const void *a, const void *b) { return strcmp(*(const char **)a, *(const char **)b); } /* aaa,aab.. */ #define min(a,b) (a < b ? a : b) #define max(a,b) (a > b ? a : b) #define rep(i, n) for (int i = 0; i < n; i++) #define MAX 100001 #define INF 1000000009 #define MOD 1000000007 typedef long long int lli; int main(void) { int H, W; scanf("%d %d", &H, &W); int c[10][10]; rep(i, 10) rep(j, 10) scanf("%d", &c[i][j]); int A[201][201]; rep(h, H) rep(w,W) scanf("%d", &A[h][w]); rep(k, 10) rep(i, 10) rep(j, 10) c[i][j] = min(c[i][j], c[i][k] + c[k][j]); int ans = 0; rep(h, H) rep(w, W) { if (A[h][w] == -1) continue; ans += c[A[h][w]][1]; } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111408/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111408/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !9 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !9 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @cmp_str(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %0 = load ptr, ptr %a, align 8, !tbaa !10 %1 = load ptr, ptr %b, align 8, !tbaa !10 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #7 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 %c = alloca [10 x [10 x i32]], align 16 %A = alloca [201 x [201 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %c) #8 br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.preheader %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.cond1.preheader ] %arrayidx6 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 0 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %arrayidx6.1 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 1 %call7.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.1) %arrayidx6.2 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 2 %call7.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.2) %arrayidx6.3 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 3 %call7.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.3) %arrayidx6.4 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 4 %call7.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.4) %arrayidx6.5 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 5 %call7.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.5) %arrayidx6.6 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 6 %call7.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.6) %arrayidx6.7 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 7 %call7.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.7) %arrayidx6.8 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 8 %call7.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.8) %arrayidx6.9 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 9 %call7.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6.9) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 10 br i1 %exitcond.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !12 for.cond.cleanup: ; preds = %for.cond1.preheader call void @llvm.lifetime.start.p0(i64 161604, ptr nonnull %A) #8 %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp12150 = icmp sgt i32 %0, 0 %1 = load i32, ptr %W, align 4 %2 = icmp sgt i32 %1, 0 %or.cond = select i1 %cmp12150, i1 %2, i1 false br i1 %or.cond, label %for.cond15.preheader, label %for.cond30.preheader for.cond15.preheader: ; preds = %for.cond.cleanup, %for.cond.cleanup17 %3 = phi i32 [ %5, %for.cond.cleanup17 ], [ %0, %for.cond.cleanup ] %4 = phi i32 [ %6, %for.cond.cleanup17 ], [ %1, %for.cond.cleanup ] %indvars.iv172 = phi i64 [ %indvars.iv.next173, %for.cond.cleanup17 ], [ 0, %for.cond.cleanup ] %cmp16148 = icmp sgt i32 %4, 0 br i1 %cmp16148, label %for.body18, label %for.cond.cleanup17 for.cond30.preheader: ; preds = %for.cond.cleanup17, %for.cond.cleanup %.lcssa = phi i32 [ %0, %for.cond.cleanup ], [ %5, %for.cond.cleanup17 ] br label %for.cond35.preheader for.cond.cleanup17.loopexit: ; preds = %for.body18 %.pre = load i32, ptr %H, align 4, !tbaa !5 br label %for.cond.cleanup17 for.cond.cleanup17: ; preds = %for.cond.cleanup17.loopexit, %for.cond15.preheader %5 = phi i32 [ %.pre, %for.cond.cleanup17.loopexit ], [ %3, %for.cond15.preheader ] %6 = phi i32 [ %8, %for.cond.cleanup17.loopexit ], [ %4, %for.cond15.preheader ] %indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1 %7 = sext i32 %5 to i64 %cmp12 = icmp slt i64 %indvars.iv.next173, %7 br i1 %cmp12, label %for.cond15.preheader, label %for.cond30.preheader, !llvm.loop !14 for.body18: ; preds = %for.cond15.preheader, %for.body18 %indvars.iv169 = phi i64 [ %indvars.iv.next170, %for.body18 ], [ 0, %for.cond15.preheader ] %arrayidx22 = getelementptr inbounds [201 x [201 x i32]], ptr %A, i64 0, i64 %indvars.iv172, i64 %indvars.iv169 %call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx22) %indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1 %8 = load i32, ptr %W, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp16 = icmp slt i64 %indvars.iv.next170, %9 br i1 %cmp16, label %for.body18, label %for.cond.cleanup17.loopexit, !llvm.loop !16 for.cond35.preheader: ; preds = %for.cond30.preheader, %for.cond.cleanup37 %indvars.iv183 = phi i64 [ 0, %for.cond30.preheader ], [ %indvars.iv.next184, %for.cond.cleanup37 ] %arrayidx55 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv183, i64 0 %arrayidx55.1 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv183, i64 1 %arrayidx55.2 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv183, i64 2 %arrayidx55.3 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv183, i64 3 %arrayidx55.4 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv183, i64 4 %arrayidx55.5 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv183, i64 5 %arrayidx55.6 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv183, i64 6 %arrayidx55.7 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv183, i64 7 %arrayidx55.8 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv183, i64 8 %arrayidx55.9 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv183, i64 9 br label %for.cond40.preheader for.cond84.preheader: ; preds = %for.cond.cleanup37 %cmp85159 = icmp sgt i32 %.lcssa, 0 br i1 %cmp85159, label %for.cond89.preheader.lr.ph, label %for.cond.cleanup86 for.cond89.preheader.lr.ph: ; preds = %for.cond84.preheader %10 = load i32, ptr %W, align 4, !tbaa !5 %cmp90155 = icmp sgt i32 %10, 0 br i1 %cmp90155, label %for.cond89.preheader.us.preheader, label %for.cond.cleanup86 for.cond89.preheader.us.preheader: ; preds = %for.cond89.preheader.lr.ph %wide.trip.count194 = zext i32 %.lcssa to i64 %wide.trip.count = zext i32 %10 to i64 %xtraiter = and i64 %wide.trip.count, 1 %11 = icmp eq i32 %10, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond89.preheader.us for.cond89.preheader.us: ; preds = %for.cond89.preheader.us.preheader, %for.cond89.for.cond.cleanup91_crit_edge.us %indvars.iv191 = phi i64 [ 0, %for.cond89.preheader.us.preheader ], [ %indvars.iv.next192, %for.cond89.for.cond.cleanup91_crit_edge.us ] %ans.0160.us = phi i32 [ 0, %for.cond89.preheader.us.preheader ], [ %ans.2.us.lcssa, %for.cond89.for.cond.cleanup91_crit_edge.us ] br i1 %11, label %for.cond89.for.cond.cleanup91_crit_edge.us.unr-lcssa, label %for.body92.us for.body92.us: ; preds = %for.cond89.preheader.us, %for.inc106.us.1 %indvars.iv187 = phi i64 [ %indvars.iv.next188.1, %for.inc106.us.1 ], [ 0, %for.cond89.preheader.us ] %ans.1156.us = phi i32 [ %ans.2.us.1, %for.inc106.us.1 ], [ %ans.0160.us, %for.cond89.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc106.us.1 ], [ 0, %for.cond89.preheader.us ] %arrayidx96.us = getelementptr inbounds [201 x [201 x i32]], ptr %A, i64 0, i64 %indvars.iv191, i64 %indvars.iv187 %12 = load i32, ptr %arrayidx96.us, align 4, !tbaa !5 %cmp97.us = icmp eq i32 %12, -1 br i1 %cmp97.us, label %for.inc106.us, label %if.end.us if.end.us: ; preds = %for.body92.us %idxprom102.us = sext i32 %12 to i64 %arrayidx104.us = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %idxprom102.us, i64 1 %13 = load i32, ptr %arrayidx104.us, align 4, !tbaa !5 %add105.us = add nsw i32 %13, %ans.1156.us br label %for.inc106.us for.inc106.us: ; preds = %if.end.us, %for.body92.us %ans.2.us = phi i32 [ %ans.1156.us, %for.body92.us ], [ %add105.us, %if.end.us ] %indvars.iv.next188 = or i64 %indvars.iv187, 1 %arrayidx96.us.1 = getelementptr inbounds [201 x [201 x i32]], ptr %A, i64 0, i64 %indvars.iv191, i64 %indvars.iv.next188 %14 = load i32, ptr %arrayidx96.us.1, align 4, !tbaa !5 %cmp97.us.1 = icmp eq i32 %14, -1 br i1 %cmp97.us.1, label %for.inc106.us.1, label %if.end.us.1 if.end.us.1: ; preds = %for.inc106.us %idxprom102.us.1 = sext i32 %14 to i64 %arrayidx104.us.1 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %idxprom102.us.1, i64 1 %15 = load i32, ptr %arrayidx104.us.1, align 4, !tbaa !5 %add105.us.1 = add nsw i32 %15, %ans.2.us br label %for.inc106.us.1 for.inc106.us.1: ; preds = %if.end.us.1, %for.inc106.us %ans.2.us.1 = phi i32 [ %ans.2.us, %for.inc106.us ], [ %add105.us.1, %if.end.us.1 ] %indvars.iv.next188.1 = add nuw nsw i64 %indvars.iv187, 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.cond89.for.cond.cleanup91_crit_edge.us.unr-lcssa, label %for.body92.us, !llvm.loop !17 for.cond89.for.cond.cleanup91_crit_edge.us.unr-lcssa: ; preds = %for.inc106.us.1, %for.cond89.preheader.us %ans.2.us.lcssa.ph = phi i32 [ undef, %for.cond89.preheader.us ], [ %ans.2.us.1, %for.inc106.us.1 ] %indvars.iv187.unr = phi i64 [ 0, %for.cond89.preheader.us ], [ %indvars.iv.next188.1, %for.inc106.us.1 ] %ans.1156.us.unr = phi i32 [ %ans.0160.us, %for.cond89.preheader.us ], [ %ans.2.us.1, %for.inc106.us.1 ] br i1 %lcmp.mod.not, label %for.cond89.for.cond.cleanup91_crit_edge.us, label %for.body92.us.epil for.body92.us.epil: ; preds = %for.cond89.for.cond.cleanup91_crit_edge.us.unr-lcssa %arrayidx96.us.epil = getelementptr inbounds [201 x [201 x i32]], ptr %A, i64 0, i64 %indvars.iv191, i64 %indvars.iv187.unr %16 = load i32, ptr %arrayidx96.us.epil, align 4, !tbaa !5 %cmp97.us.epil = icmp eq i32 %16, -1 br i1 %cmp97.us.epil, label %for.cond89.for.cond.cleanup91_crit_edge.us, label %if.end.us.epil if.end.us.epil: ; preds = %for.body92.us.epil %idxprom102.us.epil = sext i32 %16 to i64 %arrayidx104.us.epil = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %idxprom102.us.epil, i64 1 %17 = load i32, ptr %arrayidx104.us.epil, align 4, !tbaa !5 %add105.us.epil = add nsw i32 %17, %ans.1156.us.unr br label %for.cond89.for.cond.cleanup91_crit_edge.us for.cond89.for.cond.cleanup91_crit_edge.us: ; preds = %for.body92.us.epil, %if.end.us.epil, %for.cond89.for.cond.cleanup91_crit_edge.us.unr-lcssa %ans.2.us.lcssa = phi i32 [ %ans.2.us.lcssa.ph, %for.cond89.for.cond.cleanup91_crit_edge.us.unr-lcssa ], [ %ans.1156.us.unr, %for.body92.us.epil ], [ %add105.us.epil, %if.end.us.epil ] %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1 %exitcond195.not = icmp eq i64 %indvars.iv.next192, %wide.trip.count194 br i1 %exitcond195.not, label %for.cond.cleanup86, label %for.cond89.preheader.us, !llvm.loop !18 for.cond40.preheader: ; preds = %for.cond35.preheader, %for.cond40.preheader %indvars.iv179 = phi i64 [ 0, %for.cond35.preheader ], [ %indvars.iv.next180, %for.cond40.preheader ] %arrayidx51 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 %indvars.iv183 %arrayidx47 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 0 %18 = load i32, ptr %arrayidx47, align 8, !tbaa !5 %19 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %20 = load i32, ptr %arrayidx55, align 8, !tbaa !5 %add = add nsw i32 %20, %19 %.add = call i32 @llvm.smin.i32(i32 %18, i32 %add) store i32 %.add, ptr %arrayidx47, align 8, !tbaa !5 %arrayidx47.1 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 1 %21 = load i32, ptr %arrayidx47.1, align 4, !tbaa !5 %22 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %23 = load i32, ptr %arrayidx55.1, align 4, !tbaa !5 %add.1 = add nsw i32 %23, %22 %.add.1 = call i32 @llvm.smin.i32(i32 %21, i32 %add.1) store i32 %.add.1, ptr %arrayidx47.1, align 4, !tbaa !5 %arrayidx47.2 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 2 %24 = load i32, ptr %arrayidx47.2, align 8, !tbaa !5 %25 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %26 = load i32, ptr %arrayidx55.2, align 8, !tbaa !5 %add.2 = add nsw i32 %26, %25 %.add.2 = call i32 @llvm.smin.i32(i32 %24, i32 %add.2) store i32 %.add.2, ptr %arrayidx47.2, align 8, !tbaa !5 %arrayidx47.3 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 3 %27 = load i32, ptr %arrayidx47.3, align 4, !tbaa !5 %28 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %29 = load i32, ptr %arrayidx55.3, align 4, !tbaa !5 %add.3 = add nsw i32 %29, %28 %.add.3 = call i32 @llvm.smin.i32(i32 %27, i32 %add.3) store i32 %.add.3, ptr %arrayidx47.3, align 4, !tbaa !5 %arrayidx47.4 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 4 %30 = load i32, ptr %arrayidx47.4, align 8, !tbaa !5 %31 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %32 = load i32, ptr %arrayidx55.4, align 8, !tbaa !5 %add.4 = add nsw i32 %32, %31 %.add.4 = call i32 @llvm.smin.i32(i32 %30, i32 %add.4) store i32 %.add.4, ptr %arrayidx47.4, align 8, !tbaa !5 %arrayidx47.5 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 5 %33 = load i32, ptr %arrayidx47.5, align 4, !tbaa !5 %34 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %35 = load i32, ptr %arrayidx55.5, align 4, !tbaa !5 %add.5 = add nsw i32 %35, %34 %.add.5 = call i32 @llvm.smin.i32(i32 %33, i32 %add.5) store i32 %.add.5, ptr %arrayidx47.5, align 4, !tbaa !5 %arrayidx47.6 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 6 %36 = load i32, ptr %arrayidx47.6, align 8, !tbaa !5 %37 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %38 = load i32, ptr %arrayidx55.6, align 8, !tbaa !5 %add.6 = add nsw i32 %38, %37 %.add.6 = call i32 @llvm.smin.i32(i32 %36, i32 %add.6) store i32 %.add.6, ptr %arrayidx47.6, align 8, !tbaa !5 %arrayidx47.7 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 7 %39 = load i32, ptr %arrayidx47.7, align 4, !tbaa !5 %40 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %41 = load i32, ptr %arrayidx55.7, align 4, !tbaa !5 %add.7 = add nsw i32 %41, %40 %.add.7 = call i32 @llvm.smin.i32(i32 %39, i32 %add.7) store i32 %.add.7, ptr %arrayidx47.7, align 4, !tbaa !5 %arrayidx47.8 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 8 %42 = load i32, ptr %arrayidx47.8, align 8, !tbaa !5 %43 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %44 = load i32, ptr %arrayidx55.8, align 8, !tbaa !5 %add.8 = add nsw i32 %44, %43 %.add.8 = call i32 @llvm.smin.i32(i32 %42, i32 %add.8) store i32 %.add.8, ptr %arrayidx47.8, align 8, !tbaa !5 %arrayidx47.9 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv179, i64 9 %45 = load i32, ptr %arrayidx47.9, align 4, !tbaa !5 %46 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %47 = load i32, ptr %arrayidx55.9, align 4, !tbaa !5 %add.9 = add nsw i32 %47, %46 %.add.9 = call i32 @llvm.smin.i32(i32 %45, i32 %add.9) store i32 %.add.9, ptr %arrayidx47.9, align 4, !tbaa !5 %indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1 %exitcond182.not = icmp eq i64 %indvars.iv.next180, 10 br i1 %exitcond182.not, label %for.cond.cleanup37, label %for.cond40.preheader, !llvm.loop !19 for.cond.cleanup37: ; preds = %for.cond40.preheader %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1 %exitcond186.not = icmp eq i64 %indvars.iv.next184, 10 br i1 %exitcond186.not, label %for.cond84.preheader, label %for.cond35.preheader, !llvm.loop !20 for.cond.cleanup86: ; preds = %for.cond89.for.cond.cleanup91_crit_edge.us, %for.cond89.preheader.lr.ph, %for.cond84.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond84.preheader ], [ 0, %for.cond89.preheader.lr.ph ], [ %ans.2.us.lcssa, %for.cond89.for.cond.cleanup91_crit_edge.us ] %call112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 161604, ptr nonnull %A) #8 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %c) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #8 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #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 = { 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 #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind willreturn memory(read) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"any pointer", !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} !17 = distinct !{!17, !13} !18 = distinct !{!18, !13} !19 = distinct !{!19, !13} !20 = distinct !{!20, !13}
#include <stdio.h> #define N 10 #define M 200 void minCost(int w[][N], int m[][N]){ int i, j, k, D; int pre[N][N]; for (i = 0; i < N; i++){ for (j = 0; j < N; j++){ m[i][j] = w[i][j]; pre[i][j] = i; } } for (k = 0; k < N; k++){ for (i = 0; i < N; i++){ for (j = 0; j < N; j++){ D = m[i][k] +m[k][j]; if (D < m[i][j]){ m[i][j] = D; pre[i][j] = pre[k][j]; } } } } } int main(void){ int H, W; scanf("%d%d", &H, &W); int c[N][N], A[M][M]; int i, j; //printf("cij>>\n"); for (i = 0; i < N; i++){ //printf("%d: ", i); for (j = 0; j < N; j++){ scanf("%d", &c[i][j]); } } //printf("Aij>>\n"); for (i = 0; i < H; i++){ //printf("%d: ", i); for (j = 0; j < W; j++){ scanf("%d", &A[i][j]); } } int minM[N][N]; minCost(c, minM); int res = 0; for (i = 0; i < H; i++){ for (j = 0; j < W; j++){ if (A[i][j] == -1) res += 0; else res += minM[A[i][j]][1]; } } printf("%d\n", res); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111451/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111451/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @minCost(ptr nocapture noundef readonly %w, ptr nocapture noundef %m) local_unnamed_addr #0 { entry: %pre = alloca [10 x [10 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %pre) #4 br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.preheader %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [10 x i32], ptr %w, i64 %indvars.iv, i64 0 %0 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %arrayidx9 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv, i64 0 store i32 %0, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx13 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv, i64 0 %1 = trunc i64 %indvars.iv to i32 %arrayidx5.1 = getelementptr inbounds [10 x i32], ptr %w, i64 %indvars.iv, i64 1 %2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %arrayidx9.1 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv, i64 1 store i32 %2, ptr %arrayidx9.1, align 4, !tbaa !5 %arrayidx5.2 = getelementptr inbounds [10 x i32], ptr %w, i64 %indvars.iv, i64 2 %3 = load i32, ptr %arrayidx5.2, align 4, !tbaa !5 %arrayidx9.2 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv, i64 2 store i32 %3, ptr %arrayidx9.2, align 4, !tbaa !5 %arrayidx5.3 = getelementptr inbounds [10 x i32], ptr %w, i64 %indvars.iv, i64 3 %4 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %arrayidx9.3 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv, i64 3 store i32 %4, ptr %arrayidx9.3, align 4, !tbaa !5 %5 = insertelement <4 x i32> poison, i32 %1, i64 0 %6 = shufflevector <4 x i32> %5, <4 x i32> poison, <4 x i32> zeroinitializer store <4 x i32> %6, ptr %arrayidx13, align 8, !tbaa !5 %arrayidx5.4 = getelementptr inbounds [10 x i32], ptr %w, i64 %indvars.iv, i64 4 %7 = load i32, ptr %arrayidx5.4, align 4, !tbaa !5 %arrayidx9.4 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv, i64 4 store i32 %7, ptr %arrayidx9.4, align 4, !tbaa !5 %arrayidx13.4 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv, i64 4 %arrayidx5.5 = getelementptr inbounds [10 x i32], ptr %w, i64 %indvars.iv, i64 5 %8 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 %arrayidx9.5 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv, i64 5 store i32 %8, ptr %arrayidx9.5, align 4, !tbaa !5 %arrayidx5.6 = getelementptr inbounds [10 x i32], ptr %w, i64 %indvars.iv, i64 6 %9 = load i32, ptr %arrayidx5.6, align 4, !tbaa !5 %arrayidx9.6 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv, i64 6 store i32 %9, ptr %arrayidx9.6, align 4, !tbaa !5 %arrayidx5.7 = getelementptr inbounds [10 x i32], ptr %w, i64 %indvars.iv, i64 7 %10 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5 %arrayidx9.7 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv, i64 7 store i32 %10, ptr %arrayidx9.7, align 4, !tbaa !5 store <4 x i32> %6, ptr %arrayidx13.4, align 8, !tbaa !5 %arrayidx5.8 = getelementptr inbounds [10 x i32], ptr %w, i64 %indvars.iv, i64 8 %11 = load i32, ptr %arrayidx5.8, align 4, !tbaa !5 %arrayidx9.8 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv, i64 8 store i32 %11, ptr %arrayidx9.8, align 4, !tbaa !5 %arrayidx13.8 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv, i64 8 store i32 %1, ptr %arrayidx13.8, align 8, !tbaa !5 %arrayidx5.9 = getelementptr inbounds [10 x i32], ptr %w, i64 %indvars.iv, i64 9 %12 = load i32, ptr %arrayidx5.9, align 4, !tbaa !5 %arrayidx9.9 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv, i64 9 store i32 %12, ptr %arrayidx9.9, align 4, !tbaa !5 %arrayidx13.9 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv, i64 9 store i32 %1, ptr %arrayidx13.9, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 10 br i1 %exitcond.not, label %for.cond20.preheader, label %for.cond1.preheader, !llvm.loop !9 for.cond20.preheader: ; preds = %for.cond1.preheader, %for.inc57 %indvars.iv107 = phi i64 [ %indvars.iv.next108, %for.inc57 ], [ 0, %for.cond1.preheader ] %arrayidx33 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv107, i64 0 %arrayidx46 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv107, i64 0 %arrayidx33.1 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv107, i64 1 %arrayidx46.1 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv107, i64 1 %arrayidx33.2 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv107, i64 2 %arrayidx46.2 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv107, i64 2 %arrayidx33.3 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv107, i64 3 %arrayidx46.3 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv107, i64 3 %arrayidx33.4 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv107, i64 4 %arrayidx46.4 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv107, i64 4 %arrayidx33.5 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv107, i64 5 %arrayidx46.5 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv107, i64 5 %arrayidx33.6 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv107, i64 6 %arrayidx46.6 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv107, i64 6 %arrayidx33.7 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv107, i64 7 %arrayidx46.7 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv107, i64 7 %arrayidx33.8 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv107, i64 8 %arrayidx46.8 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv107, i64 8 %arrayidx33.9 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv107, i64 9 %arrayidx46.9 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv107, i64 9 br label %for.cond23.preheader for.cond23.preheader: ; preds = %for.cond20.preheader, %for.inc51.9 %indvars.iv103 = phi i64 [ 0, %for.cond20.preheader ], [ %indvars.iv.next104, %for.inc51.9 ] %arrayidx29 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 %indvars.iv107 %13 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %14 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %add = add nsw i32 %14, %13 %arrayidx37 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 0 %15 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %cmp38 = icmp slt i32 %add, %15 br i1 %cmp38, label %if.then, label %for.inc51 if.then: ; preds = %for.cond23.preheader store i32 %add, ptr %arrayidx37, align 4, !tbaa !5 %16 = load i32, ptr %arrayidx46, align 8, !tbaa !5 %arrayidx50 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv103, i64 0 store i32 %16, ptr %arrayidx50, align 8, !tbaa !5 %.pre = load i32, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc51 for.inc51: ; preds = %for.cond23.preheader, %if.then %17 = phi i32 [ %13, %for.cond23.preheader ], [ %.pre, %if.then ] %18 = load i32, ptr %arrayidx33.1, align 4, !tbaa !5 %add.1 = add nsw i32 %18, %17 %arrayidx37.1 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 1 %19 = load i32, ptr %arrayidx37.1, align 4, !tbaa !5 %cmp38.1 = icmp slt i32 %add.1, %19 br i1 %cmp38.1, label %if.then.1, label %for.inc51.1 if.then.1: ; preds = %for.inc51 store i32 %add.1, ptr %arrayidx37.1, align 4, !tbaa !5 %20 = load i32, ptr %arrayidx46.1, align 4, !tbaa !5 %arrayidx50.1 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv103, i64 1 store i32 %20, ptr %arrayidx50.1, align 4, !tbaa !5 %.pre111 = load i32, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc51.1 for.inc51.1: ; preds = %if.then.1, %for.inc51 %21 = phi i32 [ %.pre111, %if.then.1 ], [ %17, %for.inc51 ] %22 = load i32, ptr %arrayidx33.2, align 4, !tbaa !5 %add.2 = add nsw i32 %22, %21 %arrayidx37.2 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 2 %23 = load i32, ptr %arrayidx37.2, align 4, !tbaa !5 %cmp38.2 = icmp slt i32 %add.2, %23 br i1 %cmp38.2, label %if.then.2, label %for.inc51.2 if.then.2: ; preds = %for.inc51.1 store i32 %add.2, ptr %arrayidx37.2, align 4, !tbaa !5 %24 = load i32, ptr %arrayidx46.2, align 8, !tbaa !5 %arrayidx50.2 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv103, i64 2 store i32 %24, ptr %arrayidx50.2, align 8, !tbaa !5 %.pre112 = load i32, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc51.2 for.inc51.2: ; preds = %if.then.2, %for.inc51.1 %25 = phi i32 [ %.pre112, %if.then.2 ], [ %21, %for.inc51.1 ] %26 = load i32, ptr %arrayidx33.3, align 4, !tbaa !5 %add.3 = add nsw i32 %26, %25 %arrayidx37.3 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 3 %27 = load i32, ptr %arrayidx37.3, align 4, !tbaa !5 %cmp38.3 = icmp slt i32 %add.3, %27 br i1 %cmp38.3, label %if.then.3, label %for.inc51.3 if.then.3: ; preds = %for.inc51.2 store i32 %add.3, ptr %arrayidx37.3, align 4, !tbaa !5 %28 = load i32, ptr %arrayidx46.3, align 4, !tbaa !5 %arrayidx50.3 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv103, i64 3 store i32 %28, ptr %arrayidx50.3, align 4, !tbaa !5 %.pre113 = load i32, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc51.3 for.inc51.3: ; preds = %if.then.3, %for.inc51.2 %29 = phi i32 [ %.pre113, %if.then.3 ], [ %25, %for.inc51.2 ] %30 = load i32, ptr %arrayidx33.4, align 4, !tbaa !5 %add.4 = add nsw i32 %30, %29 %arrayidx37.4 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 4 %31 = load i32, ptr %arrayidx37.4, align 4, !tbaa !5 %cmp38.4 = icmp slt i32 %add.4, %31 br i1 %cmp38.4, label %if.then.4, label %for.inc51.4 if.then.4: ; preds = %for.inc51.3 store i32 %add.4, ptr %arrayidx37.4, align 4, !tbaa !5 %32 = load i32, ptr %arrayidx46.4, align 8, !tbaa !5 %arrayidx50.4 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv103, i64 4 store i32 %32, ptr %arrayidx50.4, align 8, !tbaa !5 %.pre114 = load i32, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc51.4 for.inc51.4: ; preds = %if.then.4, %for.inc51.3 %33 = phi i32 [ %.pre114, %if.then.4 ], [ %29, %for.inc51.3 ] %34 = load i32, ptr %arrayidx33.5, align 4, !tbaa !5 %add.5 = add nsw i32 %34, %33 %arrayidx37.5 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 5 %35 = load i32, ptr %arrayidx37.5, align 4, !tbaa !5 %cmp38.5 = icmp slt i32 %add.5, %35 br i1 %cmp38.5, label %if.then.5, label %for.inc51.5 if.then.5: ; preds = %for.inc51.4 store i32 %add.5, ptr %arrayidx37.5, align 4, !tbaa !5 %36 = load i32, ptr %arrayidx46.5, align 4, !tbaa !5 %arrayidx50.5 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv103, i64 5 store i32 %36, ptr %arrayidx50.5, align 4, !tbaa !5 %.pre115 = load i32, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc51.5 for.inc51.5: ; preds = %if.then.5, %for.inc51.4 %37 = phi i32 [ %.pre115, %if.then.5 ], [ %33, %for.inc51.4 ] %38 = load i32, ptr %arrayidx33.6, align 4, !tbaa !5 %add.6 = add nsw i32 %38, %37 %arrayidx37.6 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 6 %39 = load i32, ptr %arrayidx37.6, align 4, !tbaa !5 %cmp38.6 = icmp slt i32 %add.6, %39 br i1 %cmp38.6, label %if.then.6, label %for.inc51.6 if.then.6: ; preds = %for.inc51.5 store i32 %add.6, ptr %arrayidx37.6, align 4, !tbaa !5 %40 = load i32, ptr %arrayidx46.6, align 8, !tbaa !5 %arrayidx50.6 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv103, i64 6 store i32 %40, ptr %arrayidx50.6, align 8, !tbaa !5 %.pre116 = load i32, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc51.6 for.inc51.6: ; preds = %if.then.6, %for.inc51.5 %41 = phi i32 [ %.pre116, %if.then.6 ], [ %37, %for.inc51.5 ] %42 = load i32, ptr %arrayidx33.7, align 4, !tbaa !5 %add.7 = add nsw i32 %42, %41 %arrayidx37.7 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 7 %43 = load i32, ptr %arrayidx37.7, align 4, !tbaa !5 %cmp38.7 = icmp slt i32 %add.7, %43 br i1 %cmp38.7, label %if.then.7, label %for.inc51.7 if.then.7: ; preds = %for.inc51.6 store i32 %add.7, ptr %arrayidx37.7, align 4, !tbaa !5 %44 = load i32, ptr %arrayidx46.7, align 4, !tbaa !5 %arrayidx50.7 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv103, i64 7 store i32 %44, ptr %arrayidx50.7, align 4, !tbaa !5 %.pre117 = load i32, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc51.7 for.inc51.7: ; preds = %if.then.7, %for.inc51.6 %45 = phi i32 [ %.pre117, %if.then.7 ], [ %41, %for.inc51.6 ] %46 = load i32, ptr %arrayidx33.8, align 4, !tbaa !5 %add.8 = add nsw i32 %46, %45 %arrayidx37.8 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 8 %47 = load i32, ptr %arrayidx37.8, align 4, !tbaa !5 %cmp38.8 = icmp slt i32 %add.8, %47 br i1 %cmp38.8, label %if.then.8, label %for.inc51.8 if.then.8: ; preds = %for.inc51.7 store i32 %add.8, ptr %arrayidx37.8, align 4, !tbaa !5 %48 = load i32, ptr %arrayidx46.8, align 8, !tbaa !5 %arrayidx50.8 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv103, i64 8 store i32 %48, ptr %arrayidx50.8, align 8, !tbaa !5 %.pre118 = load i32, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc51.8 for.inc51.8: ; preds = %if.then.8, %for.inc51.7 %49 = phi i32 [ %.pre118, %if.then.8 ], [ %45, %for.inc51.7 ] %50 = load i32, ptr %arrayidx33.9, align 4, !tbaa !5 %add.9 = add nsw i32 %50, %49 %arrayidx37.9 = getelementptr inbounds [10 x i32], ptr %m, i64 %indvars.iv103, i64 9 %51 = load i32, ptr %arrayidx37.9, align 4, !tbaa !5 %cmp38.9 = icmp slt i32 %add.9, %51 br i1 %cmp38.9, label %if.then.9, label %for.inc51.9 if.then.9: ; preds = %for.inc51.8 store i32 %add.9, ptr %arrayidx37.9, align 4, !tbaa !5 %52 = load i32, ptr %arrayidx46.9, align 4, !tbaa !5 %arrayidx50.9 = getelementptr inbounds [10 x [10 x i32]], ptr %pre, i64 0, i64 %indvars.iv103, i64 9 store i32 %52, ptr %arrayidx50.9, align 4, !tbaa !5 br label %for.inc51.9 for.inc51.9: ; preds = %if.then.9, %for.inc51.8 %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1 %exitcond106.not = icmp eq i64 %indvars.iv.next104, 10 br i1 %exitcond106.not, label %for.inc57, label %for.cond23.preheader, !llvm.loop !11 for.inc57: ; preds = %for.inc51.9 %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1 %exitcond110.not = icmp eq i64 %indvars.iv.next108, 10 br i1 %exitcond110.not, label %for.end59, label %for.cond20.preheader, !llvm.loop !12 for.end59: ; preds = %for.inc57 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %pre) #4 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 %c = alloca [10 x [10 x i32]], align 16 %A = alloca [200 x [200 x i32]], align 16 %minM = alloca [10 x [10 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 160000, ptr nonnull %A) #4 br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.preheader %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 0 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %arrayidx5.1 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 1 %call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.1) %arrayidx5.2 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 2 %call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.2) %arrayidx5.3 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 3 %call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.3) %arrayidx5.4 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 4 %call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.4) %arrayidx5.5 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 5 %call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.5) %arrayidx5.6 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 6 %call6.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.6) %arrayidx5.7 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 7 %call6.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.7) %arrayidx5.8 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 8 %call6.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.8) %arrayidx5.9 = getelementptr inbounds [10 x [10 x i32]], ptr %c, i64 0, i64 %indvars.iv, i64 9 %call6.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.9) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 10 br i1 %exitcond.not, label %for.cond10.preheader, label %for.cond1.preheader, !llvm.loop !13 for.cond10.preheader: ; preds = %for.cond1.preheader %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp1178 = icmp sgt i32 %0, 0 br i1 %cmp1178, label %for.cond13.preheader.lr.ph, label %for.end26.thread112 for.end26.thread112: ; preds = %for.cond10.preheader call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %minM) #4 br label %for.end52.sink.split for.cond13.preheader.lr.ph: ; preds = %for.cond10.preheader %1 = load i32, ptr %W, align 4, !tbaa !5 %2 = icmp sgt i32 %1, 0 br i1 %2, label %for.cond13.preheader, label %for.cond31.preheader.lr.ph.thread for.cond31.preheader.lr.ph.thread: ; preds = %for.cond13.preheader.lr.ph call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %minM) #4 br label %for.end52.sink.split for.cond13.preheader: ; preds = %for.cond13.preheader.lr.ph, %for.inc24 %3 = phi i32 [ %7, %for.inc24 ], [ %0, %for.cond13.preheader.lr.ph ] %4 = phi i32 [ %8, %for.inc24 ], [ %1, %for.cond13.preheader.lr.ph ] %indvars.iv97 = phi i64 [ %indvars.iv.next98, %for.inc24 ], [ 0, %for.cond13.preheader.lr.ph ] %cmp1476 = icmp sgt i32 %4, 0 br i1 %cmp1476, label %for.body15, label %for.inc24 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [200 x [200 x i32]], ptr %A, i64 0, i64 %indvars.iv97, i64 %indvars.iv94 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %5 = load i32, ptr %W, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp14 = icmp slt i64 %indvars.iv.next95, %6 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !14 for.inc24.loopexit: ; preds = %for.body15 %.pre = load i32, ptr %H, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %7 = phi i32 [ %.pre, %for.inc24.loopexit ], [ %3, %for.cond13.preheader ] %8 = phi i32 [ %5, %for.inc24.loopexit ], [ %4, %for.cond13.preheader ] %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1 %9 = sext i32 %7 to i64 %cmp11 = icmp slt i64 %indvars.iv.next98, %9 br i1 %cmp11, label %for.cond13.preheader, label %for.end26, !llvm.loop !15 for.end26: ; preds = %for.inc24 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %minM) #4 call void @minCost(ptr noundef nonnull %c, ptr noundef nonnull %minM) %cmp2984 = icmp sgt i32 %7, 0 br i1 %cmp2984, label %for.cond31.preheader.lr.ph, label %for.end52 for.cond31.preheader.lr.ph: ; preds = %for.end26 %.pr = load i32, ptr %W, align 4, !tbaa !5 %cmp3280 = icmp sgt i32 %.pr, 0 br i1 %cmp3280, label %for.cond31.preheader.us.preheader, label %for.end52 for.cond31.preheader.us.preheader: ; preds = %for.cond31.preheader.lr.ph %wide.trip.count107 = zext i32 %7 to i64 %wide.trip.count = zext i32 %.pr to i64 %xtraiter = and i64 %wide.trip.count, 1 %10 = icmp eq i32 %.pr, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond31.preheader.us for.cond31.preheader.us: ; preds = %for.cond31.preheader.us.preheader, %for.cond31.for.inc50_crit_edge.us %indvars.iv104 = phi i64 [ 0, %for.cond31.preheader.us.preheader ], [ %indvars.iv.next105, %for.cond31.for.inc50_crit_edge.us ] %res.086.us = phi i32 [ 0, %for.cond31.preheader.us.preheader ], [ %res.2.us.lcssa, %for.cond31.for.inc50_crit_edge.us ] br i1 %10, label %for.cond31.for.inc50_crit_edge.us.unr-lcssa, label %for.body33.us for.body33.us: ; preds = %for.cond31.preheader.us, %for.inc47.us.1 %indvars.iv100 = phi i64 [ %indvars.iv.next101.1, %for.inc47.us.1 ], [ 0, %for.cond31.preheader.us ] %res.182.us = phi i32 [ %res.2.us.1, %for.inc47.us.1 ], [ %res.086.us, %for.cond31.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc47.us.1 ], [ 0, %for.cond31.preheader.us ] %arrayidx37.us = getelementptr inbounds [200 x [200 x i32]], ptr %A, i64 0, i64 %indvars.iv104, i64 %indvars.iv100 %11 = load i32, ptr %arrayidx37.us, align 8, !tbaa !5 %cmp38.us = icmp eq i32 %11, -1 br i1 %cmp38.us, label %for.inc47.us, label %if.else.us if.else.us: ; preds = %for.body33.us %idxprom43.us = sext i32 %11 to i64 %arrayidx45.us = getelementptr inbounds [10 x [10 x i32]], ptr %minM, i64 0, i64 %idxprom43.us, i64 1 %12 = load i32, ptr %arrayidx45.us, align 4, !tbaa !5 %add46.us = add nsw i32 %12, %res.182.us br label %for.inc47.us for.inc47.us: ; preds = %if.else.us, %for.body33.us %res.2.us = phi i32 [ %add46.us, %if.else.us ], [ %res.182.us, %for.body33.us ] %indvars.iv.next101 = or i64 %indvars.iv100, 1 %arrayidx37.us.1 = getelementptr inbounds [200 x [200 x i32]], ptr %A, i64 0, i64 %indvars.iv104, i64 %indvars.iv.next101 %13 = load i32, ptr %arrayidx37.us.1, align 4, !tbaa !5 %cmp38.us.1 = icmp eq i32 %13, -1 br i1 %cmp38.us.1, label %for.inc47.us.1, label %if.else.us.1 if.else.us.1: ; preds = %for.inc47.us %idxprom43.us.1 = sext i32 %13 to i64 %arrayidx45.us.1 = getelementptr inbounds [10 x [10 x i32]], ptr %minM, i64 0, i64 %idxprom43.us.1, i64 1 %14 = load i32, ptr %arrayidx45.us.1, align 4, !tbaa !5 %add46.us.1 = add nsw i32 %14, %res.2.us br label %for.inc47.us.1 for.inc47.us.1: ; preds = %if.else.us.1, %for.inc47.us %res.2.us.1 = phi i32 [ %add46.us.1, %if.else.us.1 ], [ %res.2.us, %for.inc47.us ] %indvars.iv.next101.1 = add nuw nsw i64 %indvars.iv100, 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.cond31.for.inc50_crit_edge.us.unr-lcssa, label %for.body33.us, !llvm.loop !17 for.cond31.for.inc50_crit_edge.us.unr-lcssa: ; preds = %for.inc47.us.1, %for.cond31.preheader.us %res.2.us.lcssa.ph = phi i32 [ undef, %for.cond31.preheader.us ], [ %res.2.us.1, %for.inc47.us.1 ] %indvars.iv100.unr = phi i64 [ 0, %for.cond31.preheader.us ], [ %indvars.iv.next101.1, %for.inc47.us.1 ] %res.182.us.unr = phi i32 [ %res.086.us, %for.cond31.preheader.us ], [ %res.2.us.1, %for.inc47.us.1 ] br i1 %lcmp.mod.not, label %for.cond31.for.inc50_crit_edge.us, label %for.body33.us.epil for.body33.us.epil: ; preds = %for.cond31.for.inc50_crit_edge.us.unr-lcssa %arrayidx37.us.epil = getelementptr inbounds [200 x [200 x i32]], ptr %A, i64 0, i64 %indvars.iv104, i64 %indvars.iv100.unr %15 = load i32, ptr %arrayidx37.us.epil, align 4, !tbaa !5 %cmp38.us.epil = icmp eq i32 %15, -1 br i1 %cmp38.us.epil, label %for.cond31.for.inc50_crit_edge.us, label %if.else.us.epil if.else.us.epil: ; preds = %for.body33.us.epil %idxprom43.us.epil = sext i32 %15 to i64 %arrayidx45.us.epil = getelementptr inbounds [10 x [10 x i32]], ptr %minM, i64 0, i64 %idxprom43.us.epil, i64 1 %16 = load i32, ptr %arrayidx45.us.epil, align 4, !tbaa !5 %add46.us.epil = add nsw i32 %16, %res.182.us.unr br label %for.cond31.for.inc50_crit_edge.us for.cond31.for.inc50_crit_edge.us: ; preds = %for.body33.us.epil, %if.else.us.epil, %for.cond31.for.inc50_crit_edge.us.unr-lcssa %res.2.us.lcssa = phi i32 [ %res.2.us.lcssa.ph, %for.cond31.for.inc50_crit_edge.us.unr-lcssa ], [ %add46.us.epil, %if.else.us.epil ], [ %res.182.us.unr, %for.body33.us.epil ] %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %exitcond108.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count107 br i1 %exitcond108.not, label %for.end52, label %for.cond31.preheader.us, !llvm.loop !18 for.end52.sink.split: ; preds = %for.end26.thread112, %for.cond31.preheader.lr.ph.thread call void @minCost(ptr noundef nonnull %c, ptr noundef nonnull %minM) br label %for.end52 for.end52: ; preds = %for.cond31.for.inc50_crit_edge.us, %for.end52.sink.split, %for.cond31.preheader.lr.ph, %for.end26 %res.0.lcssa = phi i32 [ 0, %for.end26 ], [ 0, %for.cond31.preheader.lr.ph ], [ 0, %for.end52.sink.split ], [ %res.2.us.lcssa, %for.cond31.for.inc50_crit_edge.us ] %call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %res.0.lcssa) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %minM) #4 call void @llvm.lifetime.end.p0(i64 160000, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %c) #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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !16} !16 = !{!"llvm.loop.unswitch.partial.disable"} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include<stdio.h> int main(void){ int d,J,M,j,m,a,b,c,e,f; scanf("%d %d %d %d %d",&d,&J,&M,&j,&m); a=J/j; b=J%j; if(b!=0){ a=a+1; } c=M/m; e=M%m; if(e!=0){ c=c+1; } if(a<=c){ f=d-c; }else{ f=d-a; } printf("%d\n",f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111495/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111495/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%d %d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca i32, align 4 %J = alloca i32, align 4 %M = alloca i32, align 4 %j = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %J) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %J, ptr noundef nonnull %M, ptr noundef nonnull %j, ptr noundef nonnull %m) %0 = load i32, ptr %J, align 4, !tbaa !5 %1 = load i32, ptr %j, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %cmp.not = icmp ne i32 %rem, 0 %add = zext i1 %cmp.not to i32 %spec.select = add nsw i32 %div, %add %2 = load i32, ptr %M, align 4, !tbaa !5 %3 = load i32, ptr %m, align 4, !tbaa !5 %div1 = sdiv i32 %2, %3 %rem2 = srem i32 %2, %3 %cmp3.not = icmp ne i32 %rem2, 0 %add5 = zext i1 %cmp3.not to i32 %c.0 = add nsw i32 %div1, %add5 %4 = load i32, ptr %d, align 4 %f.0.v = call i32 @llvm.smax.i32(i32 %spec.select, i32 %c.0) %f.0 = sub nsw i32 %4, %f.0.v %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %f.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %J) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<math.h> int main() { int a, b, c, d, l, n, x, z; scanf("%d %d %d %d %d", &l, &a, &b, &c, &d); n = ceil((double)a / (double)c); x = ceil((double)b / (double)d); if(n >= x) { z = l - n; }else{ z = l - x; } printf("%d\n", z); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111538/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111538/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%d %d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %l = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i32, ptr %a, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %1 = load i32, ptr %c, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to double %div = fdiv double %conv, %conv1 %2 = call double @llvm.ceil.f64(double %div) %conv2 = fptosi double %2 to i32 %3 = load i32, ptr %b, align 4, !tbaa !5 %conv3 = sitofp i32 %3 to double %4 = load i32, ptr %d, align 4, !tbaa !5 %conv4 = sitofp i32 %4 to double %div5 = fdiv double %conv3, %conv4 %5 = call double @llvm.ceil.f64(double %div5) %conv6 = fptosi double %5 to i32 %6 = load i32, ptr %l, align 4 %z.0.v = call i32 @llvm.smax.i32(i32 %conv2, i32 %conv6) %z.0 = sub nsw i32 %6, %z.0.v %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %z.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 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 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.ceil.f64(double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int i,j,m; int data[10]; for(i=1;i<=5;i++){ scanf("%d",&data[i-1]); } j=data[1]/data[3]; if(data[1]%data[3]!=0){ j++; } m=data[2]/data[4]; if(data[2]%data[4]!=0){ m++; } if(j>=m){ printf("%d\n",data[0]-j); }else{ printf("%d\n",data[0]-m); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111581/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111581/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %data = alloca [10 x i32], align 16 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %data) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %data) %arrayidx.1 = getelementptr inbounds [10 x i32], ptr %data, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [10 x i32], ptr %data, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [10 x i32], ptr %data, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [10 x i32], ptr %data, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %0 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %cmp5.not = icmp ne i32 %rem, 0 %inc6 = zext i1 %cmp5.not to i32 %spec.select = add nsw i32 %div, %inc6 %2 = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %3 = load i32, ptr %arrayidx.4, align 16, !tbaa !5 %div9 = sdiv i32 %2, %3 %rem12 = srem i32 %2, %3 %cmp13.not = icmp ne i32 %rem12, 0 %inc15 = zext i1 %cmp13.not to i32 %m.0 = add nsw i32 %div9, %inc15 %4 = load i32, ptr %data, align 16, !tbaa !5 %m.0.spec.select = call i32 @llvm.smax.i32(i32 %spec.select, i32 %m.0) %sub23 = sub nsw i32 %4, %m.0.spec.select %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub23) call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %data) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b,c,d,e,i,j; scanf("%d%d%d%d%d",&a,&b,&c,&d,&e); for(i=0;;i++){ if(b<1&&c<1){ printf("%d\n",a); break; } a--; b=b-d; c=c-e; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111631/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111631/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %e = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e) %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %c.promoted = load i32, ptr %c, align 4 %cmp6 = icmp slt i32 %b.promoted, 1 %cmp17 = icmp slt i32 %c.promoted, 1 %or.cond8 = select i1 %cmp6, i1 %cmp17, i1 false %.pre = load i32, ptr %a, align 4, !tbaa !5 br i1 %or.cond8, label %if.then, label %if.end.lr.ph if.end.lr.ph: ; preds = %entry %0 = load i32, ptr %d, align 4, !tbaa !5 %1 = load i32, ptr %e, align 4, !tbaa !5 br label %if.end for.cond.if.then_crit_edge: ; preds = %if.end store i32 %dec, ptr %a, align 4, !tbaa !5 store i32 %sub, ptr %b, align 4, !tbaa !5 store i32 %sub3, ptr %c, align 4, !tbaa !5 br label %if.then if.then: ; preds = %entry, %for.cond.if.then_crit_edge %2 = phi i32 [ %dec, %for.cond.if.then_crit_edge ], [ %.pre, %entry ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 if.end: ; preds = %if.end.lr.ph, %if.end %sub410 = phi i32 [ %b.promoted, %if.end.lr.ph ], [ %sub, %if.end ] %3 = phi i32 [ %c.promoted, %if.end.lr.ph ], [ %sub3, %if.end ] %dec59 = phi i32 [ %.pre, %if.end.lr.ph ], [ %dec, %if.end ] %dec = add nsw i32 %dec59, -1 %sub = sub nsw i32 %sub410, %0 %sub3 = sub nsw i32 %3, %1 %cmp = icmp slt i32 %sub, 1 %cmp1 = icmp slt i32 %sub3, 1 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %for.cond.if.then_crit_edge, label %if.end } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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; while(scanf("%d",&x) != EOF){ int count=0; for(int i= 0; i<=9; i++){ for(int j = 0; j<= 9; j++){ for(int k = 0; k<=9; k++){ for(int l = 0; l<=9; l++){ if(i+j+k+l==x){ count++; } } } } } printf("%d\n",count); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111675/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111675/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %cmp.not46 = icmp eq i32 %call45, -1 br i1 %cmp.not46, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.cleanup %0 = load i32, ptr %x, align 4, !tbaa !5 %broadcast.splatinsert49 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat50 = shufflevector <4 x i32> %broadcast.splatinsert49, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond.preheader, %for.cond.cleanup4 %i.044 = phi i32 [ 0, %for.cond.preheader ], [ %inc25, %for.cond.cleanup4 ] %count.043 = phi i32 [ 0, %for.cond.preheader ], [ %123, %for.cond.cleanup4 ] br label %vector.ph for.cond.cleanup: ; preds = %for.cond.cleanup4 %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %123) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !9 vector.ph: ; preds = %vector.ph, %for.cond2.preheader %j.042 = phi i32 [ 0, %for.cond2.preheader ], [ %inc22, %vector.ph ] %count.141 = phi i32 [ %count.043, %for.cond2.preheader ], [ %123, %vector.ph ] %add = add nuw nsw i32 %j.042, %i.044 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.141, i64 0 %2 = add nuw nsw <4 x i32> %broadcast.splat, <i32 0, i32 1, i32 2, i32 3> %3 = icmp eq <4 x i32> %2, %broadcast.splat50 %4 = zext <4 x i1> %3 to <4 x i32> %5 = add <4 x i32> %1, %4 %6 = add nuw <4 x i32> %broadcast.splat, <i32 1, i32 2, i32 3, i32 4> %7 = icmp eq <4 x i32> %6, %broadcast.splat50 %8 = zext <4 x i1> %7 to <4 x i32> %9 = add <4 x i32> %5, %8 %10 = add nuw <4 x i32> %broadcast.splat, <i32 2, i32 3, i32 4, i32 5> %11 = icmp eq <4 x i32> %10, %broadcast.splat50 %12 = zext <4 x i1> %11 to <4 x i32> %13 = add <4 x i32> %9, %12 %14 = add nuw <4 x i32> %broadcast.splat, <i32 3, i32 4, i32 5, i32 6> %15 = icmp eq <4 x i32> %14, %broadcast.splat50 %16 = zext <4 x i1> %15 to <4 x i32> %17 = add <4 x i32> %13, %16 %18 = add nuw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %19 = icmp eq <4 x i32> %18, %broadcast.splat50 %20 = zext <4 x i1> %19 to <4 x i32> %21 = add <4 x i32> %17, %20 %22 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %23 = icmp eq <4 x i32> %22, %broadcast.splat50 %24 = zext <4 x i1> %23 to <4 x i32> %25 = add <4 x i32> %21, %24 %26 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %27 = icmp eq <4 x i32> %26, %broadcast.splat50 %28 = zext <4 x i1> %27 to <4 x i32> %29 = add <4 x i32> %25, %28 %30 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %31 = icmp eq <4 x i32> %30, %broadcast.splat50 %32 = zext <4 x i1> %31 to <4 x i32> %33 = add <4 x i32> %29, %32 %34 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %35 = icmp eq <4 x i32> %34, %broadcast.splat50 %36 = zext <4 x i1> %35 to <4 x i32> %37 = add <4 x i32> %33, %36 %38 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %39 = icmp eq <4 x i32> %38, %broadcast.splat50 %40 = zext <4 x i1> %39 to <4 x i32> %41 = add <4 x i32> %37, %40 %42 = add nuw nsw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %43 = icmp eq <4 x i32> %42, %broadcast.splat50 %44 = zext <4 x i1> %43 to <4 x i32> %45 = add <4 x i32> %41, %44 %46 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %47 = icmp eq <4 x i32> %46, %broadcast.splat50 %48 = zext <4 x i1> %47 to <4 x i32> %49 = add <4 x i32> %45, %48 %50 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %51 = icmp eq <4 x i32> %50, %broadcast.splat50 %52 = zext <4 x i1> %51 to <4 x i32> %53 = add <4 x i32> %49, %52 %54 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %55 = icmp eq <4 x i32> %54, %broadcast.splat50 %56 = zext <4 x i1> %55 to <4 x i32> %57 = add <4 x i32> %53, %56 %58 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %59 = icmp eq <4 x i32> %58, %broadcast.splat50 %60 = zext <4 x i1> %59 to <4 x i32> %61 = add <4 x i32> %57, %60 %62 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %63 = icmp eq <4 x i32> %62, %broadcast.splat50 %64 = zext <4 x i1> %63 to <4 x i32> %65 = add <4 x i32> %61, %64 %66 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %67 = icmp eq <4 x i32> %66, %broadcast.splat50 %68 = zext <4 x i1> %67 to <4 x i32> %69 = add <4 x i32> %65, %68 %70 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %71 = icmp eq <4 x i32> %70, %broadcast.splat50 %72 = zext <4 x i1> %71 to <4 x i32> %73 = add <4 x i32> %69, %72 %74 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %75 = icmp eq <4 x i32> %74, %broadcast.splat50 %76 = zext <4 x i1> %75 to <4 x i32> %77 = add <4 x i32> %73, %76 %78 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %79 = icmp eq <4 x i32> %78, %broadcast.splat50 %80 = zext <4 x i1> %79 to <4 x i32> %81 = add <4 x i32> %77, %80 %82 = add nuw nsw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %83 = icmp eq <4 x i32> %82, %broadcast.splat50 %84 = zext <4 x i1> %83 to <4 x i32> %85 = add <4 x i32> %81, %84 %86 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %87 = icmp eq <4 x i32> %86, %broadcast.splat50 %88 = zext <4 x i1> %87 to <4 x i32> %89 = add <4 x i32> %85, %88 %90 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %91 = icmp eq <4 x i32> %90, %broadcast.splat50 %92 = zext <4 x i1> %91 to <4 x i32> %93 = add <4 x i32> %89, %92 %94 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %95 = icmp eq <4 x i32> %94, %broadcast.splat50 %96 = zext <4 x i1> %95 to <4 x i32> %97 = add <4 x i32> %93, %96 %98 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %99 = icmp eq <4 x i32> %98, %broadcast.splat50 %100 = zext <4 x i1> %99 to <4 x i32> %101 = add <4 x i32> %97, %100 %102 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %103 = icmp eq <4 x i32> %102, %broadcast.splat50 %104 = zext <4 x i1> %103 to <4 x i32> %105 = add <4 x i32> %101, %104 %106 = add nuw <4 x i32> %broadcast.splat, <i32 14, i32 15, i32 16, i32 17> %107 = icmp eq <4 x i32> %106, %broadcast.splat50 %108 = zext <4 x i1> %107 to <4 x i32> %109 = add <4 x i32> %105, %108 %110 = add nuw <4 x i32> %broadcast.splat, <i32 15, i32 16, i32 17, i32 18> %111 = icmp eq <4 x i32> %110, %broadcast.splat50 %112 = zext <4 x i1> %111 to <4 x i32> %113 = add <4 x i32> %109, %112 %114 = add nuw <4 x i32> %broadcast.splat, <i32 16, i32 17, i32 18, i32 19> %115 = icmp eq <4 x i32> %114, %broadcast.splat50 %116 = zext <4 x i1> %115 to <4 x i32> %117 = add <4 x i32> %113, %116 %118 = add nuw <4 x i32> %broadcast.splat, <i32 17, i32 18, i32 19, i32 20> %119 = icmp eq <4 x i32> %118, %broadcast.splat50 %120 = zext <4 x i1> %119 to <4 x i32> %121 = add <4 x i32> %117, %120 %122 = shufflevector <4 x i32> %121, <4 x i32> %81, <4 x i32> <i32 0, i32 1, i32 6, i32 7> %123 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %122) %inc22 = add nuw nsw i32 %j.042, 1 %exitcond47.not = icmp eq i32 %inc22, 10 br i1 %exitcond47.not, label %for.cond.cleanup4, label %vector.ph, !llvm.loop !11 for.cond.cleanup4: ; preds = %vector.ph %inc25 = add nuw nsw i32 %i.044, 1 %exitcond48.not = icmp eq i32 %inc25, 10 br i1 %exitcond48.not, label %for.cond.cleanup, label %for.cond2.preheader, !llvm.loop !12 while.end: ; preds = %for.cond.cleanup, %entry 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void) { int a,b,c,d,i=0,j,n,trues[100]={0}; while(scanf("%d",&n)!=EOF) { for(a=0;a<10;a++) for(b=0;b<10;b++) for(c=0;c<10;c++) for(d=0;d<10;d++) if(n==a+b+c+d) trues[i]++; i++; } for(j=0;j<i;j++) printf("%d\n",trues[j]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111718/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111718/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %trues = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %trues) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %trues, i8 0, i64 400, i1 false) %call50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not51 = icmp eq i32 %call50, -1 br i1 %cmp.not51, label %for.end33, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end23 %indvars.iv = phi i64 [ %indvars.iv.next, %for.end23 ], [ 0, %entry ] %0 = load i32, ptr %n, align 4, !tbaa !5 %arrayidx = getelementptr inbounds [100 x i32], ptr %trues, i64 0, i64 %indvars.iv br label %for.cond2.preheader for.cond25.preheader: ; preds = %for.end23 %1 = and i64 %indvars.iv.next, 4294967295 %cmp2653.not = icmp eq i64 %1, 0 br i1 %cmp2653.not, label %for.end33, label %for.body27.preheader for.body27.preheader: ; preds = %for.cond25.preheader %wide.trip.count = and i64 %indvars.iv.next, 4294967295 br label %for.body27 for.cond2.preheader: ; preds = %for.cond.preheader, %for.inc21 %a.049 = phi i32 [ 0, %for.cond.preheader ], [ %inc22, %for.inc21 ] br label %for.cond5.preheader for.cond5.preheader: ; preds = %for.cond2.preheader, %for.inc18 %b.048 = phi i32 [ 0, %for.cond2.preheader ], [ %inc19, %for.inc18 ] %add = add nuw nsw i32 %b.048, %a.049 br label %for.cond8.preheader for.cond8.preheader: ; preds = %for.cond5.preheader, %for.inc.9 %c.047 = phi i32 [ 0, %for.cond5.preheader ], [ %inc16, %for.inc.9 ] %add11 = add nuw nsw i32 %add, %c.047 %cmp13 = icmp eq i32 %0, %add11 br i1 %cmp13, label %if.then, label %for.inc if.then: ; preds = %for.cond8.preheader %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.cond8.preheader, %if.then %add12.1 = add nuw nsw i32 %add11, 1 %cmp13.1 = icmp eq i32 %0, %add12.1 br i1 %cmp13.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.1 = add nsw i32 %3, 1 store i32 %inc.1, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %add12.2 = add nuw nsw i32 %add11, 2 %cmp13.2 = icmp eq i32 %0, %add12.2 br i1 %cmp13.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.2 = add nsw i32 %4, 1 store i32 %inc.2, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %add12.3 = add nuw nsw i32 %add11, 3 %cmp13.3 = icmp eq i32 %0, %add12.3 br i1 %cmp13.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.inc.2 %5 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.3 = add nsw i32 %5, 1 store i32 %inc.3, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.inc.2 %add12.4 = add nuw nsw i32 %add11, 4 %cmp13.4 = icmp eq i32 %0, %add12.4 br i1 %cmp13.4, label %if.then.4, label %for.inc.4 if.then.4: ; preds = %for.inc.3 %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.4 = add nsw i32 %6, 1 store i32 %inc.4, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.inc.3 %add12.5 = add nuw nsw i32 %add11, 5 %cmp13.5 = icmp eq i32 %0, %add12.5 br i1 %cmp13.5, label %if.then.5, label %for.inc.5 if.then.5: ; preds = %for.inc.4 %7 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.5 = add nsw i32 %7, 1 store i32 %inc.5, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.inc.4 %add12.6 = add nuw nsw i32 %add11, 6 %cmp13.6 = icmp eq i32 %0, %add12.6 br i1 %cmp13.6, label %if.then.6, label %for.inc.6 if.then.6: ; preds = %for.inc.5 %8 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.6 = add nsw i32 %8, 1 store i32 %inc.6, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.6 for.inc.6: ; preds = %if.then.6, %for.inc.5 %add12.7 = add nuw nsw i32 %add11, 7 %cmp13.7 = icmp eq i32 %0, %add12.7 br i1 %cmp13.7, label %if.then.7, label %for.inc.7 if.then.7: ; preds = %for.inc.6 %9 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.7 = add nsw i32 %9, 1 store i32 %inc.7, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.7 for.inc.7: ; preds = %if.then.7, %for.inc.6 %add12.8 = add nuw nsw i32 %add11, 8 %cmp13.8 = icmp eq i32 %0, %add12.8 br i1 %cmp13.8, label %if.then.8, label %for.inc.8 if.then.8: ; preds = %for.inc.7 %10 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.8 = add nsw i32 %10, 1 store i32 %inc.8, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.8 for.inc.8: ; preds = %if.then.8, %for.inc.7 %add12.9 = add nuw nsw i32 %add11, 9 %cmp13.9 = icmp eq i32 %0, %add12.9 br i1 %cmp13.9, label %if.then.9, label %for.inc.9 if.then.9: ; preds = %for.inc.8 %11 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.9 = add nsw i32 %11, 1 store i32 %inc.9, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.9 for.inc.9: ; preds = %if.then.9, %for.inc.8 %inc16 = add nuw nsw i32 %c.047, 1 %exitcond.not = icmp eq i32 %inc16, 10 br i1 %exitcond.not, label %for.inc18, label %for.cond8.preheader, !llvm.loop !9 for.inc18: ; preds = %for.inc.9 %inc19 = add nuw nsw i32 %b.048, 1 %exitcond55.not = icmp eq i32 %inc19, 10 br i1 %exitcond55.not, label %for.inc21, label %for.cond5.preheader, !llvm.loop !11 for.inc21: ; preds = %for.inc18 %inc22 = add nuw nsw i32 %a.049, 1 %exitcond56.not = icmp eq i32 %inc22, 10 br i1 %exitcond56.not, label %for.end23, label %for.cond2.preheader, !llvm.loop !12 for.end23: ; preds = %for.inc21 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond25.preheader, label %for.cond.preheader, !llvm.loop !13 for.body27: ; preds = %for.body27.preheader, %for.body27 %indvars.iv58 = phi i64 [ 0, %for.body27.preheader ], [ %indvars.iv.next59, %for.body27 ] %arrayidx29 = getelementptr inbounds [100 x i32], ptr %trues, i64 0, i64 %indvars.iv58 %12 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12) %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %exitcond61.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count br i1 %exitcond61.not, label %for.end33, label %for.body27, !llvm.loop !14 for.end33: ; preds = %for.body27, %entry, %for.cond25.preheader call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %trues) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = 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> int main(void) { int i, n, a, b, c, d; while (scanf("%d", &n) != EOF) { i = 0; for (a = 0; a<10; a++) for (b = 0; b<10; b++) for (c = 0; c<10; c++) for (d = 0; d<10; d++) if (a + b + c + d == n)i++; printf("%d\n", i); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111769/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111769/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not43 = icmp eq i32 %call42, -1 br i1 %cmp.not43, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end23 %0 = load i32, ptr %n, align 4, !tbaa !5 %broadcast.splatinsert46 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat47 = shufflevector <4 x i32> %broadcast.splatinsert46, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond.preheader, %for.inc21 %a.041 = phi i32 [ 0, %for.cond.preheader ], [ %inc22, %for.inc21 ] %i.040 = phi i32 [ 0, %for.cond.preheader ], [ %123, %for.inc21 ] br label %vector.ph vector.ph: ; preds = %vector.ph, %for.cond2.preheader %b.039 = phi i32 [ 0, %for.cond2.preheader ], [ %inc19, %vector.ph ] %i.138 = phi i32 [ %i.040, %for.cond2.preheader ], [ %123, %vector.ph ] %add = add nuw nsw i32 %b.039, %a.041 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %i.138, i64 0 %2 = add nuw nsw <4 x i32> %broadcast.splat, <i32 0, i32 1, i32 2, i32 3> %3 = icmp eq <4 x i32> %2, %broadcast.splat47 %4 = zext <4 x i1> %3 to <4 x i32> %5 = add <4 x i32> %1, %4 %6 = add nuw <4 x i32> %broadcast.splat, <i32 1, i32 2, i32 3, i32 4> %7 = icmp eq <4 x i32> %6, %broadcast.splat47 %8 = zext <4 x i1> %7 to <4 x i32> %9 = add <4 x i32> %5, %8 %10 = add nuw <4 x i32> %broadcast.splat, <i32 2, i32 3, i32 4, i32 5> %11 = icmp eq <4 x i32> %10, %broadcast.splat47 %12 = zext <4 x i1> %11 to <4 x i32> %13 = add <4 x i32> %9, %12 %14 = add nuw <4 x i32> %broadcast.splat, <i32 3, i32 4, i32 5, i32 6> %15 = icmp eq <4 x i32> %14, %broadcast.splat47 %16 = zext <4 x i1> %15 to <4 x i32> %17 = add <4 x i32> %13, %16 %18 = add nuw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %19 = icmp eq <4 x i32> %18, %broadcast.splat47 %20 = zext <4 x i1> %19 to <4 x i32> %21 = add <4 x i32> %17, %20 %22 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %23 = icmp eq <4 x i32> %22, %broadcast.splat47 %24 = zext <4 x i1> %23 to <4 x i32> %25 = add <4 x i32> %21, %24 %26 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %27 = icmp eq <4 x i32> %26, %broadcast.splat47 %28 = zext <4 x i1> %27 to <4 x i32> %29 = add <4 x i32> %25, %28 %30 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %31 = icmp eq <4 x i32> %30, %broadcast.splat47 %32 = zext <4 x i1> %31 to <4 x i32> %33 = add <4 x i32> %29, %32 %34 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %35 = icmp eq <4 x i32> %34, %broadcast.splat47 %36 = zext <4 x i1> %35 to <4 x i32> %37 = add <4 x i32> %33, %36 %38 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %39 = icmp eq <4 x i32> %38, %broadcast.splat47 %40 = zext <4 x i1> %39 to <4 x i32> %41 = add <4 x i32> %37, %40 %42 = add nuw nsw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %43 = icmp eq <4 x i32> %42, %broadcast.splat47 %44 = zext <4 x i1> %43 to <4 x i32> %45 = add <4 x i32> %41, %44 %46 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %47 = icmp eq <4 x i32> %46, %broadcast.splat47 %48 = zext <4 x i1> %47 to <4 x i32> %49 = add <4 x i32> %45, %48 %50 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %51 = icmp eq <4 x i32> %50, %broadcast.splat47 %52 = zext <4 x i1> %51 to <4 x i32> %53 = add <4 x i32> %49, %52 %54 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %55 = icmp eq <4 x i32> %54, %broadcast.splat47 %56 = zext <4 x i1> %55 to <4 x i32> %57 = add <4 x i32> %53, %56 %58 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %59 = icmp eq <4 x i32> %58, %broadcast.splat47 %60 = zext <4 x i1> %59 to <4 x i32> %61 = add <4 x i32> %57, %60 %62 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %63 = icmp eq <4 x i32> %62, %broadcast.splat47 %64 = zext <4 x i1> %63 to <4 x i32> %65 = add <4 x i32> %61, %64 %66 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %67 = icmp eq <4 x i32> %66, %broadcast.splat47 %68 = zext <4 x i1> %67 to <4 x i32> %69 = add <4 x i32> %65, %68 %70 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %71 = icmp eq <4 x i32> %70, %broadcast.splat47 %72 = zext <4 x i1> %71 to <4 x i32> %73 = add <4 x i32> %69, %72 %74 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %75 = icmp eq <4 x i32> %74, %broadcast.splat47 %76 = zext <4 x i1> %75 to <4 x i32> %77 = add <4 x i32> %73, %76 %78 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %79 = icmp eq <4 x i32> %78, %broadcast.splat47 %80 = zext <4 x i1> %79 to <4 x i32> %81 = add <4 x i32> %77, %80 %82 = add nuw nsw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %83 = icmp eq <4 x i32> %82, %broadcast.splat47 %84 = zext <4 x i1> %83 to <4 x i32> %85 = add <4 x i32> %81, %84 %86 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %87 = icmp eq <4 x i32> %86, %broadcast.splat47 %88 = zext <4 x i1> %87 to <4 x i32> %89 = add <4 x i32> %85, %88 %90 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %91 = icmp eq <4 x i32> %90, %broadcast.splat47 %92 = zext <4 x i1> %91 to <4 x i32> %93 = add <4 x i32> %89, %92 %94 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %95 = icmp eq <4 x i32> %94, %broadcast.splat47 %96 = zext <4 x i1> %95 to <4 x i32> %97 = add <4 x i32> %93, %96 %98 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %99 = icmp eq <4 x i32> %98, %broadcast.splat47 %100 = zext <4 x i1> %99 to <4 x i32> %101 = add <4 x i32> %97, %100 %102 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %103 = icmp eq <4 x i32> %102, %broadcast.splat47 %104 = zext <4 x i1> %103 to <4 x i32> %105 = add <4 x i32> %101, %104 %106 = add nuw <4 x i32> %broadcast.splat, <i32 14, i32 15, i32 16, i32 17> %107 = icmp eq <4 x i32> %106, %broadcast.splat47 %108 = zext <4 x i1> %107 to <4 x i32> %109 = add <4 x i32> %105, %108 %110 = add nuw <4 x i32> %broadcast.splat, <i32 15, i32 16, i32 17, i32 18> %111 = icmp eq <4 x i32> %110, %broadcast.splat47 %112 = zext <4 x i1> %111 to <4 x i32> %113 = add <4 x i32> %109, %112 %114 = add nuw <4 x i32> %broadcast.splat, <i32 16, i32 17, i32 18, i32 19> %115 = icmp eq <4 x i32> %114, %broadcast.splat47 %116 = zext <4 x i1> %115 to <4 x i32> %117 = add <4 x i32> %113, %116 %118 = add nuw <4 x i32> %broadcast.splat, <i32 17, i32 18, i32 19, i32 20> %119 = icmp eq <4 x i32> %118, %broadcast.splat47 %120 = zext <4 x i1> %119 to <4 x i32> %121 = add <4 x i32> %117, %120 %122 = shufflevector <4 x i32> %121, <4 x i32> %81, <4 x i32> <i32 0, i32 1, i32 6, i32 7> %123 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %122) %inc19 = add nuw nsw i32 %b.039, 1 %exitcond44.not = icmp eq i32 %inc19, 10 br i1 %exitcond44.not, label %for.inc21, label %vector.ph, !llvm.loop !9 for.inc21: ; preds = %vector.ph %inc22 = add nuw nsw i32 %a.041, 1 %exitcond45.not = icmp eq i32 %inc22, 10 br i1 %exitcond45.not, label %for.end23, label %for.cond2.preheader, !llvm.loop !11 for.end23: ; preds = %for.inc21 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %123) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12 while.end: ; preds = %for.end23, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main(){ int n; int r; int i,t,s,k; while(scanf("%d", &n)!=EOF){ r = 0; for(i = 0;i <= 9 && i<=n;i++){ for(t = 0;t <= 9 && i+t<=n;t++){ for(s = 0;s <=9 && i+t+s<=n;s++){ for(k = 0;k <=9 && i+t+s+k<=n;k++){ if(i+t+s+k==n)r++; } } } } printf("%d\n", r); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111811/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111811/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call69 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not70 = icmp eq i32 %call69, -1 br i1 %cmp.not70, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end39 %0 = load i32, ptr %n, align 4 %cmp266 = icmp sgt i32 %0, -1 br i1 %cmp266, label %for.cond3.preheader.preheader, label %for.end39 for.cond3.preheader.preheader: ; preds = %for.cond.preheader %umin = call i32 @llvm.umin.i32(i32 %0, i32 9) br label %for.cond3.preheader for.cond3.preheader: ; preds = %for.cond3.preheader.preheader, %for.inc37 %i.068 = phi i32 [ %inc38, %for.inc37 ], [ 0, %for.cond3.preheader.preheader ] %r.067 = phi i32 [ %r.1.lcssa, %for.inc37 ], [ 0, %for.cond3.preheader.preheader ] br label %land.rhs5 land.rhs5: ; preds = %for.cond3.preheader, %for.inc34 %t.065 = phi i32 [ 0, %for.cond3.preheader ], [ %inc35, %for.inc34 ] %r.164 = phi i32 [ %r.067, %for.cond3.preheader ], [ %r.2.lcssa, %for.inc34 ] %add = add nuw nsw i32 %t.065, %i.068 %cmp6.not = icmp sgt i32 %add, %0 br i1 %cmp6.not, label %for.inc37, label %land.rhs11 land.rhs11: ; preds = %land.rhs5, %for.inc31 %s.063 = phi i32 [ %inc32, %for.inc31 ], [ 0, %land.rhs5 ] %r.262 = phi i32 [ %r.3.lcssa, %for.inc31 ], [ %r.164, %land.rhs5 ] %add13 = add nuw nsw i32 %s.063, %add %cmp14.not = icmp sgt i32 %add13, %0 br i1 %cmp14.not, label %for.inc34, label %for.body25 for.body25: ; preds = %land.rhs11 %cmp29 = icmp eq i32 %add13, %0 %inc = zext i1 %cmp29 to i32 %spec.select = add nsw i32 %r.262, %inc %cmp23.not.1.not = icmp slt i32 %add13, %0 br i1 %cmp23.not.1.not, label %for.body25.1, label %for.inc31 for.body25.1: ; preds = %for.body25 %add22.1 = add nuw nsw i32 %add13, 1 %cmp29.1 = icmp eq i32 %add22.1, %0 %inc.1 = zext i1 %cmp29.1 to i32 %spec.select.1 = add nsw i32 %spec.select, %inc.1 %add22.2 = add nuw nsw i32 %add13, 2 %cmp23.not.2 = icmp sgt i32 %add22.2, %0 br i1 %cmp23.not.2, label %for.inc31, label %for.body25.2 for.body25.2: ; preds = %for.body25.1 %cmp29.2 = icmp eq i32 %add22.2, %0 %inc.2 = zext i1 %cmp29.2 to i32 %spec.select.2 = add nsw i32 %spec.select.1, %inc.2 %add22.3 = add nuw nsw i32 %add13, 3 %cmp23.not.3 = icmp sgt i32 %add22.3, %0 br i1 %cmp23.not.3, label %for.inc31, label %for.body25.3 for.body25.3: ; preds = %for.body25.2 %cmp29.3 = icmp eq i32 %add22.3, %0 %inc.3 = zext i1 %cmp29.3 to i32 %spec.select.3 = add nsw i32 %spec.select.2, %inc.3 %add22.4 = add nuw nsw i32 %add13, 4 %cmp23.not.4 = icmp sgt i32 %add22.4, %0 br i1 %cmp23.not.4, label %for.inc31, label %for.body25.4 for.body25.4: ; preds = %for.body25.3 %cmp29.4 = icmp eq i32 %add22.4, %0 %inc.4 = zext i1 %cmp29.4 to i32 %spec.select.4 = add nsw i32 %spec.select.3, %inc.4 %add22.5 = add nuw nsw i32 %add13, 5 %cmp23.not.5 = icmp sgt i32 %add22.5, %0 br i1 %cmp23.not.5, label %for.inc31, label %for.body25.5 for.body25.5: ; preds = %for.body25.4 %cmp29.5 = icmp eq i32 %add22.5, %0 %inc.5 = zext i1 %cmp29.5 to i32 %spec.select.5 = add nsw i32 %spec.select.4, %inc.5 %add22.6 = add nuw nsw i32 %add13, 6 %cmp23.not.6 = icmp sgt i32 %add22.6, %0 br i1 %cmp23.not.6, label %for.inc31, label %for.body25.6 for.body25.6: ; preds = %for.body25.5 %cmp29.6 = icmp eq i32 %add22.6, %0 %inc.6 = zext i1 %cmp29.6 to i32 %spec.select.6 = add nsw i32 %spec.select.5, %inc.6 %add22.7 = add nuw nsw i32 %add13, 7 %cmp23.not.7 = icmp sgt i32 %add22.7, %0 br i1 %cmp23.not.7, label %for.inc31, label %for.body25.7 for.body25.7: ; preds = %for.body25.6 %cmp29.7 = icmp eq i32 %add22.7, %0 %inc.7 = zext i1 %cmp29.7 to i32 %spec.select.7 = add nsw i32 %spec.select.6, %inc.7 %add22.8 = add nuw nsw i32 %add13, 8 %cmp23.not.8 = icmp sgt i32 %add22.8, %0 br i1 %cmp23.not.8, label %for.inc31, label %for.body25.8 for.body25.8: ; preds = %for.body25.7 %cmp29.8 = icmp eq i32 %add22.8, %0 %inc.8 = zext i1 %cmp29.8 to i32 %spec.select.8 = add nsw i32 %spec.select.7, %inc.8 %add22.9 = add nuw nsw i32 %add13, 9 %cmp23.not.9 = icmp sgt i32 %add22.9, %0 br i1 %cmp23.not.9, label %for.inc31, label %for.body25.9 for.body25.9: ; preds = %for.body25.8 %cmp29.9 = icmp eq i32 %add22.9, %0 %inc.9 = zext i1 %cmp29.9 to i32 %spec.select.9 = add nsw i32 %spec.select.8, %inc.9 br label %for.inc31 for.inc31: ; preds = %for.body25.9, %for.body25.8, %for.body25.7, %for.body25.6, %for.body25.5, %for.body25.4, %for.body25.3, %for.body25.2, %for.body25.1, %for.body25 %r.3.lcssa = phi i32 [ %spec.select, %for.body25 ], [ %spec.select.1, %for.body25.1 ], [ %spec.select.2, %for.body25.2 ], [ %spec.select.3, %for.body25.3 ], [ %spec.select.4, %for.body25.4 ], [ %spec.select.5, %for.body25.5 ], [ %spec.select.6, %for.body25.6 ], [ %spec.select.7, %for.body25.7 ], [ %spec.select.8, %for.body25.8 ], [ %spec.select.9, %for.body25.9 ] %inc32 = add nuw nsw i32 %s.063, 1 %exitcond.not = icmp eq i32 %inc32, 10 br i1 %exitcond.not, label %for.inc34, label %land.rhs11, !llvm.loop !5 for.inc34: ; preds = %land.rhs11, %for.inc31 %r.2.lcssa = phi i32 [ %r.262, %land.rhs11 ], [ %r.3.lcssa, %for.inc31 ] %inc35 = add nuw nsw i32 %t.065, 1 %exitcond71.not = icmp eq i32 %inc35, 10 br i1 %exitcond71.not, label %for.inc37, label %land.rhs5, !llvm.loop !7 for.inc37: ; preds = %land.rhs5, %for.inc34 %r.1.lcssa = phi i32 [ %r.164, %land.rhs5 ], [ %r.2.lcssa, %for.inc34 ] %inc38 = add nuw nsw i32 %i.068, 1 %exitcond72.not = icmp eq i32 %i.068, %umin br i1 %exitcond72.not, label %for.end39, label %for.cond3.preheader, !llvm.loop !8 for.end39: ; preds = %for.inc37, %for.cond.preheader %r.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %r.1.lcssa, %for.inc37 ] %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !9 while.end: ; preds = %for.end39, %entry 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.umin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = distinct !{!8, !6} !9 = distinct !{!9, !6}
#include <stdio.h> int main(){ int a,b,c,n,counter=0; while (scanf("%d",&n) !=EOF) { for (a=0; a<=9; a++) for (b=0; b<=9; b++) for (c=0; c<=9; c++) if (0<=n-a-b-c && n-a-b-c<=9) counter++; printf("%d\n",counter); counter=0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111855/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111855/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not41 = icmp eq i32 %call40, -1 br i1 %cmp.not41, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end21 %0 = load i32, ptr %n, align 4, !tbaa !5 %broadcast.splatinsert43 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat44 = shufflevector <4 x i32> %broadcast.splatinsert43, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.ph vector.ph: ; preds = %vector.ph, %for.cond.preheader %counter.139 = phi i32 [ 0, %for.cond.preheader ], [ %150, %vector.ph ] %a.038 = phi i32 [ 0, %for.cond.preheader ], [ %inc20, %vector.ph ] %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a.038, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %counter.139, i64 0 %2 = add nuw nsw <4 x i32> %broadcast.splat, <i32 0, i32 1, i32 2, i32 3> %3 = sub <4 x i32> %broadcast.splat44, %2 %4 = icmp ult <4 x i32> %3, <i32 10, i32 10, i32 10, i32 10> %5 = zext <4 x i1> %4 to <4 x i32> %6 = add <4 x i32> %1, %5 %reass.sub = sub <4 x i32> %broadcast.splat44, %broadcast.splat %7 = add <4 x i32> %reass.sub, <i32 -1, i32 -2, i32 -3, i32 -4> %8 = icmp ult <4 x i32> %7, <i32 10, i32 10, i32 10, i32 10> %9 = zext <4 x i1> %8 to <4 x i32> %10 = add <4 x i32> %6, %9 %11 = add nuw <4 x i32> %broadcast.splat, <i32 2, i32 3, i32 4, i32 5> %12 = sub <4 x i32> %broadcast.splat44, %11 %13 = icmp ult <4 x i32> %12, <i32 10, i32 10, i32 10, i32 10> %14 = zext <4 x i1> %13 to <4 x i32> %15 = add <4 x i32> %10, %14 %16 = add nuw <4 x i32> %broadcast.splat, <i32 3, i32 4, i32 5, i32 6> %17 = sub <4 x i32> %broadcast.splat44, %16 %18 = icmp ult <4 x i32> %17, <i32 10, i32 10, i32 10, i32 10> %19 = zext <4 x i1> %18 to <4 x i32> %20 = add <4 x i32> %15, %19 %21 = add nuw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %22 = sub <4 x i32> %broadcast.splat44, %21 %23 = icmp ult <4 x i32> %22, <i32 10, i32 10, i32 10, i32 10> %24 = zext <4 x i1> %23 to <4 x i32> %25 = add <4 x i32> %20, %24 %26 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %27 = sub <4 x i32> %broadcast.splat44, %26 %28 = icmp ult <4 x i32> %27, <i32 10, i32 10, i32 10, i32 10> %29 = zext <4 x i1> %28 to <4 x i32> %30 = add <4 x i32> %25, %29 %31 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %32 = sub <4 x i32> %broadcast.splat44, %31 %33 = icmp ult <4 x i32> %32, <i32 10, i32 10, i32 10, i32 10> %34 = zext <4 x i1> %33 to <4 x i32> %35 = add <4 x i32> %30, %34 %36 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %37 = sub <4 x i32> %broadcast.splat44, %36 %38 = icmp ult <4 x i32> %37, <i32 10, i32 10, i32 10, i32 10> %39 = zext <4 x i1> %38 to <4 x i32> %40 = add <4 x i32> %35, %39 %41 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %42 = sub <4 x i32> %broadcast.splat44, %41 %43 = icmp ult <4 x i32> %42, <i32 10, i32 10, i32 10, i32 10> %44 = zext <4 x i1> %43 to <4 x i32> %45 = add <4 x i32> %40, %44 %46 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %47 = sub <4 x i32> %broadcast.splat44, %46 %48 = icmp ult <4 x i32> %47, <i32 10, i32 10, i32 10, i32 10> %49 = zext <4 x i1> %48 to <4 x i32> %50 = add <4 x i32> %45, %49 %51 = add nuw nsw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %52 = sub <4 x i32> %broadcast.splat44, %51 %53 = icmp ult <4 x i32> %52, <i32 10, i32 10, i32 10, i32 10> %54 = zext <4 x i1> %53 to <4 x i32> %55 = add <4 x i32> %50, %54 %reass.sub46 = sub <4 x i32> %broadcast.splat44, %broadcast.splat %56 = add <4 x i32> %reass.sub46, <i32 -5, i32 -6, i32 -7, i32 -8> %57 = icmp ult <4 x i32> %56, <i32 10, i32 10, i32 10, i32 10> %58 = zext <4 x i1> %57 to <4 x i32> %59 = add <4 x i32> %55, %58 %60 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %61 = sub <4 x i32> %broadcast.splat44, %60 %62 = icmp ult <4 x i32> %61, <i32 10, i32 10, i32 10, i32 10> %63 = zext <4 x i1> %62 to <4 x i32> %64 = add <4 x i32> %59, %63 %65 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %66 = sub <4 x i32> %broadcast.splat44, %65 %67 = icmp ult <4 x i32> %66, <i32 10, i32 10, i32 10, i32 10> %68 = zext <4 x i1> %67 to <4 x i32> %69 = add <4 x i32> %64, %68 %70 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %71 = sub <4 x i32> %broadcast.splat44, %70 %72 = icmp ult <4 x i32> %71, <i32 10, i32 10, i32 10, i32 10> %73 = zext <4 x i1> %72 to <4 x i32> %74 = add <4 x i32> %69, %73 %75 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %76 = sub <4 x i32> %broadcast.splat44, %75 %77 = icmp ult <4 x i32> %76, <i32 10, i32 10, i32 10, i32 10> %78 = zext <4 x i1> %77 to <4 x i32> %79 = add <4 x i32> %74, %78 %80 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %81 = sub <4 x i32> %broadcast.splat44, %80 %82 = icmp ult <4 x i32> %81, <i32 10, i32 10, i32 10, i32 10> %83 = zext <4 x i1> %82 to <4 x i32> %84 = add <4 x i32> %79, %83 %85 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %86 = sub <4 x i32> %broadcast.splat44, %85 %87 = icmp ult <4 x i32> %86, <i32 10, i32 10, i32 10, i32 10> %88 = zext <4 x i1> %87 to <4 x i32> %89 = add <4 x i32> %84, %88 %90 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %91 = sub <4 x i32> %broadcast.splat44, %90 %92 = icmp ult <4 x i32> %91, <i32 10, i32 10, i32 10, i32 10> %93 = zext <4 x i1> %92 to <4 x i32> %94 = add <4 x i32> %89, %93 %95 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %96 = sub <4 x i32> %broadcast.splat44, %95 %97 = icmp ult <4 x i32> %96, <i32 10, i32 10, i32 10, i32 10> %98 = zext <4 x i1> %97 to <4 x i32> %99 = add <4 x i32> %94, %98 %100 = add nuw nsw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %101 = sub <4 x i32> %broadcast.splat44, %100 %102 = icmp ult <4 x i32> %101, <i32 10, i32 10, i32 10, i32 10> %103 = zext <4 x i1> %102 to <4 x i32> %104 = add <4 x i32> %99, %103 %reass.sub47 = sub <4 x i32> %broadcast.splat44, %broadcast.splat %105 = add <4 x i32> %reass.sub47, <i32 -9, i32 -10, i32 -11, i32 -12> %106 = icmp ult <4 x i32> %105, <i32 10, i32 10, i32 10, i32 10> %107 = zext <4 x i1> %106 to <4 x i32> %108 = add <4 x i32> %104, %107 %109 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %110 = sub <4 x i32> %broadcast.splat44, %109 %111 = icmp ult <4 x i32> %110, <i32 10, i32 10, i32 10, i32 10> %112 = zext <4 x i1> %111 to <4 x i32> %113 = add <4 x i32> %108, %112 %114 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %115 = sub <4 x i32> %broadcast.splat44, %114 %116 = icmp ult <4 x i32> %115, <i32 10, i32 10, i32 10, i32 10> %117 = zext <4 x i1> %116 to <4 x i32> %118 = add <4 x i32> %113, %117 %119 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %120 = sub <4 x i32> %broadcast.splat44, %119 %121 = icmp ult <4 x i32> %120, <i32 10, i32 10, i32 10, i32 10> %122 = zext <4 x i1> %121 to <4 x i32> %123 = add <4 x i32> %118, %122 %124 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %125 = sub <4 x i32> %broadcast.splat44, %124 %126 = icmp ult <4 x i32> %125, <i32 10, i32 10, i32 10, i32 10> %127 = zext <4 x i1> %126 to <4 x i32> %128 = add <4 x i32> %123, %127 %129 = add nuw <4 x i32> %broadcast.splat, <i32 14, i32 15, i32 16, i32 17> %130 = sub <4 x i32> %broadcast.splat44, %129 %131 = icmp ult <4 x i32> %130, <i32 10, i32 10, i32 10, i32 10> %132 = zext <4 x i1> %131 to <4 x i32> %133 = add <4 x i32> %128, %132 %134 = add nuw <4 x i32> %broadcast.splat, <i32 15, i32 16, i32 17, i32 18> %135 = sub <4 x i32> %broadcast.splat44, %134 %136 = icmp ult <4 x i32> %135, <i32 10, i32 10, i32 10, i32 10> %137 = zext <4 x i1> %136 to <4 x i32> %138 = add <4 x i32> %133, %137 %139 = add nuw <4 x i32> %broadcast.splat, <i32 16, i32 17, i32 18, i32 19> %140 = sub <4 x i32> %broadcast.splat44, %139 %141 = icmp ult <4 x i32> %140, <i32 10, i32 10, i32 10, i32 10> %142 = zext <4 x i1> %141 to <4 x i32> %143 = add <4 x i32> %138, %142 %144 = add nuw <4 x i32> %broadcast.splat, <i32 17, i32 18, i32 19, i32 20> %145 = sub <4 x i32> %broadcast.splat44, %144 %146 = icmp ult <4 x i32> %145, <i32 10, i32 10, i32 10, i32 10> %147 = zext <4 x i1> %146 to <4 x i32> %148 = add <4 x i32> %143, %147 %149 = shufflevector <4 x i32> %148, <4 x i32> %99, <4 x i32> <i32 0, i32 1, i32 6, i32 7> %150 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %149) %inc20 = add nuw nsw i32 %a.038, 1 %exitcond42.not = icmp eq i32 %inc20, 10 br i1 %exitcond42.not, label %for.end21, label %vector.ph, !llvm.loop !9 for.end21: ; preds = %vector.ph %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %150) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11 while.end: ; preds = %for.end21, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main( void ) { int N ; while( scanf( "%d" ,&N ) != EOF ) { long cnt[ 4 + 1 ][ 50 + 1 ] = { 1 } ; int i ,j ,k ; for( i = 1 ; i <= 4 ; ++i ) { for( j = 0 ; j <= N ; ++j ) { if( cnt[ i - 1 ][ j ] > 0 ) { for( k = 0 ; k <= 9 ; ++k ) { if( j + k < 50 + 1 ) { cnt[ i ][ j + k ] += cnt[ i - 1 ][ j ] ; } } } } } printf( "%ld\n" ,cnt[ 4 ][ N ] ) ; } return 0 ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111905/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111905/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %cnt = alloca [5 x [51 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %cmp.not52 = icmp eq i32 %call51, -1 br i1 %cmp.not52, label %while.end, label %while.body while.body: ; preds = %entry, %for.end30 call void @llvm.lifetime.start.p0(i64 2040, ptr nonnull %cnt) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2040) %cnt, i8 0, i64 2040, i1 false) store i64 1, ptr %cnt, align 16 %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp3.not48 = icmp slt i32 %0, 0 br i1 %cmp3.not48, label %for.end30, label %for.cond2.preheader.preheader for.cond2.preheader.preheader: ; preds = %while.body %1 = add nuw i32 %0, 1 %wide.trip.count = zext i32 %1 to i64 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.cond2.for.inc28_crit_edge %indvars.iv57 = phi i64 [ 1, %for.cond2.preheader.preheader ], [ %indvars.iv.next58, %for.cond2.for.inc28_crit_edge ] %2 = add nsw i64 %indvars.iv57, -1 br label %for.body4 for.body4: ; preds = %for.cond2.preheader, %for.inc25 %indvars.iv = phi i64 [ 0, %for.cond2.preheader ], [ %indvars.iv.next.pre-phi, %for.inc25 ] %arrayidx6 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %2, i64 %indvars.iv %3 = load i64, ptr %arrayidx6, align 8, !tbaa !9 %cmp7 = icmp sgt i64 %3, 0 br i1 %cmp7, label %for.body10.preheader, label %for.body4.for.inc25_crit_edge for.body4.for.inc25_crit_edge: ; preds = %for.body4 %.pre = add nuw nsw i64 %indvars.iv, 1 br label %for.inc25 for.body10.preheader: ; preds = %for.body4 %cmp11 = icmp ult i64 %indvars.iv, 51 br i1 %cmp11, label %for.inc, label %for.inc.thread for.inc.thread: ; preds = %for.body10.preheader %4 = add nuw nsw i64 %indvars.iv, 1 br label %for.inc25 for.inc: ; preds = %for.body10.preheader %arrayidx22 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %indvars.iv57, i64 %indvars.iv %5 = load i64, ptr %arrayidx22, align 8, !tbaa !9 %add23 = add nsw i64 %5, %3 store i64 %add23, ptr %arrayidx22, align 8, !tbaa !9 %6 = add nuw nsw i64 %indvars.iv, 1 %cmp11.1.not = icmp eq i64 %indvars.iv, 50 br i1 %cmp11.1.not, label %for.inc25, label %for.inc.1 for.inc.1: ; preds = %for.inc %arrayidx22.1 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %indvars.iv57, i64 %6 %7 = load i64, ptr %arrayidx22.1, align 8, !tbaa !9 %add23.1 = add nsw i64 %7, %3 store i64 %add23.1, ptr %arrayidx22.1, align 8, !tbaa !9 %cmp11.2 = icmp ult i64 %indvars.iv, 49 br i1 %cmp11.2, label %for.inc.2, label %for.inc25 for.inc.2: ; preds = %for.inc.1 %8 = add nuw nsw i64 %indvars.iv, 2 %9 = load i64, ptr %arrayidx6, align 8, !tbaa !9 %arrayidx22.2 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %indvars.iv57, i64 %8 %10 = load i64, ptr %arrayidx22.2, align 8, !tbaa !9 %add23.2 = add nsw i64 %10, %9 store i64 %add23.2, ptr %arrayidx22.2, align 8, !tbaa !9 %cmp11.3.not = icmp eq i64 %indvars.iv, 48 br i1 %cmp11.3.not, label %for.inc25, label %for.inc.3 for.inc.3: ; preds = %for.inc.2 %11 = add nuw nsw i64 %indvars.iv, 3 %12 = load i64, ptr %arrayidx6, align 8, !tbaa !9 %arrayidx22.3 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %indvars.iv57, i64 %11 %13 = load i64, ptr %arrayidx22.3, align 8, !tbaa !9 %add23.3 = add nsw i64 %13, %12 store i64 %add23.3, ptr %arrayidx22.3, align 8, !tbaa !9 %cmp11.4 = icmp ult i64 %indvars.iv, 47 br i1 %cmp11.4, label %for.inc.4, label %for.inc25 for.inc.4: ; preds = %for.inc.3 %14 = add nuw nsw i64 %indvars.iv, 4 %15 = load i64, ptr %arrayidx6, align 8, !tbaa !9 %arrayidx22.4 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %indvars.iv57, i64 %14 %16 = load i64, ptr %arrayidx22.4, align 8, !tbaa !9 %add23.4 = add nsw i64 %16, %15 store i64 %add23.4, ptr %arrayidx22.4, align 8, !tbaa !9 %cmp11.5.not = icmp eq i64 %indvars.iv, 46 br i1 %cmp11.5.not, label %for.inc25, label %for.inc.5 for.inc.5: ; preds = %for.inc.4 %17 = add nuw nsw i64 %indvars.iv, 5 %18 = load i64, ptr %arrayidx6, align 8, !tbaa !9 %arrayidx22.5 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %indvars.iv57, i64 %17 %19 = load i64, ptr %arrayidx22.5, align 8, !tbaa !9 %add23.5 = add nsw i64 %19, %18 store i64 %add23.5, ptr %arrayidx22.5, align 8, !tbaa !9 %cmp11.6 = icmp ult i64 %indvars.iv, 45 br i1 %cmp11.6, label %for.inc.6, label %for.inc25 for.inc.6: ; preds = %for.inc.5 %20 = add nuw nsw i64 %indvars.iv, 6 %21 = load i64, ptr %arrayidx6, align 8, !tbaa !9 %arrayidx22.6 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %indvars.iv57, i64 %20 %22 = load i64, ptr %arrayidx22.6, align 8, !tbaa !9 %add23.6 = add nsw i64 %22, %21 store i64 %add23.6, ptr %arrayidx22.6, align 8, !tbaa !9 %cmp11.7.not = icmp eq i64 %indvars.iv, 44 br i1 %cmp11.7.not, label %for.inc25, label %for.inc.7 for.inc.7: ; preds = %for.inc.6 %23 = add nuw nsw i64 %indvars.iv, 7 %24 = load i64, ptr %arrayidx6, align 8, !tbaa !9 %arrayidx22.7 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %indvars.iv57, i64 %23 %25 = load i64, ptr %arrayidx22.7, align 8, !tbaa !9 %add23.7 = add nsw i64 %25, %24 store i64 %add23.7, ptr %arrayidx22.7, align 8, !tbaa !9 %cmp11.8 = icmp ult i64 %indvars.iv, 43 br i1 %cmp11.8, label %for.inc.8, label %for.inc25 for.inc.8: ; preds = %for.inc.7 %26 = add nuw nsw i64 %indvars.iv, 8 %27 = load i64, ptr %arrayidx6, align 8, !tbaa !9 %arrayidx22.8 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %indvars.iv57, i64 %26 %28 = load i64, ptr %arrayidx22.8, align 8, !tbaa !9 %add23.8 = add nsw i64 %28, %27 store i64 %add23.8, ptr %arrayidx22.8, align 8, !tbaa !9 %cmp11.9.not = icmp eq i64 %indvars.iv, 42 br i1 %cmp11.9.not, label %for.inc25, label %if.then12.9 if.then12.9: ; preds = %for.inc.8 %29 = add nuw nsw i64 %indvars.iv, 9 %30 = load i64, ptr %arrayidx6, align 8, !tbaa !9 %arrayidx22.9 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 %indvars.iv57, i64 %29 %31 = load i64, ptr %arrayidx22.9, align 8, !tbaa !9 %add23.9 = add nsw i64 %31, %30 store i64 %add23.9, ptr %arrayidx22.9, align 8, !tbaa !9 br label %for.inc25 for.inc25: ; preds = %for.inc, %for.inc.thread, %for.inc.1, %for.inc.2, %for.inc.3, %for.inc.4, %for.inc.5, %for.inc.6, %for.inc.7, %for.inc.8, %if.then12.9, %for.body4.for.inc25_crit_edge %indvars.iv.next.pre-phi = phi i64 [ %.pre, %for.body4.for.inc25_crit_edge ], [ %6, %if.then12.9 ], [ %6, %for.inc.8 ], [ %6, %for.inc.7 ], [ %6, %for.inc.6 ], [ %6, %for.inc.5 ], [ %6, %for.inc.4 ], [ %6, %for.inc.3 ], [ %6, %for.inc.2 ], [ %6, %for.inc.1 ], [ %6, %for.inc ], [ %4, %for.inc.thread ] %exitcond.not = icmp eq i64 %indvars.iv.next.pre-phi, %wide.trip.count br i1 %exitcond.not, label %for.cond2.for.inc28_crit_edge, label %for.body4, !llvm.loop !11 for.cond2.for.inc28_crit_edge: ; preds = %for.inc25 %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %exitcond61.not = icmp eq i64 %indvars.iv.next58, 5 br i1 %exitcond61.not, label %for.end30, label %for.cond2.preheader, !llvm.loop !13 for.end30: ; preds = %for.cond2.for.inc28_crit_edge, %while.body %idxprom32 = sext i32 %0 to i64 %arrayidx33 = getelementptr inbounds [5 x [51 x i64]], ptr %cnt, i64 0, i64 4, i64 %idxprom32 %32 = load i64, ptr %arrayidx33, align 8, !tbaa !9 %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %32) call void @llvm.lifetime.end.p0(i64 2040, ptr nonnull %cnt) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %for.end30, %entry 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 = !{!10, !10, i64 0} !10 = !{!"long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12}
#include <stdio.h> int main(void) { int i, j, k, l; int input; int count; while (scanf("%d", &input) != EOF){ count = 0; if (input < 37){ for (i = 0; i <= 9; i++){ for (j = 0; j <= 9; j++){ for (k = 0; k <= 9; k++){ for (l = 0; l <= 9; l++){ if (input == i + j + k + l){ count++; } } } } } } printf("%d\n", count); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_111970/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_111970/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %input = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input) #4 %call45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input) %cmp.not46 = icmp eq i32 %call45, -1 br i1 %cmp.not46, label %while.end, label %while.body while.body: ; preds = %entry, %if.end26 %0 = load i32, ptr %input, align 4, !tbaa !5 %cmp1 = icmp slt i32 %0, 37 br i1 %cmp1, label %for.cond3.preheader.preheader, label %if.end26 for.cond3.preheader.preheader: ; preds = %while.body %broadcast.splatinsert49 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat50 = shufflevector <4 x i32> %broadcast.splatinsert49, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.cond3.preheader for.cond3.preheader: ; preds = %for.cond3.preheader.preheader, %for.inc23 %count.044 = phi i32 [ %123, %for.inc23 ], [ 0, %for.cond3.preheader.preheader ] %i.043 = phi i32 [ %inc24, %for.inc23 ], [ 0, %for.cond3.preheader.preheader ] br label %vector.ph vector.ph: ; preds = %vector.ph, %for.cond3.preheader %count.142 = phi i32 [ %count.044, %for.cond3.preheader ], [ %123, %vector.ph ] %j.041 = phi i32 [ 0, %for.cond3.preheader ], [ %inc21, %vector.ph ] %add = add nuw nsw i32 %j.041, %i.043 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.142, i64 0 %2 = add nuw nsw <4 x i32> %broadcast.splat, <i32 0, i32 1, i32 2, i32 3> %3 = icmp eq <4 x i32> %broadcast.splat50, %2 %4 = zext <4 x i1> %3 to <4 x i32> %5 = add <4 x i32> %1, %4 %6 = add nuw <4 x i32> %broadcast.splat, <i32 1, i32 2, i32 3, i32 4> %7 = icmp eq <4 x i32> %broadcast.splat50, %6 %8 = zext <4 x i1> %7 to <4 x i32> %9 = add <4 x i32> %5, %8 %10 = add nuw <4 x i32> %broadcast.splat, <i32 2, i32 3, i32 4, i32 5> %11 = icmp eq <4 x i32> %broadcast.splat50, %10 %12 = zext <4 x i1> %11 to <4 x i32> %13 = add <4 x i32> %9, %12 %14 = add nuw <4 x i32> %broadcast.splat, <i32 3, i32 4, i32 5, i32 6> %15 = icmp eq <4 x i32> %broadcast.splat50, %14 %16 = zext <4 x i1> %15 to <4 x i32> %17 = add <4 x i32> %13, %16 %18 = add nuw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %19 = icmp eq <4 x i32> %broadcast.splat50, %18 %20 = zext <4 x i1> %19 to <4 x i32> %21 = add <4 x i32> %17, %20 %22 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %23 = icmp eq <4 x i32> %broadcast.splat50, %22 %24 = zext <4 x i1> %23 to <4 x i32> %25 = add <4 x i32> %21, %24 %26 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %27 = icmp eq <4 x i32> %broadcast.splat50, %26 %28 = zext <4 x i1> %27 to <4 x i32> %29 = add <4 x i32> %25, %28 %30 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %31 = icmp eq <4 x i32> %broadcast.splat50, %30 %32 = zext <4 x i1> %31 to <4 x i32> %33 = add <4 x i32> %29, %32 %34 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %35 = icmp eq <4 x i32> %broadcast.splat50, %34 %36 = zext <4 x i1> %35 to <4 x i32> %37 = add <4 x i32> %33, %36 %38 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %39 = icmp eq <4 x i32> %broadcast.splat50, %38 %40 = zext <4 x i1> %39 to <4 x i32> %41 = add <4 x i32> %37, %40 %42 = add nuw nsw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %43 = icmp eq <4 x i32> %broadcast.splat50, %42 %44 = zext <4 x i1> %43 to <4 x i32> %45 = add <4 x i32> %41, %44 %46 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %47 = icmp eq <4 x i32> %broadcast.splat50, %46 %48 = zext <4 x i1> %47 to <4 x i32> %49 = add <4 x i32> %45, %48 %50 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %51 = icmp eq <4 x i32> %broadcast.splat50, %50 %52 = zext <4 x i1> %51 to <4 x i32> %53 = add <4 x i32> %49, %52 %54 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %55 = icmp eq <4 x i32> %broadcast.splat50, %54 %56 = zext <4 x i1> %55 to <4 x i32> %57 = add <4 x i32> %53, %56 %58 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %59 = icmp eq <4 x i32> %broadcast.splat50, %58 %60 = zext <4 x i1> %59 to <4 x i32> %61 = add <4 x i32> %57, %60 %62 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %63 = icmp eq <4 x i32> %broadcast.splat50, %62 %64 = zext <4 x i1> %63 to <4 x i32> %65 = add <4 x i32> %61, %64 %66 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %67 = icmp eq <4 x i32> %broadcast.splat50, %66 %68 = zext <4 x i1> %67 to <4 x i32> %69 = add <4 x i32> %65, %68 %70 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %71 = icmp eq <4 x i32> %broadcast.splat50, %70 %72 = zext <4 x i1> %71 to <4 x i32> %73 = add <4 x i32> %69, %72 %74 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %75 = icmp eq <4 x i32> %broadcast.splat50, %74 %76 = zext <4 x i1> %75 to <4 x i32> %77 = add <4 x i32> %73, %76 %78 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %79 = icmp eq <4 x i32> %broadcast.splat50, %78 %80 = zext <4 x i1> %79 to <4 x i32> %81 = add <4 x i32> %77, %80 %82 = add nuw nsw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %83 = icmp eq <4 x i32> %broadcast.splat50, %82 %84 = zext <4 x i1> %83 to <4 x i32> %85 = add <4 x i32> %81, %84 %86 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %87 = icmp eq <4 x i32> %broadcast.splat50, %86 %88 = zext <4 x i1> %87 to <4 x i32> %89 = add <4 x i32> %85, %88 %90 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %91 = icmp eq <4 x i32> %broadcast.splat50, %90 %92 = zext <4 x i1> %91 to <4 x i32> %93 = add <4 x i32> %89, %92 %94 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %95 = icmp eq <4 x i32> %broadcast.splat50, %94 %96 = zext <4 x i1> %95 to <4 x i32> %97 = add <4 x i32> %93, %96 %98 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %99 = icmp eq <4 x i32> %broadcast.splat50, %98 %100 = zext <4 x i1> %99 to <4 x i32> %101 = add <4 x i32> %97, %100 %102 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %103 = icmp eq <4 x i32> %broadcast.splat50, %102 %104 = zext <4 x i1> %103 to <4 x i32> %105 = add <4 x i32> %101, %104 %106 = add nuw <4 x i32> %broadcast.splat, <i32 14, i32 15, i32 16, i32 17> %107 = icmp eq <4 x i32> %broadcast.splat50, %106 %108 = zext <4 x i1> %107 to <4 x i32> %109 = add <4 x i32> %105, %108 %110 = add nuw <4 x i32> %broadcast.splat, <i32 15, i32 16, i32 17, i32 18> %111 = icmp eq <4 x i32> %broadcast.splat50, %110 %112 = zext <4 x i1> %111 to <4 x i32> %113 = add <4 x i32> %109, %112 %114 = add nuw <4 x i32> %broadcast.splat, <i32 16, i32 17, i32 18, i32 19> %115 = icmp eq <4 x i32> %broadcast.splat50, %114 %116 = zext <4 x i1> %115 to <4 x i32> %117 = add <4 x i32> %113, %116 %118 = add nuw <4 x i32> %broadcast.splat, <i32 17, i32 18, i32 19, i32 20> %119 = icmp eq <4 x i32> %broadcast.splat50, %118 %120 = zext <4 x i1> %119 to <4 x i32> %121 = add <4 x i32> %117, %120 %122 = shufflevector <4 x i32> %121, <4 x i32> %81, <4 x i32> <i32 0, i32 1, i32 6, i32 7> %123 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %122) %inc21 = add nuw nsw i32 %j.041, 1 %exitcond47.not = icmp eq i32 %inc21, 10 br i1 %exitcond47.not, label %for.inc23, label %vector.ph, !llvm.loop !9 for.inc23: ; preds = %vector.ph %inc24 = add nuw nsw i32 %i.043, 1 %exitcond48.not = icmp eq i32 %inc24, 10 br i1 %exitcond48.not, label %if.end26, label %for.cond3.preheader, !llvm.loop !11 if.end26: ; preds = %for.inc23, %while.body %count.5 = phi i32 [ 0, %while.body ], [ %123, %for.inc23 ] %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.5) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !12 while.end: ; preds = %if.end26, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #define VAR_MAX 9 int main(void){ int a, b, c, N, count=0; while(scanf("%d",&N)==1){ count=0; for(a=0;a<=VAR_MAX;a++){ for(b=0;b<=VAR_MAX;b++){ for(c=0;c<=VAR_MAX;c++) if(0<=N-a-b-c && N-a-b-c<=VAR_MAX) count++; } } printf("%d\n",count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112034/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112034/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %cmp41 = icmp eq i32 %call40, 1 br i1 %cmp41, label %for.cond.preheader, label %while.end for.cond.preheader: ; preds = %entry, %for.end21 %0 = load i32, ptr %N, align 4, !tbaa !5 %broadcast.splatinsert43 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat44 = shufflevector <4 x i32> %broadcast.splatinsert43, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.ph vector.ph: ; preds = %vector.ph, %for.cond.preheader %count.039 = phi i32 [ 0, %for.cond.preheader ], [ %150, %vector.ph ] %a.038 = phi i32 [ 0, %for.cond.preheader ], [ %inc20, %vector.ph ] %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a.038, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.039, i64 0 %2 = add nuw nsw <4 x i32> %broadcast.splat, <i32 0, i32 1, i32 2, i32 3> %3 = sub <4 x i32> %broadcast.splat44, %2 %4 = icmp ult <4 x i32> %3, <i32 10, i32 10, i32 10, i32 10> %5 = zext <4 x i1> %4 to <4 x i32> %6 = add <4 x i32> %1, %5 %reass.sub = sub <4 x i32> %broadcast.splat44, %broadcast.splat %7 = add <4 x i32> %reass.sub, <i32 -1, i32 -2, i32 -3, i32 -4> %8 = icmp ult <4 x i32> %7, <i32 10, i32 10, i32 10, i32 10> %9 = zext <4 x i1> %8 to <4 x i32> %10 = add <4 x i32> %6, %9 %11 = add nuw <4 x i32> %broadcast.splat, <i32 2, i32 3, i32 4, i32 5> %12 = sub <4 x i32> %broadcast.splat44, %11 %13 = icmp ult <4 x i32> %12, <i32 10, i32 10, i32 10, i32 10> %14 = zext <4 x i1> %13 to <4 x i32> %15 = add <4 x i32> %10, %14 %16 = add nuw <4 x i32> %broadcast.splat, <i32 3, i32 4, i32 5, i32 6> %17 = sub <4 x i32> %broadcast.splat44, %16 %18 = icmp ult <4 x i32> %17, <i32 10, i32 10, i32 10, i32 10> %19 = zext <4 x i1> %18 to <4 x i32> %20 = add <4 x i32> %15, %19 %21 = add nuw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %22 = sub <4 x i32> %broadcast.splat44, %21 %23 = icmp ult <4 x i32> %22, <i32 10, i32 10, i32 10, i32 10> %24 = zext <4 x i1> %23 to <4 x i32> %25 = add <4 x i32> %20, %24 %26 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %27 = sub <4 x i32> %broadcast.splat44, %26 %28 = icmp ult <4 x i32> %27, <i32 10, i32 10, i32 10, i32 10> %29 = zext <4 x i1> %28 to <4 x i32> %30 = add <4 x i32> %25, %29 %31 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %32 = sub <4 x i32> %broadcast.splat44, %31 %33 = icmp ult <4 x i32> %32, <i32 10, i32 10, i32 10, i32 10> %34 = zext <4 x i1> %33 to <4 x i32> %35 = add <4 x i32> %30, %34 %36 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %37 = sub <4 x i32> %broadcast.splat44, %36 %38 = icmp ult <4 x i32> %37, <i32 10, i32 10, i32 10, i32 10> %39 = zext <4 x i1> %38 to <4 x i32> %40 = add <4 x i32> %35, %39 %41 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %42 = sub <4 x i32> %broadcast.splat44, %41 %43 = icmp ult <4 x i32> %42, <i32 10, i32 10, i32 10, i32 10> %44 = zext <4 x i1> %43 to <4 x i32> %45 = add <4 x i32> %40, %44 %46 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %47 = sub <4 x i32> %broadcast.splat44, %46 %48 = icmp ult <4 x i32> %47, <i32 10, i32 10, i32 10, i32 10> %49 = zext <4 x i1> %48 to <4 x i32> %50 = add <4 x i32> %45, %49 %51 = add nuw nsw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %52 = sub <4 x i32> %broadcast.splat44, %51 %53 = icmp ult <4 x i32> %52, <i32 10, i32 10, i32 10, i32 10> %54 = zext <4 x i1> %53 to <4 x i32> %55 = add <4 x i32> %50, %54 %reass.sub46 = sub <4 x i32> %broadcast.splat44, %broadcast.splat %56 = add <4 x i32> %reass.sub46, <i32 -5, i32 -6, i32 -7, i32 -8> %57 = icmp ult <4 x i32> %56, <i32 10, i32 10, i32 10, i32 10> %58 = zext <4 x i1> %57 to <4 x i32> %59 = add <4 x i32> %55, %58 %60 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %61 = sub <4 x i32> %broadcast.splat44, %60 %62 = icmp ult <4 x i32> %61, <i32 10, i32 10, i32 10, i32 10> %63 = zext <4 x i1> %62 to <4 x i32> %64 = add <4 x i32> %59, %63 %65 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %66 = sub <4 x i32> %broadcast.splat44, %65 %67 = icmp ult <4 x i32> %66, <i32 10, i32 10, i32 10, i32 10> %68 = zext <4 x i1> %67 to <4 x i32> %69 = add <4 x i32> %64, %68 %70 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %71 = sub <4 x i32> %broadcast.splat44, %70 %72 = icmp ult <4 x i32> %71, <i32 10, i32 10, i32 10, i32 10> %73 = zext <4 x i1> %72 to <4 x i32> %74 = add <4 x i32> %69, %73 %75 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %76 = sub <4 x i32> %broadcast.splat44, %75 %77 = icmp ult <4 x i32> %76, <i32 10, i32 10, i32 10, i32 10> %78 = zext <4 x i1> %77 to <4 x i32> %79 = add <4 x i32> %74, %78 %80 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %81 = sub <4 x i32> %broadcast.splat44, %80 %82 = icmp ult <4 x i32> %81, <i32 10, i32 10, i32 10, i32 10> %83 = zext <4 x i1> %82 to <4 x i32> %84 = add <4 x i32> %79, %83 %85 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %86 = sub <4 x i32> %broadcast.splat44, %85 %87 = icmp ult <4 x i32> %86, <i32 10, i32 10, i32 10, i32 10> %88 = zext <4 x i1> %87 to <4 x i32> %89 = add <4 x i32> %84, %88 %90 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %91 = sub <4 x i32> %broadcast.splat44, %90 %92 = icmp ult <4 x i32> %91, <i32 10, i32 10, i32 10, i32 10> %93 = zext <4 x i1> %92 to <4 x i32> %94 = add <4 x i32> %89, %93 %95 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %96 = sub <4 x i32> %broadcast.splat44, %95 %97 = icmp ult <4 x i32> %96, <i32 10, i32 10, i32 10, i32 10> %98 = zext <4 x i1> %97 to <4 x i32> %99 = add <4 x i32> %94, %98 %100 = add nuw nsw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %101 = sub <4 x i32> %broadcast.splat44, %100 %102 = icmp ult <4 x i32> %101, <i32 10, i32 10, i32 10, i32 10> %103 = zext <4 x i1> %102 to <4 x i32> %104 = add <4 x i32> %99, %103 %reass.sub47 = sub <4 x i32> %broadcast.splat44, %broadcast.splat %105 = add <4 x i32> %reass.sub47, <i32 -9, i32 -10, i32 -11, i32 -12> %106 = icmp ult <4 x i32> %105, <i32 10, i32 10, i32 10, i32 10> %107 = zext <4 x i1> %106 to <4 x i32> %108 = add <4 x i32> %104, %107 %109 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %110 = sub <4 x i32> %broadcast.splat44, %109 %111 = icmp ult <4 x i32> %110, <i32 10, i32 10, i32 10, i32 10> %112 = zext <4 x i1> %111 to <4 x i32> %113 = add <4 x i32> %108, %112 %114 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %115 = sub <4 x i32> %broadcast.splat44, %114 %116 = icmp ult <4 x i32> %115, <i32 10, i32 10, i32 10, i32 10> %117 = zext <4 x i1> %116 to <4 x i32> %118 = add <4 x i32> %113, %117 %119 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %120 = sub <4 x i32> %broadcast.splat44, %119 %121 = icmp ult <4 x i32> %120, <i32 10, i32 10, i32 10, i32 10> %122 = zext <4 x i1> %121 to <4 x i32> %123 = add <4 x i32> %118, %122 %124 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %125 = sub <4 x i32> %broadcast.splat44, %124 %126 = icmp ult <4 x i32> %125, <i32 10, i32 10, i32 10, i32 10> %127 = zext <4 x i1> %126 to <4 x i32> %128 = add <4 x i32> %123, %127 %129 = add nuw <4 x i32> %broadcast.splat, <i32 14, i32 15, i32 16, i32 17> %130 = sub <4 x i32> %broadcast.splat44, %129 %131 = icmp ult <4 x i32> %130, <i32 10, i32 10, i32 10, i32 10> %132 = zext <4 x i1> %131 to <4 x i32> %133 = add <4 x i32> %128, %132 %134 = add nuw <4 x i32> %broadcast.splat, <i32 15, i32 16, i32 17, i32 18> %135 = sub <4 x i32> %broadcast.splat44, %134 %136 = icmp ult <4 x i32> %135, <i32 10, i32 10, i32 10, i32 10> %137 = zext <4 x i1> %136 to <4 x i32> %138 = add <4 x i32> %133, %137 %139 = add nuw <4 x i32> %broadcast.splat, <i32 16, i32 17, i32 18, i32 19> %140 = sub <4 x i32> %broadcast.splat44, %139 %141 = icmp ult <4 x i32> %140, <i32 10, i32 10, i32 10, i32 10> %142 = zext <4 x i1> %141 to <4 x i32> %143 = add <4 x i32> %138, %142 %144 = add nuw <4 x i32> %broadcast.splat, <i32 17, i32 18, i32 19, i32 20> %145 = sub <4 x i32> %broadcast.splat44, %144 %146 = icmp ult <4 x i32> %145, <i32 10, i32 10, i32 10, i32 10> %147 = zext <4 x i1> %146 to <4 x i32> %148 = add <4 x i32> %143, %147 %149 = shufflevector <4 x i32> %148, <4 x i32> %99, <4 x i32> <i32 0, i32 1, i32 6, i32 7> %150 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %149) %inc20 = add nuw nsw i32 %a.038, 1 %exitcond42.not = icmp eq i32 %inc20, 10 br i1 %exitcond42.not, label %for.end21, label %vector.ph, !llvm.loop !9 for.end21: ; preds = %vector.ph %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %150) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %cmp = icmp eq i32 %call, 1 br i1 %cmp, label %for.cond.preheader, label %while.end, !llvm.loop !11 while.end: ; preds = %for.end21, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void) { int i, j, k, l, cnt, n; while(scanf("%d",&n)!=EOF) { cnt = 0; for(i = 0; i <= 9; i++) for(j = 0; j <= 9; j++) for(k = 0; k <= 9; k++) for(l = 0; l <= 9; l++) if(i + j + k + l == n) cnt++; printf("%d\n", cnt); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112078/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112078/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not43 = icmp eq i32 %call42, -1 br i1 %cmp.not43, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end23 %0 = load i32, ptr %n, align 4, !tbaa !5 %broadcast.splatinsert46 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat47 = shufflevector <4 x i32> %broadcast.splatinsert46, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond.preheader, %for.inc21 %cnt.041 = phi i32 [ 0, %for.cond.preheader ], [ %123, %for.inc21 ] %i.040 = phi i32 [ 0, %for.cond.preheader ], [ %inc22, %for.inc21 ] br label %vector.ph vector.ph: ; preds = %vector.ph, %for.cond2.preheader %cnt.139 = phi i32 [ %cnt.041, %for.cond2.preheader ], [ %123, %vector.ph ] %j.038 = phi i32 [ 0, %for.cond2.preheader ], [ %inc19, %vector.ph ] %add = add nuw nsw i32 %j.038, %i.040 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %cnt.139, i64 0 %2 = add nuw nsw <4 x i32> %broadcast.splat, <i32 0, i32 1, i32 2, i32 3> %3 = icmp eq <4 x i32> %2, %broadcast.splat47 %4 = zext <4 x i1> %3 to <4 x i32> %5 = add <4 x i32> %1, %4 %6 = add nuw <4 x i32> %broadcast.splat, <i32 1, i32 2, i32 3, i32 4> %7 = icmp eq <4 x i32> %6, %broadcast.splat47 %8 = zext <4 x i1> %7 to <4 x i32> %9 = add <4 x i32> %5, %8 %10 = add nuw <4 x i32> %broadcast.splat, <i32 2, i32 3, i32 4, i32 5> %11 = icmp eq <4 x i32> %10, %broadcast.splat47 %12 = zext <4 x i1> %11 to <4 x i32> %13 = add <4 x i32> %9, %12 %14 = add nuw <4 x i32> %broadcast.splat, <i32 3, i32 4, i32 5, i32 6> %15 = icmp eq <4 x i32> %14, %broadcast.splat47 %16 = zext <4 x i1> %15 to <4 x i32> %17 = add <4 x i32> %13, %16 %18 = add nuw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %19 = icmp eq <4 x i32> %18, %broadcast.splat47 %20 = zext <4 x i1> %19 to <4 x i32> %21 = add <4 x i32> %17, %20 %22 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %23 = icmp eq <4 x i32> %22, %broadcast.splat47 %24 = zext <4 x i1> %23 to <4 x i32> %25 = add <4 x i32> %21, %24 %26 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %27 = icmp eq <4 x i32> %26, %broadcast.splat47 %28 = zext <4 x i1> %27 to <4 x i32> %29 = add <4 x i32> %25, %28 %30 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %31 = icmp eq <4 x i32> %30, %broadcast.splat47 %32 = zext <4 x i1> %31 to <4 x i32> %33 = add <4 x i32> %29, %32 %34 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %35 = icmp eq <4 x i32> %34, %broadcast.splat47 %36 = zext <4 x i1> %35 to <4 x i32> %37 = add <4 x i32> %33, %36 %38 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %39 = icmp eq <4 x i32> %38, %broadcast.splat47 %40 = zext <4 x i1> %39 to <4 x i32> %41 = add <4 x i32> %37, %40 %42 = add nuw nsw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %43 = icmp eq <4 x i32> %42, %broadcast.splat47 %44 = zext <4 x i1> %43 to <4 x i32> %45 = add <4 x i32> %41, %44 %46 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %47 = icmp eq <4 x i32> %46, %broadcast.splat47 %48 = zext <4 x i1> %47 to <4 x i32> %49 = add <4 x i32> %45, %48 %50 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %51 = icmp eq <4 x i32> %50, %broadcast.splat47 %52 = zext <4 x i1> %51 to <4 x i32> %53 = add <4 x i32> %49, %52 %54 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %55 = icmp eq <4 x i32> %54, %broadcast.splat47 %56 = zext <4 x i1> %55 to <4 x i32> %57 = add <4 x i32> %53, %56 %58 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %59 = icmp eq <4 x i32> %58, %broadcast.splat47 %60 = zext <4 x i1> %59 to <4 x i32> %61 = add <4 x i32> %57, %60 %62 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %63 = icmp eq <4 x i32> %62, %broadcast.splat47 %64 = zext <4 x i1> %63 to <4 x i32> %65 = add <4 x i32> %61, %64 %66 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %67 = icmp eq <4 x i32> %66, %broadcast.splat47 %68 = zext <4 x i1> %67 to <4 x i32> %69 = add <4 x i32> %65, %68 %70 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %71 = icmp eq <4 x i32> %70, %broadcast.splat47 %72 = zext <4 x i1> %71 to <4 x i32> %73 = add <4 x i32> %69, %72 %74 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %75 = icmp eq <4 x i32> %74, %broadcast.splat47 %76 = zext <4 x i1> %75 to <4 x i32> %77 = add <4 x i32> %73, %76 %78 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %79 = icmp eq <4 x i32> %78, %broadcast.splat47 %80 = zext <4 x i1> %79 to <4 x i32> %81 = add <4 x i32> %77, %80 %82 = add nuw nsw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %83 = icmp eq <4 x i32> %82, %broadcast.splat47 %84 = zext <4 x i1> %83 to <4 x i32> %85 = add <4 x i32> %81, %84 %86 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %87 = icmp eq <4 x i32> %86, %broadcast.splat47 %88 = zext <4 x i1> %87 to <4 x i32> %89 = add <4 x i32> %85, %88 %90 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %91 = icmp eq <4 x i32> %90, %broadcast.splat47 %92 = zext <4 x i1> %91 to <4 x i32> %93 = add <4 x i32> %89, %92 %94 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %95 = icmp eq <4 x i32> %94, %broadcast.splat47 %96 = zext <4 x i1> %95 to <4 x i32> %97 = add <4 x i32> %93, %96 %98 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %99 = icmp eq <4 x i32> %98, %broadcast.splat47 %100 = zext <4 x i1> %99 to <4 x i32> %101 = add <4 x i32> %97, %100 %102 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %103 = icmp eq <4 x i32> %102, %broadcast.splat47 %104 = zext <4 x i1> %103 to <4 x i32> %105 = add <4 x i32> %101, %104 %106 = add nuw <4 x i32> %broadcast.splat, <i32 14, i32 15, i32 16, i32 17> %107 = icmp eq <4 x i32> %106, %broadcast.splat47 %108 = zext <4 x i1> %107 to <4 x i32> %109 = add <4 x i32> %105, %108 %110 = add nuw <4 x i32> %broadcast.splat, <i32 15, i32 16, i32 17, i32 18> %111 = icmp eq <4 x i32> %110, %broadcast.splat47 %112 = zext <4 x i1> %111 to <4 x i32> %113 = add <4 x i32> %109, %112 %114 = add nuw <4 x i32> %broadcast.splat, <i32 16, i32 17, i32 18, i32 19> %115 = icmp eq <4 x i32> %114, %broadcast.splat47 %116 = zext <4 x i1> %115 to <4 x i32> %117 = add <4 x i32> %113, %116 %118 = add nuw <4 x i32> %broadcast.splat, <i32 17, i32 18, i32 19, i32 20> %119 = icmp eq <4 x i32> %118, %broadcast.splat47 %120 = zext <4 x i1> %119 to <4 x i32> %121 = add <4 x i32> %117, %120 %122 = shufflevector <4 x i32> %121, <4 x i32> %81, <4 x i32> <i32 0, i32 1, i32 6, i32 7> %123 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %122) %inc19 = add nuw nsw i32 %j.038, 1 %exitcond44.not = icmp eq i32 %inc19, 10 br i1 %exitcond44.not, label %for.inc21, label %vector.ph, !llvm.loop !9 for.inc21: ; preds = %vector.ph %inc22 = add nuw nsw i32 %i.040, 1 %exitcond45.not = icmp eq i32 %inc22, 10 br i1 %exitcond45.not, label %for.end23, label %for.cond2.preheader, !llvm.loop !11 for.end23: ; preds = %for.inc21 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %123) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12 while.end: ; preds = %for.end23, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int solve(int answer) { int a, ab, abc, abcd; int cnt = 0; for (a = 0; a < 10; a++) { if (answer < a) break; for (ab = a; ab < a + 10; ab++) { if (answer < ab) break; for (abc = ab; abc < ab + 10; abc++) { if (answer < abc) break; for (abcd = abc; abcd < abc + 10; abcd++) { if (answer == abcd) { cnt++; break; } if (answer < abcd) break; } } } } return cnt; } int main() { int n; while (scanf(" %d", &n) != EOF) { printf("%d\n", solve(n)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112128/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112128/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @solve(i32 noundef %answer) local_unnamed_addr #0 { entry: %cmp162 = icmp slt i32 %answer, 0 br i1 %cmp162, label %for.end34, label %for.cond2.preheader.preheader for.cond2.preheader.preheader: ; preds = %entry %umin84 = tail call i32 @llvm.umin.i32(i32 %answer, i32 9) br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.inc32 %indvars.iv76 = phi i32 [ 1, %for.cond2.preheader.preheader ], [ %indvars.iv.next77, %for.inc32 ] %indvars.iv70 = phi i32 [ -1, %for.cond2.preheader.preheader ], [ %indvars.iv.next71, %for.inc32 ] %indvars.iv = phi i32 [ %answer, %for.cond2.preheader.preheader ], [ %indvars.iv.next, %for.inc32 ] %cnt.064 = phi i32 [ 0, %for.cond2.preheader.preheader ], [ %cnt.3, %for.inc32 ] %a.063 = phi i32 [ 0, %for.cond2.preheader.preheader ], [ %inc33, %for.inc32 ] %add = add nuw nsw i32 %a.063, 10 br label %for.cond8.preheader for.cond8.preheader: ; preds = %for.cond2.preheader, %for.inc29 %indvars.iv78 = phi i32 [ %indvars.iv76, %for.cond2.preheader ], [ %indvars.iv.next79, %for.inc29 ] %indvars.iv72 = phi i32 [ %indvars.iv70, %for.cond2.preheader ], [ %indvars.iv.next73, %for.inc29 ] %indvars.iv66 = phi i32 [ %indvars.iv, %for.cond2.preheader ], [ %indvars.iv.next67, %for.inc29 ] %cnt.161 = phi i32 [ %cnt.064, %for.cond2.preheader ], [ %cnt.3, %for.inc29 ] %ab.060 = phi i32 [ %a.063, %for.cond2.preheader ], [ %inc30, %for.inc29 ] %add9 = add nuw nsw i32 %ab.060, 10 br label %for.cond15.preheader for.cond15.preheader: ; preds = %for.cond8.preheader, %for.inc26 %indvars.iv80 = phi i32 [ %indvars.iv78, %for.cond8.preheader ], [ %indvars.iv.next81, %for.inc26 ] %indvars.iv74 = phi i32 [ %indvars.iv72, %for.cond8.preheader ], [ %indvars.iv.next75, %for.inc26 ] %indvars.iv68 = phi i32 [ %indvars.iv66, %for.cond8.preheader ], [ %indvars.iv.next69, %for.inc26 ] %cnt.259 = phi i32 [ %cnt.161, %for.cond8.preheader ], [ %cnt.3, %for.inc26 ] %abc.058 = phi i32 [ %ab.060, %for.cond8.preheader ], [ %inc27, %for.inc26 ] %smax = tail call i32 @llvm.smax.i32(i32 %answer, i32 %indvars.iv74) %0 = add i32 %smax, %indvars.iv80 %umin = tail call i32 @llvm.umin.i32(i32 %indvars.iv68, i32 %0) %umin82 = tail call i32 @llvm.umin.i32(i32 %umin, i32 9) %umin83 = tail call i32 @llvm.umin.i32(i32 %0, i32 9) %1 = icmp eq i32 %indvars.iv68, %umin82 %.not = icmp eq i32 %umin83, %umin82 br label %for.body18 for.body18: ; preds = %if.end21, %for.cond15.preheader br i1 %1, label %if.then20, label %if.end21 if.then20: ; preds = %for.body18 %inc = add nsw i32 %cnt.259, 1 br label %for.inc26 if.end21: ; preds = %for.body18 br i1 %.not, label %for.inc26, label %for.body18, !llvm.loop !5 for.inc26: ; preds = %if.end21, %if.then20 %cnt.3 = phi i32 [ %inc, %if.then20 ], [ %cnt.259, %if.end21 ] %inc27 = add nuw nsw i32 %abc.058, 1 %cmp10 = icmp uge i32 %inc27, %add9 %cmp12 = icmp sge i32 %abc.058, %answer %or.cond56 = or i1 %cmp10, %cmp12 %indvars.iv.next69 = add i32 %indvars.iv68, -1 %indvars.iv.next75 = add nsw i32 %indvars.iv74, 1 %indvars.iv.next81 = add nsw i32 %indvars.iv80, -1 br i1 %or.cond56, label %for.inc29, label %for.cond15.preheader, !llvm.loop !7 for.inc29: ; preds = %for.inc26 %inc30 = add nuw nsw i32 %ab.060, 1 %cmp3 = icmp uge i32 %inc30, %add %cmp5 = icmp sge i32 %ab.060, %answer %or.cond55 = or i1 %cmp3, %cmp5 %indvars.iv.next67 = add i32 %indvars.iv66, -1 %indvars.iv.next73 = add nsw i32 %indvars.iv72, 1 %indvars.iv.next79 = add nsw i32 %indvars.iv78, -1 br i1 %or.cond55, label %for.inc32, label %for.cond8.preheader, !llvm.loop !8 for.inc32: ; preds = %for.inc29 %inc33 = add nuw nsw i32 %a.063, 1 %indvars.iv.next = add i32 %indvars.iv, -1 %indvars.iv.next71 = add nsw i32 %indvars.iv70, 1 %indvars.iv.next77 = add nsw i32 %indvars.iv76, -1 %exitcond = icmp eq i32 %a.063, %umin84 br i1 %exitcond, label %for.end34, label %for.cond2.preheader, !llvm.loop !9 for.end34: ; preds = %for.inc32, %entry %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.3, %for.inc32 ] ret i32 %cnt.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 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not4 = icmp eq i32 %call3, -1 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %solve.exit %0 = load i32, ptr %n, align 4, !tbaa !10 %cmp162.i = icmp slt i32 %0, 0 br i1 %cmp162.i, label %solve.exit, label %for.cond2.preheader.preheader.i for.cond2.preheader.preheader.i: ; preds = %while.body %umin84.i = call i32 @llvm.umin.i32(i32 %0, i32 9) br label %for.cond2.preheader.i for.cond2.preheader.i: ; preds = %for.inc32.i, %for.cond2.preheader.preheader.i %indvars.iv76.i = phi i32 [ 1, %for.cond2.preheader.preheader.i ], [ %indvars.iv.next77.i, %for.inc32.i ] %indvars.iv70.i = phi i32 [ -1, %for.cond2.preheader.preheader.i ], [ %indvars.iv.next71.i, %for.inc32.i ] %indvars.iv.i = phi i32 [ %0, %for.cond2.preheader.preheader.i ], [ %indvars.iv.next.i, %for.inc32.i ] %cnt.064.i = phi i32 [ 0, %for.cond2.preheader.preheader.i ], [ %cnt.3.i, %for.inc32.i ] %a.063.i = phi i32 [ 0, %for.cond2.preheader.preheader.i ], [ %inc33.i, %for.inc32.i ] %add.i = add nuw nsw i32 %a.063.i, 10 br label %for.cond8.preheader.i for.cond8.preheader.i: ; preds = %for.inc29.i, %for.cond2.preheader.i %indvars.iv78.i = phi i32 [ %indvars.iv76.i, %for.cond2.preheader.i ], [ %indvars.iv.next79.i, %for.inc29.i ] %indvars.iv72.i = phi i32 [ %indvars.iv70.i, %for.cond2.preheader.i ], [ %indvars.iv.next73.i, %for.inc29.i ] %indvars.iv66.i = phi i32 [ %indvars.iv.i, %for.cond2.preheader.i ], [ %indvars.iv.next67.i, %for.inc29.i ] %cnt.161.i = phi i32 [ %cnt.064.i, %for.cond2.preheader.i ], [ %cnt.3.i, %for.inc29.i ] %ab.060.i = phi i32 [ %a.063.i, %for.cond2.preheader.i ], [ %inc30.i, %for.inc29.i ] %add9.i = add nuw nsw i32 %ab.060.i, 10 br label %for.cond15.preheader.i for.cond15.preheader.i: ; preds = %for.inc26.i, %for.cond8.preheader.i %indvars.iv80.i = phi i32 [ %indvars.iv78.i, %for.cond8.preheader.i ], [ %indvars.iv.next81.i, %for.inc26.i ] %indvars.iv74.i = phi i32 [ %indvars.iv72.i, %for.cond8.preheader.i ], [ %indvars.iv.next75.i, %for.inc26.i ] %indvars.iv68.i = phi i32 [ %indvars.iv66.i, %for.cond8.preheader.i ], [ %indvars.iv.next69.i, %for.inc26.i ] %cnt.259.i = phi i32 [ %cnt.161.i, %for.cond8.preheader.i ], [ %cnt.3.i, %for.inc26.i ] %abc.058.i = phi i32 [ %ab.060.i, %for.cond8.preheader.i ], [ %inc27.i, %for.inc26.i ] %smax.i = call i32 @llvm.smax.i32(i32 %0, i32 %indvars.iv74.i) %1 = add i32 %smax.i, %indvars.iv80.i %umin.i = call i32 @llvm.umin.i32(i32 %indvars.iv68.i, i32 %1) %umin82.i = call i32 @llvm.umin.i32(i32 %umin.i, i32 9) %2 = icmp eq i32 %indvars.iv68.i, %umin82.i br i1 %2, label %if.then20.i, label %for.cond15.preheader.i.split for.cond15.preheader.i.split: ; preds = %for.cond15.preheader.i %umin83.i = call i32 @llvm.umin.i32(i32 %1, i32 9) %.not.i = icmp eq i32 %umin83.i, %umin82.i br i1 %.not.i, label %for.inc26.i, label %for.body18.i, !llvm.loop !5 for.body18.i: ; preds = %for.cond15.preheader.i.split, %for.body18.i br label %for.body18.i if.then20.i: ; preds = %for.cond15.preheader.i %inc.i = add nsw i32 %cnt.259.i, 1 br label %for.inc26.i for.inc26.i: ; preds = %for.cond15.preheader.i.split, %if.then20.i %cnt.3.i = phi i32 [ %inc.i, %if.then20.i ], [ %cnt.259.i, %for.cond15.preheader.i.split ] %inc27.i = add nuw nsw i32 %abc.058.i, 1 %cmp10.i = icmp uge i32 %inc27.i, %add9.i %cmp12.i = icmp sge i32 %abc.058.i, %0 %or.cond56.i = or i1 %cmp12.i, %cmp10.i %indvars.iv.next69.i = add i32 %indvars.iv68.i, -1 %indvars.iv.next75.i = add nsw i32 %indvars.iv74.i, 1 %indvars.iv.next81.i = add nsw i32 %indvars.iv80.i, -1 br i1 %or.cond56.i, label %for.inc29.i, label %for.cond15.preheader.i, !llvm.loop !7 for.inc29.i: ; preds = %for.inc26.i %inc30.i = add nuw nsw i32 %ab.060.i, 1 %cmp3.i = icmp uge i32 %inc30.i, %add.i %cmp5.i = icmp sge i32 %ab.060.i, %0 %or.cond55.i = or i1 %cmp5.i, %cmp3.i %indvars.iv.next67.i = add i32 %indvars.iv66.i, -1 %indvars.iv.next73.i = add nsw i32 %indvars.iv72.i, 1 %indvars.iv.next79.i = add nsw i32 %indvars.iv78.i, -1 br i1 %or.cond55.i, label %for.inc32.i, label %for.cond8.preheader.i, !llvm.loop !8 for.inc32.i: ; preds = %for.inc29.i %inc33.i = add nuw nsw i32 %a.063.i, 1 %indvars.iv.next.i = add i32 %indvars.iv.i, -1 %indvars.iv.next71.i = add nsw i32 %indvars.iv70.i, 1 %indvars.iv.next77.i = add nsw i32 %indvars.iv76.i, -1 %exitcond.i = icmp eq i32 %a.063.i, %umin84.i br i1 %exitcond.i, label %solve.exit, label %for.cond2.preheader.i, !llvm.loop !9 solve.exit: ; preds = %for.inc32.i, %while.body %cnt.0.lcssa.i = phi i32 [ 0, %while.body ], [ %cnt.3.i, %for.inc32.i ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %solve.exit, %entry 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.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umin.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 = distinct !{!7, !6} !8 = distinct !{!8, !6} !9 = distinct !{!9, !6} !10 = !{!11, !11, i64 0} !11 = !{!"int", !12, i64 0} !12 = !{!"omnipotent char", !13, i64 0} !13 = !{!"Simple C/C++ TBAA"} !14 = distinct !{!14, !6}
#include <stdio.h> int main() { int a,b,c,d,n,count; while(scanf("%d",&n)!=EOF){ count = 0; for(a=0; a<10; a++){ for(b=0; b<10; b++){ for(c=0; c<10; c++){ for(d=0; d<10; d++){ if((a+b+c+d)==n) count ++; } } } } printf("%d\n",count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112179/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112179/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not43 = icmp eq i32 %call42, -1 br i1 %cmp.not43, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end23 %0 = load i32, ptr %n, align 4, !tbaa !5 %broadcast.splatinsert46 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat47 = shufflevector <4 x i32> %broadcast.splatinsert46, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond.preheader, %for.inc21 %count.041 = phi i32 [ 0, %for.cond.preheader ], [ %123, %for.inc21 ] %a.040 = phi i32 [ 0, %for.cond.preheader ], [ %inc22, %for.inc21 ] br label %vector.ph vector.ph: ; preds = %vector.ph, %for.cond2.preheader %count.139 = phi i32 [ %count.041, %for.cond2.preheader ], [ %123, %vector.ph ] %b.038 = phi i32 [ 0, %for.cond2.preheader ], [ %inc19, %vector.ph ] %add = add nuw nsw i32 %b.038, %a.040 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.139, i64 0 %2 = add nuw nsw <4 x i32> %broadcast.splat, <i32 0, i32 1, i32 2, i32 3> %3 = icmp eq <4 x i32> %2, %broadcast.splat47 %4 = zext <4 x i1> %3 to <4 x i32> %5 = add <4 x i32> %1, %4 %6 = add nuw <4 x i32> %broadcast.splat, <i32 1, i32 2, i32 3, i32 4> %7 = icmp eq <4 x i32> %6, %broadcast.splat47 %8 = zext <4 x i1> %7 to <4 x i32> %9 = add <4 x i32> %5, %8 %10 = add nuw <4 x i32> %broadcast.splat, <i32 2, i32 3, i32 4, i32 5> %11 = icmp eq <4 x i32> %10, %broadcast.splat47 %12 = zext <4 x i1> %11 to <4 x i32> %13 = add <4 x i32> %9, %12 %14 = add nuw <4 x i32> %broadcast.splat, <i32 3, i32 4, i32 5, i32 6> %15 = icmp eq <4 x i32> %14, %broadcast.splat47 %16 = zext <4 x i1> %15 to <4 x i32> %17 = add <4 x i32> %13, %16 %18 = add nuw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %19 = icmp eq <4 x i32> %18, %broadcast.splat47 %20 = zext <4 x i1> %19 to <4 x i32> %21 = add <4 x i32> %17, %20 %22 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %23 = icmp eq <4 x i32> %22, %broadcast.splat47 %24 = zext <4 x i1> %23 to <4 x i32> %25 = add <4 x i32> %21, %24 %26 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %27 = icmp eq <4 x i32> %26, %broadcast.splat47 %28 = zext <4 x i1> %27 to <4 x i32> %29 = add <4 x i32> %25, %28 %30 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %31 = icmp eq <4 x i32> %30, %broadcast.splat47 %32 = zext <4 x i1> %31 to <4 x i32> %33 = add <4 x i32> %29, %32 %34 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %35 = icmp eq <4 x i32> %34, %broadcast.splat47 %36 = zext <4 x i1> %35 to <4 x i32> %37 = add <4 x i32> %33, %36 %38 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %39 = icmp eq <4 x i32> %38, %broadcast.splat47 %40 = zext <4 x i1> %39 to <4 x i32> %41 = add <4 x i32> %37, %40 %42 = add nuw nsw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %43 = icmp eq <4 x i32> %42, %broadcast.splat47 %44 = zext <4 x i1> %43 to <4 x i32> %45 = add <4 x i32> %41, %44 %46 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %47 = icmp eq <4 x i32> %46, %broadcast.splat47 %48 = zext <4 x i1> %47 to <4 x i32> %49 = add <4 x i32> %45, %48 %50 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %51 = icmp eq <4 x i32> %50, %broadcast.splat47 %52 = zext <4 x i1> %51 to <4 x i32> %53 = add <4 x i32> %49, %52 %54 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %55 = icmp eq <4 x i32> %54, %broadcast.splat47 %56 = zext <4 x i1> %55 to <4 x i32> %57 = add <4 x i32> %53, %56 %58 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %59 = icmp eq <4 x i32> %58, %broadcast.splat47 %60 = zext <4 x i1> %59 to <4 x i32> %61 = add <4 x i32> %57, %60 %62 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %63 = icmp eq <4 x i32> %62, %broadcast.splat47 %64 = zext <4 x i1> %63 to <4 x i32> %65 = add <4 x i32> %61, %64 %66 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %67 = icmp eq <4 x i32> %66, %broadcast.splat47 %68 = zext <4 x i1> %67 to <4 x i32> %69 = add <4 x i32> %65, %68 %70 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %71 = icmp eq <4 x i32> %70, %broadcast.splat47 %72 = zext <4 x i1> %71 to <4 x i32> %73 = add <4 x i32> %69, %72 %74 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %75 = icmp eq <4 x i32> %74, %broadcast.splat47 %76 = zext <4 x i1> %75 to <4 x i32> %77 = add <4 x i32> %73, %76 %78 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %79 = icmp eq <4 x i32> %78, %broadcast.splat47 %80 = zext <4 x i1> %79 to <4 x i32> %81 = add <4 x i32> %77, %80 %82 = add nuw nsw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %83 = icmp eq <4 x i32> %82, %broadcast.splat47 %84 = zext <4 x i1> %83 to <4 x i32> %85 = add <4 x i32> %81, %84 %86 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %87 = icmp eq <4 x i32> %86, %broadcast.splat47 %88 = zext <4 x i1> %87 to <4 x i32> %89 = add <4 x i32> %85, %88 %90 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %91 = icmp eq <4 x i32> %90, %broadcast.splat47 %92 = zext <4 x i1> %91 to <4 x i32> %93 = add <4 x i32> %89, %92 %94 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %95 = icmp eq <4 x i32> %94, %broadcast.splat47 %96 = zext <4 x i1> %95 to <4 x i32> %97 = add <4 x i32> %93, %96 %98 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %99 = icmp eq <4 x i32> %98, %broadcast.splat47 %100 = zext <4 x i1> %99 to <4 x i32> %101 = add <4 x i32> %97, %100 %102 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %103 = icmp eq <4 x i32> %102, %broadcast.splat47 %104 = zext <4 x i1> %103 to <4 x i32> %105 = add <4 x i32> %101, %104 %106 = add nuw <4 x i32> %broadcast.splat, <i32 14, i32 15, i32 16, i32 17> %107 = icmp eq <4 x i32> %106, %broadcast.splat47 %108 = zext <4 x i1> %107 to <4 x i32> %109 = add <4 x i32> %105, %108 %110 = add nuw <4 x i32> %broadcast.splat, <i32 15, i32 16, i32 17, i32 18> %111 = icmp eq <4 x i32> %110, %broadcast.splat47 %112 = zext <4 x i1> %111 to <4 x i32> %113 = add <4 x i32> %109, %112 %114 = add nuw <4 x i32> %broadcast.splat, <i32 16, i32 17, i32 18, i32 19> %115 = icmp eq <4 x i32> %114, %broadcast.splat47 %116 = zext <4 x i1> %115 to <4 x i32> %117 = add <4 x i32> %113, %116 %118 = add nuw <4 x i32> %broadcast.splat, <i32 17, i32 18, i32 19, i32 20> %119 = icmp eq <4 x i32> %118, %broadcast.splat47 %120 = zext <4 x i1> %119 to <4 x i32> %121 = add <4 x i32> %117, %120 %122 = shufflevector <4 x i32> %121, <4 x i32> %81, <4 x i32> <i32 0, i32 1, i32 6, i32 7> %123 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %122) %inc19 = add nuw nsw i32 %b.038, 1 %exitcond44.not = icmp eq i32 %inc19, 10 br i1 %exitcond44.not, label %for.inc21, label %vector.ph, !llvm.loop !9 for.inc21: ; preds = %vector.ph %inc22 = add nuw nsw i32 %a.040, 1 %exitcond45.not = icmp eq i32 %inc22, 10 br i1 %exitcond45.not, label %for.end23, label %for.cond2.preheader, !llvm.loop !11 for.end23: ; preds = %for.inc21 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %123) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12 while.end: ; preds = %for.end23, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void) { int n[50]={0},m,i,j,k,l,c=0; while(scanf("%d",&m)!=-1){ for(i=0;i<10;i++){ for(j=0;j<10;j++){ for(k=0;k<10;k++){ for(l=0;l<10;l++){ if (i+j+k+l==m)n[c]++; } } } } c++; } for(i=0;i<c;i++)printf("%d\n",n[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112221/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112221/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca [50 x i32], align 16 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %n) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) %n, i8 0, i64 200, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %cmp.not52 = icmp eq i32 %call51, -1 br i1 %cmp.not52, label %for.end33, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end23 %indvars.iv = phi i64 [ %indvars.iv.next, %for.end23 ], [ 0, %entry ] %0 = load i32, ptr %m, align 4, !tbaa !5 %arrayidx = getelementptr inbounds [50 x i32], ptr %n, i64 0, i64 %indvars.iv br label %for.cond2.preheader for.cond25.preheader: ; preds = %for.end23 %1 = and i64 %indvars.iv.next, 4294967295 %cmp2654.not = icmp eq i64 %1, 0 br i1 %cmp2654.not, label %for.end33, label %for.body27.preheader for.body27.preheader: ; preds = %for.cond25.preheader %wide.trip.count = and i64 %indvars.iv.next, 4294967295 br label %for.body27 for.cond2.preheader: ; preds = %for.cond.preheader, %for.inc21 %i.050 = phi i32 [ 0, %for.cond.preheader ], [ %inc22, %for.inc21 ] br label %for.cond5.preheader for.cond5.preheader: ; preds = %for.cond2.preheader, %for.inc18 %j.049 = phi i32 [ 0, %for.cond2.preheader ], [ %inc19, %for.inc18 ] %add = add nuw nsw i32 %j.049, %i.050 br label %for.cond8.preheader for.cond8.preheader: ; preds = %for.cond5.preheader, %for.inc.9 %k.048 = phi i32 [ 0, %for.cond5.preheader ], [ %inc16, %for.inc.9 ] %add11 = add nuw nsw i32 %add, %k.048 %cmp13 = icmp eq i32 %add11, %0 br i1 %cmp13, label %if.then, label %for.inc if.then: ; preds = %for.cond8.preheader %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.cond8.preheader, %if.then %add12.1 = add nuw nsw i32 %add11, 1 %cmp13.1 = icmp eq i32 %add12.1, %0 br i1 %cmp13.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.1 = add nsw i32 %3, 1 store i32 %inc.1, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %add12.2 = add nuw nsw i32 %add11, 2 %cmp13.2 = icmp eq i32 %add12.2, %0 br i1 %cmp13.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.2 = add nsw i32 %4, 1 store i32 %inc.2, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %add12.3 = add nuw nsw i32 %add11, 3 %cmp13.3 = icmp eq i32 %add12.3, %0 br i1 %cmp13.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.inc.2 %5 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.3 = add nsw i32 %5, 1 store i32 %inc.3, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.inc.2 %add12.4 = add nuw nsw i32 %add11, 4 %cmp13.4 = icmp eq i32 %add12.4, %0 br i1 %cmp13.4, label %if.then.4, label %for.inc.4 if.then.4: ; preds = %for.inc.3 %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.4 = add nsw i32 %6, 1 store i32 %inc.4, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.inc.3 %add12.5 = add nuw nsw i32 %add11, 5 %cmp13.5 = icmp eq i32 %add12.5, %0 br i1 %cmp13.5, label %if.then.5, label %for.inc.5 if.then.5: ; preds = %for.inc.4 %7 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.5 = add nsw i32 %7, 1 store i32 %inc.5, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.inc.4 %add12.6 = add nuw nsw i32 %add11, 6 %cmp13.6 = icmp eq i32 %add12.6, %0 br i1 %cmp13.6, label %if.then.6, label %for.inc.6 if.then.6: ; preds = %for.inc.5 %8 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.6 = add nsw i32 %8, 1 store i32 %inc.6, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.6 for.inc.6: ; preds = %if.then.6, %for.inc.5 %add12.7 = add nuw nsw i32 %add11, 7 %cmp13.7 = icmp eq i32 %add12.7, %0 br i1 %cmp13.7, label %if.then.7, label %for.inc.7 if.then.7: ; preds = %for.inc.6 %9 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.7 = add nsw i32 %9, 1 store i32 %inc.7, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.7 for.inc.7: ; preds = %if.then.7, %for.inc.6 %add12.8 = add nuw nsw i32 %add11, 8 %cmp13.8 = icmp eq i32 %add12.8, %0 br i1 %cmp13.8, label %if.then.8, label %for.inc.8 if.then.8: ; preds = %for.inc.7 %10 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.8 = add nsw i32 %10, 1 store i32 %inc.8, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.8 for.inc.8: ; preds = %if.then.8, %for.inc.7 %add12.9 = add nuw nsw i32 %add11, 9 %cmp13.9 = icmp eq i32 %add12.9, %0 br i1 %cmp13.9, label %if.then.9, label %for.inc.9 if.then.9: ; preds = %for.inc.8 %11 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc.9 = add nsw i32 %11, 1 store i32 %inc.9, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.9 for.inc.9: ; preds = %if.then.9, %for.inc.8 %inc16 = add nuw nsw i32 %k.048, 1 %exitcond.not = icmp eq i32 %inc16, 10 br i1 %exitcond.not, label %for.inc18, label %for.cond8.preheader, !llvm.loop !9 for.inc18: ; preds = %for.inc.9 %inc19 = add nuw nsw i32 %j.049, 1 %exitcond56.not = icmp eq i32 %inc19, 10 br i1 %exitcond56.not, label %for.inc21, label %for.cond5.preheader, !llvm.loop !11 for.inc21: ; preds = %for.inc18 %inc22 = add nuw nsw i32 %i.050, 1 %exitcond57.not = icmp eq i32 %inc22, 10 br i1 %exitcond57.not, label %for.end23, label %for.cond2.preheader, !llvm.loop !12 for.end23: ; preds = %for.inc21 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond25.preheader, label %for.cond.preheader, !llvm.loop !13 for.body27: ; preds = %for.body27.preheader, %for.body27 %indvars.iv59 = phi i64 [ 0, %for.body27.preheader ], [ %indvars.iv.next60, %for.body27 ] %arrayidx29 = getelementptr inbounds [50 x i32], ptr %n, i64 0, i64 %indvars.iv59 %12 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12) %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1 %exitcond62.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count br i1 %exitcond62.not, label %for.end33, label %for.body27, !llvm.loop !14 for.end33: ; preds = %for.body27, %entry, %for.cond25.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = 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> int main() { int n, cnt; while ( scanf("%d", &n) != EOF ) { cnt = 0; for (int a=0; a<10; a++) { for (int b=0; b<10; b++) { for (int c=0; c<10; c++) { for (int d=0; d<10; d++) { if ( a + b + c + d == n ) cnt++; } } } } printf("%d\n", cnt); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112272/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112272/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not46 = icmp eq i32 %call45, -1 br i1 %cmp.not46, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.cleanup %0 = load i32, ptr %n, align 4, !tbaa !5 %broadcast.splatinsert49 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat50 = shufflevector <4 x i32> %broadcast.splatinsert49, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond.preheader, %for.cond.cleanup4 %a.044 = phi i32 [ 0, %for.cond.preheader ], [ %inc25, %for.cond.cleanup4 ] %cnt.043 = phi i32 [ 0, %for.cond.preheader ], [ %123, %for.cond.cleanup4 ] br label %vector.ph for.cond.cleanup: ; preds = %for.cond.cleanup4 %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %123) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !9 vector.ph: ; preds = %vector.ph, %for.cond2.preheader %b.042 = phi i32 [ 0, %for.cond2.preheader ], [ %inc22, %vector.ph ] %cnt.141 = phi i32 [ %cnt.043, %for.cond2.preheader ], [ %123, %vector.ph ] %add = add nuw nsw i32 %b.042, %a.044 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %cnt.141, i64 0 %2 = add nuw nsw <4 x i32> %broadcast.splat, <i32 0, i32 1, i32 2, i32 3> %3 = icmp eq <4 x i32> %2, %broadcast.splat50 %4 = zext <4 x i1> %3 to <4 x i32> %5 = add <4 x i32> %1, %4 %6 = add nuw <4 x i32> %broadcast.splat, <i32 1, i32 2, i32 3, i32 4> %7 = icmp eq <4 x i32> %6, %broadcast.splat50 %8 = zext <4 x i1> %7 to <4 x i32> %9 = add <4 x i32> %5, %8 %10 = add nuw <4 x i32> %broadcast.splat, <i32 2, i32 3, i32 4, i32 5> %11 = icmp eq <4 x i32> %10, %broadcast.splat50 %12 = zext <4 x i1> %11 to <4 x i32> %13 = add <4 x i32> %9, %12 %14 = add nuw <4 x i32> %broadcast.splat, <i32 3, i32 4, i32 5, i32 6> %15 = icmp eq <4 x i32> %14, %broadcast.splat50 %16 = zext <4 x i1> %15 to <4 x i32> %17 = add <4 x i32> %13, %16 %18 = add nuw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %19 = icmp eq <4 x i32> %18, %broadcast.splat50 %20 = zext <4 x i1> %19 to <4 x i32> %21 = add <4 x i32> %17, %20 %22 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %23 = icmp eq <4 x i32> %22, %broadcast.splat50 %24 = zext <4 x i1> %23 to <4 x i32> %25 = add <4 x i32> %21, %24 %26 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %27 = icmp eq <4 x i32> %26, %broadcast.splat50 %28 = zext <4 x i1> %27 to <4 x i32> %29 = add <4 x i32> %25, %28 %30 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %31 = icmp eq <4 x i32> %30, %broadcast.splat50 %32 = zext <4 x i1> %31 to <4 x i32> %33 = add <4 x i32> %29, %32 %34 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %35 = icmp eq <4 x i32> %34, %broadcast.splat50 %36 = zext <4 x i1> %35 to <4 x i32> %37 = add <4 x i32> %33, %36 %38 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %39 = icmp eq <4 x i32> %38, %broadcast.splat50 %40 = zext <4 x i1> %39 to <4 x i32> %41 = add <4 x i32> %37, %40 %42 = add nuw nsw <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7> %43 = icmp eq <4 x i32> %42, %broadcast.splat50 %44 = zext <4 x i1> %43 to <4 x i32> %45 = add <4 x i32> %41, %44 %46 = add nuw <4 x i32> %broadcast.splat, <i32 5, i32 6, i32 7, i32 8> %47 = icmp eq <4 x i32> %46, %broadcast.splat50 %48 = zext <4 x i1> %47 to <4 x i32> %49 = add <4 x i32> %45, %48 %50 = add nuw <4 x i32> %broadcast.splat, <i32 6, i32 7, i32 8, i32 9> %51 = icmp eq <4 x i32> %50, %broadcast.splat50 %52 = zext <4 x i1> %51 to <4 x i32> %53 = add <4 x i32> %49, %52 %54 = add nuw <4 x i32> %broadcast.splat, <i32 7, i32 8, i32 9, i32 10> %55 = icmp eq <4 x i32> %54, %broadcast.splat50 %56 = zext <4 x i1> %55 to <4 x i32> %57 = add <4 x i32> %53, %56 %58 = add nuw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %59 = icmp eq <4 x i32> %58, %broadcast.splat50 %60 = zext <4 x i1> %59 to <4 x i32> %61 = add <4 x i32> %57, %60 %62 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %63 = icmp eq <4 x i32> %62, %broadcast.splat50 %64 = zext <4 x i1> %63 to <4 x i32> %65 = add <4 x i32> %61, %64 %66 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %67 = icmp eq <4 x i32> %66, %broadcast.splat50 %68 = zext <4 x i1> %67 to <4 x i32> %69 = add <4 x i32> %65, %68 %70 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %71 = icmp eq <4 x i32> %70, %broadcast.splat50 %72 = zext <4 x i1> %71 to <4 x i32> %73 = add <4 x i32> %69, %72 %74 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %75 = icmp eq <4 x i32> %74, %broadcast.splat50 %76 = zext <4 x i1> %75 to <4 x i32> %77 = add <4 x i32> %73, %76 %78 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %79 = icmp eq <4 x i32> %78, %broadcast.splat50 %80 = zext <4 x i1> %79 to <4 x i32> %81 = add <4 x i32> %77, %80 %82 = add nuw nsw <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11> %83 = icmp eq <4 x i32> %82, %broadcast.splat50 %84 = zext <4 x i1> %83 to <4 x i32> %85 = add <4 x i32> %81, %84 %86 = add nuw <4 x i32> %broadcast.splat, <i32 9, i32 10, i32 11, i32 12> %87 = icmp eq <4 x i32> %86, %broadcast.splat50 %88 = zext <4 x i1> %87 to <4 x i32> %89 = add <4 x i32> %85, %88 %90 = add nuw <4 x i32> %broadcast.splat, <i32 10, i32 11, i32 12, i32 13> %91 = icmp eq <4 x i32> %90, %broadcast.splat50 %92 = zext <4 x i1> %91 to <4 x i32> %93 = add <4 x i32> %89, %92 %94 = add nuw <4 x i32> %broadcast.splat, <i32 11, i32 12, i32 13, i32 14> %95 = icmp eq <4 x i32> %94, %broadcast.splat50 %96 = zext <4 x i1> %95 to <4 x i32> %97 = add <4 x i32> %93, %96 %98 = add nuw <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15> %99 = icmp eq <4 x i32> %98, %broadcast.splat50 %100 = zext <4 x i1> %99 to <4 x i32> %101 = add <4 x i32> %97, %100 %102 = add nuw <4 x i32> %broadcast.splat, <i32 13, i32 14, i32 15, i32 16> %103 = icmp eq <4 x i32> %102, %broadcast.splat50 %104 = zext <4 x i1> %103 to <4 x i32> %105 = add <4 x i32> %101, %104 %106 = add nuw <4 x i32> %broadcast.splat, <i32 14, i32 15, i32 16, i32 17> %107 = icmp eq <4 x i32> %106, %broadcast.splat50 %108 = zext <4 x i1> %107 to <4 x i32> %109 = add <4 x i32> %105, %108 %110 = add nuw <4 x i32> %broadcast.splat, <i32 15, i32 16, i32 17, i32 18> %111 = icmp eq <4 x i32> %110, %broadcast.splat50 %112 = zext <4 x i1> %111 to <4 x i32> %113 = add <4 x i32> %109, %112 %114 = add nuw <4 x i32> %broadcast.splat, <i32 16, i32 17, i32 18, i32 19> %115 = icmp eq <4 x i32> %114, %broadcast.splat50 %116 = zext <4 x i1> %115 to <4 x i32> %117 = add <4 x i32> %113, %116 %118 = add nuw <4 x i32> %broadcast.splat, <i32 17, i32 18, i32 19, i32 20> %119 = icmp eq <4 x i32> %118, %broadcast.splat50 %120 = zext <4 x i1> %119 to <4 x i32> %121 = add <4 x i32> %117, %120 %122 = shufflevector <4 x i32> %121, <4 x i32> %81, <4 x i32> <i32 0, i32 1, i32 6, i32 7> %123 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %122) %inc22 = add nuw nsw i32 %b.042, 1 %exitcond47.not = icmp eq i32 %inc22, 10 br i1 %exitcond47.not, label %for.cond.cleanup4, label %vector.ph, !llvm.loop !11 for.cond.cleanup4: ; preds = %vector.ph %inc25 = add nuw nsw i32 %a.044, 1 %exitcond48.not = icmp eq i32 %inc25, 10 br i1 %exitcond48.not, label %for.cond.cleanup, label %for.cond2.preheader, !llvm.loop !12 while.end: ; preds = %for.cond.cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define PEOPLE 100001 //最大出場者数 int a[PEOPLE]; int **b; //各人の勝った相手一覧 int num; //出場者数 int d[PEOPLE]; //各人の勝数 int count[PEOPLE]; /* void mergesort(int *array, int left, int right) { if(left+1<right){} int mid = (left+rught) / 2; mergesort(array, left, mid); mergesort(array, mid , right); merge(array, left, mid, right); } */ int int_cmp(const int *a, const int *b) { if (*a > *b) return (-1); else if (*a < *b) return (1); return (0); } int saiteikaisou(int n) { //再帰を使って最小深さを求める int max = -1; //敗者の中でその段階までの階層数が最大のもの→maxの階層数を持つ敗者を最後に対戦させる。 int i = 0; int *temp; temp = (int *)malloc(sizeof(int) * d[n]); int c = 0; // maxの階層数を持つ敗者の数 if (b[n][i] == 0) { return 0; } while (b[n][i] != 0) { temp[i] = saiteikaisou(b[n][i]); i++; } qsort(temp, d[n], sizeof(int), (int(*)(const void*, const void*))int_cmp); for (i = 0; i < d[n]; i++) { if (max < i + temp[i] + 1) { max = i + temp[i] + 1; } } return max; } int main() { int i, j; int ans; for (i = 0; i < PEOPLE; i++) { //初期化 a[i] = 0; d[i] = 0; count[i] = 0; } scanf("%d", &num); for (i = 2; i <= num; i++) { scanf("%d", &a[i]); d[a[i]]++; } b = (int **)malloc(sizeof(int *) * (num + 1)); //各人の for (i = 0; i < num + 1; i++) { b[i] = (int *)calloc((d[i] + 2), sizeof(int)); //勝った相手の番号を入れる入れ物 } for (i = 2; i <= num; i++) { //勝った相手のリストを作成 b[a[i]][count[a[i]]] = i; count[a[i]]++; } ans = saiteikaisou(1); printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112315/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112315/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @d = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global ptr null, align 8 @a = dso_local global [100001 x i32] zeroinitializer, align 16 @count = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @num = dso_local global i32 0, align 4 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @int_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 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp slt i32 %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 @saiteikaisou(i32 noundef %n) local_unnamed_addr #1 { entry: %idxprom = sext i32 %n to i64 %arrayidx = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #7 %1 = load ptr, ptr @b, align 8, !tbaa !9 %arrayidx2 = getelementptr inbounds ptr, ptr %1, i64 %idxprom %2 = load ptr, ptr %arrayidx2, align 8, !tbaa !9 %3 = load i32, ptr %2, align 4, !tbaa !5 %cmp = icmp eq i32 %3, 0 br i1 %cmp, label %cleanup, label %while.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %4 = phi i32 [ %7, %while.body ], [ %3, %entry ] %call16 = tail call i32 @saiteikaisou(i32 noundef %4), !range !11 %arrayidx18 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv store i32 %call16, ptr %arrayidx18, align 4, !tbaa !5 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %5 = load ptr, ptr @b, align 8, !tbaa !9 %arrayidx7 = getelementptr inbounds ptr, ptr %5, i64 %idxprom %6 = load ptr, ptr %arrayidx7, align 8, !tbaa !9 %arrayidx9 = getelementptr inbounds i32, ptr %6, i64 %indvars.iv.next %7 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10.not = icmp eq i32 %7, 0 br i1 %cmp10.not, label %while.end, label %while.body, !llvm.loop !12 while.end: ; preds = %while.body %.pre = load i32, ptr %arrayidx, align 4, !tbaa !5 %.pre71 = sext i32 %.pre to i64 tail call void @qsort(ptr noundef nonnull %call, i64 noundef %.pre71, i64 noundef 4, ptr noundef nonnull @int_cmp) #8 %8 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp2464 = icmp sgt i32 %8, 0 br i1 %cmp2464, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %while.end %wide.trip.count = zext i32 %8 to i64 %xtraiter = and i64 %wide.trip.count, 3 %9 = icmp ult i32 %8, 4 br i1 %9, label %cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv68 = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next69.3, %for.body ] %max.066 = phi i32 [ -1, %for.body.preheader.new ], [ %spec.select.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx27 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv68 %10 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv68 to i32 %add = add nsw i32 %10, %11 %cmp29.not = icmp sgt i32 %max.066, %add %add28 = add nsw i32 %add, 1 %spec.select = select i1 %cmp29.not, i32 %max.066, i32 %add28 %indvars.iv.next69 = or i64 %indvars.iv68, 1 %arrayidx27.1 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next69 %12 = load i32, ptr %arrayidx27.1, align 4, !tbaa !5 %13 = trunc i64 %indvars.iv.next69 to i32 %add.1 = add nsw i32 %12, %13 %cmp29.not.1 = icmp sgt i32 %spec.select, %add.1 %add28.1 = add nsw i32 %add.1, 1 %spec.select.1 = select i1 %cmp29.not.1, i32 %spec.select, i32 %add28.1 %indvars.iv.next69.1 = or i64 %indvars.iv68, 2 %arrayidx27.2 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next69.1 %14 = load i32, ptr %arrayidx27.2, align 4, !tbaa !5 %15 = trunc i64 %indvars.iv.next69.1 to i32 %add.2 = add nsw i32 %14, %15 %cmp29.not.2 = icmp sgt i32 %spec.select.1, %add.2 %add28.2 = add nsw i32 %add.2, 1 %spec.select.2 = select i1 %cmp29.not.2, i32 %spec.select.1, i32 %add28.2 %indvars.iv.next69.2 = or i64 %indvars.iv68, 3 %arrayidx27.3 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next69.2 %16 = load i32, ptr %arrayidx27.3, align 4, !tbaa !5 %17 = trunc i64 %indvars.iv.next69.2 to i32 %add.3 = add nsw i32 %16, %17 %cmp29.not.3 = icmp sgt i32 %spec.select.2, %add.3 %add28.3 = add nsw i32 %add.3, 1 %spec.select.3 = select i1 %cmp29.not.3, i32 %spec.select.2, i32 %add28.3 %indvars.iv.next69.3 = add nuw nsw i64 %indvars.iv68, 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 %cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !14 cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.3, %for.body ] %indvars.iv68.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next69.3, %for.body ] %max.066.unr = phi i32 [ -1, %for.body.preheader ], [ %spec.select.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %cleanup, label %for.body.epil for.body.epil: ; preds = %cleanup.loopexit.unr-lcssa, %for.body.epil %indvars.iv68.epil = phi i64 [ %indvars.iv.next69.epil, %for.body.epil ], [ %indvars.iv68.unr, %cleanup.loopexit.unr-lcssa ] %max.066.epil = phi i32 [ %spec.select.epil, %for.body.epil ], [ %max.066.unr, %cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %cleanup.loopexit.unr-lcssa ] %arrayidx27.epil = getelementptr inbounds i32, ptr %call, i64 %indvars.iv68.epil %18 = load i32, ptr %arrayidx27.epil, align 4, !tbaa !5 %19 = trunc i64 %indvars.iv68.epil to i32 %add.epil = add nsw i32 %18, %19 %cmp29.not.epil = icmp sgt i32 %max.066.epil, %add.epil %add28.epil = add nsw i32 %add.epil, 1 %spec.select.epil = select i1 %cmp29.not.epil, i32 %max.066.epil, i32 %add28.epil %indvars.iv.next69.epil = add nuw nsw i64 %indvars.iv68.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 %cleanup, label %for.body.epil, !llvm.loop !15 cleanup: ; preds = %cleanup.loopexit.unr-lcssa, %for.body.epil, %while.end, %entry %retval.0 = phi i32 [ 0, %entry ], [ -1, %while.end ], [ %spec.select.lcssa.ph, %cleanup.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) @a, i8 0, i64 400004, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) @d, i8 0, i64 400004, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) @count, i8 0, i64 400004, i1 false), !tbaa !5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @num) %0 = load i32, ptr @num, align 4, !tbaa !5 %cmp6.not78 = icmp slt i32 %0, 2 br i1 %cmp6.not78, label %for.end18, label %for.body7 for.body7: ; preds = %entry, %for.body7 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ 2, %entry ] %arrayidx9 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv %call10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9) %1 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %idxprom13 = sext i32 %1 to i64 %arrayidx14 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %idxprom13 %2 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %inc15 = add nsw i32 %2, 1 store i32 %inc15, ptr %arrayidx14, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @num, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp6.not.not = icmp slt i64 %indvars.iv, %4 br i1 %cmp6.not.not, label %for.body7, label %for.end18, !llvm.loop !17 for.end18: ; preds = %for.body7, %entry %5 = phi i32 [ %0, %entry ], [ %3, %for.body7 ] %add = add i32 %5, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 3 %call19 = tail call noalias ptr @malloc(i64 noundef %mul) #7 store ptr %call19, ptr @b, align 8, !tbaa !9 %cmp22.not80 = icmp slt i32 %5, 0 br i1 %cmp22.not80, label %for.end56, label %for.body24.preheader for.body24.preheader: ; preds = %for.end18 %wide.trip.count = zext i32 %add to i64 br label %for.body24 for.cond35.preheader: ; preds = %for.body24 %cmp36.not82 = icmp slt i32 %5, 2 br i1 %cmp36.not82, label %for.end56, label %for.body38.lr.ph for.body38.lr.ph: ; preds = %for.cond35.preheader %6 = load ptr, ptr @b, align 8, !tbaa !9 br label %for.body38 for.body24: ; preds = %for.body24.preheader, %for.body24 %indvars.iv87 = phi i64 [ 0, %for.body24.preheader ], [ %indvars.iv.next88, %for.body24 ] %arrayidx26 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %indvars.iv87 %7 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %add27 = add nsw i32 %7, 2 %conv28 = sext i32 %add27 to i64 %call29 = tail call noalias ptr @calloc(i64 noundef %conv28, i64 noundef 4) #9 %8 = load ptr, ptr @b, align 8, !tbaa !9 %arrayidx31 = getelementptr inbounds ptr, ptr %8, i64 %indvars.iv87 store ptr %call29, ptr %arrayidx31, align 8, !tbaa !9 %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1 %exitcond.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count br i1 %exitcond.not, label %for.cond35.preheader, label %for.body24, !llvm.loop !18 for.body38: ; preds = %for.body38.lr.ph, %for.body38 %indvars.iv90 = phi i64 [ 2, %for.body38.lr.ph ], [ %indvars.iv.next91, %for.body38 ] %arrayidx40 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv90 %9 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %idxprom41 = sext i32 %9 to i64 %arrayidx42 = getelementptr inbounds ptr, ptr %6, i64 %idxprom41 %10 = load ptr, ptr %arrayidx42, align 8, !tbaa !9 %arrayidx46 = getelementptr inbounds [100001 x i32], ptr @count, i64 0, i64 %idxprom41 %11 = load i32, ptr %arrayidx46, align 4, !tbaa !5 %idxprom47 = sext i32 %11 to i64 %arrayidx48 = getelementptr inbounds i32, ptr %10, i64 %idxprom47 %12 = trunc i64 %indvars.iv90 to i32 store i32 %12, ptr %arrayidx48, align 4, !tbaa !5 %13 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %idxprom51 = sext i32 %13 to i64 %arrayidx52 = getelementptr inbounds [100001 x i32], ptr @count, i64 0, i64 %idxprom51 %14 = load i32, ptr %arrayidx52, align 4, !tbaa !5 %inc53 = add nsw i32 %14, 1 store i32 %inc53, ptr %arrayidx52, align 4, !tbaa !5 %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %15 = load i32, ptr @num, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp36.not.not = icmp slt i64 %indvars.iv90, %16 br i1 %cmp36.not.not, label %for.body38, label %for.end56, !llvm.loop !19 for.end56: ; preds = %for.body38, %for.end18, %for.cond35.preheader %call57 = tail call i32 @saiteikaisou(i32 noundef 1), !range !11 %call58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %call57) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; 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 #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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) #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nounwind allocsize(0) } attributes #8 = { nounwind } attributes #9 = { 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 = !{!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 = !{!"any pointer", !7, i64 0} !11 = !{i32 -1, i32 -2147483648} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.unroll.disable"} !17 = distinct !{!17, !13} !18 = distinct !{!18, !13} !19 = distinct !{!19, !13}
#include <stdio.h> int main(void){ int n; scanf("%d", &n); printf("%d\n", (n + 1) / 2); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112359/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112359/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %div = sdiv i32 %add, 2 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int N; scanf("%d",&N); if(N%2==0){ printf("%d\n",N/2); }else{ N=N+1; printf("%d\n",N/2); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112401/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112401/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 br i1 %cmp, label %if.end, label %if.else if.else: ; preds = %entry %add = add nsw i32 %0, 1 store i32 %add, ptr %N, align 4, !tbaa !5 br label %if.end if.end: ; preds = %entry, %if.else %add.sink = phi i32 [ %add, %if.else ], [ %0, %entry ] %div2 = sdiv i32 %add.sink, 2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a; scanf("%d",&a); printf("%d",(a+1)/2); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112445/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112445/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %div = sdiv i32 %add, 2 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %div) 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 n; scanf("%d", &n); if(n % 2 == 0){ printf("%d\n", n/2); } else printf("%d\n", n/2 + 1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112489/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112489/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = and i32 %0, 1 %div = sdiv i32 %0, 2 %add.sink = add nsw i32 %div, %1 %call3 = 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 %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int N,n; scanf("%d",&n); N=n/2; if(n%2==1) N++; printf("%d\n",N); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112531/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112531/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %div = sdiv i32 %0, 2 %1 = and i32 %0, -2147483647 %cmp = icmp eq i32 %1, 1 %inc = zext i1 %cmp to i32 %spec.select = add nsw i32 %div, %inc %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int n,p; scanf("%d", &n); if (n%2 == 0){ p = (n/2); } else if(n%2!=0){ p = ((n+1)/2); } printf("%d\n", p); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112575/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112575/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = and i32 %0, 1 %p.0.in = add i32 %1, %0 %p.0 = sdiv i32 %p.0.in, 2 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> //#include <iostream> //#include <vector> //#include <string.h> #pragma warning (push) #pragma warning (disable : 4996) #define mod 1000000007; //using namespace std; int main() { int N; scanf("%d", &N); char ret[3]; if (N % 2 == 1) { sprintf(ret, "%d", (int)(N / 2 + 1)); } else { sprintf(ret, "%d", (int)(N / 2)); } printf(ret); } #pragma warning (pop)
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112625/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112625/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %ret = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %ret) #3 %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = and i32 %0, -2147483647 %cmp = icmp eq i32 %1, 1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %div78 = lshr i32 %0, 1 %add = add nuw nsw i32 %div78, 1 br label %if.end if.else: ; preds = %entry %div3 = sdiv i32 %0, 2 br label %if.end if.end: ; preds = %if.else, %if.then %div3.sink = phi i32 [ %div3, %if.else ], [ %add, %if.then ] %call4 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %ret, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %div3.sink) #3 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %ret) call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %ret) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int N; scanf("%d", &N); if(N%2==0){ printf("%d\n", N/2); }else{ printf("%d\n", N/2+1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112669/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112669/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = and i32 %0, 1 %div = sdiv i32 %0, 2 %add.sink = add nsw i32 %div, %1 %call3 = 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 %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int pege,two,sum; scanf("%d",&pege); if(pege%2==0){ two=pege/2; } else{ two=pege/2+1; } printf("%d\n",two); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112711/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112711/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %pege = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %pege) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pege) %0 = load i32, ptr %pege, align 4, !tbaa !5 %1 = and i32 %0, 1 %div = sdiv i32 %0, 2 %two.0 = add nsw i32 %div, %1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %two.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %pege) #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; scanf("%d", &a); printf("%d\n", (a & 1) ? a / 2 + 1 : a / 2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112755/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112755/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %and = and i32 %0, 1 %div1 = sdiv i32 %0, 2 %cond = add nsw i32 %div1, %and %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond) 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 N; scanf("%d",&N); if(N%2 == 0){ printf("%d\n",N/2); } else { printf("%d\n",N/2 + 1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112799/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112799/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = and i32 %0, 1 %div = sdiv i32 %0, 2 %add.sink = add nsw i32 %div, %1 %call3 = 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 %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int sum, i; char x[1000]; while(scanf("%s", x), x[0] != '0'){ sum = i = 0; while(x[i]) sum += x[i++] - '0'; printf("%d\n", sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112841/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112841/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %x) #3 %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i8, ptr %x, align 16, !tbaa !5 %cmp.not16 = icmp eq i8 %0, 48 br i1 %cmp.not16, label %while.end9, label %while.cond2.preheader while.cond2.preheader: ; preds = %entry, %while.end %1 = phi i8 [ %4, %while.end ], [ %0, %entry ] %tobool.not12 = icmp eq i8 %1, 0 br i1 %tobool.not12, label %while.end, label %while.body4 while.body4: ; preds = %while.cond2.preheader, %while.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %while.body4 ], [ 0, %while.cond2.preheader ] %2 = phi i8 [ %3, %while.body4 ], [ %1, %while.cond2.preheader ] %sum.013 = phi i32 [ %add, %while.body4 ], [ 0, %while.cond2.preheader ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %conv7 = sext i8 %2 to i32 %sub = add i32 %sum.013, -48 %add = add i32 %sub, %conv7 %arrayidx3 = getelementptr inbounds [1000 x i8], ptr %x, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx3, align 1, !tbaa !5 %tobool.not = icmp eq i8 %3, 0 br i1 %tobool.not, label %while.end, label %while.body4, !llvm.loop !8 while.end: ; preds = %while.body4, %while.cond2.preheader %sum.0.lcssa = phi i32 [ 0, %while.cond2.preheader ], [ %add, %while.body4 ] %call8 = 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 %x) %4 = load i8, ptr %x, align 16, !tbaa !5 %cmp.not = icmp eq i8 %4, 48 br i1 %cmp.not, label %while.end9, label %while.cond2.preheader, !llvm.loop !10 while.end9: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 1000, 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 = !{!"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<stdlib.h> void solve() { int n; scanf("%d",&n); int *arr = (int*)(malloc(sizeof(int)*n)); int i; for(i = 0 ; i < n ; i++) { scanf("%d",arr + i); } int *arr1 = (int*)(malloc(sizeof(int)*n)); int *arr2 = (int*)(malloc(sizeof(int)*n)); int len1 = 0; int len2 = 0; for(i = 0 ; i < n ; i++) { if(arr[i]%2 == 0) { arr2[len2] = arr[i]; len2 = len2 + 1; } else if(arr[i]%2 != 0) { arr1[len1] = arr[i]; len1 = len1 + 1; } } for(i = 0 ; i < len1 ; i++) { printf("%d ",arr1[i]); } for(i = 0 ; i < len2 ; i++) { printf("%d ",arr2[i]); } printf("\n"); } int main() { int t; scanf("%d",&t); while(t > 0) { solve(); t--; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1129/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1129/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @solve() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #6 %cmp80 = icmp sgt i32 %0, 0 br i1 %cmp80, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %add.ptr) %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.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.body %.pre = shl nsw i64 %2, 2 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %mul5.pre-phi = phi i64 [ %.pre, %for.end.loopexit ], [ %mul, %entry ] %.lcssa = phi i32 [ %1, %for.end.loopexit ], [ %0, %entry ] %call6 = call noalias ptr @malloc(i64 noundef %mul5.pre-phi) #6 %call9 = call noalias ptr @malloc(i64 noundef %mul5.pre-phi) #6 %cmp1182 = icmp sgt i32 %.lcssa, 0 br i1 %cmp1182, label %for.body13.preheader, label %for.end54 for.body13.preheader: ; preds = %for.end %wide.trip.count = zext i32 %.lcssa to i64 br label %for.body13 for.cond35.preheader: ; preds = %for.inc32 %cmp3688 = icmp sgt i32 %len1.1, 0 br i1 %cmp3688, label %for.body38.preheader, label %for.cond45.preheader for.body38.preheader: ; preds = %for.cond35.preheader %wide.trip.count100 = zext i32 %len1.1 to i64 br label %for.body38 for.body13: ; preds = %for.body13.preheader, %for.inc32 %indvars.iv94 = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next95, %for.inc32 ] %len2.085 = phi i32 [ 0, %for.body13.preheader ], [ %len2.1, %for.inc32 ] %len1.084 = phi i32 [ 0, %for.body13.preheader ], [ %len1.1, %for.inc32 ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv94 %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %4 = and i32 %3, 1 %cmp14 = icmp eq i32 %4, 0 br i1 %cmp14, label %if.then, label %if.then25 if.then: ; preds = %for.body13 %idxprom18 = sext i32 %len2.085 to i64 %arrayidx19 = getelementptr inbounds i32, ptr %call9, i64 %idxprom18 store i32 %3, ptr %arrayidx19, align 4, !tbaa !5 %add = add nsw i32 %len2.085, 1 br label %for.inc32 if.then25: ; preds = %for.body13 %idxprom28 = sext i32 %len1.084 to i64 %arrayidx29 = getelementptr inbounds i32, ptr %call6, i64 %idxprom28 store i32 %3, ptr %arrayidx29, align 4, !tbaa !5 %add30 = add nsw i32 %len1.084, 1 br label %for.inc32 for.inc32: ; preds = %if.then, %if.then25 %len1.1 = phi i32 [ %len1.084, %if.then ], [ %add30, %if.then25 ] %len2.1 = phi i32 [ %add, %if.then ], [ %len2.085, %if.then25 ] %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %exitcond.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count br i1 %exitcond.not, label %for.cond35.preheader, label %for.body13, !llvm.loop !11 for.cond45.preheader: ; preds = %for.body38, %for.cond35.preheader %cmp4690 = icmp sgt i32 %len2.1, 0 br i1 %cmp4690, label %for.body48.preheader, label %for.end54 for.body48.preheader: ; preds = %for.cond45.preheader %wide.trip.count105 = zext i32 %len2.1 to i64 br label %for.body48 for.body38: ; preds = %for.body38.preheader, %for.body38 %indvars.iv97 = phi i64 [ 0, %for.body38.preheader ], [ %indvars.iv.next98, %for.body38 ] %arrayidx40 = getelementptr inbounds i32, ptr %call6, i64 %indvars.iv97 %5 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5) %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1 %exitcond101.not = icmp eq i64 %indvars.iv.next98, %wide.trip.count100 br i1 %exitcond101.not, label %for.cond45.preheader, label %for.body38, !llvm.loop !12 for.body48: ; preds = %for.body48.preheader, %for.body48 %indvars.iv102 = phi i64 [ 0, %for.body48.preheader ], [ %indvars.iv.next103, %for.body48 ] %arrayidx50 = getelementptr inbounds i32, ptr %call9, i64 %indvars.iv102 %6 = load i32, ptr %arrayidx50, align 4, !tbaa !5 %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6) %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1 %exitcond106.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count105 br i1 %exitcond106.not, label %for.end54, label %for.body48, !llvm.loop !13 for.end54: ; preds = %for.body48, %for.end, %for.cond45.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress 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: %t = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %.pr = load i32, ptr %t, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %.pr, 0 br i1 %cmp1, label %while.body, label %while.end while.body: ; preds = %entry, %while.body call void @solve() %0 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %0, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !14 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 ret i32 0 } ; 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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> #include <string.h> int main() { int i, total; char digits[1001]; scanf(" %1000s", digits); while (strcmp(digits, "0")) { total = 0; for (i = 0; digits[i] != '\0'; i++) { total += digits[i] - '0'; } printf("%d\n", total); scanf(" %1000s", digits); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112942/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112942/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c" %1000s\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: %digits = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %digits) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %digits) %lhsv17 = load i16, ptr %digits, align 16 %.not18 = icmp eq i16 %lhsv17, 48 br i1 %.not18, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %.in = phi i16 [ %lhsv, %for.end ], [ %lhsv17, %entry ] %0 = trunc i16 %.in to i8 %cmp.not14 = icmp eq i8 %0, 0 br i1 %cmp.not14, 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 ] %1 = phi i8 [ %2, %for.body ], [ %0, %for.cond.preheader ] %total.016 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %conv = sext i8 %1 to i32 %sub = add i32 %total.016, -48 %add = add i32 %sub, %conv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1001 x i8], ptr %digits, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %2, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %for.cond.preheader %total.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %total.0.lcssa) %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %digits) %lhsv = load i16, ptr %digits, align 16 %.not = icmp eq i16 %lhsv, 48 br i1 %.not, label %while.end, label %for.cond.preheader, !llvm.loop !10 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %digits) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include <stdio.h> int main(void) { char c; int sum = 0;; while(1){ c = getchar( ); if(c == '\n'){ if(sum == 0) break; else printf("%d\n", sum); sum = 0; } else{ sum += (c - '0'); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_112986/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_112986/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %sum.0 = phi i32 [ 0, %entry ], [ %sum.0.be, %while.cond.backedge ] %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %sext = shl i32 %call.i, 24 %cmp = icmp eq i32 %sext, 167772160 br i1 %cmp, label %if.then, label %if.else7 if.then: ; preds = %while.cond %cmp3 = icmp eq i32 %sum.0, 0 br i1 %cmp3, label %while.end, label %if.else if.else: ; preds = %if.then %call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0) br label %while.cond.backedge if.else7: ; preds = %while.cond %conv1 = ashr exact i32 %sext, 24 %sub = add i32 %sum.0, -48 %add = add i32 %sub, %conv1 br label %while.cond.backedge while.cond.backedge: ; preds = %if.else7, %if.else %sum.0.be = phi i32 [ 0, %if.else ], [ %add, %if.else7 ] br label %while.cond while.end: ; preds = %if.then ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int t,n; scanf("%d",&t); while(t--) { scanf("%d",&n); if(n&1==1) n++; printf("%d\n",n/2); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11305/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11305/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec4 = add nsw i32 %0, -1 store i32 %dec4, ptr %t, align 4, !tbaa !5 %tobool.not5 = icmp eq i32 %0, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %and = and i32 %1, 1 %tobool2.not = icmp eq i32 %and, 0 br i1 %tobool2.not, label %if.end, label %if.then if.then: ; preds = %while.body %inc = add nsw i32 %1, 1 store i32 %inc, ptr %n, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %2 = phi i32 [ %inc, %if.then ], [ %1, %while.body ] %div = sdiv i32 %2, 2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) %3 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %3, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %3, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include "stdio.h" #include "string.h" #include "math.h" int main(int argc, char const *argv[]) { char S[1000000]; scanf("%s", S); int N=strlen(S); int i; int w=0; long long int ans=0; for (i = 0; i < N; i++) { if (S[i]=='W') { ans=ans+i-w; w++; } } if (w==N||w==0) { ans=0; } printf("%lld",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_113093/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_113093/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %S = alloca [1000000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000000, 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 %cmp25 = icmp sgt i32 %conv, 0 br i1 %cmp25, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 %xtraiter = and i64 %call2, 1 %0 = icmp eq i64 %wide.trip.count, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %ans.028 = phi i64 [ 0, %for.body.preheader.new ], [ %ans.1.1, %for.body ] %w.027 = phi i32 [ 0, %for.body.preheader.new ], [ %w.1.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds [1000000 x i8], ptr %S, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 2, !tbaa !5 %cmp5 = icmp eq i8 %1, 87 %add = add nsw i64 %ans.028, %indvars.iv %conv8 = zext i32 %w.027 to i64 %sub = sub i64 %add, %conv8 %inc = zext i1 %cmp5 to i32 %w.1 = add nuw nsw i32 %w.027, %inc %ans.1 = select i1 %cmp5, i64 %sub, i64 %ans.028 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1000000 x i8], ptr %S, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %cmp5.1 = icmp eq i8 %2, 87 %add.1 = add nsw i64 %ans.1, %indvars.iv.next %conv8.1 = zext i32 %w.1 to i64 %sub.1 = sub i64 %add.1, %conv8.1 %inc.1 = zext i1 %cmp5.1 to i32 %w.1.1 = add nuw nsw i32 %w.1, %inc.1 %ans.1.1 = select i1 %cmp5.1, i64 %sub.1, i64 %ans.1 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !8 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %w.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %w.1.1, %for.body ] %ans.1.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %ans.1.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %ans.028.unr = phi i64 [ 0, %for.body.preheader ], [ %ans.1.1, %for.body ] %w.027.unr = phi i32 [ 0, %for.body.preheader ], [ %w.1.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds [1000000 x i8], ptr %S, i64 0, i64 %indvars.iv.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 %cmp5.epil = icmp eq i8 %3, 87 %add.epil = add nsw i64 %ans.028.unr, %indvars.iv.unr %conv8.epil = zext i32 %w.027.unr to i64 %sub.epil = sub i64 %add.epil, %conv8.epil %inc.epil = zext i1 %cmp5.epil to i32 %w.1.epil = add nuw nsw i32 %w.027.unr, %inc.epil %ans.1.epil = select i1 %cmp5.epil, i64 %sub.epil, i64 %ans.028.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %w.0.lcssa = phi i32 [ 0, %entry ], [ %w.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %w.1.epil, %for.body.epil ] %ans.0.lcssa = phi i64 [ 0, %entry ], [ %ans.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body.epil ] %cmp10 = icmp eq i32 %w.0.lcssa, %conv %cmp12 = icmp eq i32 %w.0.lcssa, 0 %or.cond = or i1 %cmp10, %cmp12 %spec.select = select i1 %or.cond, i64 0, i64 %ans.0.lcssa %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 1000000, 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<stdlib.h> #define NMIN 1 #define NMAX 36 struct Number{ char mark; char value; }; void bubble(struct Number A[],int N){ int i,j; struct Number t; for(i=0;i<N;i++){ for(j=N-1;j>=i;j--){ if(A[j].value<A[j-1].value){ t=A[j]; A[j]=A[j-1]; A[j-1]=t; } } } } void selections(struct Number A[],int N){ int i,j,minj; struct Number t; for(i=0;i<N;i++){ minj=i; for(j=i;j<N;j++){ if(A[j].value<A[minj].value) minj=j; } t=A[i]; A[i]=A[minj]; A[minj]=t; } } void print(struct Number A[],int N){ int i; for(i=0;i<N;i++){ if(i>0) printf(" "); printf("%c%c",A[i].mark,A[i].value); } printf("\n"); } int isStable(struct Number N1[],struct Number N2[],int N){ int i; for(i=0;i<N;i++){ if(N1[i].mark != N2[i].mark) return 0; } return 1; } int main(){ int N,i,j; struct Number N1[NMAX],N2[NMAX]; char ch; scanf("%d",&N); if(N<NMIN||N>NMAX) exit(1); for(i=0;i<N;i++){ scanf(" %c%c",&N1[i].mark,&N1[i].value); } for(i=0;i<N;i++){ N2[i]=N1[i]; } bubble(N1,N); selections(N2,N); print(N1,N); printf("Stable\n"); print(N2,N); if(isStable(N1,N2,N)==1){ printf("Stable\n"); } else{ printf("Not stable\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_113136/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_113136/source.c" target datalayout = "e-m:e-p270: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.Number = type { i8, i8 } @.str.1 = private unnamed_addr constant [5 x i8] c"%c%c\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.4 = private unnamed_addr constant [6 x i8] c" %c%c\00", align 1 @str.7 = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1 @str.8 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @bubble(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp41 = icmp sgt i32 %N, 0 br i1 %cmp41, label %for.cond1.preheader.lr.ph, label %for.end22 for.cond1.preheader.lr.ph: ; preds = %entry %0 = zext i32 %N to i64 %wide.trip.count = zext i32 %N to i64 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc21 %indvars.iv45 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next46, %for.inc21 ] br label %for.body3 for.body3: ; preds = %for.cond1.preheader, %for.inc %indvars.iv = phi i64 [ %0, %for.cond1.preheader ], [ %indvars.iv.next, %for.inc ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %value = getelementptr inbounds %struct.Number, ptr %A, i64 %indvars.iv.next, i32 1 %1 = load i8, ptr %value, align 1, !tbaa !5 %2 = add nsw i64 %indvars.iv, -2 %value7 = getelementptr inbounds %struct.Number, ptr %A, i64 %2, i32 1 %3 = load i8, ptr %value7, align 1, !tbaa !5 %cmp9 = icmp slt i8 %1, %3 br i1 %cmp9, label %if.then, label %for.inc if.then: ; preds = %for.body3 %arrayidx6 = getelementptr inbounds %struct.Number, ptr %A, i64 %2 %4 = load <2 x i16>, ptr %arrayidx6, align 1 %5 = shufflevector <2 x i16> %4, <2 x i16> poison, <2 x i32> <i32 1, i32 0> store <2 x i16> %5, ptr %arrayidx6, align 1 br label %for.inc for.inc: ; preds = %for.body3, %if.then %cmp2.not.not = icmp sgt i64 %indvars.iv.next, %indvars.iv45 br i1 %cmp2.not.not, label %for.body3, label %for.inc21, !llvm.loop !9 for.inc21: ; preds = %for.inc %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1 %exitcond.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count br i1 %exitcond.not, label %for.end22, label %for.cond1.preheader, !llvm.loop !11 for.end22: ; preds = %for.inc21, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @selections(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp39 = icmp sgt i32 %N, 0 br i1 %cmp39, label %for.cond1.preheader.preheader, label %for.end20 for.cond1.preheader.preheader: ; preds = %entry %0 = zext i32 %N to i64 %wide.trip.count = zext i32 %N to i64 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.end %indvars.iv = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %indvars.iv.next, %for.end ] %1 = trunc i64 %indvars.iv to i32 br label %for.body3 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv41 = phi i64 [ %indvars.iv, %for.cond1.preheader ], [ %indvars.iv.next42, %for.body3 ] %minj.038 = phi i32 [ %1, %for.cond1.preheader ], [ %spec.select, %for.body3 ] %value = getelementptr inbounds %struct.Number, ptr %A, i64 %indvars.iv41, i32 1 %2 = load i8, ptr %value, align 1, !tbaa !5 %idxprom4 = sext i32 %minj.038 to i64 %value6 = getelementptr inbounds %struct.Number, ptr %A, i64 %idxprom4, i32 1 %3 = load i8, ptr %value6, align 1, !tbaa !5 %cmp8 = icmp slt i8 %2, %3 %4 = trunc i64 %indvars.iv41 to i32 %spec.select = select i1 %cmp8, i32 %4, i32 %minj.038 %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1 %cmp2 = icmp ult i64 %indvars.iv.next42, %0 br i1 %cmp2, label %for.body3, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body3 %arrayidx11 = getelementptr inbounds %struct.Number, ptr %A, i64 %indvars.iv %5 = load i16, ptr %arrayidx11, align 1 %idxprom14 = sext i32 %spec.select to i64 %arrayidx15 = getelementptr inbounds %struct.Number, ptr %A, i64 %idxprom14 %6 = load i16, ptr %arrayidx15, align 1 store i16 %6, ptr %arrayidx11, align 1 store i16 %5, ptr %arrayidx15, align 1 %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.end20, label %for.cond1.preheader, !llvm.loop !13 for.end20: ; preds = %for.end, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #3 { entry: %cmp13 = icmp sgt i32 %N, 0 br i1 %cmp13, label %if.end.peel, label %for.end if.end.peel: ; preds = %entry %wide.trip.count = zext i32 %N to i64 %value.peel.phi.trans.insert = getelementptr inbounds %struct.Number, ptr %A, i64 0, i32 1 %.pre17 = load i8, ptr %value.peel.phi.trans.insert, align 1, !tbaa !5 %.pre = load i8, ptr %A, align 1, !tbaa !14 %conv.peel = sext i8 %.pre to i32 %conv4.peel = sext i8 %.pre17 to i32 %call5.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv.peel, i32 noundef %conv4.peel) %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 ] %putchar12 = tail call i32 @putchar(i32 32) %arrayidx = getelementptr inbounds %struct.Number, ptr %A, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !14 %conv = sext i8 %0 to i32 %value = getelementptr inbounds %struct.Number, ptr %A, i64 %indvars.iv, i32 1 %1 = load i8, ptr %value, align 1, !tbaa !5 %conv4 = sext i8 %1 to i32 %call5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv4) %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 !15 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 #4 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @isStable(ptr nocapture noundef readonly %N1, ptr nocapture noundef readonly %N2, i32 noundef %N) local_unnamed_addr #5 { entry: %cmp10 = icmp sgt i32 %N, 0 br i1 %cmp10, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %N to i64 br label %for.body for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !17 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds %struct.Number, ptr %N1, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !14 %arrayidx2 = getelementptr inbounds %struct.Number, ptr %N2, i64 %indvars.iv %1 = load i8, ptr %arrayidx2, align 1, !tbaa !14 %cmp5.not = icmp eq i8 %0, %1 br i1 %cmp5.not, label %for.cond, label %cleanup cleanup: ; preds = %for.body, %for.cond, %entry %retval.0 = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ 0, %for.body ] ret i32 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %N = alloca i32, align 4 %N1 = alloca [36 x %struct.Number], align 16 %N2 = alloca [36 x %struct.Number], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #9 call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %N1) #9 call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %N2) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4 %1 = add i32 %0, -37 %or.cond = icmp ult i32 %1, -36 br i1 %or.cond, label %if.then, label %for.body if.then: ; preds = %entry call void @exit(i32 noundef 1) #10 unreachable for.cond6.preheader: ; preds = %for.body %cmp783 = icmp sgt i32 %.pr, 0 br i1 %cmp783, label %for.cond1.preheader.lr.ph.i, label %print.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [36 x %struct.Number], ptr %N1, i64 0, i64 %indvars.iv %value = getelementptr inbounds [36 x %struct.Number], ptr %N1, i64 0, i64 %indvars.iv, i32 1 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx, ptr noundef nonnull %value) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %.pr = load i32, ptr %N, align 4, !tbaa !18 %2 = sext i32 %.pr to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp2, label %for.body, label %for.cond6.preheader, !llvm.loop !20 for.cond1.preheader.lr.ph.i: ; preds = %for.cond6.preheader %3 = zext i32 %.pr to i64 %4 = shl nuw nsw i64 %3, 1 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %N2, ptr nonnull align 16 %N1, i64 %4, i1 false) %5 = zext i32 %.pr to i64 br label %for.cond1.preheader.i for.cond1.preheader.i: ; preds = %for.inc21.i, %for.cond1.preheader.lr.ph.i %indvars.iv45.i = phi i64 [ 0, %for.cond1.preheader.lr.ph.i ], [ %indvars.iv.next46.i, %for.inc21.i ] br label %for.body3.i for.body3.i: ; preds = %for.inc.i, %for.cond1.preheader.i %indvars.iv.i = phi i64 [ %5, %for.cond1.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %value.i = getelementptr inbounds %struct.Number, ptr %N1, i64 %indvars.iv.next.i, i32 1 %6 = load i8, ptr %value.i, align 1, !tbaa !5 %7 = add nsw i64 %indvars.iv.i, -2 %value7.i = getelementptr inbounds %struct.Number, ptr %N1, i64 %7, i32 1 %8 = load i8, ptr %value7.i, align 1, !tbaa !5 %cmp9.i = icmp slt i8 %6, %8 br i1 %cmp9.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body3.i %arrayidx6.i = getelementptr inbounds %struct.Number, ptr %N1, i64 %7 %9 = load <2 x i16>, ptr %arrayidx6.i, align 2 %10 = shufflevector <2 x i16> %9, <2 x i16> poison, <2 x i32> <i32 1, i32 0> store <2 x i16> %10, ptr %arrayidx6.i, align 2 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body3.i %cmp2.not.not.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv45.i br i1 %cmp2.not.not.i, label %for.body3.i, label %for.inc21.i, !llvm.loop !9 for.inc21.i: ; preds = %for.inc.i %indvars.iv.next46.i = add nuw nsw i64 %indvars.iv45.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next46.i, %5 br i1 %exitcond.not.i, label %for.cond1.preheader.i38, label %for.cond1.preheader.i, !llvm.loop !11 for.cond1.preheader.i38: ; preds = %for.inc21.i, %for.end.i %indvars.iv.i39 = phi i64 [ %indvars.iv.next.i42, %for.end.i ], [ 0, %for.inc21.i ] %11 = trunc i64 %indvars.iv.i39 to i32 br label %for.body3.i40 for.body3.i40: ; preds = %for.body3.i40, %for.cond1.preheader.i38 %indvars.iv41.i = phi i64 [ %indvars.iv.i39, %for.cond1.preheader.i38 ], [ %indvars.iv.next42.i, %for.body3.i40 ] %minj.038.i = phi i32 [ %11, %for.cond1.preheader.i38 ], [ %spec.select.i, %for.body3.i40 ] %value.i41 = getelementptr inbounds %struct.Number, ptr %N2, i64 %indvars.iv41.i, i32 1 %12 = load i8, ptr %value.i41, align 1, !tbaa !5 %idxprom4.i = sext i32 %minj.038.i to i64 %value6.i = getelementptr inbounds %struct.Number, ptr %N2, i64 %idxprom4.i, i32 1 %13 = load i8, ptr %value6.i, align 1, !tbaa !5 %cmp8.i = icmp slt i8 %12, %13 %14 = trunc i64 %indvars.iv41.i to i32 %spec.select.i = select i1 %cmp8.i, i32 %14, i32 %minj.038.i %indvars.iv.next42.i = add nuw nsw i64 %indvars.iv41.i, 1 %cmp2.i = icmp ult i64 %indvars.iv.next42.i, %5 br i1 %cmp2.i, label %for.body3.i40, label %for.end.i, !llvm.loop !12 for.end.i: ; preds = %for.body3.i40 %arrayidx11.i = getelementptr inbounds %struct.Number, ptr %N2, i64 %indvars.iv.i39 %15 = load i16, ptr %arrayidx11.i, align 2 %idxprom14.i = sext i32 %spec.select.i to i64 %arrayidx15.i = getelementptr inbounds %struct.Number, ptr %N2, i64 %idxprom14.i %16 = load i16, ptr %arrayidx15.i, align 2 store i16 %16, ptr %arrayidx11.i, align 2 store i16 %15, ptr %arrayidx15.i, align 2 %indvars.iv.next.i42 = add nuw nsw i64 %indvars.iv.i39, 1 %exitcond.not.i43 = icmp eq i64 %indvars.iv.next.i42, %5 br i1 %exitcond.not.i43, label %if.end.peel.i, label %for.cond1.preheader.i38, !llvm.loop !13 if.end.peel.i: ; preds = %for.end.i %value.peel.phi.trans.insert.i = getelementptr inbounds %struct.Number, ptr %N1, i64 0, i32 1 %.pre17.i = load i8, ptr %value.peel.phi.trans.insert.i, align 1, !tbaa !5 %.pre.i = load i8, ptr %N1, align 16, !tbaa !14 %conv.peel.i = sext i8 %.pre.i to i32 %conv4.peel.i = sext i8 %.pre17.i to i32 %call5.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv.peel.i, i32 noundef %conv4.peel.i) %exitcond.peel.not.i = icmp eq i32 %.pr, 1 br i1 %exitcond.peel.not.i, label %print.exit, label %if.end.i if.end.i: ; preds = %if.end.peel.i, %if.end.i %indvars.iv.i46 = phi i64 [ %indvars.iv.next.i49, %if.end.i ], [ 1, %if.end.peel.i ] %putchar12.i = call i32 @putchar(i32 32) %arrayidx.i47 = getelementptr inbounds %struct.Number, ptr %N1, i64 %indvars.iv.i46 %17 = load i8, ptr %arrayidx.i47, align 2, !tbaa !14 %conv.i = sext i8 %17 to i32 %value.i48 = getelementptr inbounds %struct.Number, ptr %N1, i64 %indvars.iv.i46, i32 1 %18 = load i8, ptr %value.i48, align 1, !tbaa !5 %conv4.i = sext i8 %18 to i32 %call5.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv.i, i32 noundef %conv4.i) %indvars.iv.next.i49 = add nuw nsw i64 %indvars.iv.i46, 1 %exitcond.not.i50 = icmp eq i64 %indvars.iv.next.i49, %5 br i1 %exitcond.not.i50, label %print.exit, label %if.end.i, !llvm.loop !15 print.exit: ; preds = %if.end.i, %for.cond6.preheader, %if.end.peel.i %putchar.i = call i32 @putchar(i32 10) %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.8) %19 = load i32, ptr %N, align 4, !tbaa !18 %cmp13.i51 = icmp sgt i32 %19, 0 br i1 %cmp13.i51, label %if.end.peel.i54, label %print.exit73 if.end.peel.i54: ; preds = %print.exit %wide.trip.count.i55 = zext i32 %19 to i64 %value.peel.phi.trans.insert.i56 = getelementptr inbounds %struct.Number, ptr %N2, i64 0, i32 1 %.pre17.i57 = load i8, ptr %value.peel.phi.trans.insert.i56, align 1, !tbaa !5 %.pre.i58 = load i8, ptr %N2, align 16, !tbaa !14 %conv.peel.i59 = sext i8 %.pre.i58 to i32 %conv4.peel.i60 = sext i8 %.pre17.i57 to i32 %call5.peel.i61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv.peel.i59, i32 noundef %conv4.peel.i60) %exitcond.peel.not.i62 = icmp eq i32 %19, 1 br i1 %exitcond.peel.not.i62, label %print.exit73, label %if.end.i63 if.end.i63: ; preds = %if.end.peel.i54, %if.end.i63 %indvars.iv.i64 = phi i64 [ %indvars.iv.next.i71, %if.end.i63 ], [ 1, %if.end.peel.i54 ] %putchar12.i65 = call i32 @putchar(i32 32) %arrayidx.i66 = getelementptr inbounds %struct.Number, ptr %N2, i64 %indvars.iv.i64 %20 = load i8, ptr %arrayidx.i66, align 2, !tbaa !14 %conv.i67 = sext i8 %20 to i32 %value.i68 = getelementptr inbounds %struct.Number, ptr %N2, i64 %indvars.iv.i64, i32 1 %21 = load i8, ptr %value.i68, align 1, !tbaa !5 %conv4.i69 = sext i8 %21 to i32 %call5.i70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv.i67, i32 noundef %conv4.i69) %indvars.iv.next.i71 = add nuw nsw i64 %indvars.iv.i64, 1 %exitcond.not.i72 = icmp eq i64 %indvars.iv.next.i71, %wide.trip.count.i55 br i1 %exitcond.not.i72, label %print.exit73, label %if.end.i63, !llvm.loop !15 print.exit73: ; preds = %if.end.i63, %print.exit, %if.end.peel.i54 %putchar.i53 = call i32 @putchar(i32 10) %22 = load i32, ptr %N, align 4, !tbaa !18 %cmp10.i = icmp sgt i32 %22, 0 br i1 %cmp10.i, label %for.body.preheader.i, label %if.end27 for.body.preheader.i: ; preds = %print.exit73 %wide.trip.count.i74 = zext i32 %22 to i64 br label %for.body.i for.cond.i: ; preds = %for.body.i %indvars.iv.next.i77 = add nuw nsw i64 %indvars.iv.i75, 1 %exitcond.not.i78 = icmp eq i64 %indvars.iv.next.i77, %wide.trip.count.i74 br i1 %exitcond.not.i78, label %if.end27, label %for.body.i, !llvm.loop !17 for.body.i: ; preds = %for.cond.i, %for.body.preheader.i %indvars.iv.i75 = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i77, %for.cond.i ] %arrayidx.i76 = getelementptr inbounds %struct.Number, ptr %N1, i64 %indvars.iv.i75 %23 = load i8, ptr %arrayidx.i76, align 2, !tbaa !14 %arrayidx2.i = getelementptr inbounds %struct.Number, ptr %N2, i64 %indvars.iv.i75 %24 = load i8, ptr %arrayidx2.i, align 2, !tbaa !14 %cmp5.not.i = icmp eq i8 %23, %24 br i1 %cmp5.not.i, label %for.cond.i, label %if.end27 if.end27: ; preds = %for.body.i, %for.cond.i, %print.exit73 %str.7.sink = phi ptr [ @str.8, %print.exit73 ], [ @str.8, %for.cond.i ], [ @str.7, %for.body.i ] %puts35 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink) call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %N2) #9 call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %N1) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #9 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind } attributes #9 = { nounwind } attributes #10 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 1} !6 = !{!"Number", !7, i64 0, !7, i64 1} !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 = !{!6, !7, i64 0} !15 = distinct !{!15, !10, !16} !16 = !{!"llvm.loop.peeled.count", i32 1} !17 = distinct !{!17, !10} !18 = !{!19, !19, i64 0} !19 = !{!"int", !7, i64 0} !20 = distinct !{!20, !10}
#include<stdio.h> int main() { long long int t, n, r; scanf("%lld", &t); while(t--) { scanf("%lld %lld", &n, &r); if(n>r) { printf("%lld\n", (r*(r+1))/2); } else { n--; printf("%lld\n", ((n*(n+1))/2)+1); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11318/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11318/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [10 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: %t = alloca i64, align 8 %n = alloca i64, align 8 %r = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i64, ptr %t, align 8, !tbaa !5 %dec10 = add nsw i64 %0, -1 store i64 %dec10, ptr %t, align 8, !tbaa !5 %tobool.not11 = icmp eq i64 %0, 0 br i1 %tobool.not11, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %r) %1 = load i64, ptr %n, align 8, !tbaa !5 %2 = load i64, ptr %r, align 8, !tbaa !5 %cmp = icmp sgt i64 %1, %2 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %add = add nsw i64 %2, 1 %mul = mul nsw i64 %add, %2 %div = sdiv i64 %mul, 2 br label %if.end if.else: ; preds = %while.body %dec3 = add nsw i64 %1, -1 store i64 %dec3, ptr %n, align 8, !tbaa !5 %mul5 = mul nsw i64 %dec3, %1 %div6 = sdiv i64 %mul5, 2 %add7 = add nsw i64 %div6, 1 br label %if.end if.end: ; preds = %if.else, %if.then %add7.sink = phi i64 [ %add7, %if.else ], [ %div, %if.then ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add7.sink) %3 = load i64, ptr %t, align 8, !tbaa !5 %dec = add nsw i64 %3, -1 store i64 %dec, ptr %t, align 8, !tbaa !5 %tobool.not = icmp eq i64 %3, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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> #define MAX_N 100 typedef struct{ char Mark; int num; } Card; void swap(int*,int*); void swap2(char*,char*); void bubbleSort(Card*,int); void selectionSort(Card*,int); void print(Card*,int); int isStable(Card*,Card*,int); int main(){ int N,i; char ch; Card a[MAX_N],b[MAX_N]; scanf("%d\n",&N); for(i = 0 ; i < N ; i++){ scanf("%c%d%c",&a[i].Mark,&a[i].num,&ch); b[i] = a[i]; } bubbleSort(a,N); selectionSort(b,N); print(a,N); puts(isStable(a,a,N) ? "Stable" : "Not stable"); print(b,N); puts(isStable(a,b,N) ? "Stable" : "Not stable"); return 0; } void swap(int *a,int *b){ int temp; temp = *a; *a = *b; *b = temp; } void swap2(char *a,char *b){ char temp; temp = *a; *a = *b; *b = temp; } void bubbleSort(Card *c,int N){ int i,j; for(i = 0 ; i < N ; i++){ for(j = N-1 ; j > i ; j--){ if(c[j].num < c[j-1].num){ swap(&c[j].num,&c[j-1].num); swap2(&c[j].Mark,&c[j-1].Mark); } } } } void selectionSort(Card *c,int N){ int i,j,min; for(i = 0 ; i < N ; i++){ min = i; for(j = i+1 ; j < N ; j++){ if(c[j].num < c[min].num){ min = j; } } swap(&c[i].num,&c[min].num); swap2(&c[i].Mark,&c[min].Mark); } } void print(Card *c,int N){ int i; for(i = 0 ; i < N ; i++){ printf("%c%d%c", c[i].Mark,c[i].num,(i < N-1 ? ' ' : '\n')); } } int isStable(Card *a,Card *b,int N){ int i,flag = 1; for(i = 0 ; i < N ; i++){ if(a[i].Mark != b[i].Mark){ flag = 0; break; } } return flag; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_113222/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_113222/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Card = type { i8, i32 } @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%c%d%c\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1 @.str.3 = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %ch = alloca i8, align 1 %a = alloca [100 x %struct.Card], align 16 %b = alloca [100 x %struct.Card], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #6 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %b) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp82 = icmp sgt i32 %0, 0 br i1 %cmp82, label %for.body, label %isStable.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x %struct.Card], ptr %a, i64 0, i64 %indvars.iv %num = getelementptr inbounds [100 x %struct.Card], ptr %a, i64 0, i64 %indvars.iv, i32 1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %num, ptr noundef nonnull %ch) %arrayidx5 = getelementptr inbounds [100 x %struct.Card], ptr %b, i64 0, i64 %indvars.iv %1 = load i64, ptr %arrayidx, align 8 store i64 %1, ptr %arrayidx5, align 8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %N, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp43.i = icmp sgt i32 %2, 0 br i1 %cmp43.i, label %for.cond1.preheader.lr.ph.i, label %isStable.exit for.cond1.preheader.lr.ph.i: ; preds = %for.end %j.039.i = add nsw i32 %2, -1 %4 = zext i32 %2 to i64 %5 = add nsw i64 %4, -1 %6 = zext i32 %j.039.i to i64 br label %for.cond1.preheader.i for.cond1.preheader.i: ; preds = %for.inc22.i, %for.cond1.preheader.lr.ph.i %indvars.iv51.i = phi i64 [ 0, %for.cond1.preheader.lr.ph.i ], [ %indvars.iv.next52.i, %for.inc22.i ] %cmp240.i = icmp ult i64 %indvars.iv51.i, %6 br i1 %cmp240.i, label %for.body3.i, label %for.inc22.i for.body3.i: ; preds = %for.cond1.preheader.i, %for.inc.i %indvars.iv45.i = phi i64 [ %indvars.iv.next46.i, %for.inc.i ], [ %4, %for.cond1.preheader.i ] %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ %5, %for.cond1.preheader.i ] %indvars.iv.next46.i = add nsw i64 %indvars.iv45.i, -1 %num.i = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.i, i32 1 %7 = load i32, ptr %num.i, align 4, !tbaa !5 %8 = add nsw i64 %indvars.iv45.i, -2 %num7.i = getelementptr inbounds %struct.Card, ptr %a, i64 %8, i32 1 %9 = load i32, ptr %num7.i, align 4, !tbaa !5 %cmp8.i = icmp slt i32 %7, %9 br i1 %cmp8.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body3.i %arrayidx6.i = getelementptr inbounds %struct.Card, ptr %a, i64 %8 %arrayidx.i = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.i store i32 %9, ptr %num.i, align 4, !tbaa !5 store i32 %7, ptr %num7.i, align 4, !tbaa !5 %10 = load i8, ptr %arrayidx.i, align 8, !tbaa !11 %11 = load i8, ptr %arrayidx6.i, align 8, !tbaa !11 store i8 %11, ptr %arrayidx.i, align 8, !tbaa !11 store i8 %10, ptr %arrayidx6.i, align 8, !tbaa !11 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body3.i %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %cmp2.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv51.i br i1 %cmp2.i, label %for.body3.i, label %for.inc22.i, !llvm.loop !12 for.inc22.i: ; preds = %for.inc.i, %for.cond1.preheader.i %indvars.iv.next52.i = add nuw nsw i64 %indvars.iv51.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next52.i, %4 br i1 %exitcond.not.i, label %for.body.i, label %for.cond1.preheader.i, !llvm.loop !13 for.body.i: ; preds = %for.inc22.i, %for.end.i %indvars.iv46.i = phi i64 [ %indvars.iv.next47.i, %for.end.i ], [ 0, %for.inc22.i ] %indvars.iv.i26 = phi i64 [ %indvars.iv.next.i27, %for.end.i ], [ 1, %for.inc22.i ] %indvars.iv.next47.i = add nuw nsw i64 %indvars.iv46.i, 1 %cmp238.i = icmp ult i64 %indvars.iv.next47.i, %4 %12 = trunc i64 %indvars.iv46.i to i32 br i1 %cmp238.i, label %for.body3.i28, label %for.end.i for.body3.i28: ; preds = %for.body.i, %for.body3.i28 %indvars.iv43.i = phi i64 [ %indvars.iv.next44.i, %for.body3.i28 ], [ %indvars.iv.i26, %for.body.i ] %min.040.i = phi i32 [ %spec.select.i, %for.body3.i28 ], [ %12, %for.body.i ] %num.i29 = getelementptr inbounds %struct.Card, ptr %b, i64 %indvars.iv43.i, i32 1 %13 = load i32, ptr %num.i29, align 4, !tbaa !14 %idxprom4.i = sext i32 %min.040.i to i64 %num6.i = getelementptr inbounds %struct.Card, ptr %b, i64 %idxprom4.i, i32 1 %14 = load i32, ptr %num6.i, align 4, !tbaa !14 %cmp7.i = icmp slt i32 %13, %14 %15 = trunc i64 %indvars.iv43.i to i32 %spec.select.i = select i1 %cmp7.i, i32 %15, i32 %min.040.i %indvars.iv.next44.i = add nuw nsw i64 %indvars.iv43.i, 1 %exitcond.not.i30 = icmp eq i64 %indvars.iv.next44.i, %4 br i1 %exitcond.not.i30, label %for.end.i, label %for.body3.i28, !llvm.loop !16 for.end.i: ; preds = %for.body3.i28, %for.body.i %min.0.lcssa.i = phi i32 [ %12, %for.body.i ], [ %spec.select.i, %for.body3.i28 ] %arrayidx9.i = getelementptr inbounds %struct.Card, ptr %b, i64 %indvars.iv46.i %num10.i = getelementptr inbounds %struct.Card, ptr %b, i64 %indvars.iv46.i, i32 1 %idxprom11.i = sext i32 %min.0.lcssa.i to i64 %arrayidx12.i = getelementptr inbounds %struct.Card, ptr %b, i64 %idxprom11.i %num13.i = getelementptr inbounds %struct.Card, ptr %b, i64 %idxprom11.i, i32 1 %16 = load i32, ptr %num10.i, align 4, !tbaa !5 %17 = load i32, ptr %num13.i, align 4, !tbaa !5 store i32 %17, ptr %num10.i, align 4, !tbaa !5 store i32 %16, ptr %num13.i, align 4, !tbaa !5 %18 = load i8, ptr %arrayidx9.i, align 8, !tbaa !11 %19 = load i8, ptr %arrayidx12.i, align 8, !tbaa !11 store i8 %19, ptr %arrayidx9.i, align 8, !tbaa !11 store i8 %18, ptr %arrayidx12.i, align 8, !tbaa !11 %indvars.iv.next.i27 = add nuw nsw i64 %indvars.iv.i26, 1 %exitcond50.not.i = icmp eq i64 %indvars.iv.next47.i, %4 br i1 %exitcond50.not.i, label %for.body.i33, label %for.body.i, !llvm.loop !17 for.body.i33: ; preds = %for.end.i, %for.body.i33 %indvars.iv.i34 = phi i64 [ %indvars.iv.next.i37, %for.body.i33 ], [ 0, %for.end.i ] %arrayidx.i35 = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.i34 %20 = load i8, ptr %arrayidx.i35, align 8, !tbaa !18 %conv.i = sext i8 %20 to i32 %num.i36 = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.i34, i32 1 %21 = load i32, ptr %num.i36, align 4, !tbaa !14 %cmp3.i = icmp ult i64 %indvars.iv.i34, %6 %cond.i = select i1 %cmp3.i, i32 32, i32 10 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv.i, i32 noundef %21, i32 noundef %cond.i) %indvars.iv.next.i37 = add nuw nsw i64 %indvars.iv.i34, 1 %exitcond.not.i38 = icmp eq i64 %indvars.iv.next.i37, %4 br i1 %exitcond.not.i38, label %isStable.exit, label %for.body.i33, !llvm.loop !19 isStable.exit: ; preds = %for.body.i33, %entry, %for.end %call13 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) %22 = load i32, ptr %N, align 4, !tbaa !5 %cmp11.i47 = icmp sgt i32 %22, 0 br i1 %cmp11.i47, label %for.body.lr.ph.i49, label %isStable.exit76 for.body.lr.ph.i49: ; preds = %isStable.exit %sub.i50 = add nsw i32 %22, -1 %23 = zext i32 %sub.i50 to i64 %wide.trip.count.i51 = zext i32 %22 to i64 br label %for.body.i52 for.body.i52: ; preds = %for.body.i52, %for.body.lr.ph.i49 %indvars.iv.i53 = phi i64 [ 0, %for.body.lr.ph.i49 ], [ %indvars.iv.next.i60, %for.body.i52 ] %arrayidx.i54 = getelementptr inbounds %struct.Card, ptr %b, i64 %indvars.iv.i53 %24 = load i8, ptr %arrayidx.i54, align 8, !tbaa !18 %conv.i55 = sext i8 %24 to i32 %num.i56 = getelementptr inbounds %struct.Card, ptr %b, i64 %indvars.iv.i53, i32 1 %25 = load i32, ptr %num.i56, align 4, !tbaa !14 %cmp3.i57 = icmp ult i64 %indvars.iv.i53, %23 %cond.i58 = select i1 %cmp3.i57, i32 32, i32 10 %call.i59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv.i55, i32 noundef %25, i32 noundef %cond.i58) %indvars.iv.next.i60 = add nuw nsw i64 %indvars.iv.i53, 1 %exitcond.not.i61 = icmp eq i64 %indvars.iv.next.i60, %wide.trip.count.i51 br i1 %exitcond.not.i61, label %print.exit62, label %for.body.i52, !llvm.loop !19 print.exit62: ; preds = %for.body.i52 %.pr = load i32, ptr %N, align 4, !tbaa !5 %cmp10.i63 = icmp sgt i32 %.pr, 0 br i1 %cmp10.i63, label %for.body.preheader.i66, label %isStable.exit76 for.body.preheader.i66: ; preds = %print.exit62 %wide.trip.count.i67 = zext i32 %.pr to i64 br label %for.body.i68 for.cond.i73: ; preds = %for.body.i68 %indvars.iv.next.i74 = add nuw nsw i64 %indvars.iv.i69, 1 %exitcond.not.i75 = icmp eq i64 %indvars.iv.next.i74, %wide.trip.count.i67 br i1 %exitcond.not.i75, label %isStable.exit76, label %for.body.i68, !llvm.loop !20 for.body.i68: ; preds = %for.cond.i73, %for.body.preheader.i66 %indvars.iv.i69 = phi i64 [ 0, %for.body.preheader.i66 ], [ %indvars.iv.next.i74, %for.cond.i73 ] %arrayidx.i70 = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv.i69 %26 = load i8, ptr %arrayidx.i70, align 8, !tbaa !18 %arrayidx2.i71 = getelementptr inbounds %struct.Card, ptr %b, i64 %indvars.iv.i69 %27 = load i8, ptr %arrayidx2.i71, align 8, !tbaa !18 %cmp5.not.i72 = icmp eq i8 %26, %27 br i1 %cmp5.not.i72, label %for.cond.i73, label %isStable.exit76 isStable.exit76: ; preds = %for.cond.i73, %for.body.i68, %isStable.exit, %print.exit62 %28 = phi ptr [ @.str.2, %print.exit62 ], [ @.str.2, %isStable.exit ], [ @.str.2, %for.cond.i73 ], [ @.str.3, %for.body.i68 ] %call20 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %28) call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @bubbleSort(ptr nocapture noundef %c, i32 noundef %N) local_unnamed_addr #3 { entry: %cmp43 = icmp sgt i32 %N, 0 br i1 %cmp43, label %for.cond1.preheader.lr.ph, label %for.end23 for.cond1.preheader.lr.ph: ; preds = %entry %j.039 = add nsw i32 %N, -1 %0 = zext i32 %N to i64 %1 = add nsw i64 %0, -1 %2 = zext i32 %j.039 to i64 %wide.trip.count = zext i32 %N to i64 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc22 %indvars.iv51 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next52, %for.inc22 ] %cmp240 = icmp ult i64 %indvars.iv51, %2 br i1 %cmp240, label %for.body3, label %for.inc22 for.body3: ; preds = %for.cond1.preheader, %for.inc %indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.inc ], [ %0, %for.cond1.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %1, %for.cond1.preheader ] %indvars.iv.next46 = add nsw i64 %indvars.iv45, -1 %num = getelementptr inbounds %struct.Card, ptr %c, i64 %indvars.iv, i32 1 %3 = load i32, ptr %num, align 4, !tbaa !5 %4 = add nsw i64 %indvars.iv45, -2 %num7 = getelementptr inbounds %struct.Card, ptr %c, i64 %4, i32 1 %5 = load i32, ptr %num7, align 4, !tbaa !5 %cmp8 = icmp slt i32 %3, %5 br i1 %cmp8, label %if.then, label %for.inc if.then: ; preds = %for.body3 %arrayidx6 = getelementptr inbounds %struct.Card, ptr %c, i64 %4 %arrayidx = getelementptr inbounds %struct.Card, ptr %c, i64 %indvars.iv store i32 %5, ptr %num, align 4, !tbaa !5 store i32 %3, ptr %num7, align 4, !tbaa !5 %6 = load i8, ptr %arrayidx, align 1, !tbaa !11 %7 = load i8, ptr %arrayidx6, align 1, !tbaa !11 store i8 %7, ptr %arrayidx, align 1, !tbaa !11 store i8 %6, ptr %arrayidx6, align 1, !tbaa !11 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next = add nsw i64 %indvars.iv, -1 %cmp2 = icmp sgt i64 %indvars.iv.next, %indvars.iv51 br i1 %cmp2, label %for.body3, label %for.inc22, !llvm.loop !12 for.inc22: ; preds = %for.inc, %for.cond1.preheader %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1 %exitcond.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count br i1 %exitcond.not, label %for.end23, label %for.cond1.preheader, !llvm.loop !13 for.end23: ; preds = %for.inc22, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @selectionSort(ptr nocapture noundef %c, i32 noundef %N) local_unnamed_addr #3 { entry: %cmp41 = icmp sgt i32 %N, 0 br i1 %cmp41, label %for.body.preheader, label %for.end21 for.body.preheader: ; preds = %entry %0 = zext i32 %N to i64 %wide.trip.count49 = zext i32 %N to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.end %indvars.iv46 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next47, %for.end ] %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.end ] %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1 %cmp238 = icmp ult i64 %indvars.iv.next47, %0 %1 = trunc i64 %indvars.iv46 to i32 br i1 %cmp238, label %for.body3, label %for.end for.body3: ; preds = %for.body, %for.body3 %indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body3 ], [ %indvars.iv, %for.body ] %min.040 = phi i32 [ %spec.select, %for.body3 ], [ %1, %for.body ] %num = getelementptr inbounds %struct.Card, ptr %c, i64 %indvars.iv43, i32 1 %2 = load i32, ptr %num, align 4, !tbaa !14 %idxprom4 = sext i32 %min.040 to i64 %num6 = getelementptr inbounds %struct.Card, ptr %c, i64 %idxprom4, i32 1 %3 = load i32, ptr %num6, align 4, !tbaa !14 %cmp7 = icmp slt i32 %2, %3 %4 = trunc i64 %indvars.iv43 to i32 %spec.select = select i1 %cmp7, i32 %4, i32 %min.040 %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %exitcond.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count49 br i1 %exitcond.not, label %for.end, label %for.body3, !llvm.loop !16 for.end: ; preds = %for.body3, %for.body %min.0.lcssa = phi i32 [ %1, %for.body ], [ %spec.select, %for.body3 ] %arrayidx9 = getelementptr inbounds %struct.Card, ptr %c, i64 %indvars.iv46 %num10 = getelementptr inbounds %struct.Card, ptr %c, i64 %indvars.iv46, i32 1 %idxprom11 = sext i32 %min.0.lcssa to i64 %arrayidx12 = getelementptr inbounds %struct.Card, ptr %c, i64 %idxprom11 %num13 = getelementptr inbounds %struct.Card, ptr %c, i64 %idxprom11, i32 1 %5 = load i32, ptr %num10, align 4, !tbaa !5 %6 = load i32, ptr %num13, align 4, !tbaa !5 store i32 %6, ptr %num10, align 4, !tbaa !5 store i32 %5, ptr %num13, align 4, !tbaa !5 %7 = load i8, ptr %arrayidx9, align 1, !tbaa !11 %8 = load i8, ptr %arrayidx12, align 1, !tbaa !11 store i8 %8, ptr %arrayidx9, align 1, !tbaa !11 store i8 %7, ptr %arrayidx12, align 1, !tbaa !11 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond50.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count49 br i1 %exitcond50.not, label %for.end21, label %for.body, !llvm.loop !17 for.end21: ; preds = %for.end, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(ptr nocapture noundef readonly %c, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp11 = icmp sgt i32 %N, 0 br i1 %cmp11, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %sub = add nsw i32 %N, -1 %0 = zext i32 %sub to i64 %wide.trip.count = zext i32 %N to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds %struct.Card, ptr %c, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 4, !tbaa !18 %conv = sext i8 %1 to i32 %num = getelementptr inbounds %struct.Card, ptr %c, i64 %indvars.iv, i32 1 %2 = load i32, ptr %num, align 4, !tbaa !14 %cmp3 = icmp ult i64 %indvars.iv, %0 %cond = select i1 %cmp3, i32 32, i32 10 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %2, i32 noundef %cond) %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 !19 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @isStable(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b, i32 noundef %N) local_unnamed_addr #4 { entry: %cmp10 = icmp sgt i32 %N, 0 br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %N to i64 br label %for.body for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !20 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds %struct.Card, ptr %a, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 4, !tbaa !18 %arrayidx2 = getelementptr inbounds %struct.Card, ptr %b, i64 %indvars.iv %1 = load i8, ptr %arrayidx2, align 4, !tbaa !18 %cmp5.not = icmp eq i8 %0, %1 br i1 %cmp5.not, label %for.cond, label %for.end for.end: ; preds = %for.cond, %for.body, %entry %flag.0 = phi i32 [ 1, %entry ], [ 0, %for.body ], [ 1, %for.cond ] ret i32 %flag.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 #5 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap2(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #5 { entry: %0 = load i8, ptr %a, align 1, !tbaa !11 %1 = load i8, ptr %b, align 1, !tbaa !11 store i8 %1, ptr %a, align 1, !tbaa !11 store i8 %0, ptr %b, align 1, !tbaa !11 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree 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 #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = !{!15, !6, i64 4} !15 = !{!"", !7, i64 0, !6, i64 4} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = !{!15, !7, i64 0} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10}
#include<stdio.h> int main(){ int i,j,N,A[2][36],minj,atmp; char C[2][36],ctmp; scanf("%d",&N); for(i=0;i<N;i++){ scanf(" %c%d",&C[0][i],&A[0][i]); A[1][i]=A[0][i]; C[1][i]=C[0][i]; } for(i=0;i<=N-1;i++){ for(j=N-1;j>=i+1;j--){ if(A[1][j]<A[1][j-1]){ atmp=A[1][j]; A[1][j]=A[1][j-1]; A[1][j-1]=atmp; ctmp=C[1][j]; C[1][j]=C[1][j-1]; C[1][j-1]=ctmp; } } } for(i=0;i<N;i++){ printf("%c%d",C[1][i],A[1][i]); if(i!=N-1)printf(" "); } printf("\nStable\n"); for(i=0;i<N;i++){ A[1][i]=A[0][i]; C[1][i]=C[0][i]; } for(i=0;i<=N-1;i++){ minj=i; for(j=i;j<=N-1;j++){ if(A[1][j]<A[1][minj])minj=j; } atmp=A[1][i]; A[1][i]=A[1][minj]; A[1][minj]=atmp; ctmp=C[1][i]; C[1][i]=C[1][minj]; C[1][minj]=ctmp; } for(i=0;i<N;i++){ printf("%c%d",C[1][i],A[1][i]); if(i!=N-1)printf(" "); } minj=0; for(i=0;i<=N-1;i++){ for(j=i+1;j<=N-1;j++){ for(atmp=0;atmp<=N-1;atmp++){ for(ctmp=atmp+1;ctmp<=N-1;ctmp++){ if(A[1][i]==A[1][j] && C[1][i]==C[0][ctmp] && C[1][j]==C[0][atmp]){ minj=1; break; } } } } } if(minj==0)printf("\nStable\n"); else printf("\nNot stable\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_113280/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_113280/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %c%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%c%d\00", align 1 @str.6 = private unnamed_addr constant [12 x i8] c"\0ANot stable\00", align 1 @str.7 = private unnamed_addr constant [8 x i8] c"\0AStable\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 [2 x [36 x i32]], align 16 %C = alloca [2 x [36 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 288, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %C) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp327 = icmp sgt i32 %0, 0 br i1 %cmp327, label %for.body, label %for.end84 for.cond18.preheader: ; preds = %for.body %cmp19.not.not334 = icmp sgt i32 %4, 0 br i1 %cmp19.not.not334, label %for.cond22.preheader.lr.ph, label %for.end84 for.cond22.preheader.lr.ph: ; preds = %for.cond18.preheader %1 = zext i32 %4 to i64 %wide.trip.count = zext i32 %4 to i64 br label %for.cond22.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx1 = getelementptr inbounds [36 x i8], ptr %C, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [36 x i32], ptr %A, i64 0, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx4) %2 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv store i32 %2, ptr %arrayidx11, align 4, !tbaa !5 %3 = load i8, ptr %arrayidx1, align 1, !tbaa !9 %arrayidx17 = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %indvars.iv store i8 %3, ptr %arrayidx17, align 1, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond18.preheader, !llvm.loop !10 for.cond18.loopexit: ; preds = %for.inc61, %for.cond22.preheader %exitcond.not = icmp eq i64 %indvars.iv.next384, %wide.trip.count br i1 %exitcond.not, label %for.cond66.preheader, label %for.cond22.preheader, !llvm.loop !12 for.cond22.preheader: ; preds = %for.cond22.preheader.lr.ph, %for.cond18.loopexit %indvars.iv383 = phi i64 [ 0, %for.cond22.preheader.lr.ph ], [ %indvars.iv.next384, %for.cond18.loopexit ] %indvars.iv.next384 = add nuw nsw i64 %indvars.iv383, 1 %cmp23.not.not330 = icmp ult i64 %indvars.iv.next384, %1 br i1 %cmp23.not.not330, label %for.body24, label %for.cond18.loopexit for.cond66.preheader: ; preds = %for.cond18.loopexit br i1 %cmp19.not.not334, label %for.body68, label %for.end84 for.body24: ; preds = %for.cond22.preheader, %for.inc61 %indvars.iv379 = phi i64 [ %indvars.iv.next380, %for.inc61 ], [ %1, %for.cond22.preheader ] %indvars.iv.next380 = add nsw i64 %indvars.iv379, -1 %arrayidx27 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv.next380 %6 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %7 = add nsw i64 %indvars.iv379, -2 %arrayidx31 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %7 %8 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %cmp32 = icmp slt i32 %6, %8 br i1 %cmp32, label %if.then, label %for.inc61 if.then: ; preds = %for.body24 store i32 %8, ptr %arrayidx27, align 4, !tbaa !5 store i32 %6, ptr %arrayidx31, align 4, !tbaa !5 %arrayidx49 = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %indvars.iv.next380 %9 = load i8, ptr %arrayidx49, align 1, !tbaa !9 %arrayidx53 = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %7 %10 = load i8, ptr %arrayidx53, align 1, !tbaa !9 store i8 %10, ptr %arrayidx49, align 1, !tbaa !9 store i8 %9, ptr %arrayidx53, align 1, !tbaa !9 br label %for.inc61 for.inc61: ; preds = %for.body24, %if.then %cmp23.not.not = icmp sgt i64 %indvars.iv.next380, %indvars.iv.next384 br i1 %cmp23.not.not, label %for.body24, label %for.cond18.loopexit, !llvm.loop !13 for.body68: ; preds = %for.cond66.preheader, %for.inc82 %indvars.iv386 = phi i64 [ %indvars.iv.next387, %for.inc82 ], [ 0, %for.cond66.preheader ] %arrayidx71 = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %indvars.iv386 %11 = load i8, ptr %arrayidx71, align 1, !tbaa !9 %conv = sext i8 %11 to i32 %arrayidx74 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv386 %12 = load i32, ptr %arrayidx74, align 4, !tbaa !5 %call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv, i32 noundef %12) %13 = load i32, ptr %N, align 4, !tbaa !5 %sub76 = add nsw i32 %13, -1 %14 = zext i32 %sub76 to i64 %cmp77.not = icmp eq i64 %indvars.iv386, %14 br i1 %cmp77.not, label %for.inc82, label %if.then79 if.then79: ; preds = %for.body68 %putchar324 = call i32 @putchar(i32 32) %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %for.inc82 for.inc82: ; preds = %for.body68, %if.then79 %15 = phi i32 [ %13, %for.body68 ], [ %.pre, %if.then79 ] %indvars.iv.next387 = add nuw nsw i64 %indvars.iv386, 1 %16 = sext i32 %15 to i64 %cmp67 = icmp slt i64 %indvars.iv.next387, %16 br i1 %cmp67, label %for.body68, label %for.end84, !llvm.loop !14 for.end84: ; preds = %for.inc82, %entry, %for.cond18.preheader, %for.cond66.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.7) %17 = load i32, ptr %N, align 4, !tbaa !5 %cmp87338 = icmp sgt i32 %17, 0 br i1 %cmp87338, label %for.body89.preheader, label %if.end248 for.body89.preheader: ; preds = %for.end84 %wide.trip.count392 = zext i32 %17 to i64 %xtraiter = and i64 %wide.trip.count392, 1 %18 = icmp eq i32 %17, 1 br i1 %18, label %for.cond105.preheader.unr-lcssa, label %for.body89.preheader.new for.body89.preheader.new: ; preds = %for.body89.preheader %unroll_iter = and i64 %wide.trip.count392, 4294967294 br label %for.body89 for.cond105.preheader.unr-lcssa: ; preds = %for.body89, %for.body89.preheader %indvars.iv389.unr = phi i64 [ 0, %for.body89.preheader ], [ %indvars.iv.next390.1, %for.body89 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond105.preheader, label %for.body89.epil for.body89.epil: ; preds = %for.cond105.preheader.unr-lcssa %arrayidx92.epil = getelementptr inbounds [36 x i32], ptr %A, i64 0, i64 %indvars.iv389.unr %19 = load i32, ptr %arrayidx92.epil, align 4, !tbaa !5 %arrayidx95.epil = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv389.unr store i32 %19, ptr %arrayidx95.epil, align 4, !tbaa !5 %arrayidx98.epil = getelementptr inbounds [36 x i8], ptr %C, i64 0, i64 %indvars.iv389.unr %20 = load i8, ptr %arrayidx98.epil, align 1, !tbaa !9 %arrayidx101.epil = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %indvars.iv389.unr store i8 %20, ptr %arrayidx101.epil, align 1, !tbaa !9 br label %for.cond105.preheader for.cond105.preheader: ; preds = %for.cond105.preheader.unr-lcssa, %for.body89.epil br i1 %cmp87338, label %for.cond110.preheader.preheader, label %if.end248 for.cond110.preheader.preheader: ; preds = %for.cond105.preheader %21 = zext i32 %17 to i64 %wide.trip.count400 = zext i32 %17 to i64 br label %for.cond110.preheader for.body89: ; preds = %for.body89, %for.body89.preheader.new %indvars.iv389 = phi i64 [ 0, %for.body89.preheader.new ], [ %indvars.iv.next390.1, %for.body89 ] %niter = phi i64 [ 0, %for.body89.preheader.new ], [ %niter.next.1, %for.body89 ] %arrayidx92 = getelementptr inbounds [36 x i32], ptr %A, i64 0, i64 %indvars.iv389 %22 = load i32, ptr %arrayidx92, align 8, !tbaa !5 %arrayidx95 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv389 store i32 %22, ptr %arrayidx95, align 8, !tbaa !5 %arrayidx98 = getelementptr inbounds [36 x i8], ptr %C, i64 0, i64 %indvars.iv389 %23 = load i8, ptr %arrayidx98, align 2, !tbaa !9 %arrayidx101 = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %indvars.iv389 store i8 %23, ptr %arrayidx101, align 2, !tbaa !9 %indvars.iv.next390 = or i64 %indvars.iv389, 1 %arrayidx92.1 = getelementptr inbounds [36 x i32], ptr %A, i64 0, i64 %indvars.iv.next390 %24 = load i32, ptr %arrayidx92.1, align 4, !tbaa !5 %arrayidx95.1 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv.next390 store i32 %24, ptr %arrayidx95.1, align 4, !tbaa !5 %arrayidx98.1 = getelementptr inbounds [36 x i8], ptr %C, i64 0, i64 %indvars.iv.next390 %25 = load i8, ptr %arrayidx98.1, align 1, !tbaa !9 %arrayidx101.1 = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %indvars.iv.next390 store i8 %25, ptr %arrayidx101.1, align 1, !tbaa !9 %indvars.iv.next390.1 = add nuw nsw i64 %indvars.iv389, 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.cond105.preheader.unr-lcssa, label %for.body89, !llvm.loop !15 for.cond110.preheader: ; preds = %for.cond110.preheader.preheader, %for.end127 %indvars.iv394 = phi i64 [ 0, %for.cond110.preheader.preheader ], [ %indvars.iv.next395, %for.end127 ] %26 = trunc i64 %indvars.iv394 to i32 br label %for.body114 for.cond155.preheader: ; preds = %for.end127 br i1 %cmp87338, label %for.body158, label %if.end248 for.body114: ; preds = %for.cond110.preheader, %for.body114 %indvars.iv396 = phi i64 [ %indvars.iv394, %for.cond110.preheader ], [ %indvars.iv.next397, %for.body114 ] %minj.0342 = phi i32 [ %26, %for.cond110.preheader ], [ %spec.select, %for.body114 ] %arrayidx117 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv396 %27 = load i32, ptr %arrayidx117, align 4, !tbaa !5 %idxprom119 = sext i32 %minj.0342 to i64 %arrayidx120 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %idxprom119 %28 = load i32, ptr %arrayidx120, align 4, !tbaa !5 %cmp121 = icmp slt i32 %27, %28 %29 = trunc i64 %indvars.iv396 to i32 %spec.select = select i1 %cmp121, i32 %29, i32 %minj.0342 %indvars.iv.next397 = add nuw nsw i64 %indvars.iv396, 1 %cmp112.not.not = icmp ult i64 %indvars.iv.next397, %21 br i1 %cmp112.not.not, label %for.body114, label %for.end127, !llvm.loop !16 for.end127: ; preds = %for.body114 %arrayidx130 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv394 %30 = load i32, ptr %arrayidx130, align 4, !tbaa !5 %idxprom132 = sext i32 %spec.select to i64 %arrayidx133 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %idxprom132 %31 = load i32, ptr %arrayidx133, align 4, !tbaa !5 store i32 %31, ptr %arrayidx130, align 4, !tbaa !5 store i32 %30, ptr %arrayidx133, align 4, !tbaa !5 %arrayidx142 = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %indvars.iv394 %32 = load i8, ptr %arrayidx142, align 1, !tbaa !9 %arrayidx145 = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %idxprom132 %33 = load i8, ptr %arrayidx145, align 1, !tbaa !9 store i8 %33, ptr %arrayidx142, align 1, !tbaa !9 store i8 %32, ptr %arrayidx145, align 1, !tbaa !9 %indvars.iv.next395 = add nuw nsw i64 %indvars.iv394, 1 %exitcond401.not = icmp eq i64 %indvars.iv.next395, %wide.trip.count400 br i1 %exitcond401.not, label %for.cond155.preheader, label %for.cond110.preheader, !llvm.loop !17 for.cond176.preheader: ; preds = %for.inc173 %cmp178.not.not369 = icmp sgt i32 %46, 0 br i1 %cmp178.not.not369, label %for.body180.us.preheader, label %if.end248 for.body180.us.preheader: ; preds = %for.cond176.preheader %34 = zext i32 %46 to i64 %wide.trip.count420 = zext i32 %46 to i64 br label %for.body180.us for.body180.us: ; preds = %for.body180.us.preheader, %for.cond176.loopexit.us %indvars.iv417 = phi i64 [ 0, %for.body180.us.preheader ], [ %indvars.iv.next418, %for.cond176.loopexit.us ] %indvars.iv410 = phi i64 [ 1, %for.body180.us.preheader ], [ %indvars.iv.next411, %for.cond176.loopexit.us ] %minj.2371.us = phi i32 [ 0, %for.body180.us.preheader ], [ %minj.3.lcssa.us, %for.cond176.loopexit.us ] %indvars.iv.next418 = add nuw nsw i64 %indvars.iv417, 1 %cmp184.not.not358.us = icmp ult i64 %indvars.iv.next418, %34 br i1 %cmp184.not.not358.us, label %for.cond187.preheader.lr.ph.us, label %for.cond176.loopexit.us for.cond176.loopexit.us: ; preds = %for.cond187.for.inc237_crit_edge.us.us, %for.body180.us %minj.3.lcssa.us = phi i32 [ %minj.2371.us, %for.body180.us ], [ %minj.5.us.us, %for.cond187.for.inc237_crit_edge.us.us ] %indvars.iv.next411 = add nuw nsw i64 %indvars.iv410, 1 %exitcond421.not = icmp eq i64 %indvars.iv.next418, %wide.trip.count420 br i1 %exitcond421.not, label %for.end242, label %for.body180.us, !llvm.loop !18 for.cond187.preheader.lr.ph.us: ; preds = %for.body180.us %arrayidx202.us = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv417 %arrayidx210.us = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %indvars.iv417 br label %for.cond187.preheader.us.us for.cond187.preheader.us.us: ; preds = %for.cond187.for.inc237_crit_edge.us.us, %for.cond187.preheader.lr.ph.us %indvars.iv412 = phi i64 [ %indvars.iv.next413, %for.cond187.for.inc237_crit_edge.us.us ], [ %indvars.iv410, %for.cond187.preheader.lr.ph.us ] %minj.3360.us.us = phi i32 [ %minj.5.us.us, %for.cond187.for.inc237_crit_edge.us.us ], [ %minj.2371.us, %for.cond187.preheader.lr.ph.us ] %arrayidx221.us.us = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %indvars.iv412 %arrayidx205.us.us = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv412 br label %for.body191.us.us for.body191.us.us: ; preds = %for.inc234.us.us, %for.cond187.preheader.us.us %indvars.iv405 = phi i64 [ %indvars.iv.next406, %for.inc234.us.us ], [ 0, %for.cond187.preheader.us.us ] %minj.4355.us.us = phi i32 [ %minj.5.us.us, %for.inc234.us.us ], [ %minj.3360.us.us, %for.cond187.preheader.us.us ] %indvars.iv.next406 = add nuw nsw i64 %indvars.iv405, 1 %35 = trunc i64 %indvars.iv.next406 to i32 %conv193.us.us = trunc i64 %indvars.iv.next406 to i8 %sext = shl i32 %35, 24 %conv195348.us.us = ashr exact i32 %sext, 24 %cmp197.not.not349.us.us = icmp sgt i32 %46, %conv195348.us.us br i1 %cmp197.not.not349.us.us, label %for.body199.lr.ph.us.us, label %for.inc234.us.us for.inc234.us.us: ; preds = %for.inc231.us.us.us, %land.lhs.true218.us.us.us, %for.body199.lr.ph.us.us, %for.body191.us.us %minj.5.us.us = phi i32 [ %minj.4355.us.us, %for.body191.us.us ], [ %minj.4355.us.us, %for.body199.lr.ph.us.us ], [ 1, %land.lhs.true218.us.us.us ], [ %minj.4355.us.us, %for.inc231.us.us.us ] %exitcond409.not = icmp eq i64 %indvars.iv.next406, %wide.trip.count420 br i1 %exitcond409.not, label %for.cond187.for.inc237_crit_edge.us.us, label %for.body191.us.us, !llvm.loop !19 for.body199.lr.ph.us.us: ; preds = %for.body191.us.us %36 = load i32, ptr %arrayidx202.us, align 4, !tbaa !5 %37 = load i32, ptr %arrayidx205.us.us, align 4, !tbaa !5 %cmp206.us.us = icmp eq i32 %36, %37 %arrayidx225.us.us = getelementptr inbounds [36 x i8], ptr %C, i64 0, i64 %indvars.iv405 br i1 %cmp206.us.us, label %for.body199.lr.ph.split.us.us.us, label %for.inc234.us.us for.body199.lr.ph.split.us.us.us: ; preds = %for.body199.lr.ph.us.us %38 = load i8, ptr %arrayidx210.us, align 1, !tbaa !9 br label %for.body199.us.us.us for.body199.us.us.us: ; preds = %for.inc231.us.us.us, %for.body199.lr.ph.split.us.us.us %ctmp.0350.us.us.us = phi i8 [ %conv193.us.us, %for.body199.lr.ph.split.us.us.us ], [ %inc232.us.us.us, %for.inc231.us.us.us ] %idxprom213.us.us.us = sext i8 %ctmp.0350.us.us.us to i64 %arrayidx214.us.us.us = getelementptr inbounds [36 x i8], ptr %C, i64 0, i64 %idxprom213.us.us.us %39 = load i8, ptr %arrayidx214.us.us.us, align 1, !tbaa !9 %cmp216.us.us.us = icmp eq i8 %38, %39 br i1 %cmp216.us.us.us, label %land.lhs.true218.us.us.us, label %for.inc231.us.us.us land.lhs.true218.us.us.us: ; preds = %for.body199.us.us.us %40 = load i8, ptr %arrayidx221.us.us, align 1, !tbaa !9 %41 = load i8, ptr %arrayidx225.us.us, align 1, !tbaa !9 %cmp227.us.us.us = icmp eq i8 %40, %41 br i1 %cmp227.us.us.us, label %for.inc234.us.us, label %for.inc231.us.us.us for.inc231.us.us.us: ; preds = %land.lhs.true218.us.us.us, %for.body199.us.us.us %inc232.us.us.us = add i8 %ctmp.0350.us.us.us, 1 %conv195.us.us.us = sext i8 %inc232.us.us.us to i32 %cmp197.not.not.us.us.us = icmp sgt i32 %46, %conv195.us.us.us br i1 %cmp197.not.not.us.us.us, label %for.body199.us.us.us, label %for.inc234.us.us, !llvm.loop !20 for.cond187.for.inc237_crit_edge.us.us: ; preds = %for.inc234.us.us %indvars.iv.next413 = add nuw nsw i64 %indvars.iv412, 1 %exitcond416.not = icmp eq i64 %indvars.iv.next413, %wide.trip.count420 br i1 %exitcond416.not, label %for.cond176.loopexit.us, label %for.cond187.preheader.us.us, !llvm.loop !21 for.body158: ; preds = %for.cond155.preheader, %for.inc173 %indvars.iv402 = phi i64 [ %indvars.iv.next403, %for.inc173 ], [ 0, %for.cond155.preheader ] %arrayidx161 = getelementptr inbounds [2 x [36 x i8]], ptr %C, i64 0, i64 1, i64 %indvars.iv402 %42 = load i8, ptr %arrayidx161, align 1, !tbaa !9 %conv162 = sext i8 %42 to i32 %arrayidx165 = getelementptr inbounds [2 x [36 x i32]], ptr %A, i64 0, i64 1, i64 %indvars.iv402 %43 = load i32, ptr %arrayidx165, align 4, !tbaa !5 %call166 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv162, i32 noundef %43) %44 = load i32, ptr %N, align 4, !tbaa !5 %sub167 = add nsw i32 %44, -1 %45 = zext i32 %sub167 to i64 %cmp168.not = icmp eq i64 %indvars.iv402, %45 br i1 %cmp168.not, label %for.inc173, label %if.then170 if.then170: ; preds = %for.body158 %putchar = call i32 @putchar(i32 32) %.pre422 = load i32, ptr %N, align 4, !tbaa !5 br label %for.inc173 for.inc173: ; preds = %for.body158, %if.then170 %46 = phi i32 [ %44, %for.body158 ], [ %.pre422, %if.then170 ] %indvars.iv.next403 = add nuw nsw i64 %indvars.iv402, 1 %47 = sext i32 %46 to i64 %cmp156 = icmp slt i64 %indvars.iv.next403, %47 br i1 %cmp156, label %for.body158, label %for.cond176.preheader, !llvm.loop !22 for.end242: ; preds = %for.cond176.loopexit.us %48 = icmp eq i32 %minj.3.lcssa.us, 0 %spec.select430 = select i1 %48, ptr @str.7, ptr @str.6 br label %if.end248 if.end248: ; preds = %for.end242, %for.cond176.preheader, %for.cond155.preheader, %for.cond105.preheader, %for.end84 %str.6.sink = phi ptr [ @str.7, %for.end84 ], [ @str.7, %for.cond105.preheader ], [ @str.7, %for.cond155.preheader ], [ @str.7, %for.cond176.preheader ], [ %spec.select430, %for.end242 ] %puts322 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %C) #4 call void @llvm.lifetime.end.p0(i64 288, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11} !16 = distinct !{!16, !11} !17 = distinct !{!17, !11} !18 = distinct !{!18, !11} !19 = distinct !{!19, !11} !20 = distinct !{!20, !11} !21 = distinct !{!21, !11} !22 = distinct !{!22, !11}